summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--LibertyAttachable.php41
-rw-r--r--LibertyBase.php18
-rw-r--r--LibertyComment.php38
-rw-r--r--LibertyContent.php74
-rwxr-xr-xLibertyStructure.php123
-rwxr-xr-xLibertySystem.php30
-rw-r--r--admin/upgrade_inc.php16
-rw-r--r--attachment_browser.php17
-rw-r--r--bit_setup_inc.php4
-rw-r--r--comments_inc.php6
-rw-r--r--display_content_inc.php4
-rw-r--r--display_structure_inc.php4
-rw-r--r--edit_help_inc.php4
-rw-r--r--edit_storage_inc.php4
-rw-r--r--edit_structure_inc.php7
-rw-r--r--get_content_list_inc.php4
-rwxr-xr-xicons/import.gifbin0 -> 111 bytes
-rw-r--r--list_content.php4
-rw-r--r--lookup_content_inc.php4
-rw-r--r--modules/mod_last_changes.php4
-rw-r--r--modules/mod_last_changes.tpl4
-rw-r--r--modules/mod_structure_navigation.php2
-rw-r--r--modules/mod_top_authors.php4
-rw-r--r--modules/mod_top_authors.tpl4
-rw-r--r--plugins/data.addtabs.php6
-rw-r--r--plugins/data.agentinfo.php6
-rw-r--r--plugins/data.article.php6
-rw-r--r--plugins/data.articles.php6
-rw-r--r--plugins/data.attachment.php6
-rw-r--r--plugins/data.avatar.php8
-rw-r--r--plugins/data.backlinks.php6
-rw-r--r--plugins/data.category.php6
-rw-r--r--plugins/data.catorphans.php6
-rw-r--r--plugins/data.catpath.php6
-rw-r--r--plugins/data.code.php6
-rw-r--r--plugins/data.comment.php6
-rw-r--r--plugins/data.copyright.php6
-rw-r--r--plugins/data.countdown.php6
-rw-r--r--plugins/data.dropdown.php4
-rw-r--r--plugins/data.example.php4
-rw-r--r--plugins/data.flash.php6
-rw-r--r--plugins/data.freemind.php4
-rw-r--r--plugins/data.gauge.php6
-rw-r--r--plugins/data.include.php6
-rw-r--r--plugins/data.lang.php6
-rw-r--r--plugins/data.maketoc.php6
-rw-r--r--plugins/data.mapquest.php6
-rw-r--r--plugins/data.module.php6
-rw-r--r--plugins/data.mqdirections.php6
-rw-r--r--plugins/data.pluginhelp.php6
-rw-r--r--plugins/data.rss.php6
-rw-r--r--plugins/data.sf.php6
-rw-r--r--plugins/data.sort.php6
-rw-r--r--plugins/data.split.php6
-rw-r--r--plugins/data.spytext.php4
-rw-r--r--plugins/data.titlesearch.php6
-rw-r--r--plugins/data.toc.php6
-rw-r--r--plugins/data.translated.php6
-rw-r--r--plugins/data.usercount.php6
-rwxr-xr-xplugins/data.userlink.php100
-rw-r--r--plugins/data.userlist.php6
-rw-r--r--plugins/data.wikilist.php6
-rw-r--r--plugins/format.pearwiki.php4
-rw-r--r--plugins/format.pearwiki_tiki.php6
-rw-r--r--plugins/format.tikihtml.php4
-rw-r--r--plugins/format.tikiwiki.php33
-rw-r--r--plugins/storage.bitfile.php20
-rw-r--r--plugins/storage.lulu.php6
-rw-r--r--plugins/storage.pbase.php4
-rw-r--r--templates/admin_liberty.tpl4
-rw-r--r--templates/attachment_browser.tpl26
-rw-r--r--templates/display_structure.tpl2
-rw-r--r--templates/edit_storage.tpl2
-rw-r--r--templates/edit_structure_inc.tpl4
-rw-r--r--templates/menu_liberty_admin.tpl12
75 files changed, 472 insertions, 391 deletions
diff --git a/LibertyAttachable.php b/LibertyAttachable.php
index 9bb83dc..342de1d 100644
--- a/LibertyAttachable.php
+++ b/LibertyAttachable.php
@@ -2,9 +2,9 @@
/**
* Management of Liberty Content
*
+ * @package liberty
+ * @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertyAttachable.php,v 1.3 2005/08/07 17:40:29 squareing Exp $
* @author spider <spider@steelsun.com>
- * @version $Revision: 1.2 $
- * @package Liberty
*/
// +----------------------------------------------------------------------+
// | Copyright (c) 2004, bitweaver.org
@@ -17,8 +17,6 @@
// +----------------------------------------------------------------------+
// | Authors: spider <spider@steelsun.com>
// +----------------------------------------------------------------------+
-//
-// $Id: LibertyAttachable.php,v 1.2 2005/06/28 07:45:47 spiderr Exp $
/**
* required setup
@@ -27,12 +25,9 @@ require_once( LIBERTY_PKG_PATH.'LibertyContent.php' );
require_once( LIBERTY_PKG_PATH.'LibertySystem.php' );
/**
- * LibertyAttachable classes.
+ * LibertyAttachable class
*
- * @author spider <spider@steelsun.com>
- * @version $Revision: 1.2 $
- * @package Liberty
- * @subpackage LibertyAttachable
+ * @package liberty
*/
class LibertyAttachable extends LibertyContent {
var $mContentId;
@@ -217,8 +212,8 @@ class LibertyAttachable extends LibertyContent {
// Things to be stored should be shoved in the array $pParamHash['STORAGE']
function store ( &$pParamHash ) {
global $gLibertySystem;
+ $this->mDb->StartTrans();
if( LibertyAttachable::verify( $pParamHash ) && LibertyContent::store( $pParamHash ) && !empty( $pParamHash['STORAGE'] ) && count( $pParamHash['STORAGE'] ) ) {
- $this->mDb->StartTrans();
foreach( array_keys( $pParamHash['STORAGE'] ) as $guid ) {
$storeRow = &$pParamHash['STORAGE'][$guid]; // short hand variable assignment
$storeRow['plugin_guid'] = $guid;
@@ -230,11 +225,11 @@ class LibertyAttachable extends LibertyContent {
if( empty( $pParamHash['attachment_id'] ) ) {
$sql = "SELECT `attachment_id` FROM `".BIT_DB_PREFIX."tiki_attachments`
WHERE `attachment_plugin_guid` = ? AND `content_id` = ? AND `foreign_id`=?";
- $rs = $this->query( $sql, array( $storeRow['plugin_guid'], (int)$storeRow['content_id'], (int)$storeRow['foreign_id'] ) );
+ $rs = $this->mDb->query( $sql, array( $storeRow['plugin_guid'], (int)$storeRow['content_id'], (int)$storeRow['foreign_id'] ) );
if( empty( $rs ) || !$rs->NumRows() ) {
- $pParamHash['attachment_id'] = $this->GenID( 'tiki_attachments_id_seq' );
+ $pParamHash['attachment_id'] = $this->mDb->GenID( 'tiki_attachments_id_seq' );
$sql = "INSERT INTO `".BIT_DB_PREFIX."tiki_attachments` ( `attachment_id`, `attachment_plugin_guid`, `content_id`, `foreign_id`, `user_id` ) VALUES ( ?, ?, ?, ?, ? )";
- $rs = $this->query( $sql, array( $pParamHash['attachment_id'], $storeRow['plugin_guid'], $pParamHash['content_id'], (int)$storeRow['foreign_id'], $storeRow['user_id'] ) );
+ $rs = $this->mDb->query( $sql, array( $pParamHash['attachment_id'], $storeRow['plugin_guid'], $pParamHash['content_id'], (int)$storeRow['foreign_id'], $storeRow['user_id'] ) );
} else {
$this->mErrors['storage'] = $guid.' '.$storeRow['foreign_id'].' has already been added to this content.';
$pParamHash['attachment_id'] = NULL;
@@ -261,8 +256,8 @@ class LibertyAttachable extends LibertyContent {
} else {
}
}
- $this->mDb->CompleteTrans();
}
+ $this->mDb->CompleteTrans();
if( !empty( $pParamHash['existing_attachment_id'] ) ) {
foreach($pParamHash['existing_attachment_id'] as $existingAttachmentId) {
@@ -280,13 +275,13 @@ class LibertyAttachable extends LibertyContent {
global $gBitUser;
$sql = "SELECT * FROM `".BIT_DB_PREFIX."tiki_attachments` WHERE `attachment_id` = ?";
- $rs = $this->query($sql, array( $pAttachmentId ));
+ $rs = $this->mDb->query($sql, array( $pAttachmentId ));
$tmpAttachment = $rs->fields;
if ( !empty($tmpAttachment['attachment_id']) ) {
- $newAttachmentId = $this->GenID( 'tiki_attachments_id_seq' );
+ $newAttachmentId = $this->mDb->GenID( 'tiki_attachments_id_seq' );
$sql = "INSERT INTO `".BIT_DB_PREFIX."tiki_attachments` ( `attachment_id`, `attachment_plugin_guid`, `content_id`, `foreign_id`, `user_id` ) VALUES ( ?, ?, ?, ?, ? )";
- $rs = $this->query( $sql, array( $newAttachmentId, $tmpAttachment['attachment_plugin_guid'], $pNewContentId, $tmpAttachment['foreign_id'], $gBitUser->mUserId ) );
+ $rs = $this->mDb->query( $sql, array( $newAttachmentId, $tmpAttachment['attachment_plugin_guid'], $pNewContentId, $tmpAttachment['foreign_id'], $gBitUser->mUserId ) );
}
}
@@ -307,7 +302,7 @@ class LibertyAttachable extends LibertyContent {
if( is_numeric( $pAttachmentId ) ) {
$sql = "SELECT `attachment_plugin_guid`, `user_id` FROM `".BIT_DB_PREFIX."tiki_attachments` WHERE `attachment_id`=?";
- $rs = $this->query( $sql, array( $pAttachmentId ) );
+ $rs = $this->mDb->query( $sql, array( $pAttachmentId ) );
$guid = $rs->fields['attachment_plugin_guid'];
$user_id = $rs->fields['user_id'];
@@ -316,7 +311,7 @@ class LibertyAttachable extends LibertyContent {
$expungeFunc = $gLibertySystem->mPlugins[$guid]['expunge_function'];
if( $expungeFunc( $pAttachmentId ) ) {
$sql = "DELETE FROM `".BIT_DB_PREFIX."tiki_attachments` WHERE `attachment_id`=?";
- $this->query( $sql, array( $pAttachmentId ) );
+ $this->mDb->query( $sql, array( $pAttachmentId ) );
}
} else {
print("Expunge function not found for this content!");
@@ -336,7 +331,7 @@ class LibertyAttachable extends LibertyContent {
$attachmentOwner->load();
if ($attachmentOwner->mContentId) {
$query = "UPDATE `".BIT_DB_PREFIX."tiki_attachments` SET `content_id` = ? WHERE `attachment_id` = ?";
- $result = $this->query($query, array($attachmentOwner->mContentId, $pAttachmentId));
+ $result = $this->mDb->query($query, array($attachmentOwner->mContentId, $pAttachmentId));
} else {
$this->mErrors[] = "Unable to detach this attachment because the owner does not have a content row";
}
@@ -357,7 +352,7 @@ class LibertyAttachable extends LibertyContent {
LibertyContent::load($pContentId);
$query = "SELECT * FROM `".BIT_DB_PREFIX."tiki_attachments` ta
WHERE ta.`content_id`=?";
- if( $result = $this->query($query,array((int) $conId)) ) {
+ if( $result = $this->mDb->query($query,array((int) $conId)) ) {
$this->mStorage = array();
while( !$result->EOF ) {
$row = &$result->fields;
@@ -382,7 +377,7 @@ class LibertyAttachable extends LibertyContent {
if( is_numeric( $pAttachmentId ) ) {
$query = "SELECT * FROM `".BIT_DB_PREFIX."tiki_attachments` ta
WHERE ta.`attachment_id`=?";
- if( $result = $this->query($query,array((int) $pAttachmentId)) ) {
+ if( $result = $this->mDb->query($query,array((int) $pAttachmentId)) ) {
$ret = array();
if( !$result->EOF ) {
$row = &$result->fields;
@@ -403,7 +398,7 @@ class LibertyAttachable extends LibertyContent {
if (!empty($attachmentInfo['attachment_id']) && !empty($attachmentInfo['foreign_id']) && !empty($attachmentInfo['attachment_plugin_guid']) ) {
$query = "SELECT * FROM `".BIT_DB_PREFIX."tiki_attachments` WHERE `foreign_id` = ? AND `attachment_plugin_guid` = ? AND `attachment_id` <> ?";
- $result = $this->query($query, array($attachmentInfo['foreign_id'], $attachmentInfo['attachment_plugin_guid'], $attachment['attachment_id']));
+ $result = $this->mDb->query($query, array($attachmentInfo['foreign_id'], $attachmentInfo['attachment_plugin_guid'], $attachment['attachment_id']));
$ret = $result->getRows();
}
diff --git a/LibertyBase.php b/LibertyBase.php
index 2fe7440..3111431 100644
--- a/LibertyBase.php
+++ b/LibertyBase.php
@@ -1,10 +1,10 @@
<?php
/**
- * Management of Liberty Content
+ * Base class for Management of Liberty Content
*
+ * @package liberty
+ * @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertyBase.php,v 1.3 2005/08/07 17:40:29 squareing Exp $
* @author spider <spider@steelsun.com>
- * @version $Revision: 1.2 $
- * @package Liberty
*/
// +----------------------------------------------------------------------+
// | Copyright (c) 2004, bitweaver.org
@@ -17,8 +17,6 @@
// +----------------------------------------------------------------------+
// | Authors: spider <spider@steelsun.com>
// +----------------------------------------------------------------------+
-//
-// $Id: LibertyBase.php,v 1.2 2005/06/28 07:45:47 spiderr Exp $
/**
* required setup
@@ -29,16 +27,12 @@ require_once( KERNEL_PKG_PATH.'BitBase.php' );
* Virtual base class (as much as one can have such things in PHP) for all
* derived bitweaver classes that manage content.
*
- * @abstract
- * @author spider <spider@steelsun.com>
- * @version $Revision: 1.2 $
- * @package Liberty
- * @subpackage LibertyBase
+ * @package liberty
*/
class LibertyBase extends BitBase {
function LibertyBase () {
- // we need to init our mDb early
+ // we need to init our database connection early
BitBase::BitBase();
}
@@ -54,7 +48,7 @@ class LibertyBase extends BitBase {
if( BitBase::verifyId( $pContentId ) ) {
if( empty( $pContentGuid ) ) {
- $pContentGuid = $gLibertySystem->GetOne( "SELECT `content_type_guid` FROM `".BIT_DB_PREFIX."tiki_content` WHERE `content_id`=?", array( $pContentId ) );
+ $pContentGuid = $gLibertySystem->mDb->GetOne( "SELECT `content_type_guid` FROM `".BIT_DB_PREFIX."tiki_content` WHERE `content_id`=?", array( $pContentId ) );
}
if( !empty( $pContentGuid) && isset( $gLibertySystem->mContentTypes[$pContentGuid] ) ) {
$type = $gLibertySystem->mContentTypes[$pContentGuid];
diff --git a/LibertyComment.php b/LibertyComment.php
index d73bae6..4ddd151 100644
--- a/LibertyComment.php
+++ b/LibertyComment.php
@@ -2,9 +2,9 @@
/**
* Management of Liberty Content
*
+ * @package liberty
+ * @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertyComment.php,v 1.6 2005/11/22 07:27:18 squareing Exp $
* @author spider <spider@steelsun.com>
- * @version $Revision: 1.4 $
- * @package Liberty
*/
/**
@@ -15,13 +15,11 @@ require_once( LIBERTY_PKG_PATH.'LibertyContent.php' );
define( 'BITCOMMENT_CONTENT_TYPE_GUID', 'bitcomment' );
/**
-* Virtual base class (as much as one can have such things in PHP) for all
-* derived tikiwiki classes that require database access.
-*
-* @author spider <spider@steelsun.com>
-* @package Liberty
-* @subpackage LibertyComment
-*/
+ * Virtual base class (as much as one can have such things in PHP) for all
+ * derived tikiwiki classes that require database access.
+ *
+ * @package kernel
+ */
class LibertyComment extends LibertyContent {
var $mCommentId;
@@ -62,7 +60,7 @@ class LibertyComment extends LibertyContent {
FROM `".BIT_DB_PREFIX."tiki_comments` tc LEFT OUTER JOIN `".BIT_DB_PREFIX."tiki_content` tcn ON (tc.`content_id` = tcn.`content_id`)
LEFT OUTER JOIN `".BIT_DB_PREFIX."users_users` uu ON (tcn.`user_id` = uu.`user_id`)
$mid";
- $rs = $this->query($sql, $bindVars);
+ $rs = $this->mDb->query($sql, $bindVars);
if ($rs && $rs->numRows()) {
$this->mInfo = $rs->fields;
@@ -84,9 +82,9 @@ class LibertyComment extends LibertyContent {
if (!$this->mCommentId) {
if( LibertyContent::store( $pStorageHash ) ) {
if ($this->verifyComment($pStorageHash)) {
- $this->mCommentId = $this->GenID( 'tiki_comments_comment_id_seq');
+ $this->mCommentId = $this->mDb->GenID( 'tiki_comments_comment_id_seq');
$sql = "INSERT INTO `".BIT_DB_PREFIX."tiki_comments` (`comment_id`, `content_id`, `parent_id`) VALUES (?,?,?)";
- $this->query($sql, array($this->mCommentId, $pStorageHash['content_id'], $pStorageHash['parent_id']));
+ $this->mDb->query($sql, array($this->mCommentId, $pStorageHash['content_id'], $pStorageHash['parent_id']));
$this->mInfo['parent_id'] = $pStorageHash['parent_id'];
$this->mInfo['content_id'] = $pStorageHash['content_id'];
$this->mContentId = $pStorageHash['content_id'];
@@ -95,7 +93,7 @@ class LibertyComment extends LibertyContent {
} else {
if( $this->verifyComment($pStorageHash) && LibertyContent::store($pStorageHash) ) {
$sql = "UPDATE `".BIT_DB_PREFIX."tiki_comments` SET `parent_id` = ?, `content_id`= ? WHERE `comment_id` = ?";
- $this->query($sql, array($pStorageHash['parent_id'], $pStorageHash['content_id'], $this->mCommentId));
+ $this->mDb->query($sql, array($pStorageHash['parent_id'], $pStorageHash['content_id'], $this->mCommentId));
$this->mInfo['parent_id'] = $pStorageHash['parent_id'];
$this->mInfo['content_id'] = $pStorageHash['content_id'];
$this->mContentId = $pStorageHash['content_id'];
@@ -106,7 +104,7 @@ class LibertyComment extends LibertyContent {
function deleteComment() {
$sql = "SELECT `comment_id` FROM `".BIT_DB_PREFIX."tiki_comments` WHERE `parent_id` = ?";
- $rs = $this->query($sql, array($this->mContentId));
+ $rs = $this->mDb->query($sql, array($this->mContentId));
$rows = $rs->getRows();
foreach ($rows as $row) {
@@ -115,10 +113,10 @@ class LibertyComment extends LibertyContent {
}
$sql = "DELETE FROM `".BIT_DB_PREFIX."tiki_comments` WHERE `comment_id` = ?";
- $rs = $this->query($sql, array($this->mCommentId));
+ $rs = $this->mDb->query($sql, array($this->mCommentId));
$sql = "DELETE FROM `".BIT_DB_PREFIX."tiki_content` WHERE `content_id` = ?";
- $rs = $this->query($sql, array($this->mContentId));
+ $rs = $this->mDb->query($sql, array($this->mContentId));
}
function userCanEdit($pUserId = NULL) {
@@ -165,7 +163,7 @@ class LibertyComment extends LibertyContent {
$pParamHash['max_records'] = $gBitSystem->getPreference( 'maxRecords' );
}
LibertyContent::prepGetList( $pParamHash );
- $sort_mode = $this->convert_sortmode($pParamHash['sort_mode']);
+ $sort_mode = $this->mDb->convert_sortmode($pParamHash['sort_mode']);
$mid = '';
$bindVars = array();
@@ -181,7 +179,7 @@ class LibertyComment extends LibertyContent {
$query = "SELECT DISTINCT( tc.`content_id` ), tc.`title` AS `content_title`, tc.`created`, tcmc.`last_modified`, tcmc.`title`, uu.`login` AS `user`, uu.`real_name`
FROM `".BIT_DB_PREFIX."tiki_comments` tcm INNER JOIN `".BIT_DB_PREFIX."tiki_content` tcmc ON (tcm.`content_id`=tcmc.`content_id` ), `".BIT_DB_PREFIX."tiki_content` tc, `".BIT_DB_PREFIX."users_users` uu
WHERE tcm.`parent_id`=tc.`content_id` AND uu.`user_id`=tcmc.`user_id` $mid ORDER BY $sort_mode";
- if( $result = $this->query($query, $bindVars, $pParamHash['max_records'], $pParamHash['offset']) ) {
+ if( $result = $this->mDb->query($query, $bindVars, $pParamHash['max_records'], $pParamHash['offset']) ) {
$ret = $result->GetRows();
}
@@ -201,7 +199,7 @@ class LibertyComment extends LibertyContent {
$sql = "SELECT tcm.*, tcmc.`parent_id` AS `child_content_id`
FROM `".BIT_DB_PREFIX."tiki_comments` tcm LEFT OUTER JOIN `".BIT_DB_PREFIX."tiki_comments` tcmc ON (tcm.`content_id`=tcmc.`parent_id`)
WHERE tcm.`parent_id` = ?";
- $rows = $this->GetAssoc($sql, array($contentId));
+ $rows = $this->mDb->getAssoc($sql, array($contentId));
$commentCount += count($rows);
foreach ($rows as $row) {
if( !empty( $row['child_content_id'] ) ) {
@@ -270,7 +268,7 @@ class LibertyComment extends LibertyContent {
if ($contentId) {
$sql = "SELECT tcm.`comment_id` FROM `".BIT_DB_PREFIX."tiki_comments` tcm, `".BIT_DB_PREFIX."tiki_content` tc
WHERE tcm.`parent_id` = ? AND tcm.`content_id` = tc.`content_id` ORDER BY tc.`created` $sort_order";
- if( $rs = $this->query( $sql, array($contentId), $pMaxComments, $pOffset ) ) {
+ if( $rs = $this->mDb->query( $sql, array($contentId), $pMaxComments, $pOffset ) ) {
$rows = $rs->getRows();
foreach ($rows as $row) {
$comment = new LibertyComment($row['comment_id']);
diff --git a/LibertyContent.php b/LibertyContent.php
index 5a3a1ee..be4b3a7 100644
--- a/LibertyContent.php
+++ b/LibertyContent.php
@@ -2,9 +2,9 @@
/**
* Management of Liberty content
*
+* @package liberty
+* @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertyContent.php,v 1.6 2005/08/07 17:40:29 squareing Exp $
* @author spider <spider@steelsun.com>
-* @version $Revision: 1.5 $
-* @package Liberty
*/
// +----------------------------------------------------------------------+
@@ -18,8 +18,6 @@
// +----------------------------------------------------------------------+
// | Authors: spider <spider@steelsun.com>
// +----------------------------------------------------------------------+
-//
-// $Id: LibertyContent.php,v 1.5 2005/08/01 18:40:46 squareing Exp $
// define( 'CONTENT_TYPE_WIKI', '1' );
// define( 'CONTENT_TYPE_COMMENT', '3' );
@@ -39,13 +37,11 @@ define( 'BIT_CONTENT_MAX_FORMAT_GUID_LEN', 16);
require_once( LIBERTY_PKG_PATH.'LibertyBase.php' );
/**
-* Virtual base class (as much as one can have such things in PHP) for all
-* derived tikiwiki classes that require database access.
-*
-* @author spider <spider@steelsun.com>
-* @package Liberty
-* @subpackage LibertyContent
-*/
+ * Virtual base class (as much as one can have such things in PHP) for all
+ * derived tikiwiki classes that require database access.
+ *
+ * @package liberty
+ */
class LibertyContent extends LibertyBase {
var $mContentId;
/**
@@ -175,15 +171,15 @@ class LibertyContent extends LibertyBase {
$this->mDb->StartTrans();
$table = BIT_DB_PREFIX."tiki_content";
if( empty( $pParamHash['content_id'] ) ) {
- $pParamHash['content_store']['content_id'] = $this->GenID( 'tiki_content_id_seq' );
+ $pParamHash['content_store']['content_id'] = $this->mDb->GenID( 'tiki_content_id_seq' );
$pParamHash['content_id'] = $pParamHash['content_store']['content_id'];
- $result = $this->associateInsert( $table, $pParamHash['content_store'] );
+ $result = $this->mDb->associateInsert( $table, $pParamHash['content_store'] );
} else {
if( !empty( $pParamHash['content_store']['title'] ) && !empty( $this->mInfo['title'] ) ) {
$renamed = $pParamHash['content_store']['title'] != $this->mInfo['title'];
}
$locId = array ( "name" => "content_id", "value" => $pParamHash['content_id'] );
- $result = $this->associateUpdate( $table, $pParamHash['content_store'], $locId );
+ $result = $this->mDb->associateUpdate( $table, $pParamHash['content_store'], $locId );
}
// If a content access system is active, let's call it
@@ -214,7 +210,7 @@ class LibertyContent extends LibertyBase {
require_once( LIBERTY_PKG_PATH.'LibertyComment.php' );
// Delete all comments associated with this piece of content
$query = "SELECT `comment_id` FROM `".BIT_DB_PREFIX."tiki_comments` WHERE `parent_id` = ?";
- $result = $this->query($query, array( $this->mContentId ) );
+ $result = $this->mDb->query($query, array( $this->mContentId ) );
$commentIds = $result->getRows();
foreach ($commentIds as $commentId) {
$tmpComment = new LibertyComment($commentId);
@@ -243,7 +239,7 @@ class LibertyContent extends LibertyBase {
*/
$query = "DELETE FROM `".BIT_DB_PREFIX."tiki_content` WHERE `content_id` = ?";
- $result = $this->query( $query, array( $this->mContentId ) );
+ $result = $this->mDb->query( $query, array( $this->mContentId ) );
$this->mDb->CompleteTrans();
$ret = TRUE;
}
@@ -254,10 +250,10 @@ class LibertyContent extends LibertyBase {
// Now remove comments
$object = $type . $id;
$query = "delete from `".BIT_DB_PREFIX."tiki_comments` where `object`=? and `object_type`=?";
- $result = $this->query($query, array( $id, $type ));
+ $result = $this->mDb->query($query, array( $id, $type ));
// Remove individual permissions for this object if they exist
$query = "delete from `".BIT_DB_PREFIX."users_objectpermissions` where `object_id`=? and `object_type`=?";
- $result = $this->query($query,array((int)$object,$type));
+ $result = $this->mDb->query($query,array((int)$object,$type));
return true;
}
*/
@@ -275,7 +271,7 @@ class LibertyContent extends LibertyBase {
}
function isValid() {
- return( !empty( $this->mContentId ) && is_numeric( $this->mContentId ) );
+ return( !empty( $this->mContentId ) && is_numeric( $this->mContentId ) && $this->mContentId );
}
function isOwner() {
@@ -291,7 +287,7 @@ class LibertyContent extends LibertyBase {
INNER JOIN `".BIT_DB_PREFIX."users_groups` ug ON( uop.`group_id`=ug.`group_id` )
WHERE uop.`object_id` = ? AND uop.`object_type` = ?";
$bindVars = array( $this->mContentId, $this->mContentTypeGuid );
- $this->mPerms = $this->GetAssoc($query, $bindVars);
+ $this->mPerms = $this->mDb->getAssoc($query, $bindVars);
}
return( count( $this->mPerms ) );
}
@@ -327,7 +323,7 @@ class LibertyContent extends LibertyBase {
INNER JOIN `".BIT_DB_PREFIX."users_groups_map` ugm ON( ugm.`group_id`=ug.`group_id` )
WHERE ugm.`user_id`=? AND uop.`object_id` = ? AND uop.`object_type` = ? ";
$bindVars = array( $pUserId, $this->mContentId, $this->mContentTypeGuid );
- $ret = $this->GetAssoc($query, $bindVars);
+ $ret = $this->mDb->getAssoc($query, $bindVars);
}
return $ret;
}
@@ -340,11 +336,11 @@ class LibertyContent extends LibertyBase {
//$object_id = md5($object_type . $object_id);
$query = "DELETE FROM `".BIT_DB_PREFIX."users_objectpermissions`
WHERE `group_id` = ? AND `perm_name` = ? AND `object_id` = ?";
- $result = $this->query($query, array($pGroupId, $perm_name, $object_id), -1, -1);
+ $result = $this->mDb->query($query, array($pGroupId, $perm_name, $object_id), -1, -1);
$query = "insert into `".BIT_DB_PREFIX."users_objectpermissions`
(`group_id`,`object_id`, `object_type`, `perm_name`)
VALUES ( ?, ?, ?, ? )";
- $result = $this->query($query, array($pGroupId, $object_id, $this->mContentTypeGuid, $perm_name));
+ $result = $this->mDb->query($query, array($pGroupId, $object_id, $this->mContentTypeGuid, $perm_name));
return true;
}
@@ -357,7 +353,7 @@ class LibertyContent extends LibertyBase {
FROM `".BIT_DB_PREFIX."users_objectpermissions`
WHERE `group_name` = ? and `object_id` = ? and `object_type` = ? and `perm_name` = ?";
$bindVars = array($group_name, $object_id, $object_type, $perm_name);
- $result = $this->getOne( $query, $bindVars );
+ $result = $this->mDb->getOne( $query, $bindVars );
if ($result>0) {
$ret = true;
}
@@ -372,7 +368,7 @@ class LibertyContent extends LibertyBase {
where `group_id` = ? and `object_id` = ?
and `object_type` = ? and `perm_name` = ?";
$bindVars = array($pGroupId, $this->mContentId, $this->mContentTypeGuid, $perm_name);
- $result = $this->query($query, $bindVars);
+ $result = $this->mDb->query($query, $bindVars);
return true;
}
@@ -383,7 +379,7 @@ class LibertyContent extends LibertyBase {
from `".BIT_DB_PREFIX."users_objectpermissions`
where `object_id` =? and `object_type` = ?";
$bindVars = array( $this->mContentId, $this->mContentTypeGuid );
- $result = $this->query($query, $bindVars);
+ $result = $this->mDb->query($query, $bindVars);
while($res = $result->fetchRow()) {
$this->storePermission( $res["group_name"], $this->mContentTypeGuid, $res["perm_name"], $destinationObjectId );
}
@@ -403,7 +399,7 @@ class LibertyContent extends LibertyBase {
global $gBitUser;
if( $this->mContentId && ($gBitUser->mUserId != $this->mInfo['user_id'] ) ) {
$query = "update `".BIT_DB_PREFIX."tiki_content` set `hits`=`hits`+1 where `content_id` = ?";
- $result = $this->query( $query, array( $this->mContentId ) );
+ $result = $this->mDb->query( $query, array( $this->mContentId ) );
}
return true;
}
@@ -421,7 +417,7 @@ class LibertyContent extends LibertyBase {
$query = "SELECT `page_id`, tp.`content_id`, `description`, tc.`last_modified`, tc.`title`
FROM `".BIT_DB_PREFIX."tiki_pages` tp, `".BIT_DB_PREFIX."tiki_content` tc
WHERE tc.`content_id`=tp.`content_id` AND $pageWhere = ?";
- $result = $this->query($query, array( $bindVars ));
+ $result = $this->mDb->query($query, array( $bindVars ));
if( $result->numRows() ) {
$ret = $result->getArray();
@@ -538,7 +534,7 @@ class LibertyContent extends LibertyBase {
WHERE uu.`user_id` != ".ANONYMOUS_USER_ID." AND tc.`hits` > 0 $mid
GROUP BY uu.`user_id`, uu.`login`, uu.`real_name`
ORDER BY `ag_hits` DESC";
- if( $result = $this->query( $query, $bindVars, $pListHash['max_records'], $pListHash['offset'] ) ) {
+ if( $result = $this->mDb->query( $query, $bindVars, $pListHash['max_records'], $pListHash['offset'] ) ) {
$ret = $result->GetRows();
}
return $ret;
@@ -582,10 +578,10 @@ class LibertyContent extends LibertyBase {
$gateFrom = '';
if (is_array($find)) { // you can use an array of pages
- $mid = " tc.`title` IN (".implode(',',array_fill(0,count($find),'?')).")";
+ $mid = " AND tc.`title` IN (".implode(',',array_fill(0,count($find),'?')).")";
$bindVars[] = $find;
} elseif (!empty($find) && is_string($find)) { // or a string
- $mid = " UPPER(tc.`title`) like ? ";
+ $mid = " AND UPPER(tc.`title`) like ? ";
$bindVars[] = ('%' . strtoupper( $find ) . '%');
}
@@ -640,12 +636,12 @@ class LibertyContent extends LibertyBase {
$query = "SELECT uue.`login` AS `modifier_user`, uue.`real_name` AS `modifier_real_name`, uue.`user_id` AS `modifier_user_id`, uuc.`login` AS`creator_user`, uuc.`real_name` AS `creator_real_name`, uuc.`user_id` AS `creator_user_id`, `hits`, tc.`title`, tc.`last_modified`, tc.`content_type_guid`, `ip`, tc.`content_id` $gateSelect
FROM `".BIT_DB_PREFIX."tiki_content` tc $gateFrom, `".BIT_DB_PREFIX."users_users` uue, `".BIT_DB_PREFIX."users_users` uuc
WHERE tc.`modifier_user_id`=uue.`user_id` AND tc.`user_id`=uuc.`user_id` $mid
- ORDER BY ".$orderTable.$this->convert_sortmode($sort_mode);
- $query_cant = "select count(*) FROM `".BIT_DB_PREFIX."tiki_content` tc $gateFrom $mid";
+ ORDER BY ".$orderTable.$this->mDb->convert_sortmode($sort_mode);
+ $query_cant = "select count(tc.`content_id`) FROM `".BIT_DB_PREFIX."tiki_content` tc $gateFrom, `".BIT_DB_PREFIX."users_users` uu WHERE uu.`user_id`=tc.`user_id` $mid";
// previous cant query - updated by xing
// $query_cant = "select count(*) from `".BIT_DB_PREFIX."tiki_pages` tp INNER JOIN `".BIT_DB_PREFIX."tiki_content` tc ON (tc.`content_id` = tp.`content_id`) $mid";
- $result = $this->query($query,$bindVars,$maxRecords,$offset);
- $cant = $this->getOne($query_cant,$bindVars);
+ $result = $this->mDb->query($query,$bindVars,$maxRecords,$offset);
+ $cant = $this->mDb->getOne($query_cant,$bindVars);
$ret = array();
$contentTypes = $gLibertySystem->mContentTypes;
while ($res = $result->fetchRow()) {
@@ -732,7 +728,7 @@ class LibertyContent extends LibertyBase {
INNER JOIN `'.BIT_DB_PREFIX.'tiki_structures` tsr ON( tsr.`structure_id`=ts.`root_structure_id` )
INNER JOIN `'.BIT_DB_PREFIX.'tiki_content` tcr ON( tsr.`content_id`=tcr.`content_id` )
WHERE tc.`content_id`=ts.`content_id` AND ts.`content_id`=?';
- if( $result = $this->query( $query,array( $this->mContentId ) ) ) {
+ if( $result = $this->mDb->query( $query,array( $this->mContentId ) ) ) {
while ($res = $result->fetchRow()) {
$ret[] = $res;
$result->MoveNext();
@@ -833,7 +829,7 @@ class LibertyContent extends LibertyBase {
function isCached($url) {
$query = "select `cache_id` from `".BIT_DB_PREFIX."tiki_link_cache` where `url`=?";
// sometimes we can have a cache_id of 0(?!) - seen it with my own eyes, spiderr
- $ret = $this->getOne($query, array( $url ) );
+ $ret = $this->mDb->getOne($query, array( $url ) );
return( isset( $ret ) );
}
@@ -866,7 +862,7 @@ class LibertyContent extends LibertyBase {
{
$refresh = date("U");
$query = "insert into `".BIT_DB_PREFIX."tiki_link_cache`(`url`,`data`,`refresh`) values(?,?,?)";
- $result = $this->query($query, array($url,BitDb::db_byte_encode($data),$refresh) );
+ $result = $this->mDb->query($query, array($url,BitDb::db_byte_encode($data),$refresh) );
return !isset($error);
}
else return false;
@@ -888,7 +884,7 @@ class LibertyContent extends LibertyBase {
}
$query = "SELECT `structure_id` FROM `".BIT_DB_PREFIX."tiki_structures` ts
WHERE ts.`content_id`=? $whereSql";
- $cant = $this->getOne( $query, $bindVars );
+ $cant = $this->mDb->getOne( $query, $bindVars );
return $cant;
}
}
diff --git a/LibertyStructure.php b/LibertyStructure.php
index c7fb358..46424c5 100755
--- a/LibertyStructure.php
+++ b/LibertyStructure.php
@@ -2,9 +2,9 @@
/**
* Management of Liberty Content
*
+ * @package liberty
+ * @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertyStructure.php,v 1.5 2005/08/07 17:40:29 squareing Exp $
* @author spider <spider@steelsun.com>
- * @version $Revision: 1.4 $
- * @package Liberty
*/
/**
@@ -13,18 +13,15 @@
require_once( LIBERTY_PKG_PATH.'LibertyBase.php' );
/**
-* System class for handling the liberty package
-*
-* @author spider <spider@steelsun.com>
-* @version $Revision: 1.4 $
-* @package Liberty
-* @subpackage LibertyStructure
-*/
+ * System class for handling the liberty package
+ *
+ * @package liberty
+ */
class LibertyStructure extends LibertyBase {
var $mStructureId;
function LibertyStructure ( $pStructureId=NULL, $pContentId=NULL ) {
- // we need to init our mDb early
+ // we need to init our database connection early
LibertyBase::LibertyBase();
$this->mStructureId = $pStructureId;
$this->mContentId = $pContentId;
@@ -53,7 +50,7 @@ class LibertyStructure extends LibertyBase {
$query .= ' WHERE ts.`content_id`=?';
$bindVars = array( $pContentId );
}
- if( $result = $this->query( $query, $bindVars ) ) {
+ if( $result = $this->mDb->query( $query, $bindVars ) ) {
$ret = $result->fields;
}
return $ret;
@@ -78,7 +75,7 @@ class LibertyStructure extends LibertyBase {
// This is a utility function mainly used for upgrading sites.
function setTreeRoot( $pRootId, $pTree ) {
foreach( $pTree as $structRow ) {
- $this->query( "UPDATE `".BIT_DB_PREFIX."tiki_structures` SET `root_structure_id`=? WHERE `structure_id`=?", array( $pRootId, $structRow["structure_id"] ) );
+ $this->mDb->query( "UPDATE `".BIT_DB_PREFIX."tiki_structures` SET `root_structure_id`=? WHERE `structure_id`=?", array( $pRootId, $structRow["structure_id"] ) );
if( !empty( $structRow["sub"] ) ) {
$this->setTreeRoot( $pRootId, $structRow["sub"] );
}
@@ -153,7 +150,7 @@ class LibertyStructure extends LibertyBase {
$query = "SELECT ts.`content_id`, ts.`structure_id`, ts.`page_alias`, tc.`title`
FROM `".BIT_DB_PREFIX."tiki_structures` ts, `".BIT_DB_PREFIX."tiki_content` tc
WHERE tc.`content_id` = ts.`content_id` AND `parent_id`=? ORDER BY `pos` asc";
- $result = $this->query($query,array( $pStructureId ) );
+ $result = $this->mDb->query($query,array( $pStructureId ) );
$subs = array();
$row_max = $result->numRows();
@@ -216,12 +213,12 @@ class LibertyStructure extends LibertyBase {
$query = "SELECT ts.`structure_id`, ts.`parent_id`, ts.`content_id`, `page_alias`, `pos`, tc.`title`, `hits`, `data`, `last_modified`, tc.`modifier_user_id`, `ip`, tc.`user_id` AS `creator_user_id`, uu.`login` AS `user`, uu.`real_name` , uu.`email`
FROM `".BIT_DB_PREFIX."tiki_structures` ts INNER JOIN `".BIT_DB_PREFIX."tiki_content` tc ON ( ts.`content_id` = tc.`content_id` ) INNER JOIN `".BIT_DB_PREFIX."users_users` uu ON ( tc.`user_id` = uu.`user_id` )
WHERE $mid
- ORDER BY ".$this->convert_sortmode($pListHash['sort_mode']);
+ ORDER BY ".$this->mDb->convert_sortmode($pListHash['sort_mode']);
$query_cant = "SELECT count(*)
FROM `".BIT_DB_PREFIX."tiki_structures` ts INNER JOIN `".BIT_DB_PREFIX."tiki_content` tc ON ( ts.`content_id` = tc.`content_id` )
WHERE $mid";
- $result = $this->query($query,$bindVars,$pListHash['max_records'],$pListHash['offset']);
- $cant = $this->getOne($query_cant,$bindVars);
+ $result = $this->mDb->query($query,$bindVars,$pListHash['max_records'],$pListHash['offset']);
+ $cant = $this->mDb->getOne($query_cant,$bindVars);
$ret = array();
while ($res = $result->fetchRow()) {
@@ -250,15 +247,15 @@ class LibertyStructure extends LibertyBase {
$pParamHash['alias'] = '';
}
if( isset( $pParamHash['after_ref_id'] ) ) {
- $pParamHash['max'] = $this->getOne("select `pos` from `".BIT_DB_PREFIX."tiki_structures` where `structure_id`=?",array((int)$pParamHash['after_ref_id']));
+ $pParamHash['max'] = $this->mDb->getOne("select `pos` from `".BIT_DB_PREFIX."tiki_structures` where `structure_id`=?",array((int)$pParamHash['after_ref_id']));
} else {
- $pParamHash['max'] = $this->getOne("select max(`pos`) from `".BIT_DB_PREFIX."tiki_structures` where `parent_id`=?",array((int)$pParamHash['parent_id']));
+ $pParamHash['max'] = $this->mDb->getOne("select max(`pos`) from `".BIT_DB_PREFIX."tiki_structures` where `parent_id`=?",array((int)$pParamHash['parent_id']));
}
if( $pParamHash['max'] > 0 ) {
//If max is 5 then we are inserting after position 5 so we'll insert 5 and move all
// the others
$query = "update `".BIT_DB_PREFIX."tiki_structures` set `pos`=`pos`+1 where `pos`>? and `parent_id`=?";
- $result = $this->query($query,array((int)$pParamHash['max'], (int)$pParamHash['parent_id']));
+ $result = $this->mDb->query($query,array((int)$pParamHash['max'], (int)$pParamHash['parent_id']));
}
$pParamHash['max']++;
}
@@ -282,12 +279,12 @@ class LibertyStructure extends LibertyBase {
$this->mDb->StartTrans();
//Create a new structure entry
- $pParamHash['structure_id'] = $this->GenID( 'tiki_structures_id_seq' );
+ $pParamHash['structure_id'] = $this->mDb->GenID( 'tiki_structures_id_seq' );
if( empty( $pParamHash['root_structure_id'] ) || !is_numeric( $pParamHash['root_structure_id'] ) ) {
$pParamHash['root_structure_id'] = $pParamHash['structure_id'];
}
$query = "INSERT INTO `".BIT_DB_PREFIX."tiki_structures`( `structure_id`, `parent_id`,`content_id`, `root_structure_id`, `page_alias`, `pos` ) values(?,?,?,?,?,?)";
- $result = $this->query( $query, array( $pParamHash['structure_id'], $pParamHash['parent_id'], (int)$pParamHash['content_id'], (int)$pParamHash['root_structure_id'], $pParamHash['alias'], $pParamHash['max'] ) );
+ $result = $this->mDb->query( $query, array( $pParamHash['structure_id'], $pParamHash['parent_id'], (int)$pParamHash['content_id'], (int)$pParamHash['root_structure_id'], $pParamHash['alias'], $pParamHash['max'] ) );
$this->mDb->CompleteTrans();
$ret = $pParamHash['structure_id'];
} else {
@@ -305,10 +302,10 @@ class LibertyStructure extends LibertyBase {
if( !empty( $parentNode['parent_id'] ) ) {
//Make a space for the node after its parent
$query = "update `".BIT_DB_PREFIX."tiki_structures` set `pos`=`pos`+1 where `pos`>? and `parent_id`=?";
- $this->query( $query, array( $parentNode['pos'], $parentNode['parent_id'] ) );
+ $this->mDb->query( $query, array( $parentNode['pos'], $parentNode['parent_id'] ) );
//Move the node up one level
$query = "update `".BIT_DB_PREFIX."tiki_structures` set `parent_id`=?, `pos`=(? + 1) where `structure_id`=?";
- $this->query($query, array( $parentNode['parent_id'], $parentNode['pos'], $this->mStructureId ) );
+ $this->mDb->query($query, array( $parentNode['parent_id'], $parentNode['pos'], $this->mStructureId ) );
}
}
$this->mDb->CompleteTrans();
@@ -319,21 +316,21 @@ class LibertyStructure extends LibertyBase {
if( $this->isValid() ) {
$this->mDb->StartTrans();
$query = "select `structure_id`, `pos` from `".BIT_DB_PREFIX."tiki_structures` where `pos`<? and `parent_id`=? order by `pos` desc";
- $result = $this->query($query,array($this->mInfo["pos"], (int)$this->mInfo["parent_id"]));
+ $result = $this->mDb->query($query,array($this->mInfo["pos"], (int)$this->mInfo["parent_id"]));
if ($previous = $result->fetchRow()) {
//Get last child nodes for previous sibling
$query = "select `pos` from `".BIT_DB_PREFIX."tiki_structures` where `parent_id`=? order by `pos` desc";
- $result = $this->query($query,array((int)$previous["structure_id"]));
+ $result = $this->mDb->query($query,array((int)$previous["structure_id"]));
if ($res = $result->fetchRow()) {
$pos = $res["pos"];
} else{
$pos = 0;
}
$query = "update `".BIT_DB_PREFIX."tiki_structures` set `parent_id`=?, `pos`=(? + 1) where `structure_id`=?";
- $this->query( $query, array((int)$previous["structure_id"], (int)$pos, (int)$this->mStructureId) );
+ $this->mDb->query( $query, array((int)$previous["structure_id"], (int)$pos, (int)$this->mStructureId) );
//Move nodes up below that had previous parent and pos
$query = "update `".BIT_DB_PREFIX."tiki_structures` set `pos`=`pos`-1 where `pos`>? and `parent_id`=?";
- $this->query( $query, array( $this->mInfo['pos'], $this->mInfo['parent_id'] ) );
+ $this->mDb->query( $query, array( $this->mInfo['pos'], $this->mInfo['parent_id'] ) );
}
$this->mDb->CompleteTrans();
}
@@ -343,13 +340,13 @@ class LibertyStructure extends LibertyBase {
if( $this->isValid() ) {
$this->mDb->StartTrans();
$query = "select `structure_id`, `pos` from `".BIT_DB_PREFIX."tiki_structures` where `pos`>? and `parent_id`=? order by `pos` asc";
- $result = $this->query($query,array((int)$this->mInfo["pos"], (int)$this->mInfo["parent_id"]));
+ $result = $this->mDb->query($query,array((int)$this->mInfo["pos"], (int)$this->mInfo["parent_id"]));
$res = $result->fetchRow();
if ($res) {
//Swap position values
$query = "update `".BIT_DB_PREFIX."tiki_structures` set `pos`=? where `structure_id`=?";
- $this->query($query,array((int)$this->mInfo["pos"], (int)$res["structure_id"]) );
- $this->query($query,array((int)$res["pos"], (int)$this->mInfo["structure_id"]) );
+ $this->mDb->query($query,array((int)$this->mInfo["pos"], (int)$res["structure_id"]) );
+ $this->mDb->query($query,array((int)$res["pos"], (int)$this->mInfo["structure_id"]) );
}
$this->mDb->CompleteTrans();
}
@@ -359,13 +356,13 @@ class LibertyStructure extends LibertyBase {
if( $this->isValid() ) {
$this->mDb->StartTrans();
$query = "select `structure_id`, `pos` from `".BIT_DB_PREFIX."tiki_structures` where `pos`<? and `parent_id`=? order by `pos` desc";
- $result = $this->query($query,array((int)$this->mInfo["pos"], (int)$this->mInfo["parent_id"]));
+ $result = $this->mDb->query($query,array((int)$this->mInfo["pos"], (int)$this->mInfo["parent_id"]));
$res = $result->fetchRow();
if ($res) {
//Swap position values
$query = "update `".BIT_DB_PREFIX."tiki_structures` set `pos`=? where `structure_id`=?";
- $this->query($query,array((int)$res["pos"], (int)$this->mInfo["structure_id"]) );
- $this->query($query,array((int)$this->mInfo["pos"], (int)$res["structure_id"]) );
+ $this->mDb->query($query,array((int)$res["pos"], (int)$this->mInfo["structure_id"]) );
+ $this->mDb->query($query,array((int)$this->mInfo["pos"], (int)$res["structure_id"]) );
}
$this->mDb->CompleteTrans();
}
@@ -445,7 +442,7 @@ class LibertyStructure extends LibertyBase {
$query = "SELECT `structure_id`, ts.`content_id`
FROM `".BIT_DB_PREFIX."tiki_structures` ts
WHERE `parent_id`=?";
- $result = $this->query( $query,array( (int)$structure_id) );
+ $result = $this->mDb->query( $query,array( (int)$structure_id) );
//Iterate down through the child nodes
while ($res = $result->fetchRow()) {
$this->s_remove_page($res["structure_id"], $delete);
@@ -455,7 +452,7 @@ class LibertyStructure extends LibertyBase {
if ($delete) {
$page_info = $this->getNode($structure_id);
$query = "select count(*) from `".BIT_DB_PREFIX."tiki_structures` where `content_id`=?";
- $count = $this->getOne($query, array((int)$page_info["page_id"]));
+ $count = $this->mDb->getOne($query, array((int)$page_info["page_id"]));
if ($count = 1) {
$this->remove_all_versions($page_info["page_id"]);
}
@@ -464,7 +461,7 @@ class LibertyStructure extends LibertyBase {
//Remove the structure node
$query = "delete from `".BIT_DB_PREFIX."tiki_structures` where `structure_id`=?";
- $result = $this->query($query, array( (int)$structure_id) );
+ $result = $this->mDb->query($query, array( (int)$structure_id) );
return true;
}
}
@@ -475,14 +472,14 @@ class LibertyStructure extends LibertyBase {
$query = "select `structure_id` ";
$query .= "from `".BIT_DB_PREFIX."tiki_structures` as ts, `".BIT_DB_PREFIX."tiki_pages` as tp ";
$query .= "where tp.`content_id`=ts.`content_id` and `parent_id`=?";
- $result = $this->query($query, array( $structure_id ) );
+ $result = $this->mDb->query($query, array( $structure_id ) );
while ($res = $result->fetchRow()) {
$this->remove_from_structure($res["structure_id"]);
}
$query = "delete from `".BIT_DB_PREFIX."tiki_structures` where `structure_id`=?";
- $result = $this->query($query, array( $structure_id ) );
+ $result = $this->mDb->query($query, array( $structure_id ) );
return true;
}
@@ -493,7 +490,7 @@ class LibertyStructure extends LibertyBase {
*/
function s_get_parent_info($structure_id) {
// Try to get the parent of this page
- $parent_id = $this->getOne("select `parent_id` from `".BIT_DB_PREFIX."tiki_structures` where `structure_id`=?",array((int)$structure_id));
+ $parent_id = $this->mDb->getOne("select `parent_id` from `".BIT_DB_PREFIX."tiki_structures` where `structure_id`=?",array((int)$structure_id));
if (!$parent_id)
return null;
@@ -505,7 +502,7 @@ class LibertyStructure extends LibertyBase {
$ret = array();
$query = "SELECT * from `".BIT_DB_PREFIX."tiki_structures` where `parent_id`=? ORDER BY pos, page_alias, content_id";
- $result = $this->query( $query, array( (int)$pStructureId ) );
+ $result = $this->mDb->query( $query, array( (int)$pStructureId ) );
while ( !$result->EOF ) {
array_push( $pToc, $result->fields['content_id'] );
$this->getContentIds( $result->fields['structure_id'], $pToc, ++$pLevel );
@@ -515,7 +512,7 @@ class LibertyStructure extends LibertyBase {
function getContentArray( $pStructureId, &$pToc, $pLevel=0 ) {
$query = "SELECT * from `".BIT_DB_PREFIX."tiki_structures` where `structure_id`=?";
- $result = $this->query( $query, array( (int)$pStructureId ) );
+ $result = $this->mDb->query( $query, array( (int)$pStructureId ) );
if( !$result->EOF ) {
array_push( $pToc, $result->fields['content_id'] );
$this->getContentIds( $pStructureId, $pToc, $pLevel );
@@ -545,13 +542,13 @@ class LibertyStructure extends LibertyBase {
// the $tocPrefix can be used to Prefix a subtree as it would start from a given number (e.g. 2.1.3)
function build_subtree_toc($id,$slide=false,$order='asc',$tocPrefix='') {
$ret = array();
- $cant = $this->getOne("select count(*) from `".BIT_DB_PREFIX."tiki_structures` where `parent_id`=?",array((int)$id));
+ $cant = $this->mDb->getOne("select count(*) from `".BIT_DB_PREFIX."tiki_structures` where `parent_id`=?",array((int)$id));
if ($cant) {
$query = "SELECT `structure_id`, tc.`title`, `page_alias`
FROM `".BIT_DB_PREFIX."tiki_structures` ts INNER JOIN `".BIT_DB_PREFIX."tiki_content` tc ON ( tc.`content_id`=ts.`content_id` )
WHERE `parent_id`=?
- ORDER BY ".$this->convert_sortmode("pos_".$order);
- $result = $this->query($query,array((int)$id));
+ ORDER BY ".$this->mDb->convert_sortmode("pos_".$order);
+ $result = $this->mDb->query($query,array((int)$id));
$prefix=1;
while ($res = $result->fetchRow()) {
$res['prefix']=($tocPrefix=='')?'':"$tocPrefix.";
@@ -608,7 +605,7 @@ class LibertyStructure extends LibertyBase {
$query = "SELECT `structure_id`
FROM `".BIT_DB_PREFIX."tiki_structures` ts, `".BIT_DB_PREFIX."tiki_pages` tp,`".BIT_DB_PREFIX."tiki_content` tc
WHERE tp.`content_id`=ts.`content_id` AND tc.`content_id` = tp.`content_id` AND (`parent_id` is null or `parent_id`=0) and tc.`title`=?";
- $structure_id = $this->getOne($query,array($title));
+ $structure_id = $this->mDb->getOne($query,array($title));
return $structure_id;
}
*/
@@ -618,8 +615,8 @@ class LibertyStructure extends LibertyBase {
$query = "SELECT `structure_id`
FROM `".BIT_DB_PREFIX."tiki_structures` ts
WHERE `parent_id`=?
- ORDER BY ".$this->convert_sortmode("pos_asc");
- $result1 = $this->query($query,array((int)$structure_id));
+ ORDER BY ".$this->mDb->convert_sortmode("pos_asc");
+ $result1 = $this->mDb->query($query,array((int)$structure_id));
if ($result1->numRows()) {
$res = $result1->fetchRow();
@@ -638,8 +635,8 @@ class LibertyStructure extends LibertyBase {
$query = "SELECT `structure_id`
FROM `".BIT_DB_PREFIX."tiki_structures` ts
WHERE `parent_id`=? and `pos`>?
- ORDER BY ".$this->convert_sortmode("pos_asc");
- $result2 = $this->query($query,array((int)$parent_id, (int)$page_pos));
+ ORDER BY ".$this->mDb->convert_sortmode("pos_asc");
+ $result2 = $this->mDb->query($query,array((int)$parent_id, (int)$page_pos));
if ($result2->numRows()) {
$res = $result2->fetchRow();
@@ -657,8 +654,8 @@ class LibertyStructure extends LibertyBase {
$query = "select `structure_id` ";
$query .= "from `".BIT_DB_PREFIX."tiki_structures` ts ";
$query .= "where `parent_id`=? ";
- $query .= "order by ".$this->convert_sortmode("pos_desc");
- $result = $this->query($query,array($structure_id));
+ $query .= "order by ".$this->mDb->convert_sortmode("pos_desc");
+ $result = $this->mDb->query($query,array($structure_id));
if ($result->numRows()) {
//There are more children
@@ -679,8 +676,8 @@ class LibertyStructure extends LibertyBase {
$query = "select `structure_id` ";
$query .= "from `".BIT_DB_PREFIX."tiki_structures` ts ";
$query .= "where `parent_id`=? and `pos`<? ";
- $query .= "order by ".$this->convert_sortmode("pos_desc");
- $result = $this->query($query,array((int)$parent_id, (int)$pos));
+ $query .= "order by ".$this->mDb->convert_sortmode("pos_desc");
+ $result = $this->mDb->query($query,array((int)$parent_id, (int)$pos));
if ($result->numRows()) {
//There is a previous sibling
@@ -702,8 +699,8 @@ class LibertyStructure extends LibertyBase {
$query = "SELECT `pos`, `structure_id`, `parent_id`, ts.`content_id`, tc.`title`, `page_alias`
FROM `".BIT_DB_PREFIX."tiki_structures` ts, `".BIT_DB_PREFIX."tiki_content` tc
WHERE ts.`content_id` = tc.`content_id` AND `parent_id`=? ";
- $query .= "order by ".$this->convert_sortmode("pos_asc");
- $result = $this->query($query,array((int)$parent_id));
+ $query .= "order by ".$this->mDb->convert_sortmode("pos_asc");
+ $result = $this->mDb->query($query,array((int)$parent_id));
while ($res = $result->fetchRow()) {
//$ret[] = $this->populate_page_info($res);
$ret[] = $res;
@@ -714,7 +711,7 @@ class LibertyStructure extends LibertyBase {
function get_max_children($structure_id) {
$query = "select `structure_id` from `".BIT_DB_PREFIX."tiki_structures` where `parent_id`=?";
- $result = $this->query($query,array((int)$structure_id));
+ $result = $this->mDb->query($query,array((int)$structure_id));
if (!$result->numRows()) {
return '';
}
@@ -753,9 +750,9 @@ class LibertyStructure extends LibertyBase {
$query = "select `pos`, `structure_id`, `parent_id`, ts.`content_id`, tc.`title`, `page_alias`
FROM `".BIT_DB_PREFIX."tiki_structures` ts, `".BIT_DB_PREFIX."tiki_content` tc
WHERE tc.`content_id` = tp.`content_id` AND tp.`content_id`=ts.`content_id` AND `parent_id`=?
- ORDER by ".$this->convert_sortmode("pos_asc");
+ ORDER by ".$this->mDb->convert_sortmode("pos_asc");
- $result = $this->query($query,array((int)$structure_id));
+ $result = $this->mDb->query($query,array((int)$structure_id));
while ($res = $result->fetchRow()) {
//$ret[] = $this->populate_page_info($res);
$ret2 = $this->_s_get_structure_pages($res["structure_id"]);
@@ -766,13 +763,13 @@ class LibertyStructure extends LibertyBase {
function get_page_alias($structure_id) {
$query = "select `page_alias` from `".BIT_DB_PREFIX."tiki_structures` where `structure_id`=?";
- $res = $this->getOne($query, array((int)$structure_id));
+ $res = $this->mDb->getOne($query, array((int)$structure_id));
return $res;
}
function set_page_alias($structure_id, $pageAlias) {
$query = "update `".BIT_DB_PREFIX."tiki_structures` set `page_alias`=? where `structure_id`=?";
- $this->query($query, array($pageAlias, (int)$structure_id));
+ $this->mDb->query($query, array($pageAlias, (int)$structure_id));
}
@@ -812,7 +809,7 @@ class LibertyStructure extends LibertyBase {
$query = "SELECT *
FROM `".BIT_DB_PREFIX."tiki_pages` tp, `".BIT_DB_PREFIX."tiki_content` tc
WHERE tc.`content_id` = tp.`content_id` AND tc.`title`=?";
- $result = $this->query($query,array($page));
+ $result = $this->mDb->query($query,array($page));
$res = $result->fetchRow();
$docs[] = $res["title"];
if(empty($res["description"])) $res["description"]=$res["title"];
@@ -863,14 +860,14 @@ class LibertyStructure extends LibertyBase {
function structure_to_tree($structure_id) {
$query = "select * from `".BIT_DB_PREFIX."tiki_structures` ts,`".BIT_DB_PREFIX."tiki_pages` tp where tp.`content_id`=ts.`content_id` and `structure_id`=?";
- $result = $this->query($query,array((int)$structure_id));
+ $result = $this->mDb->query($query,array((int)$structure_id));
$res = $result->fetchRow();
if(empty($res['description'])) $res['description']=$res['title'];
$name = $res['description'].'|'.$res['title'];
$code = '';
$code.= "'$name'=>";
$query = "select * from `".BIT_DB_PREFIX."tiki_structures` ts, `".BIT_DB_PREFIX."tiki_pages` tp where tp.`content_id`=ts.`content_id` and `parent_id`=?";
- $result = $this->query($query,array((int)$structure_id));
+ $result = $this->mDb->query($query,array((int)$structure_id));
if($result->numRows()) {
$code.="Array(";
$first = true;
diff --git a/LibertySystem.php b/LibertySystem.php
index 2834025..3324937 100755
--- a/LibertySystem.php
+++ b/LibertySystem.php
@@ -2,9 +2,9 @@
/**
* System class for handling the liberty package
*
+* @package liberty
+* @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertySystem.php,v 1.5 2005/08/07 17:40:29 squareing Exp $
* @author spider <spider@steelsun.com>
-* @version $Revision: 1.4 $
-* @package Liberty
*/
// +----------------------------------------------------------------------+
@@ -18,8 +18,7 @@
// +----------------------------------------------------------------------+
// | Authors: spider <spider@steelsun.com>
// +----------------------------------------------------------------------+
-//
-// $Id: LibertySystem.php,v 1.4 2005/08/01 18:40:47 squareing Exp $
+
/**
* Local base defines
*/
@@ -39,10 +38,7 @@ require_once( LIBERTY_PKG_PATH.'LibertyBase.php' );
/**
* System class for handling the liberty package
*
- * @author spider <spider@steelsun.com>
- * @version $Revision: 1.4 $
- * @package Liberty
- * @subpackage LibertySystem
+ * @package liberty
*/
class LibertySystem extends LibertyBase {
@@ -58,7 +54,7 @@ class LibertySystem extends LibertyBase {
}
function loadPlugins() {
- $rs = $this->query( "SELECT * FROM `".BIT_DB_PREFIX."tiki_plugins`", NULL, BIT_QUERY_DEFAULT, BIT_QUERY_DEFAULT );
+ $rs = $this->mDb->query( "SELECT * FROM `".BIT_DB_PREFIX."tiki_plugins`", NULL, BIT_QUERY_DEFAULT, BIT_QUERY_DEFAULT );
while( $rs && !$rs->EOF ) {
$this->mPlugins[$rs->fields['plugin_guid']] = $rs->fields;
$rs->MoveNext();
@@ -81,25 +77,25 @@ class LibertySystem extends LibertyBase {
if( !isset( $handler['verified'] ) && $handler['is_active'] =='y' ) {
// We are missing a plugin!
$sql = "UPDATE `".BIT_DB_PREFIX."tiki_plugins` SET `is_active`='x' WHERE `plugin_guid`=?";
- $this->query( $sql, array( $guid ) );
+ $this->mDb->query( $sql, array( $guid ) );
$handler['is_active'] = 'n';
} elseif( !empty( $handler['verified'] ) && $handler['is_active'] =='x' ) {
//We found a formally missing plugin - re-enable it
$sql = "UPDATE `".BIT_DB_PREFIX."tiki_plugins` SET `is_active`='y' WHERE `plugin_guid`=?";
- $this->query( $sql, array( $guid ) );
+ $this->mDb->query( $sql, array( $guid ) );
$handler['is_active'] = 'y';
} elseif( empty( $handler['verified'] ) && !isset( $handler['is_active'] ) ) {
//We found a missing plugin - insert it
$handler['is_active'] = ( ( isset( $handler['auto_activate'] ) && $handler['auto_activate'] == FALSE ) ? 'n' : 'y' );
$sql = "INSERT INTO `".BIT_DB_PREFIX."tiki_plugins` ( `plugin_guid`, `plugin_type`, `plugin_description`, `is_active` ) VALUES ( ?, ?, ?, ? )";
- $this->query( $sql, array( $guid, $handler['plugin_type'], $handler['description'], $handler['is_active'] ) );
+ $this->mDb->query( $sql, array( $guid, $handler['plugin_type'], $handler['description'], $handler['is_active'] ) );
}
}
asort( $this->mPlugins );
}
function loadContentTypes( $pCacheTime=BIT_QUERY_CACHE_TIME ) {
- $rs = $this->query( "SELECT * FROM `".BIT_DB_PREFIX."tiki_content_types`", NULL, BIT_QUERY_DEFAULT, BIT_QUERY_DEFAULT );
+ $rs = $this->mDb->query( "SELECT * FROM `".BIT_DB_PREFIX."tiki_content_types`", NULL, BIT_QUERY_DEFAULT, BIT_QUERY_DEFAULT );
while( $rs && !$rs->EOF ) {
$this->mContentTypes[$rs->fields['content_type_guid']] = $rs->fields;
$rs->MoveNext();
@@ -112,12 +108,12 @@ class LibertySystem extends LibertyBase {
}
$pTypeParams['content_type_guid'] = $pGuid;
if( empty( $this->mContentTypes[$pGuid] ) && !empty( $pTypeParams ) ) {
- $result = $this->associateInsert( BIT_DB_PREFIX."tiki_content_types", $pTypeParams );
+ $result = $this->mDb->associateInsert( BIT_DB_PREFIX."tiki_content_types", $pTypeParams );
// we just ran some SQL - let's flush the loadContentTypes query cache
$this->loadContentTypes( 0 );
} else {
if( $pTypeParams['handler_package'] != $this->mContentTypes[$pGuid]['handler_package'] || $pTypeParams['handler_file'] != $this->mContentTypes[$pGuid]['handler_file'] || $pTypeParams['handler_class'] != $this->mContentTypes[$pGuid]['handler_class'] ) {
- $result = $this->associateUpdate( BIT_DB_PREFIX."tiki_content_types", $pTypeParams, array( 'name'=>'content_type_guid', 'value'=>$pGuid ) );
+ $result = $this->mDb->associateUpdate( BIT_DB_PREFIX."tiki_content_types", $pTypeParams, array( 'name'=>'content_type_guid', 'value'=>$pGuid ) );
}
}
}
@@ -143,14 +139,14 @@ class LibertySystem extends LibertyBase {
function setActivePlugins( $pPluginGuids ) {
if( is_array( $pPluginGuids ) ) {
$sql = "UPDATE `".BIT_DB_PREFIX."tiki_plugins` SET `is_active`='n' WHERE `is_active`!='x'";
- $this->query( $sql );
+ $this->mDb->query( $sql );
foreach( array_keys( $this->mPlugins ) as $guid ) {
$this->mPlugins[$guid]['is_active'] = 'n';
}
foreach( array_keys( $pPluginGuids ) as $guid ) {
$sql = "UPDATE `".BIT_DB_PREFIX."tiki_plugins` SET `is_active`='y' WHERE `plugin_guid`=?";
- $this->query( $sql, array( $guid ) );
+ $this->mDb->query( $sql, array( $guid ) );
$this->mPlugins[$guid]['is_active'] = 'y';
}
// we just ran some SQL - let's flush the loadPlugins query cache
diff --git a/admin/upgrade_inc.php b/admin/upgrade_inc.php
index fcab19a..a7b536f 100644
--- a/admin/upgrade_inc.php
+++ b/admin/upgrade_inc.php
@@ -156,25 +156,25 @@ user_ip
// STEP 2
array( 'PHP' => '
global $gBitSystem;
- $gBitSystem->mDb->mDb->CreateSequence( "tiki_attachments_id_seq", 1 );
- $gBitSystem->mDb->mDb->CreateSequence( "tiki_content_id_seq", 1 );
- $gBitSystem->mDb->mDb->CreateSequence( "tiki_files_file_id_seq", 1 );
+ $gBitSystem->mDb->CreateSequence( "tiki_attachments_id_seq", 1 );
+ $gBitSystem->mDb->CreateSequence( "tiki_content_id_seq", 1 );
+ $gBitSystem->mDb->CreateSequence( "tiki_files_file_id_seq", 1 );
$max = $gBitSystem->GetOne( "SELECT MAX(`comment_id`) FROM `'.BIT_DB_PREFIX.'tiki_comments`" );
- $gBitSystem->mDb->mDb->CreateSequence( "tiki_comments_comment_id_seq", $max + 1 );
+ $gBitSystem->mDb->CreateSequence( "tiki_comments_comment_id_seq", $max + 1 );
$max = $gBitSystem->GetOne( "SELECT MAX(`structure_id`) FROM `'.BIT_DB_PREFIX.'tiki_structures`" );
- $gBitSystem->mDb->mDb->CreateSequence( "tiki_structures_id_seq", $max + 1 );
+ $gBitSystem->mDb->CreateSequence( "tiki_structures_id_seq", $max + 1 );
$query = "SELECT `comment_id`, uu.`user_id`, uu.`user_id` AS `modifier_user_id`, `commentDate` AS `created`, `commentDate` AS `last_modified`, `hits`, `data`, `title`, `user_ip` AS `ip`
FROM `'.BIT_DB_PREFIX.'tiki_comments` tc INNER JOIN `'.BIT_DB_PREFIX.'users_users` uu ON( tc.`userName`=uu.`login` )";
- if( $rs = $gBitSystem->query( $query ) ) {
+ if( $rs = $gBitSystem->mDb->query( $query ) ) {
while( !$rs->EOF ) {
$commentId = $rs->fields["comment_id"]; unset( $rs->fields["comment_id"] );
- $conId = $gBitSystem->mDb->mDb->GenID( "tiki_content_id_seq" );
+ $conId = $gBitSystem->mDb->GenID( "tiki_content_id_seq" );
$rs->fields["content_id"] = $conId;
$rs->fields["content_type_guid"] = BITCOMMENT_CONTENT_TYPE_GUID;
$rs->fields["format_guid"] = PLUGIN_GUID_TIKIWIKI;
$gBitSystem->mDb->associateInsert( "tiki_content", $rs->fields );
- $gBitSystem->query( "UPDATE `'.BIT_DB_PREFIX.'tiki_comments` SET `content_id`=? WHERE `comment_id`=?", array( $conId, $commentId ) );
+ $gBitSystem->mDb->query( "UPDATE `'.BIT_DB_PREFIX.'tiki_comments` SET `content_id`=? WHERE `comment_id`=?", array( $conId, $commentId ) );
$rs->MoveNext();
}
}
diff --git a/attachment_browser.php b/attachment_browser.php
index ff88558..227675b 100644
--- a/attachment_browser.php
+++ b/attachment_browser.php
@@ -3,8 +3,8 @@
* attachment_browser
*
* @author spider <spider@steelsun.com>
- * @version $Revision: 1.3 $
- * @package Liberty
+ * @version $Revision: 1.4 $
+ * @package liberty
* @subpackage functions
*/
@@ -15,12 +15,15 @@ include("../bit_setup_inc.php");
$userAttachments = $gBitUser->getUserAttachments();
$gBitSmarty->assign('userAttachments', $userAttachments);
-if (empty($gBitLoc['styleSheet'])) {
- $gBitLoc['styleSheet'] = $gBitSystem->getStyleCss();
+if (empty($gBitSystem->mStyles['styleSheet'])) {
+ $gBitSystem->mStyles['styleSheet'] = $gBitSystem->getStyleCss();
}
-$gBitLoc['browserStyleSheet'] = $gBitSystem->getBrowserStyleCss();
-$gBitLoc['customStyleSheet'] = $gBitSystem->getCustomStyleCss();
-$gBitLoc['THEMES_STYLE_URL'] = $gBitSystem->getStyleUrl();
+$gBitSystem->mStyles['browserStyleSheet'] = $gBitSystem->getBrowserStyleCss();
+$gBitSystem->mStyles['customStyleSheet'] = $gBitSystem->getCustomStyleCss();
+if( !defined( 'THEMES_STYLE_URL' ) ) {
+ define( 'THEMES_STYLE_URL', $gBitSystem->getStyleUrl() );
+}
+
//vd($userAttachments);
$gBitSmarty->display('bitpackage:liberty/attachment_browser.tpl');
?>
diff --git a/bit_setup_inc.php b/bit_setup_inc.php
index 79b9178..89f0b10 100644
--- a/bit_setup_inc.php
+++ b/bit_setup_inc.php
@@ -3,8 +3,8 @@
* base package include
*
* @author spider <spider@steelsun.com>
- * @version $Revision: 1.3 $
- * @package Liberty
+ * @version $Revision: 1.4 $
+ * @package liberty
* @subpackage functions
*/
diff --git a/comments_inc.php b/comments_inc.php
index bdca186..7e3b06b 100644
--- a/comments_inc.php
+++ b/comments_inc.php
@@ -3,12 +3,12 @@
* comment_inc
*
* @author spider <spider@steelsun.com>
- * @version $Revision: 1.4 $
- * @package Liberty
+ * @version $Revision: 1.5 $
+ * @package liberty
* @subpackage functions
*/
-// $Header: /cvsroot/bitweaver/_bit_liberty/comments_inc.php,v 1.4 2005/08/01 18:40:48 squareing Exp $
+// $Header: /cvsroot/bitweaver/_bit_liberty/comments_inc.php,v 1.5 2005/08/07 17:40:29 squareing 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.
diff --git a/display_content_inc.php b/display_content_inc.php
index fbcdd3e..3947024 100644
--- a/display_content_inc.php
+++ b/display_content_inc.php
@@ -3,8 +3,8 @@
* display_content_inc
*
* @author spider <spider@steelsun.com>
- * @version $Revision: 1.3 $
- * @package Liberty
+ * @version $Revision: 1.4 $
+ * @package liberty
* @subpackage functions
*/
diff --git a/display_structure_inc.php b/display_structure_inc.php
index 0bb2f83..5ce0db1 100644
--- a/display_structure_inc.php
+++ b/display_structure_inc.php
@@ -3,8 +3,8 @@
* display_structure_inc
*
* @author spider <spider@steelsun.com>
- * @version $Revision: 1.2 $
- * @package Liberty
+ * @version $Revision: 1.3 $
+ * @package liberty
* @subpackage functions
*/
diff --git a/edit_help_inc.php b/edit_help_inc.php
index c02fea3..e28d5fb 100644
--- a/edit_help_inc.php
+++ b/edit_help_inc.php
@@ -3,8 +3,8 @@
* edit_help_inc
*
* @author spider <spider@steelsun.com>
- * @version $Revision: 1.3 $
- * @package Liberty
+ * @version $Revision: 1.4 $
+ * @package liberty
* @subpackage functions
*/
diff --git a/edit_storage_inc.php b/edit_storage_inc.php
index 78b75d9..5c8cf0f 100644
--- a/edit_storage_inc.php
+++ b/edit_storage_inc.php
@@ -3,8 +3,8 @@
* edit_storage_inc
*
* @author spider <spider@steelsun.com>
- * @version $Revision: 1.3 $
- * @package Liberty
+ * @version $Revision: 1.4 $
+ * @package liberty
* @subpackage functions
*
* This file is automatically included by edit_storage.tpl - All you need to do is include edit_storage.tpl
diff --git a/edit_structure_inc.php b/edit_structure_inc.php
index b8dd6fa..5becf0e 100644
--- a/edit_structure_inc.php
+++ b/edit_structure_inc.php
@@ -3,8 +3,8 @@
* edit_structure_inc
*
* @author Christian Fowler>
- * @version $Revision: 1.5 $
- * @package Liberty
+ * @version $Revision: 1.6 $
+ * @package liberty
* @subpackage functions
*/
@@ -23,6 +23,7 @@ if( empty( $_REQUEST["structure_id"] ) ) {
} else {
global $gStructure;
$gStructure = new LibertyStructure( $_REQUEST["structure_id"] );
+ $gStructure->StartTrans();
$gStructure->load();
// order matters for these conditionals
@@ -125,7 +126,7 @@ if( empty( $_REQUEST["structure_id"] ) ) {
$gBitSmarty->assign( (!empty( $_REQUEST['tab'] ) ? $_REQUEST['tab'] : 'body').'TabSelect', 'tdefault' );
$gBitSmarty->assign('subtree', $rootTree = $rootStructure->getSubTree( $rootStructure->mStructureId ));
-
+ $gStructure->CompleteTrans();
}
?>
diff --git a/get_content_list_inc.php b/get_content_list_inc.php
index b23622b..9e78045 100644
--- a/get_content_list_inc.php
+++ b/get_content_list_inc.php
@@ -3,8 +3,8 @@
* get_content_list
*
* @author Christian Fowler>
- * @version $Revision: 1.3 $
- * @package Liberty
+ * @version $Revision: 1.4 $
+ * @package liberty
* @subpackage functions
*/
diff --git a/icons/import.gif b/icons/import.gif
new file mode 100755
index 0000000..49e8ab9
--- /dev/null
+++ b/icons/import.gif
Binary files differ
diff --git a/list_content.php b/list_content.php
index 9e1d605..6992bd8 100644
--- a/list_content.php
+++ b/list_content.php
@@ -3,8 +3,8 @@
* list_content
*
* @author spider <spider@steelsun.com>
- * @version $Revision: 1.5 $
- * @package Liberty
+ * @version $Revision: 1.6 $
+ * @package liberty
* @subpackage functions
*/
diff --git a/lookup_content_inc.php b/lookup_content_inc.php
index 14787c8..e7305fc 100644
--- a/lookup_content_inc.php
+++ b/lookup_content_inc.php
@@ -3,8 +3,8 @@
* lookup_content_inc
*
* @author spider <spider@steelsun.com>
- * @version $Revision: 1.3 $
- * @package Liberty
+ * @version $Revision: 1.4 $
+ * @package liberty
* @subpackage functions
*/
global $gContent;
diff --git a/modules/mod_last_changes.php b/modules/mod_last_changes.php
index 508771e..f042231 100644
--- a/modules/mod_last_changes.php
+++ b/modules/mod_last_changes.php
@@ -1,10 +1,10 @@
<?php
-// $Header: /cvsroot/bitweaver/_bit_liberty/modules/mod_last_changes.php,v 1.4 2005/08/01 18:40:50 squareing Exp $
+// $Header: /cvsroot/bitweaver/_bit_liberty/modules/mod_last_changes.php,v 1.5 2005/08/07 17:40:30 squareing Exp $
/**
* Params:
* - content_type_guid : if set, show only those content_type_guid's
* - show_date : if set, show date of last modification
- * @package Liberty
+ * @package liberty
* @subpackage modules
*/
diff --git a/modules/mod_last_changes.tpl b/modules/mod_last_changes.tpl
index 28edb99..6398634 100644
--- a/modules/mod_last_changes.tpl
+++ b/modules/mod_last_changes.tpl
@@ -1,4 +1,4 @@
-{* $Header: /cvsroot/bitweaver/_bit_liberty/modules/mod_last_changes.tpl,v 1.2 2005/07/25 20:02:13 squareing Exp $ *}
+{* $Header: /cvsroot/bitweaver/_bit_liberty/modules/mod_last_changes.tpl,v 1.3 2005/08/07 17:40:30 squareing Exp $ *}
{strip}
{if $modLastContent}
{bitmodule title="$moduleTitle" name="last_changes"}
@@ -17,7 +17,7 @@
<li></li>
{/section}
</ol>
- <a href="{$gBitLoc.LIBERTY_PKG_URL}list_content.php?user_id={$gQueryUserId}&amp;sort_mode=last_modified_desc{if $contentType}&content_type_guid={$contentType}{/if}">{tr}View more{/tr}&hellip;</a>
+ <a href="{$smarty.const.LIBERTY_PKG_URL}list_content.php?user_id={$gQueryUserId}&amp;sort_mode=last_modified_desc{if $contentType}&content_type_guid={$contentType}{/if}">{tr}View more{/tr}&hellip;</a>
{/bitmodule}
{/if}
{/strip}
diff --git a/modules/mod_structure_navigation.php b/modules/mod_structure_navigation.php
index 9ec15e7..170dd64 100644
--- a/modules/mod_structure_navigation.php
+++ b/modules/mod_structure_navigation.php
@@ -1,6 +1,6 @@
<?php
/**
- * @package Liberty
+ * @package liberty
* @subpackage modules
*/
?> \ No newline at end of file
diff --git a/modules/mod_top_authors.php b/modules/mod_top_authors.php
index d5ee38f..dcf91da 100644
--- a/modules/mod_top_authors.php
+++ b/modules/mod_top_authors.php
@@ -1,9 +1,9 @@
<?php
-// $Header: /cvsroot/bitweaver/_bit_liberty/modules/mod_top_authors.php,v 1.3 2005/08/01 18:40:50 squareing Exp $
+// $Header: /cvsroot/bitweaver/_bit_liberty/modules/mod_top_authors.php,v 1.4 2005/08/07 17:40:30 squareing Exp $
/**
* Params:
* - content_type_guid : if set, show only those content_type_guid's
- * @package Liberty
+ * @package liberty
* @subpackage modules
*/
diff --git a/modules/mod_top_authors.tpl b/modules/mod_top_authors.tpl
index 8bef14a..b72b7d8 100644
--- a/modules/mod_top_authors.tpl
+++ b/modules/mod_top_authors.tpl
@@ -1,4 +1,4 @@
-{* $Header: /cvsroot/bitweaver/_bit_liberty/modules/mod_top_authors.tpl,v 1.1 2005/06/19 04:55:51 bitweaver Exp $ *}
+{* $Header: /cvsroot/bitweaver/_bit_liberty/modules/mod_top_authors.tpl,v 1.2 2005/08/07 17:40:30 squareing Exp $ *}
{strip}
{if $modAuthors}
{bitmodule title="$moduleTitle" name="top_authors"}
@@ -11,7 +11,7 @@
<li></li>
{/section}
</ol>
-{* <div style="text-align:center;"><a href="{$gBitLoc.LIBERTY_PKG_URL}list_content.php?user_id={$gQueryUserId}&sort_mode=last_modified_desc">{tr}View more{/tr}...</a></div> *}
+{* <div style="text-align:center;"><a href="{$smarty.const.LIBERTY_PKG_URL}list_content.php?user_id={$gQueryUserId}&sort_mode=last_modified_desc">{tr}View more{/tr}...</a></div> *}
{/bitmodule}
{/if}
{/strip}
diff --git a/plugins/data.addtabs.php b/plugins/data.addtabs.php
index 5adccd6..b1eff09 100644
--- a/plugins/data.addtabs.php
+++ b/plugins/data.addtabs.php
@@ -1,7 +1,7 @@
<?php
/**
- * @version $Revision: 1.3 $
- * @package Liberty
+ * @version $Revision: 1.4 $
+ * @package liberty
* @subpackage plugins_data
*/
// +----------------------------------------------------------------------+
@@ -15,7 +15,7 @@
// +----------------------------------------------------------------------+
// | Author: StarRider <starrrider@users.sourceforge.net>
// +----------------------------------------------------------------------+
-// $Id: data.addtabs.php,v 1.3 2005/07/17 17:36:09 squareing Exp $
+// $Id: data.addtabs.php,v 1.4 2005/08/07 17:40:31 squareing Exp $
/**
* definitions
diff --git a/plugins/data.agentinfo.php b/plugins/data.agentinfo.php
index 36a01ee..a5f69cf 100644
--- a/plugins/data.agentinfo.php
+++ b/plugins/data.agentinfo.php
@@ -1,7 +1,7 @@
<?php
/**
- * @version $Revision: 1.3 $
- * @package Liberty
+ * @version $Revision: 1.4 $
+ * @package liberty
* @subpackage plugins_data
*/
// +----------------------------------------------------------------------+
@@ -17,7 +17,7 @@
// | Reworked for Bitweaver (& Undoubtedly Screwed-Up)
// | by: StarRider <starrrider@users.sourceforge.net>
// +----------------------------------------------------------------------+
-// $Id: data.agentinfo.php,v 1.3 2005/07/17 17:36:09 squareing Exp $
+// $Id: data.agentinfo.php,v 1.4 2005/08/07 17:40:31 squareing Exp $
/**
* definitions
diff --git a/plugins/data.article.php b/plugins/data.article.php
index 14608d7..ef5ec6c 100644
--- a/plugins/data.article.php
+++ b/plugins/data.article.php
@@ -1,7 +1,7 @@
<?php
/**
- * @version $Revision: 1.3 $
- * @package Liberty
+ * @version $Revision: 1.4 $
+ * @package liberty
* @subpackage plugins_data
*/
// +----------------------------------------------------------------------+
@@ -18,7 +18,7 @@
// | by: StarRider <starrrider@users.sourceforge.net>
// | Reworked from: wikiplugin_article.php - see deprecated code below
// +----------------------------------------------------------------------+
-// $Id: data.article.php,v 1.3 2005/07/17 17:36:09 squareing Exp $
+// $Id: data.article.php,v 1.4 2005/08/07 17:40:31 squareing Exp $
/**
* definitions
diff --git a/plugins/data.articles.php b/plugins/data.articles.php
index 0b30589..81c2297 100644
--- a/plugins/data.articles.php
+++ b/plugins/data.articles.php
@@ -1,7 +1,7 @@
<?php
/**
- * @version $Revision: 1.4 $
- * @package Liberty
+ * @version $Revision: 1.5 $
+ * @package liberty
* @subpackage plugins_data
*/
// +----------------------------------------------------------------------+
@@ -18,7 +18,7 @@
// | by: StarRider <starrrider@users.sourceforge.net>
// | Reworked from: wikiplugin_articles.php - see deprecated code below
// +----------------------------------------------------------------------+
-// $Id: data.articles.php,v 1.4 2005/08/01 18:40:50 squareing Exp $
+// $Id: data.articles.php,v 1.5 2005/08/07 17:40:31 squareing Exp $
/**
* definitions
diff --git a/plugins/data.attachment.php b/plugins/data.attachment.php
index aef47a5..4e64ab1 100644
--- a/plugins/data.attachment.php
+++ b/plugins/data.attachment.php
@@ -1,7 +1,7 @@
<?php
/**
- * @version $Revision: 1.3 $
- * @package Liberty
+ * @version $Revision: 1.4 $
+ * @package liberty
* @subpackage plugins_data
*/
// +----------------------------------------------------------------------+
@@ -15,7 +15,7 @@
// +----------------------------------------------------------------------+
// | Authors: drewslater <andrew@andrewslater.com>
// +----------------------------------------------------------------------+
-// $Id: data.attachment.php,v 1.3 2005/07/17 17:36:09 squareing Exp $
+// $Id: data.attachment.php,v 1.4 2005/08/07 17:40:31 squareing Exp $
/**
* definitions
diff --git a/plugins/data.avatar.php b/plugins/data.avatar.php
index d6fa424..bfc8ea3 100644
--- a/plugins/data.avatar.php
+++ b/plugins/data.avatar.php
@@ -1,7 +1,7 @@
<?php
/**
- * @version $Revision: 1.3 $
- * @package Liberty
+ * @version $Revision: 1.4 $
+ * @package liberty
* @subpackage plugins_data
*/
// +----------------------------------------------------------------------+
@@ -18,7 +18,7 @@
// | by: StarRider <starrrider@users.sourceforge.net>
// | Reworked from: wikiplugin_avatar.php - see deprecated code below
// +----------------------------------------------------------------------+
-// $Id: data.avatar.php,v 1.3 2005/07/17 17:36:09 squareing Exp $
+// $Id: data.avatar.php,v 1.4 2005/08/07 17:40:31 squareing Exp $
/**
* definitions
@@ -97,7 +97,7 @@ function wikiplugin_avatar($data, $params) {
$avatar = $gBitSystem->get_user_avatar($data);
if (isset($page)) {
$avatar = "<a href=\"".WIKI_PKG_URL."index.php?page=$page'>" . $avatar . '</a>';
- } else if ($gBitUser->userExists( array( 'login' => $data ) ) && $gBitSystem->get_user_preference($data, 'user_information', 'public') == 'public') {
+ } else if ($gBitUser->userExists( array( 'login' => $data ) ) && $gBitSystem->getPreference('user_information', 'public', $data ) == 'public') {
$avatar = "<a href=\"".USERS_PKG_URL."\"index.php?fHomepage=$data\">" . $avatar . '</a>';
}
return $avatar;
diff --git a/plugins/data.backlinks.php b/plugins/data.backlinks.php
index b67cbf2..1a09e8c 100644
--- a/plugins/data.backlinks.php
+++ b/plugins/data.backlinks.php
@@ -1,7 +1,7 @@
<?php
/**
- * @version $Revision: 1.3 $
- * @package Liberty
+ * @version $Revision: 1.4 $
+ * @package liberty
* @subpackage plugins_data
*/
// +----------------------------------------------------------------------+
@@ -18,7 +18,7 @@
// | by: StarRider <starrrider@users.sourceforge.net>
// | Reworked from: wikiplugin_backlinks.php - see deprecated code below
// +----------------------------------------------------------------------+
-// $Id: data.backlinks.php,v 1.3 2005/07/17 17:36:09 squareing Exp $
+// $Id: data.backlinks.php,v 1.4 2005/08/07 17:40:31 squareing Exp $
/**
* definitions
diff --git a/plugins/data.category.php b/plugins/data.category.php
index 52b409b..e0c1101 100644
--- a/plugins/data.category.php
+++ b/plugins/data.category.php
@@ -1,7 +1,7 @@
<?php
/**
- * @version $Revision: 1.4 $
- * @package Liberty
+ * @version $Revision: 1.5 $
+ * @package liberty
* @subpackage plugins_data
*/
// +----------------------------------------------------------------------+
@@ -18,7 +18,7 @@
// | by: StarRider <starrrider@users.sourceforge.net>
// | Reworked from: wikiplugin_category.php - see deprecated code below
// +----------------------------------------------------------------------+
-// $Id: data.category.php,v 1.4 2005/08/01 18:41:06 squareing Exp $
+// $Id: data.category.php,v 1.5 2005/08/07 17:40:31 squareing Exp $
/**
* definitions
diff --git a/plugins/data.catorphans.php b/plugins/data.catorphans.php
index d72db88..d200549 100644
--- a/plugins/data.catorphans.php
+++ b/plugins/data.catorphans.php
@@ -1,7 +1,7 @@
<?php
/**
- * @version $Revision: 1.4 $
- * @package Liberty
+ * @version $Revision: 1.5 $
+ * @package liberty
* @subpackage plugins_data
*/
// +----------------------------------------------------------------------+
@@ -18,7 +18,7 @@
// | by: StarRider <starrrider@users.sourceforge.net>
// | Reworked from: wikiplugin_catorphans.php - see deprecated code below
// +----------------------------------------------------------------------+
-// $Id: data.catorphans.php,v 1.4 2005/08/01 18:41:06 squareing Exp $
+// $Id: data.catorphans.php,v 1.5 2005/08/07 17:40:31 squareing Exp $
/**
* definitions
diff --git a/plugins/data.catpath.php b/plugins/data.catpath.php
index 46f4182..af4fbfb 100644
--- a/plugins/data.catpath.php
+++ b/plugins/data.catpath.php
@@ -1,7 +1,7 @@
<?php
/**
- * @version $Revision: 1.4 $
- * @package Liberty
+ * @version $Revision: 1.5 $
+ * @package liberty
* @subpackage plugins_data
*/
// +----------------------------------------------------------------------+
@@ -18,7 +18,7 @@
// | by: StarRider <starrrider@users.sourceforge.net>
// | Reworked from: wikiplugin_catpath.php - see deprecated code below
// +----------------------------------------------------------------------+
-// $Id: data.catpath.php,v 1.4 2005/08/01 18:41:06 squareing Exp $
+// $Id: data.catpath.php,v 1.5 2005/08/07 17:40:31 squareing Exp $
/**
* definitions
diff --git a/plugins/data.code.php b/plugins/data.code.php
index cb0a32f..6b354a1 100644
--- a/plugins/data.code.php
+++ b/plugins/data.code.php
@@ -1,7 +1,7 @@
<?php
/**
- * @version $Revision: 1.4 $
- * @package Liberty
+ * @version $Revision: 1.5 $
+ * @package liberty
* @subpackage plugins_data
*/
// +----------------------------------------------------------------------+
@@ -17,7 +17,7 @@
// | Reworked for Bitweaver (& Undoubtedly Screwed-Up)
// | by: StarRider <starrrider@users.sourceforge.net>
// +----------------------------------------------------------------------+
-// $Id: data.code.php,v 1.4 2005/07/25 20:02:13 squareing Exp $
+// $Id: data.code.php,v 1.5 2005/08/07 17:40:31 squareing Exp $
/**
* definitions
diff --git a/plugins/data.comment.php b/plugins/data.comment.php
index 3fb4f73..bf493e0 100644
--- a/plugins/data.comment.php
+++ b/plugins/data.comment.php
@@ -1,11 +1,11 @@
<?php
-// $Id: data.comment.php,v 1.4 2005/08/01 18:41:06 squareing Exp $
+// $Id: data.comment.php,v 1.5 2005/08/07 17:40:31 squareing Exp $
/**
* assigned_modules
*
* @author StarRider <starrrider@sourceforge.net>
- * @version $Revision: 1.4 $
- * @package Liberty
+ * @version $Revision: 1.5 $
+ * @package liberty
* @subpackage plugins_data
* @copyright Copyright (c) 2004, bitweaver.org
* All Rights Reserved. See copyright.txt for details and a complete list of authors.
diff --git a/plugins/data.copyright.php b/plugins/data.copyright.php
index 86e50ba..809ed13 100644
--- a/plugins/data.copyright.php
+++ b/plugins/data.copyright.php
@@ -1,7 +1,7 @@
<?php
/**
- * @version $Revision: 1.2 $
- * @package Liberty
+ * @version $Revision: 1.3 $
+ * @package liberty
* @subpackage plugins_data
*/
// +----------------------------------------------------------------------+
@@ -17,7 +17,7 @@
// | Reworked for Bitweaver (& Undoubtedly Screwed-Up)
// | by: StarRider <starrrider@users.sourceforge.net>
// +----------------------------------------------------------------------+
-// $Id: data.copyright.php,v 1.2 2005/06/28 07:45:48 spiderr Exp $
+// $Id: data.copyright.php,v 1.3 2005/08/07 17:40:31 squareing Exp $
/**
* definitions
diff --git a/plugins/data.countdown.php b/plugins/data.countdown.php
index 8aa5b26..5f15782 100644
--- a/plugins/data.countdown.php
+++ b/plugins/data.countdown.php
@@ -1,7 +1,7 @@
<?php
/**
- * @version $Revision: 1.3 $
- * @package Liberty
+ * @version $Revision: 1.4 $
+ * @package liberty
* @subpackage plugins_data
*/
// +----------------------------------------------------------------------+
@@ -17,7 +17,7 @@
// | Reworked for Bitweaver (& Undoubtedly Screwed-Up)
// | by: StarRider <starrrider@users.sourceforge.net>
// +----------------------------------------------------------------------+
-// $Id: data.countdown.php,v 1.3 2005/07/17 17:36:09 squareing Exp $
+// $Id: data.countdown.php,v 1.4 2005/08/07 17:40:31 squareing Exp $
/**
* definitions
diff --git a/plugins/data.dropdown.php b/plugins/data.dropdown.php
index ec6d79a..db384d3 100644
--- a/plugins/data.dropdown.php
+++ b/plugins/data.dropdown.php
@@ -4,8 +4,8 @@
* assigned_modules
*
* @author StarRider <starrrider@sourceforge.net>
- * @version $Revision: 1.3 $
- * @package Liberty
+ * @version $Revision: 1.4 $
+ * @package liberty
* @subpackage plugins_data
*
* @copyright Copyright (c) 2004, bitweaver.org
diff --git a/plugins/data.example.php b/plugins/data.example.php
index 026779c..ba36530 100644
--- a/plugins/data.example.php
+++ b/plugins/data.example.php
@@ -4,8 +4,8 @@
* assigned_modules
*
* @author StarRider starrrider@sourceforge.net
- * @version $Revision: 1.7 $
- * @package Liberty
+ * @version $Revision: 1.8 $
+ * @package liberty
* @subpackage plugins_data
* @copyright Copyright (c) 2004, bitweaver.org
* All Rights Reserved. See copyright.txt for details and a complete list of authors.
diff --git a/plugins/data.flash.php b/plugins/data.flash.php
index d8a0dc3..4a5abae 100644
--- a/plugins/data.flash.php
+++ b/plugins/data.flash.php
@@ -1,7 +1,7 @@
<?php
/**
- * @version $Revision: 1.2 $
- * @package Liberty
+ * @version $Revision: 1.3 $
+ * @package liberty
* @subpackage plugins_data
*/
// +----------------------------------------------------------------------+
@@ -17,7 +17,7 @@
// | Reworked for Bitweaver (& Undoubtedly Screwed-Up)
// | by: StarRider <starrrider@users.sourceforge.net>
// +----------------------------------------------------------------------+
-// $Id: data.flash.php,v 1.2 2005/06/28 07:45:48 spiderr Exp $
+// $Id: data.flash.php,v 1.3 2005/08/07 17:40:31 squareing Exp $
/**
* definitions
diff --git a/plugins/data.freemind.php b/plugins/data.freemind.php
index f41e195..c338e6a 100644
--- a/plugins/data.freemind.php
+++ b/plugins/data.freemind.php
@@ -1,7 +1,7 @@
<?php
/**
- * @version $Revision: 1.4 $
- * @package Liberty
+ * @version $Revision: 1.5 $
+ * @package liberty
* @subpackage plugins_data
*/
// +----------------------------------------------------------------------+
diff --git a/plugins/data.gauge.php b/plugins/data.gauge.php
index f2614fc..5f578c2 100644
--- a/plugins/data.gauge.php
+++ b/plugins/data.gauge.php
@@ -1,7 +1,7 @@
<?php
/**
- * @version $Revision: 1.5 $
- * @package Liberty
+ * @version $Revision: 1.6 $
+ * @package liberty
* @subpackage plugins_data
*/
// +----------------------------------------------------------------------+
@@ -17,7 +17,7 @@
// | Reworked for Bitweaver (& Undoubtedly Screwed-Up)
// | by: StarRider <starrrider@users.sourceforge.net>
// +----------------------------------------------------------------------+
-// $Id: data.gauge.php,v 1.5 2005/06/28 07:45:48 spiderr Exp $
+// $Id: data.gauge.php,v 1.6 2005/08/07 17:40:31 squareing Exp $
/**
* definitions
diff --git a/plugins/data.include.php b/plugins/data.include.php
index 267fd33..eabd09c 100644
--- a/plugins/data.include.php
+++ b/plugins/data.include.php
@@ -1,7 +1,7 @@
<?php
/**
- * @version $Revision: 1.4 $
- * @package Liberty
+ * @version $Revision: 1.5 $
+ * @package liberty
* @subpackage plugins_data
*/
// +----------------------------------------------------------------------+
@@ -17,7 +17,7 @@
// | Reworked for Bitweaver (& Undoubtedly Screwed-Up)
// | by: StarRider <starrrider@users.sourceforge.net>
// +----------------------------------------------------------------------+
-// $Id: data.include.php,v 1.4 2005/07/17 17:36:10 squareing Exp $
+// $Id: data.include.php,v 1.5 2005/08/07 17:40:31 squareing Exp $
/**
* definitions
diff --git a/plugins/data.lang.php b/plugins/data.lang.php
index 4b6a219..85e5edd 100644
--- a/plugins/data.lang.php
+++ b/plugins/data.lang.php
@@ -1,7 +1,7 @@
<?php
/**
- * @version $Revision: 1.2 $
- * @package Liberty
+ * @version $Revision: 1.3 $
+ * @package liberty
* @subpackage plugins_data
*/
// +----------------------------------------------------------------------+
@@ -18,7 +18,7 @@
// | by: StarRider <starrrider@users.sourceforge.net>
// | Reworked from: wikiplugin_lang.php - see deprecated code below
// +----------------------------------------------------------------------+
-// $Id: data.lang.php,v 1.2 2005/06/28 07:45:48 spiderr Exp $
+// $Id: data.lang.php,v 1.3 2005/08/07 17:40:31 squareing Exp $
/**
* definitions
diff --git a/plugins/data.maketoc.php b/plugins/data.maketoc.php
index 527de65..45baabd 100644
--- a/plugins/data.maketoc.php
+++ b/plugins/data.maketoc.php
@@ -1,7 +1,7 @@
<?php
/**
- * @version $Revision: 1.3 $
- * @package Liberty
+ * @version $Revision: 1.4 $
+ * @package liberty
* @subpackage plugins_data
*/
// +----------------------------------------------------------------------+
@@ -15,7 +15,7 @@
// +----------------------------------------------------------------------+
// | Author: xing <xing@synapse.plus.com>
// +----------------------------------------------------------------------+
-// $Id: data.maketoc.php,v 1.3 2005/07/17 17:36:10 squareing Exp $
+// $Id: data.maketoc.php,v 1.4 2005/08/07 17:40:31 squareing Exp $
/**
* definitions
diff --git a/plugins/data.mapquest.php b/plugins/data.mapquest.php
index a6e5d1c..dff3dc3 100644
--- a/plugins/data.mapquest.php
+++ b/plugins/data.mapquest.php
@@ -1,7 +1,7 @@
<?php
/**
- * @version $Revision: 1.3 $
- * @package Liberty
+ * @version $Revision: 1.4 $
+ * @package liberty
* @subpackage plugins_data
*/
// +----------------------------------------------------------------------+
@@ -15,7 +15,7 @@
// +----------------------------------------------------------------------+
// | Author: StarRider <starrrider@users.sourceforge.net>
// +----------------------------------------------------------------------+
-// $Id: data.mapquest.php,v 1.3 2005/06/28 07:45:48 spiderr Exp $
+// $Id: data.mapquest.php,v 1.4 2005/08/07 17:40:31 squareing Exp $
/**
* definitions
diff --git a/plugins/data.module.php b/plugins/data.module.php
index 9d3cd0e..315341a 100644
--- a/plugins/data.module.php
+++ b/plugins/data.module.php
@@ -1,7 +1,7 @@
<?php
/**
- * @version $Revision: 1.3 $
- * @package Liberty
+ * @version $Revision: 1.4 $
+ * @package liberty
* @subpackage plugins_data
*/
// +----------------------------------------------------------------------+
@@ -16,7 +16,7 @@
// | Author (TikiWiki): Mose <mose@users.sourceforge.net>
// | Reworked for Bitweaver by: Christian Fowler <spiderr@users.sourceforge.net>
// +----------------------------------------------------------------------+
-// $Id: data.module.php,v 1.3 2005/08/01 18:41:07 squareing Exp $
+// $Id: data.module.php,v 1.4 2005/08/07 17:40:31 squareing Exp $
/**
Displays a module inlined in page
diff --git a/plugins/data.mqdirections.php b/plugins/data.mqdirections.php
index aef0f7e..25694d1 100644
--- a/plugins/data.mqdirections.php
+++ b/plugins/data.mqdirections.php
@@ -1,7 +1,7 @@
<?php
/**
- * @version $Revision: 1.3 $
- * @package Liberty
+ * @version $Revision: 1.4 $
+ * @package liberty
* @subpackage plugins_data
*/
// +----------------------------------------------------------------------+
@@ -15,7 +15,7 @@
// +----------------------------------------------------------------------+
// | Author: StarRider <starrrider@users.sourceforge.net>
// +----------------------------------------------------------------------+
-// $Id: data.mqdirections.php,v 1.3 2005/06/28 07:45:48 spiderr Exp $
+// $Id: data.mqdirections.php,v 1.4 2005/08/07 17:40:31 squareing Exp $
/**
* definitions
diff --git a/plugins/data.pluginhelp.php b/plugins/data.pluginhelp.php
index 07867dd..486e818 100644
--- a/plugins/data.pluginhelp.php
+++ b/plugins/data.pluginhelp.php
@@ -1,7 +1,7 @@
<?php
/**
- * @version $Revision: 1.3 $
- * @package Liberty
+ * @version $Revision: 1.4 $
+ * @package liberty
* @subpackage plugins_data
*/
// +----------------------------------------------------------------------+
@@ -17,7 +17,7 @@
// | Rewritten for bitweaver by Author
// | wikiplugin_pluginhelp.php - see deprecated code below
// +----------------------------------------------------------------------+
-// $Id: data.pluginhelp.php,v 1.3 2005/07/17 17:36:10 squareing Exp $
+// $Id: data.pluginhelp.php,v 1.4 2005/08/07 17:40:31 squareing Exp $
/**
* definitions
diff --git a/plugins/data.rss.php b/plugins/data.rss.php
index 1ab7d1c..58d191b 100644
--- a/plugins/data.rss.php
+++ b/plugins/data.rss.php
@@ -1,7 +1,7 @@
<?php
/**
- * @version $Revision: 1.2 $
- * @package Liberty
+ * @version $Revision: 1.3 $
+ * @package liberty
* @subpackage plugins_data
*/
// +----------------------------------------------------------------------+
@@ -17,7 +17,7 @@
// | Reworked for Bitweaver (& Undoubtedly Screwed-Up)
// | by: StarRider <starrrider@users.sourceforge.net>
// +----------------------------------------------------------------------+
-// $Id: data.rss.php,v 1.2 2005/06/28 07:45:48 spiderr Exp $
+// $Id: data.rss.php,v 1.3 2005/08/07 17:40:31 squareing Exp $
/**
* definitions
diff --git a/plugins/data.sf.php b/plugins/data.sf.php
index 3769650..8506d67 100644
--- a/plugins/data.sf.php
+++ b/plugins/data.sf.php
@@ -1,7 +1,7 @@
<?php
/**
- * @version $Revision: 1.4 $
- * @package Liberty
+ * @version $Revision: 1.5 $
+ * @package liberty
* @subpackage plugins_data
*/
// +----------------------------------------------------------------------+
@@ -17,7 +17,7 @@
// | Reworked & Undoubtedly Screwed-Up for (Bitweaver)
// | by: StarRider <starrrider@sourceforge.net>
// +----------------------------------------------------------------------+
-// $Id: data.sf.php,v 1.4 2005/07/17 17:36:10 squareing Exp $
+// $Id: data.sf.php,v 1.5 2005/08/07 17:40:31 squareing Exp $
/**
* definitions
diff --git a/plugins/data.sort.php b/plugins/data.sort.php
index 8334bcc..bf46993 100644
--- a/plugins/data.sort.php
+++ b/plugins/data.sort.php
@@ -1,7 +1,7 @@
<?php
/**
- * @version $Revision: 1.3 $
- * @package Liberty
+ * @version $Revision: 1.4 $
+ * @package liberty
* @subpackage plugins_data
*/
// +----------------------------------------------------------------------+
@@ -17,7 +17,7 @@
// | Reworked & Undoubtedly Screwed-Up for (Bitweaver)
// | by: StarRider <starrrider@sourceforge.net>
// +----------------------------------------------------------------------+
-// $Id: data.sort.php,v 1.3 2005/07/17 17:36:10 squareing Exp $
+// $Id: data.sort.php,v 1.4 2005/08/07 17:40:31 squareing Exp $
/**
* definitions
diff --git a/plugins/data.split.php b/plugins/data.split.php
index e3a2468..8567431 100644
--- a/plugins/data.split.php
+++ b/plugins/data.split.php
@@ -1,7 +1,7 @@
<?php
/**
- * @version $Revision: 1.3 $
- * @package Liberty
+ * @version $Revision: 1.4 $
+ * @package liberty
* @subpackage plugins_data
*/
// +----------------------------------------------------------------------+
@@ -18,7 +18,7 @@
// | by: StarRider <starrrider@users.sourceforge.net>
// | Reworked from: wikiplugin_split.php - see deprecated code below
// +----------------------------------------------------------------------+
-// $Id: data.split.php,v 1.3 2005/07/17 17:36:10 squareing Exp $
+// $Id: data.split.php,v 1.4 2005/08/07 17:40:31 squareing Exp $
/**
* definitions
diff --git a/plugins/data.spytext.php b/plugins/data.spytext.php
index 0d1d022..4e9a4b0 100644
--- a/plugins/data.spytext.php
+++ b/plugins/data.spytext.php
@@ -4,8 +4,8 @@
* assigned_modules
*
* @author StarRider starrrider@sourceforge.net
- * @version $Revision: 1.3 $
- * @package Liberty
+ * @version $Revision: 1.4 $
+ * @package liberty
* @subpackage plugins_data
* @copyright Copyright (c) 2004, bitweaver.org
* All Rights Reserved. See copyright.txt for details and a complete list of authors.
diff --git a/plugins/data.titlesearch.php b/plugins/data.titlesearch.php
index 27fba3d..06170d5 100644
--- a/plugins/data.titlesearch.php
+++ b/plugins/data.titlesearch.php
@@ -1,7 +1,7 @@
<?php
/**
- * @version $Revision: 1.3 $
- * @package Liberty
+ * @version $Revision: 1.4 $
+ * @package liberty
* @subpackage plugins_data
*/
// +----------------------------------------------------------------------+
@@ -18,7 +18,7 @@
// | by: StarRider <starrrider@users.sourceforge.net>
// | Reworked from: wikiplugin_titlesearch.php - see deprecated code below
// +----------------------------------------------------------------------+
-// $Id: data.titlesearch.php,v 1.3 2005/07/17 17:36:10 squareing Exp $
+// $Id: data.titlesearch.php,v 1.4 2005/08/07 17:40:31 squareing Exp $
/**
* definitions
diff --git a/plugins/data.toc.php b/plugins/data.toc.php
index 26e79bc..aa0ae02 100644
--- a/plugins/data.toc.php
+++ b/plugins/data.toc.php
@@ -1,7 +1,7 @@
<?php
/**
- * @version $Revision: 1.3 $
- * @package Liberty
+ * @version $Revision: 1.4 $
+ * @package liberty
* @subpackage plugins_data
*/
// +----------------------------------------------------------------------+
@@ -15,7 +15,7 @@
// +----------------------------------------------------------------------+
// | Author: Christian Fowler <spiderr@users.sourceforge.net>
// +----------------------------------------------------------------------+
-// $Id: data.toc.php,v 1.3 2005/07/17 17:36:10 squareing Exp $
+// $Id: data.toc.php,v 1.4 2005/08/07 17:40:31 squareing Exp $
/**
* definitions
diff --git a/plugins/data.translated.php b/plugins/data.translated.php
index 45bdbb2..57897fd 100644
--- a/plugins/data.translated.php
+++ b/plugins/data.translated.php
@@ -1,7 +1,7 @@
<?php
/**
- * @version $Revision: 1.3 $
- * @package Liberty
+ * @version $Revision: 1.4 $
+ * @package liberty
* @subpackage plugins_data
*/
// +----------------------------------------------------------------------+
@@ -18,7 +18,7 @@
// | by: StarRider <starrrider@sourceforge.net>
// | Reworked from: wikiplugin_translated.php - see deprecated code below
// +----------------------------------------------------------------------+
-// $Id: data.translated.php,v 1.3 2005/07/17 17:36:10 squareing Exp $
+// $Id: data.translated.php,v 1.4 2005/08/07 17:40:31 squareing Exp $
/**
* definitions
diff --git a/plugins/data.usercount.php b/plugins/data.usercount.php
index ac2a0fd..b6d3fff 100644
--- a/plugins/data.usercount.php
+++ b/plugins/data.usercount.php
@@ -1,7 +1,7 @@
<?php
/**
- * @version $Revision: 1.3 $
- * @package Liberty
+ * @version $Revision: 1.4 $
+ * @package liberty
* @subpackage plugins_data
*/
// +----------------------------------------------------------------------+
@@ -18,7 +18,7 @@
// | by: StarRider <starrrider@sourceforge.net>
// | Reworked from: wikiplugin_usercount.php - see deprecated code below
// +----------------------------------------------------------------------+
-// $Id: data.usercount.php,v 1.3 2005/07/17 17:36:10 squareing Exp $
+// $Id: data.usercount.php,v 1.4 2005/08/07 17:40:31 squareing Exp $
/**
* definitions
diff --git a/plugins/data.userlink.php b/plugins/data.userlink.php
new file mode 100755
index 0000000..804a2f2
--- /dev/null
+++ b/plugins/data.userlink.php
@@ -0,0 +1,100 @@
+<?php
+/**
+ * @version $Revision: 1.2 $
+ * @package liberty
+ * @subpackage plugins_data
+ * @author bigwasp bigwasp@sourceforge.net
+ */
+// +----------------------------------------------------------------------+
+// | 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): Damian Parker <damosoft@users.sourceforge.net>
+// | Reworked & Undoubtedly Screwed-Up for (Bitweaver)
+// | by: StarRider <starrrider@sourceforge.net>
+// | Reworked from: wikiplugin_usercount.php - see deprecated code below
+// +----------------------------------------------------------------------+
+// $Id: data.userlink.php,v 1.2 2005/08/07 17:40:31 squareing Exp $
+
+/**
+ * definitions
+ */
+define( 'PLUGIN_GUID_DATAUSERLINK', 'datauserlink' );
+global $gLibertySystem;
+$pluginParams = array ( 'tag' => 'USERLINK',
+ 'auto_activate' => FALSE,
+ 'requires_pair' => FALSE,
+ 'load_function' => 'data_userlink',
+ 'title' => 'UserLink shows a link to the UserPage for a given login or email', // Remove this line when the plugin becomes operational
+// 'title' => 'User', // and Remove the comment from the start of this line
+ 'help_page' => 'DataPluginUserLink',
+ 'description' => tra("Will show a link to the userpage"),
+ 'help_function' => 'data_userlink_help',
+ 'syntax' => "{USERLINK login='bigwasp'}",
+ 'plugin_type' => DATA_PLUGIN
+ );
+$gLibertySystem->registerPlugin( PLUGIN_GUID_DATAUSERLINK, $pluginParams );
+$gLibertySystem->registerDataTag( $pluginParams['tag'], PLUGIN_GUID_DATAUSERLINK );
+
+// Help Function
+function data_userlink_help() {
+ $help =
+ '<table class="data help">'
+ .'<tr>'
+ .'<th>' . tra( "Key" ) . '</th>'
+ .'<th>' . tra( "Type" ) . '</th>'
+ .'<th>' . tra( "Comments") . '</th>'
+ .'</tr>'
+ .'<tr class="odd">'
+ .'<td>login</td>'
+ .'<td>' . tra( "string" ) . '<br />' . tra( "(optional)") . '</td>'
+ .'<td>' . tra( "The login name to gernerate the link" ) . '</td>'
+ .'</tr>'
+ .'<tr class="even">'
+ .'<td>email</td>'
+ .'<td>' . tra( "string" ) . '<br />' . tra( "(optional)") . '</td>'
+ .'<td>' . tra( "The mailadress to gernerate the link" ) . '</td>'
+ .'</tr>'
+ .'</table>'
+ .tra("Example: ") . "{USERLINK login='admin'}";
+ return $help;
+}
+
+// Load Function
+function data_userlink($data, $params) {
+ global $gBitUser;
+ $nFlag = 0;
+ $myHash = array();
+ $ret = '';
+ extract ($params);
+ if (isset($login)) {
+ $myHash['login'] = $login;
+ $nFlag++;
+ }
+ If (isset($email)) {
+ $myHash['email'] = $email;
+ $nFlag++;
+ }
+ If (isset($user_id)) {
+ $myHash['user_id'] = $user_id;
+ $nFlag++;
+ }
+
+ // $nFlag check if only exactly one parameter was given!
+ if ($nFlag == 1) {
+ $user = $gBitUser->userExists($myHash);
+
+ if(!$user==Null) {
+ $tmpUser = $gBitUser->getUserInfo(array('user_id'=>$user));
+ $ret = $gBitUser->getDisplayName(TRUE,$tmpUser) ;
+ }
+
+ }
+ return $ret;
+}
+?>
diff --git a/plugins/data.userlist.php b/plugins/data.userlist.php
index 0bfa9bd..8ed651a 100644
--- a/plugins/data.userlist.php
+++ b/plugins/data.userlist.php
@@ -1,7 +1,7 @@
<?php
/**
- * @version $Revision: 1.3 $
- * @package Liberty
+ * @version $Revision: 1.4 $
+ * @package liberty
* @subpackage plugins_data
*/
// +----------------------------------------------------------------------+
@@ -18,7 +18,7 @@
// | by: StarRider <starrrider@sourceforge.net>
// | Reworked from: wikiplugin_userlist.php - see deprecated code below
// +----------------------------------------------------------------------+
-// $Id: data.userlist.php,v 1.3 2005/07/17 17:36:10 squareing Exp $
+// $Id: data.userlist.php,v 1.4 2005/08/07 17:40:31 squareing Exp $
/**
* definitions
diff --git a/plugins/data.wikilist.php b/plugins/data.wikilist.php
index 4e58098..7e66663 100644
--- a/plugins/data.wikilist.php
+++ b/plugins/data.wikilist.php
@@ -1,7 +1,7 @@
<?php
/**
- * @version $Revision: 1.3 $
- * @package Liberty
+ * @version $Revision: 1.4 $
+ * @package liberty
* @subpackage plugins_data
*/
// +----------------------------------------------------------------------+
@@ -18,7 +18,7 @@
// | by: StarRider <starrrider@sourceforge.net>
// | Reworked from: wikiplugin_wikilist.php - see deprecated code below
// +----------------------------------------------------------------------+
-// $Id: data.wikilist.php,v 1.3 2005/07/17 17:36:10 squareing Exp $
+// $Id: data.wikilist.php,v 1.4 2005/08/07 17:40:31 squareing Exp $
/**
* definitions
diff --git a/plugins/format.pearwiki.php b/plugins/format.pearwiki.php
index 87bf76f..211ac76 100644
--- a/plugins/format.pearwiki.php
+++ b/plugins/format.pearwiki.php
@@ -1,7 +1,7 @@
<?php
/**
- * @version $Revision: 1.4 $
- * @package Liberty
+ * @version $Revision: 1.5 $
+ * @package liberty
* @subpackage plugins_format
*/
diff --git a/plugins/format.pearwiki_tiki.php b/plugins/format.pearwiki_tiki.php
index 8ac015f..cc86d75 100644
--- a/plugins/format.pearwiki_tiki.php
+++ b/plugins/format.pearwiki_tiki.php
@@ -1,7 +1,7 @@
<?php
/**
- * @version $Revision: 1.4 $
- * @package Liberty
+ * @version $Revision: 1.5 $
+ * @package liberty
* @subpackage plugins_format
*/
@@ -51,7 +51,7 @@ function pearwiki_tiki_parse_data( &$pData, &$pCommonObject ) {
$parser->setRenderConf('xhtml', 'table', 'css_td', 'wikicell');
//$parser->setFormatConf('Xhtml', 'translate', false);
/*$extwiki = array();
- $extwikiSth = $this->query('SELECT `extwiki`, `name` FROM `tiki_extwiki`');
+ $extwikiSth = $this->mDb->query('SELECT `extwiki`, `name` FROM `tiki_extwiki`');
while ($rec = $extwikiSth->fetchRow()) {
$extwiki[$rec['name']] = str_replace('$page', '%s', $rec['extwiki']);
}
diff --git a/plugins/format.tikihtml.php b/plugins/format.tikihtml.php
index 8521664..8b57960 100644
--- a/plugins/format.tikihtml.php
+++ b/plugins/format.tikihtml.php
@@ -1,7 +1,7 @@
<?php
/**
- * @version $Revision: 1.3 $
- * @package Liberty
+ * @version $Revision: 1.4 $
+ * @package liberty
* @subpackage plugins_format
*/
global $gLibertySystem;
diff --git a/plugins/format.tikiwiki.php b/plugins/format.tikiwiki.php
index 00face8..7ccb464 100644
--- a/plugins/format.tikiwiki.php
+++ b/plugins/format.tikiwiki.php
@@ -1,7 +1,7 @@
<?php
/**
- * @version $Revision: 1.7 $
- * @package Liberty
+ * @version $Revision: 1.8 $
+ * @package liberty
*/
global $gLibertySystem;
@@ -12,7 +12,7 @@ define( 'PLUGIN_GUID_TIKIWIKI', 'tikiwiki' );
define( 'WIKI_WORDS_REGEX', '[A-z0-9]{2}[\w\d_\-]+[A-Z_][\w\d_\-]+[A-z0-9]+' );
/**
- * @package Liberty
+ * @package liberty
* @subpackage plugins_format
*/
$pluginParams = array ( 'store_function' => 'tikiwiki_save_data',
@@ -81,8 +81,9 @@ function tikiwiki_parse_data( &$pData, &$pCommonObject ) {
}
/**
- * @package Liberty
- * @subpackage TikiWikiParser
+ * TikiWikiParser
+ *
+ * @package kernel
*/
class TikiWikiParser extends BitBase {
var $mWikiWordRegex;
@@ -146,7 +147,7 @@ class TikiWikiParser extends BitBase {
$links_already_inserted_table = array();
if( !empty( $pParamHash['content_id'] ) ) {
$query = "DELETE FROM `".BIT_DB_PREFIX."tiki_links` WHERE `from_content_id`=?";
- $result = $this->query( $query, array( $pParamHash['content_id'] ) );
+ $result = $this->mDb->query( $query, array( $pParamHash['content_id'] ) );
$linkPages = $this->extractWikiWords( $pParamHash['edit'] );
if( is_array( $linkPages ) && count( $linkPages ) ) {
@@ -154,13 +155,13 @@ class TikiWikiParser extends BitBase {
if( !empty( $page ) ) {
// SPIDERFKILL - this query is guaranteed to die - i forget where it came from and why it's here. will debug soon enough...
$query = "SELECT tp.`content_id` FROM `".BIT_DB_PREFIX."tiki_pages` tp INNER JOIN `".BIT_DB_PREFIX."tiki_content` tc ON (tc.`content_id` = tp.`content_id`) WHERE tc.`title`=?";
- $result = $this->query( $query, array( $page ) );
+ $result = $this->mDb->query( $query, array( $page ) );
if( $result->numRows() ) {
$res = $result->fetchRow();
$key = $pParamHash['content_id'] . "-" . $res['content_id'];
if (empty($links_already_inserted_table[$key])) {
$query = "insert into `".BIT_DB_PREFIX."tiki_links`(`from_content_id`,`to_content_id`) values(?, ?)";
- $result = $this->query($query, array( $pParamHash['content_id'], $res['content_id'] ) );
+ $result = $this->mDb->query($query, array( $pParamHash['content_id'], $res['content_id'] ) );
}
$links_already_inserted_table[$key] = 1;
}
@@ -173,7 +174,7 @@ class TikiWikiParser extends BitBase {
function expungeLinks( $pContentId ) {
if( !empty( $pContentId ) ) {
$this->mDb->StartTrans();
- $this->query( "DELETE FROM `".BIT_DB_PREFIX."tiki_links` WHERE from_content_id=? OR to_content_id=?", array( $pContentId, $pContentId ) );
+ $this->mDb->query( "DELETE FROM `".BIT_DB_PREFIX."tiki_links` WHERE from_content_id=? OR to_content_id=?", array( $pContentId, $pContentId ) );
$this->mDb->CompleteTrans();
}
}
@@ -188,7 +189,7 @@ class TikiWikiParser extends BitBase {
INNER JOIN `".BIT_DB_PREFIX."tiki_content` tc ON( tl.`to_content_id`=tc.`content_id` )
INNER JOIN `".BIT_DB_PREFIX."tiki_pages` tp ON( tp.`content_id`=tc.`content_id` )
WHERE tl.`from_content_id`=? ORDER BY tc.`title`";
- if( $result = $this->query( $query, array( $pContentId ) ) ) {
+ if( $result = $this->mDb->query( $query, array( $pContentId ) ) ) {
$lastTitle = '';
while( !$result->EOF ) {
if( $result->fields['title'] == $lastTitle ) {
@@ -203,7 +204,7 @@ class TikiWikiParser extends BitBase {
if( !isset( $this->mPageLookup[$pTitle] ) ) {
$this->mPageLookup[$pTitle] = $pCommonObject->pageExists( $pTitle );
if( !empty( $this->mPageLookup[$pTitle] ) && ( count( $this->mPageLookup[$pTitle] ) == 1 ) ) {
-// $this->query( "INSERT INTO `".BIT_DB_PREFIX."tiki_links` ( `from_content_id`, `to_content_id` ) VALUES ( ?, ? )" , array( $pContentId, $this->mPageLookup[$pTitle][0]['content_id'] ) );
+// $this->mDb->query( "INSERT INTO `".BIT_DB_PREFIX."tiki_links` ( `from_content_id`, `to_content_id` ) VALUES ( ?, ? )" , array( $pContentId, $this->mPageLookup[$pTitle][0]['content_id'] ) );
}
}
}
@@ -632,7 +633,7 @@ $this->debug(0);
// variable value and a text field to edit the variable. Each
foreach($dvars as $dvar) {
$query = "select `data` from `".BIT_DB_PREFIX."tiki_dynamic_variables` where `name`=?";
- $result = $this->query($query,Array($dvar));
+ $result = $this->mDb->query($query,Array($dvar));
if($result->numRows()) {
$value = $result->fetchRow();
$value = $value["data"];
@@ -711,8 +712,8 @@ $this->debug(0);
if (count($wexs) == 2) {
$wkname = $wexs[0];
- if ($this->getOne("select count(*) from `".BIT_DB_PREFIX."tiki_extwiki` where `name`=?",array($wkname)) == 1) {
- $wkurl = $this->getOne("select `extwiki` from `".BIT_DB_PREFIX."tiki_extwiki` where `name`=?",array($wkname));
+ if ($this->mDb->getOne("select count(*) from `".BIT_DB_PREFIX."tiki_extwiki` where `name`=?",array($wkname)) == 1) {
+ $wkurl = $this->mDb->getOne("select `extwiki` from `".BIT_DB_PREFIX."tiki_extwiki` where `name`=?",array($wkname));
$wkurl = '<a href="' . str_replace('$page', urlencode($wexs[1]), $wkurl). '">' . $wexs[1] . '</a>';
$data = preg_replace($pattern, "$wkurl", $data);
$repl2 = false;
@@ -762,8 +763,8 @@ $this->debug(0);
if (count($wexs) == 2) {
$wkname = $wexs[0];
- if ($this->getOne("select count(*) from `".BIT_DB_PREFIX."tiki_extwiki` where `name`=?",array($wkname)) == 1) {
- $wkurl = $this->getOne("select `extwiki` from `".BIT_DB_PREFIX."tiki_extwiki` where `name`=?",array($wkname));
+ if ($this->mDb->getOne("select count(*) from `".BIT_DB_PREFIX."tiki_extwiki` where `name`=?",array($wkname)) == 1) {
+ $wkurl = $this->mDb->getOne("select `extwiki` from `".BIT_DB_PREFIX."tiki_extwiki` where `name`=?",array($wkname));
$wkurl = '<a href="' . str_replace('$page', urlencode($wexs[1]), $wkurl). '">' . $wexs[1] . '</a>';
$data = preg_replace("/\(\($page_parse\)\)/", "$wkurl", $data);
diff --git a/plugins/storage.bitfile.php b/plugins/storage.bitfile.php
index 99bc875..ea0589a 100644
--- a/plugins/storage.bitfile.php
+++ b/plugins/storage.bitfile.php
@@ -1,7 +1,7 @@
<?php
/**
- * @version $Revision: 1.3 $
- * @package Liberty
+ * @version $Revision: 1.4 $
+ * @package liberty
* @subpackage plugins_storage
*/
global $gLibertySystem;
@@ -45,15 +45,15 @@ function bit_files_store( &$pStoreRow ) {
if( !empty( $pStoreRow['foreign_id'] ) ) {
//$sql = "UPDATE tiki_attachment SET `binary_id`=NULL, `storage_path`=? WHERE `user_id`=? AND storage_id=?";
$sql = "UPDATE `".BIT_DB_PREFIX."tiki_files SET `storage_path`=?, `mime_type`=?, `size`=? WHERE `file_id` = ?";
- $gBitSystem->query( $sql, array( $pStoreRow['dest_file_path'], $pStoreRow['type'], $pStoreRow['size'], $pStoreRow['foreign_id'] ) );
+ $gBitSystem->mDb->query( $sql, array( $pStoreRow['dest_file_path'], $pStoreRow['type'], $pStoreRow['size'], $pStoreRow['foreign_id'] ) );
} else {
$pStoreRow['file_id'] = $gBitSystem->GenID( 'tiki_files_file_id_seq' );
$sql = "INSERT INTO `".BIT_DB_PREFIX."tiki_files` ( `storage_path`, `file_id`, `mime_type`, `size`, `user_id` ) VALUES ( ?, ?, ?, ?, ? )";
$userId = !empty( $pStoreRow['upload']['user_id'] ) ? $pStoreRow['upload']['user_id'] : $gBitUser->mUserId;
- $gBitSystem->query($sql, array( $pStoreRow['upload']['dest_path'].$pStoreRow['upload']['name'], $pStoreRow['file_id'], $pStoreRow['upload']['type'], $pStoreRow['upload']['size'], $userId ) );
+ $gBitSystem->mDb->query($sql, array( $pStoreRow['upload']['dest_path'].$pStoreRow['upload']['name'], $pStoreRow['file_id'], $pStoreRow['upload']['type'], $pStoreRow['upload']['size'], $userId ) );
}
$sql = "UPDATE `".BIT_DB_PREFIX."tiki_attachments` SET `foreign_id`=? WHERE `attachment_id` = ?";
- $gBitSystem->query( $sql, array( $pStoreRow['file_id'], $pStoreRow['attachment_id'] ) );
+ $gBitSystem->mDb->query( $sql, array( $pStoreRow['file_id'], $pStoreRow['attachment_id'] ) );
}
return $ret;
}
@@ -67,7 +67,7 @@ function bit_files_load( $pRow ) {
$query = "SELECT *
FROM `".BIT_DB_PREFIX."tiki_attachments` ta INNER JOIN `".BIT_DB_PREFIX."tiki_files` tf ON (tf.`file_id` = ta.`foreign_id`)
WHERE ta.`foreign_id` = ? AND ta.`content_id` = ?";
- if( $rs = $gBitSystem->query($query, array( $pRow['foreign_id'], $pRow['content_id'] )) ) {
+ if( $rs = $gBitSystem->mDb->query($query, array( $pRow['foreign_id'], $pRow['content_id'] )) ) {
$ret = $rs->fields;
if (preg_match ( '/image\//', $ret['mime_type'] )) {
$ret['thumbnail_url']['avatar'] = BIT_ROOT_URL.dirname( $ret['storage_path'] ).'/avatar.jpg';
@@ -95,11 +95,11 @@ function bit_files_expunge( $pStorageId ) {
if (is_numeric($pStorageId)) {
$sql = "SELECT * FROM `".BIT_DB_PREFIX."tiki_attachments` WHERE `attachment_id` = ?";
- $rs = $gBitSystem->query($sql, array($pStorageId));
+ $rs = $gBitSystem->mDb->query($sql, array($pStorageId));
$row = &$rs->fields;
if ($row) {
$sql = "SELECT * FROM `".BIT_DB_PREFIX."tiki_files` WHERE `file_id` = ?";
- $fileRs = $gBitSystem->query($sql, array($row['foreign_id']) );
+ $fileRs = $gBitSystem->mDb->query($sql, array($row['foreign_id']) );
$fileRow = &$fileRs->fields;
if ($fileRow) {
$absolutePath = BIT_ROOT_PATH.'/'.$fileRow['storage_path'];
@@ -109,9 +109,9 @@ function bit_files_expunge( $pStorageId ) {
unlink($absolutePath);
}
$query = "DELETE FROM `".BIT_DB_PREFIX."tiki_attachments` WHERE `attachment_id` = ?";
- $gBitSystem->query($query, array($pStorageId));
+ $gBitSystem->mDb->query($query, array($pStorageId));
$query = "DELETE FROM `".BIT_DB_PREFIX."tiki_files` WHERE `file_id` = ?";
- $gBitSystem->query($query, array($row['foreign_id']) );
+ $gBitSystem->mDb->query($query, array($row['foreign_id']) );
$ret = TRUE;
}
}
diff --git a/plugins/storage.lulu.php b/plugins/storage.lulu.php
index 2f49357..abd04d3 100644
--- a/plugins/storage.lulu.php
+++ b/plugins/storage.lulu.php
@@ -1,7 +1,7 @@
<?php
/**
- * @version $Revision: 1.3 $
- * @package Liberty
+ * @version $Revision: 1.4 $
+ * @package liberty
* @subpackage plugins_storage
*/
global $gLibertySystem;
@@ -45,7 +45,7 @@ $gLibertySystem->registerPlugin( PLUGIN_GUID_LULU, $pluginParams );
global $gBitSystem;
$sql = "DELETE FROM `".BIT_DB_PREFIX."tiki_attachments` WHERE `attachment_id` = ?";
- $gBitSystem->query($sql, array($pAttachmentId));
+ $gBitSystem->mDb->query($sql, array($pAttachmentId));
return TRUE;
}
diff --git a/plugins/storage.pbase.php b/plugins/storage.pbase.php
index 6c70cdb..d51aec7 100644
--- a/plugins/storage.pbase.php
+++ b/plugins/storage.pbase.php
@@ -1,7 +1,7 @@
<?php
/**
- * @version $Revision: 1.2 $
- * @package Liberty
+ * @version $Revision: 1.3 $
+ * @package liberty
* @subpackage plugins_storage
*/
global $gLibertySystem;
diff --git a/templates/admin_liberty.tpl b/templates/admin_liberty.tpl
index 7aa0444..e3805f1 100644
--- a/templates/admin_liberty.tpl
+++ b/templates/admin_liberty.tpl
@@ -83,7 +83,7 @@
<div class="row">
{formlabel label="
<a href='http://www.boutell.com/gd/'>
- <img class='icon' src=\"`$gBitLoc.LIBERTY_PKG_URL`icons/gd_logo.jpg\" alt='GD' />
+ <img class='icon' src=\"`$smarty.const.LIBERTY_PKG_URL`icons/gd_logo.jpg\" alt='GD' />
</a>
"}
{forminput}
@@ -100,7 +100,7 @@
<div class="row">
{formlabel label="
<a href='http://www.imagemagick.org/'>
- <img class='icon' src=\"`$gBitLoc.LIBERTY_PKG_URL`icons/imagick_logo.jpg\" alt='ImageMagick' />
+ <img class='icon' src=\"`$smarty.const.LIBERTY_PKG_URL`icons/imagick_logo.jpg\" alt='ImageMagick' />
</a>
"}
{forminput}
diff --git a/templates/attachment_browser.tpl b/templates/attachment_browser.tpl
index 48a59eb..d44dd2a 100644
--- a/templates/attachment_browser.tpl
+++ b/templates/attachment_browser.tpl
@@ -3,26 +3,26 @@
<head>
<title>{tr}Attachment Browser{/tr}</title>
- {if $gBitLoc.styleSheet}
- <link rel="stylesheet" title="{$style}" type="text/css" href="{$gBitLoc.styleSheet}" media="all" />
+ {if $gBitSystem->mStyles.styleSheet}
+ <link rel="stylesheet" title="{$style}" type="text/css" href="{$gBitSystem->mStyles.styleSheet}" media="all" />
{/if}
- {if $gBitLoc.browserStyleSheet}
- <link rel="stylesheet" title="{$style}" type="text/css" href="{$gBitLoc.browserStyleSheet}" media="all" />
+ {if $gBitSystem->mStyles.browserStyleSheet}
+ <link rel="stylesheet" title="{$style}" type="text/css" href="{$gBitSystem->mStyles.browserStyleSheet}" media="all" />
{/if}
- {if $gBitLoc.customStyleSheet}
- <link rel="stylesheet" title="{$style}" type="text/css" href="{$gBitLoc.custumStyleSheet}" media="all" />
+ {if $gBitSystem->mStyles.customStyleSheet}
+ <link rel="stylesheet" title="{$style}" type="text/css" href="{$gBitSystem->mStyles.custumStyleSheet}" media="all" />
{/if}
- {foreach from=$gBitLoc.altStyleSheets item=alt_path key=alt_name}
+ {foreach from=$gBitSystem->mStyles.altStyleSheets item=alt_path key=alt_name}
<link rel="alternate stylesheet" title="{$alt_name}" type="text/css" href="{$alt_path}" media="screen" />
{/foreach}
<script type="text/javascript"><!--
- var tikiCookiePath = "{$gBitLoc.cookie_path}";
- var tikiCookieDomain = "{$gBitLoc.cookie_domain}";
- var tikiIconDir = "{$gBitLoc.LIBERTY_PKG_URL}icons";
- var tikiRootUrl = "{$gBitLoc.BIT_ROOT_URL}";
+ var tikiCookiePath = "{$gBitSystemPrefs.cookie_path}";
+ var tikiCookieDomain = "{$gBitSystemPrefs.cookie_domain}";
+ var tikiIconDir = "{$smarty.const.LIBERTY_PKG_URL}icons";
+ var tikiRootUrl = "{$smarty.const.BIT_ROOT_URL}";
--></script>
- <script type="text/javascript" src="{$gBitLoc.KERNEL_PKG_URL}bitweaver.js"></script>
+ <script type="text/javascript" src="{$smarty.const.KERNEL_PKG_URL}bitweaver.js"></script>
{literal}
<script type="text/javascript"><!--
@@ -34,7 +34,7 @@
{/literal}
<!--[if gte IE 5.5000]>
- <script type="text/javascript" src="{$gBitLoc.THEMES_PKG_URL}js/pngfix.js"></script>
+ <script type="text/javascript" src="{$smarty.const.THEMES_PKG_URL}js/pngfix.js"></script>
<![endif]-->
{strip}
diff --git a/templates/display_structure.tpl b/templates/display_structure.tpl
index 0a252f5..6c83603 100644
--- a/templates/display_structure.tpl
+++ b/templates/display_structure.tpl
@@ -1,5 +1,5 @@
{strip}
-{if $structureInfo}
+{if $structureInfo.structure_path}
<div class="structurebar">
{if $gBitSystem->isFeatureActive( 'wikibook_show_path' )}
<span class="path">
diff --git a/templates/edit_storage.tpl b/templates/edit_storage.tpl
index f0613c5..1073e56 100644
--- a/templates/edit_storage.tpl
+++ b/templates/edit_storage.tpl
@@ -20,7 +20,7 @@ include (LIBERTY_PKG_PATH."edit_storage_inc.php");
{formlabel label="Existing Attachment ID"}
{forminput}
<input type="text" name="existing_attachment_id[]" id="existing_attachment_id_input" size="6"/><br />
- <a href="{$gBitLoc.LIBERTY_PKG_URL}attachment_browser.php" title="{tr}Opens attachemnt browser in new window{/tr}" onkeypress="popUpWin(this.href,'standard',600,400);" onclick="popUpWin(this.href,'standard',600,400);return false;">{tr}Attachment Browser{/tr}</a>
+ <a href="{$smarty.const.LIBERTY_PKG_URL}attachment_browser.php" title="{tr}Opens attachemnt browser in new window{/tr}" onkeypress="popUpWin(this.href,'standard',600,400);" onclick="popUpWin(this.href,'standard',600,400);return false;">{tr}Attachment Browser{/tr}</a>
{/forminput}
</div>
diff --git a/templates/edit_structure_inc.tpl b/templates/edit_structure_inc.tpl
index a8ae2cf..5ef21f9 100644
--- a/templates/edit_structure_inc.tpl
+++ b/templates/edit_structure_inc.tpl
@@ -6,7 +6,7 @@
{if $structureInfo.structure_id eq $subtree[ix].structure_id}<div class="highlight">{/if}
{if !$hide_extended}
<div style="float:right;">
- <a href="{$gBitLoc.WIKI_PKG_URL}index.php?structure_id={$subtree[ix].structure_id}">{biticon iforce=icon ipackage=liberty iname="view" iexplain="view page"}</a>
+ <a href="{$smarty.const.WIKI_PKG_URL}index.php?structure_id={$subtree[ix].structure_id}">{biticon iforce=icon ipackage=liberty iname="view" iexplain="view page"}</a>
<a href="{$PHP_SELF}?structure_id={$subtree[ix].structure_id}">{biticon iforce=icon ipackage=liberty iname="settings" iexplain="edit book"}</a>
{biticon iforce=icon ipackage=liberty iname="spacer" iexplain=""}
</div>
@@ -28,7 +28,7 @@
{if !$hide_extended}
{biticon iforce=icon ipackage=liberty iname="spacer" iexplain=""}
- <a href="{$gBitLoc.WIKI_PKG_URL}index.php?structure_id={$subtree[ix].structure_id}">{biticon iforce=icon ipackage=liberty iname="view" iexplain="view page"}</a>
+ <a href="{$smarty.const.WIKI_PKG_URL}index.php?structure_id={$subtree[ix].structure_id}">{biticon iforce=icon ipackage=liberty iname="view" iexplain="view page"}</a>
<a href="{$PHP_SELF}?structure_id={$subtree[ix].structure_id}&amp;action=edit">{biticon iforce=icon ipackage=liberty iname="settings" iexplain="edit book"}</a>
<a href="{$PHP_SELF}?structure_id={$subtree[ix].structure_id}&amp;action=remove">{biticon iforce=icon ipackage=liberty iname="delete" iexplain="remove page"}</a>
{/if}
diff --git a/templates/menu_liberty_admin.tpl b/templates/menu_liberty_admin.tpl
index d3651b9..ba5a53d 100644
--- a/templates/menu_liberty_admin.tpl
+++ b/templates/menu_liberty_admin.tpl
@@ -1,18 +1,18 @@
{strip}
<ul>
- <li><a class="item" href="{$gBitLoc.KERNEL_PKG_URL}admin/index.php?page=liberty">{tr}Liberty Settings{/tr}</a></li>
- <li><a class="item" href="{$gBitLoc.LIBERTY_PKG_URL}admin/plugins.php">{tr}Plugins{/tr}</a></li>
+ <li><a class="item" href="{$smarty.const.KERNEL_PKG_URL}admin/index.php?page=liberty">{tr}Liberty Settings{/tr}</a></li>
+ <li><a class="item" href="{$smarty.const.LIBERTY_PKG_URL}admin/plugins.php">{tr}Plugins{/tr}</a></li>
{if $gBitSystem->isPackageActive( 'pdf' ) }
- <li><a class="item" href="{$gBitLoc.KERNEL_PKG_URL}admin/index.php?page=pdf">{tr}PDF Settings{/tr}</a></li>
+ <li><a class="item" href="{$smarty.const.KERNEL_PKG_URL}admin/index.php?page=pdf">{tr}PDF Settings{/tr}</a></li>
{/if}
{if $gBitSystem->isPackageActive( 'quota' ) }
- <li><a class="item" href="{$gBitLoc.KERNEL_PKG_URL}admin/index.php?page=quota">{tr}Quota Settings{/tr}</a></li>
+ <li><a class="item" href="{$smarty.const.KERNEL_PKG_URL}admin/index.php?page=quota">{tr}Quota Settings{/tr}</a></li>
{/if}
{if $gBitSystem->isPackageActive( 'quicktags' ) }
- <li><a class="item" href="{$gBitLoc.QUICKTAGS_PKG_URL}admin/index.php">{tr}Quicktags{/tr}</a></li>
+ <li><a class="item" href="{$smarty.const.QUICKTAGS_PKG_URL}admin/index.php">{tr}Quicktags{/tr}</a></li>
{/if}
{if $gBitSystem->isPackageActive( 'hotwords' ) }
- <li><a class="item" href="{$gBitLoc.HOTWORDS_PKG_URL}admin/index.php">{tr}Hotwords{/tr}</a></li>
+ <li><a class="item" href="{$smarty.const.HOTWORDS_PKG_URL}admin/index.php">{tr}Hotwords{/tr}</a></li>
{/if}
</ul>
{/strip}