summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHash9 <hash9@users.sourceforge.net>2006-07-22 15:08:34 +0000
committerHash9 <hash9@users.sourceforge.net>2006-07-22 15:08:34 +0000
commit27eef6deec6d7e4d63010f5de56dbf2414654166 (patch)
tree3a83902654035a03018b298092266a39ce3639ff
parent82fef2f2e198a3ecaac37abaca1ac44946064d24 (diff)
downloadliberty-27eef6deec6d7e4d63010f5de56dbf2414654166.tar.gz
liberty-27eef6deec6d7e4d63010f5de56dbf2414654166.tar.bz2
liberty-27eef6deec6d7e4d63010f5de56dbf2414654166.zip
add signitures that can be written in any format and stored in a comment which can have any content type
-rw-r--r--comments_inc.php11
-rw-r--r--plugins/data.renderer.php122
2 files changed, 131 insertions, 2 deletions
diff --git a/comments_inc.php b/comments_inc.php
index e2053bb..c57887b 100644
--- a/comments_inc.php
+++ b/comments_inc.php
@@ -3,12 +3,12 @@
* comment_inc
*
* @author spider <spider@steelsun.com>
- * @version $Revision: 1.20 $
+ * @version $Revision: 1.21 $
* @package liberty
* @subpackage functions
*/
-// $Header: /cvsroot/bitweaver/_bit_liberty/comments_inc.php,v 1.20 2006/07/21 23:50:37 hash9 Exp $
+// $Header: /cvsroot/bitweaver/_bit_liberty/comments_inc.php,v 1.21 2006/07/22 15:08:34 hash9 Exp $
// Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
@@ -82,6 +82,13 @@ if (!empty($_REQUEST['post_comment_submit']) && $gBitUser->hasPermission( 'p_lib
$storeRow = array();
$storeRow['title'] = $_REQUEST['comment_title'];
$storeRow['edit'] = $_REQUEST['comment_data'];
+ if (empty($_REQUEST['post_comment_id'])&&$gBitSystem->isPackageActive('bitboards')) {
+ $content_type = $gBitUser->getPreference('signiture_content_type');
+ $content_data = $gBitUser->getPreference('signiture_content_data');
+ if (!empty($content_type) && !empty($content_data)) {
+ $storeRow['edit'] .= "\n{renderer format_guid=$content_type class=mb-signature}$content_data{/renderer}";
+ }
+ }
$storeRow['root_id'] = $commentsParentId;
$storeRow['parent_id'] = (@BitBase::verifyId($storeComment->mInfo['parent_id']) ? $storeComment->mInfo['parent_id'] : (!@BitBase::verifyId($_REQUEST['post_comment_reply_id']) ? $commentsParentId : $_REQUEST['post_comment_reply_id']));
$storeRow['content_id'] = (@BitBase::verifyId($storeComment->mContentId) ? $storeComment->mContentId : NULL);
diff --git a/plugins/data.renderer.php b/plugins/data.renderer.php
new file mode 100644
index 0000000..71d331f
--- /dev/null
+++ b/plugins/data.renderer.php
@@ -0,0 +1,122 @@
+<?php
+/**
+ * @version $Revision: 1.1 $
+ * @package liberty
+ * @subpackage plugins_data
+ */
+// +----------------------------------------------------------------------+
+// | Copyright (c) 2005, bitweaver.org
+// +----------------------------------------------------------------------+
+// | All Rights Reserved. See copyright.txt for details and a complete list of authors.
+// | Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details
+// |
+// | For comments, please use phpdocu.sourceforge.net documentation standards!!!
+// | -> see http://phpdocu.sourceforge.net/
+// +----------------------------------------------------------------------+
+// | Author (TikiWiki): Gustavo Muslera <gmuslera@users.sourceforge.net>
+// | Reworked for Bitweaver (& Undoubtedly Screwed-Up)
+// | by: wjames5
+// | Reworked from: data.articles.php from wikiplugin_articles.php
+// +----------------------------------------------------------------------+
+// $Id: data.renderer.php,v 1.1 2006/07/22 15:08:34 hash9 Exp $
+
+/**
+ * definitions
+ */
+global $gBitSystem, $gBitSmarty;
+if( $gBitSystem->isPackageActive( 'bitboards' ) ) { // Do not include this Plugin if the Package is not active
+ define( 'PLUGIN_GUID_DATARENDERER', 'datarenderer' );
+ global $gLibertySystem;
+ $pluginParams = array (
+ 'tag' => 'renderer',
+ 'auto_activate' => TRUE,
+ 'requires_pair' => TRUE,
+ 'load_function' => 'data_renderer',
+ 'help_function' => 'data_renderer_help',
+ 'title' => 'Renderer',
+ 'help_page' => 'DataPluginRenderer',
+ 'description' => tra( "This plugin will render the given content as discribed by the contnet_type given" ),
+ 'syntax' => "{renderer class= format_guid= }.. content ..{/renderer}",
+ 'path' => LIBERTY_PKG_PATH.'plugins/data.renderer.php',
+ 'security' => 'registered',
+ 'plugin_type' => DATA_PLUGIN
+ );
+ $gLibertySystem->registerPlugin( PLUGIN_GUID_DATABLOG, $pluginParams );
+ $gLibertySystem->registerDataTag( $pluginParams['tag'], PLUGIN_GUID_DATABLOG );
+
+ // Help Routine
+ function data_renderer_help() {
+ $help ="<table class=\"data help\">
+ <tr>
+ <th>" . tra( "Key" ) . "</th>
+ <th>" . tra( "Type" ) . "</th>
+ <th>" . tra( "Comments" ) . "</th>
+ </tr>
+ <tr class=\"even\">
+ <td>id</td>
+ <td>" . tra( "div id") . '<br />' . tra("(optional)") . "</td>
+ <td>" . tra( "specify the id of the outputed div") . "</td>
+ </tr>
+ <tr class=\"odd\">
+ <td>class</td>
+ <td>" . tra( "div class") . '<br />' . tra("(optional)") . "</td>
+ <td>" . tra( "specify the class of the outputed div") . "</td>
+ </tr>
+ <tr class=\"even\">
+ <td>format_guid</td>
+ <td>" . tra( "string") . '<br />' . tra("(required unless content_id is given)") . "</td>
+ <td>" . tra( "Specify what renderer should be used to render the contents") . "</td>
+ </tr>'
+ <tr class=\"odd\">
+ <td>content_id</td>
+ <td>" . tra( "div class") . '<br />' . tra("(optional, overrides format_guid)") . "</td>
+ <td>" . tra( "Specify the content of the outputed div") . "</td>
+ </tr>
+ </table>".
+ tra("Example: ") . "{renderer class=abc format_guid=tiki }.. content ..{/renderer}<br />";
+ return $help;
+ }
+
+ // Executable Routine
+ function data_renderer($data, $params) { // No change in the parameters with Clyde
+ // The next 2 lines allow access to the $pluginParams given above and may be removed when no longer needed
+ global $gLibertySystem, $gBitSmarty;
+ $pluginParams = $gLibertySystem->mPlugins[PLUGIN_GUID_DATABLOG];
+
+ require_once( BLOGS_PKG_PATH.'BitBlog.php');
+ require_once( LIBERTY_PKG_PATH.'lookup_content_inc.php' );
+
+ $params;
+
+ $data = trim($data);
+
+ if (empty($data) && @LibertyContent::verifyId($rendererHash['content_id'])) {
+ $rendererHash = BitBoardForum::loadContent($rendererHash['content_id']);
+ } elseif (empty($data)) { // If there is NO data to display - why do anything - get out of here
+ return " ";
+ } else {
+ $rendererHash=array();
+ $rendererHash['content_id']=0;
+ $rendererHash['format_guid'] =$params['format_guid'];
+ $rendererHash['data'] =$data;
+ }
+
+ $formatGuid=$rendererHash['format_guid'];
+ $ret = "";
+ if( $func = $gLibertySystem->getPluginFunction( $formatGuid, 'load_function' ) ) {
+ $ret = $func( $rendererHash, $this );
+ }
+
+ $display_result = "<div";
+ if (!empty($params['id'])) {
+ $display_result .= " id=\"".$params['id']."\"";
+ }
+ if (!empty($params['class'])) {
+ $display_result .= " class=\"".$params['class']."\"";
+ }
+ $display_result .= ">$ret</div>";
+
+ return $display_result;
+ }
+}
+?>