summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorMax Kremmel <xing@synapse.plus.com>2007-05-21 20:44:06 +0000
committerMax Kremmel <xing@synapse.plus.com>2007-05-21 20:44:06 +0000
commit6f1468efc69961c142d8e06af187bede405743c9 (patch)
treebbdb0d9ca36e0b51846ead03dec854f5bd2c1d59 /modules
parent15e7ab1e253fb1068b990a01977a65af830483a6 (diff)
downloadliberty-6f1468efc69961c142d8e06af187bede405743c9.tar.gz
liberty-6f1468efc69961c142d8e06af187bede405743c9.tar.bz2
liberty-6f1468efc69961c142d8e06af187bede405743c9.zip
add a last comment module. this is similar to last cahnges but it's possible to gate comment list based on parent content_type_guid and it will display the title of the parent the comment belongs to
Diffstat (limited to 'modules')
-rw-r--r--modules/help_mod_last_comments.tpl18
-rw-r--r--modules/mod_last_comments.php24
-rw-r--r--modules/mod_last_comments.tpl19
3 files changed, 61 insertions, 0 deletions
diff --git a/modules/help_mod_last_comments.tpl b/modules/help_mod_last_comments.tpl
new file mode 100644
index 0000000..f9c1167
--- /dev/null
+++ b/modules/help_mod_last_comments.tpl
@@ -0,0 +1,18 @@
+{tr}<strong>Summary</strong>: Display the most recent comments.{/tr}<br />
+<table class="data">
+ <tr>
+ <th style="width:20%;">{tr}Parameter{/tr}</th>
+ <th style="width:20%;">{tr}Value{/tr}</th>
+ <th style="width:60%;">{tr}Description{/tr}</th>
+ </tr>
+ <tr class="odd">
+ <td>parent_content_type_guid</td>
+ <td>bitpage<br />bituser<br />...</td>
+ <td>{tr}You can limit the comments submitted to a given content type. Please note that applying this limit will only display comments that have been submitted directly to that content item - replies will not show up.{/tr}</td>
+ </tr>
+ <tr class="even">
+ <td>show_date</td>
+ <td>( {tr}boolean{/tr} )</td>
+ <td>{tr}Specify if you want to display the date of the last modification.{/tr}</td>
+ </tr>
+</table>
diff --git a/modules/mod_last_comments.php b/modules/mod_last_comments.php
new file mode 100644
index 0000000..309f5be
--- /dev/null
+++ b/modules/mod_last_comments.php
@@ -0,0 +1,24 @@
+<?php
+require_once( LIBERTY_PKG_PATH.'LibertyComment.php' );
+global $gQueryUser, $gBitUser, $gLibertySystem, $moduleParams;
+$params = $moduleParams['module_params'];
+
+$userId = NULL;
+if( !empty( $gQueryUser->mUserId ) ) {
+ $userId = $gQueryUser->mUserId;
+}
+
+$listHash = array(
+ 'user_id' => $userId,
+);
+
+if( !empty( $params['root_content_type_guid'] ) && in_array( $params['root_content_type_guid'], array_keys( $gLibertySystem->mContentTypes ))) {
+ $moduleTitle = $gLibertySystem->mContentTypes[$params['root_content_type_guid']]['content_description'].' '.tra( 'Comments' );
+ $gBitSmarty->assign( 'moduleTitle', $moduleTitle );
+ $listHash['root_content_type_guid'] = $params['root_content_type_guid'];
+}
+
+$lcom = new LibertyComment();
+$modLastComments = $lcom->getList( $listHash );
+$gBitSmarty->assign( 'modLastComments', $modLastComments );
+?>
diff --git a/modules/mod_last_comments.tpl b/modules/mod_last_comments.tpl
new file mode 100644
index 0000000..5f5c88b
--- /dev/null
+++ b/modules/mod_last_comments.tpl
@@ -0,0 +1,19 @@
+{* $Header: /cvsroot/bitweaver/_bit_liberty/modules/mod_last_comments.tpl,v 1.1 2007/05/21 20:44:06 squareing Exp $ *}
+{strip}
+{if $modLastComments}
+ {bitmodule title="$moduleTitle" name="last_comments"}
+ <ol>
+ {section name=ix loop=$modLastComments}
+ <li>
+ {$modLastComments[ix].root_content_title}: {$modLastComments[ix].display_link}
+ {if $moduleParams.module_params.show_date}
+ <br /><span class="date">{$modLastComments[ix].last_modified|bit_short_datetime}</span>
+ {/if}
+ </li>
+ {sectionelse}
+ <li></li>
+ {/section}
+ </ol>
+ {/bitmodule}
+{/if}
+{/strip}