diff options
| author | Max Kremmel <xing@synapse.plus.com> | 2006-02-01 18:42:13 +0000 |
|---|---|---|
| committer | Max Kremmel <xing@synapse.plus.com> | 2006-02-01 18:42:13 +0000 |
| commit | 0bba046924eb0135229108f60a432e5bfca3934d (patch) | |
| tree | b6a8e6b48985f976ea53cfb8402564625e3a28cf | |
| parent | b034452aaf0a6dc09a9621fdfcfc2cae7804c128 (diff) | |
| download | liberty-0bba046924eb0135229108f60a432e5bfca3934d.tar.gz liberty-0bba046924eb0135229108f60a432e5bfca3934d.tar.bz2 liberty-0bba046924eb0135229108f60a432e5bfca3934d.zip | |
detikify liberty
| -rw-r--r-- | LibertyAttachable.php | 28 | ||||
| -rw-r--r-- | LibertyBase.php | 4 | ||||
| -rw-r--r-- | LibertyComment.php | 38 | ||||
| -rw-r--r-- | LibertyContent.php | 104 | ||||
| -rwxr-xr-x | LibertyStructure.php | 142 | ||||
| -rwxr-xr-x | LibertySystem.php | 20 | ||||
| -rw-r--r-- | admin/schema_inc.php | 86 | ||||
| -rw-r--r-- | plugins/data.clock.php | 8 | ||||
| -rw-r--r-- | plugins/format.tikiwiki.php | 24 | ||||
| -rw-r--r-- | plugins/storage.bitfile.php | 18 | ||||
| -rw-r--r-- | plugins/storage.lulu.php | 4 |
11 files changed, 238 insertions, 238 deletions
diff --git a/LibertyAttachable.php b/LibertyAttachable.php index be2997f..7ae9dd2 100644 --- a/LibertyAttachable.php +++ b/LibertyAttachable.php @@ -3,7 +3,7 @@ * Management of Liberty Content * * @package liberty - * @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertyAttachable.php,v 1.14 2006/01/31 20:18:26 bitweaver Exp $ + * @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertyAttachable.php,v 1.15 2006/02/01 18:42:12 squareing Exp $ * @author spider <spider@steelsun.com> */ // +----------------------------------------------------------------------+ @@ -221,12 +221,12 @@ Disable for now - instead fend off new uploads once quota is exceeded. Need a ni if( function_exists( $gLibertySystem->mPlugins[$guid]['verify_function'] ) && $gLibertySystem->mPlugins[$guid]['verify_function']( $storeRow ) ) { if( empty( $pParamHash['attachment_id'] ) ) { - $sql = "SELECT `attachment_id` FROM `".BIT_DB_PREFIX."tiki_attachments` + $sql = "SELECT `attachment_id` FROM `".BIT_DB_PREFIX."liberty_attachments` WHERE `attachment_plugin_guid` = ? AND `content_id` = ? AND `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->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 ( ?, ?, ?, ?, ? )"; + $sql = "INSERT INTO `".BIT_DB_PREFIX."liberty_attachments` ( `attachment_id`, `attachment_plugin_guid`, `content_id`, `foreign_id`, `user_id` ) VALUES ( ?, ?, ?, ?, ? )"; $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.'; @@ -243,7 +243,7 @@ Disable for now - instead fend off new uploads once quota is exceeded. Need a ni } $storeRow['upload']['dest_path'] = $this->getStorageBranch( $storeRow['attachment_id'], $pParamHash['user_id'], 'images' ); $storagePath = liberty_process_upload( $storeRow ); - // We're gonna store to local file system & tiki_files table + // We're gonna store to local file system & liberty_files table if( empty( $storagePath ) ) { $this->mErrors['file'] = 'Could not store file '.$storeRow['upload']['name'].'.'; $pParamHash['attachment_id'] = NULL; @@ -282,13 +282,13 @@ Disable for now - instead fend off new uploads once quota is exceeded. Need a ni global $gLibertySystem; global $gBitUser; - $sql = "SELECT * FROM `".BIT_DB_PREFIX."tiki_attachments` WHERE `attachment_id` = ?"; + $sql = "SELECT * FROM `".BIT_DB_PREFIX."liberty_attachments` WHERE `attachment_id` = ?"; $rs = $this->mDb->query($sql, array( $pAttachmentId )); $tmpAttachment = $rs->fetchRow(); if ( @$this->verifyId($tmpAttachment['attachment_id']) ) { $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 ( ?, ?, ?, ?, ? )"; + $sql = "INSERT INTO `".BIT_DB_PREFIX."liberty_attachments` ( `attachment_id`, `attachment_plugin_guid`, `content_id`, `foreign_id`, `user_id` ) VALUES ( ?, ?, ?, ?, ? )"; $rs = $this->mDb->query( $sql, array( $newAttachmentId, $tmpAttachment['attachment_plugin_guid'], $pNewContentId, $tmpAttachment['foreign_id'], $gBitUser->mUserId ) ); } } @@ -309,7 +309,7 @@ Disable for now - instead fend off new uploads once quota is exceeded. Need a ni $ret = NULL; if( @$this->verifyId( $pAttachmentId ) ) { - $sql = "SELECT `attachment_plugin_guid`, `user_id` FROM `".BIT_DB_PREFIX."tiki_attachments` WHERE `attachment_id`=?"; + $sql = "SELECT `attachment_plugin_guid`, `user_id` FROM `".BIT_DB_PREFIX."liberty_attachments` WHERE `attachment_id`=?"; $row = $this->mDb->getRow( $sql, array( $pAttachmentId ) ); $guid = $row['attachment_plugin_guid']; $user_id = $row['user_id']; @@ -324,7 +324,7 @@ Disable for now - instead fend off new uploads once quota is exceeded. Need a ni if( preg_match ( '/image\//', $this->mStorage[$pAttachmentId]['mime_type'] ) && preg_match( "/images\/$pAttachmentId/", $delDir ) ) { unlink_r( BIT_ROOT_PATH.dirname( $this->mStorage[$pAttachmentId]['storage_path'] ) ); } - $sql = "DELETE FROM `".BIT_DB_PREFIX."tiki_attachments` WHERE `attachment_id`=?"; + $sql = "DELETE FROM `".BIT_DB_PREFIX."liberty_attachments` WHERE `attachment_id`=?"; $this->mDb->query( $sql, array( $pAttachmentId ) ); unset($this->mStorage[$pAttachmentId]); @@ -346,7 +346,7 @@ Disable for now - instead fend off new uploads once quota is exceeded. Need a ni $attachmentOwner = new BitUser($attachmentInfo['user_id']); $attachmentOwner->load(); if ($attachmentOwner->mContentId) { - $query = "UPDATE `".BIT_DB_PREFIX."tiki_attachments` SET `content_id` = ? WHERE `attachment_id` = ?"; + $query = "UPDATE `".BIT_DB_PREFIX."liberty_attachments` SET `content_id` = ? WHERE `attachment_id` = ?"; $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"; @@ -360,13 +360,13 @@ Disable for now - instead fend off new uploads once quota is exceeded. Need a ni // allow an optional content_id to be passed in to ease legacy lib style objects (like blogs, articles, etc.) function load( $pContentId=NULL ) { - // assume a derived class has joined on the tiki_content table, and loaded it's columns already. + // assume a derived class has joined on the liberty_content table, and loaded it's columns already. global $gLibertySystem; $conId = ( @$this->verifyId( $pContentId ) ? $pContentId : $this->mContentId ); if( @$this->verifyId( $conId ) ) { LibertyContent::load($pContentId); - $query = "SELECT * FROM `".BIT_DB_PREFIX."tiki_attachments` a + $query = "SELECT * FROM `".BIT_DB_PREFIX."liberty_attachments` a WHERE a.`content_id`=?"; if( $result = $this->mDb->query($query,array((int) $conId)) ) { $this->mStorage = array(); @@ -384,12 +384,12 @@ Disable for now - instead fend off new uploads once quota is exceeded. Need a ni // allow an optional content_id to be passed in to ease legacy lib style objects (like blogs, articles, etc.) function getAttachment( $pAttachmentId ) { - // assume a derived class has joined on the tiki_content table, and loaded it's columns already. + // assume a derived class has joined on the liberty_content table, and loaded it's columns already. global $gLibertySystem; $ret = NULL; if( @$this->verifyId( $pAttachmentId ) ) { - $query = "SELECT * FROM `".BIT_DB_PREFIX."tiki_attachments` a + $query = "SELECT * FROM `".BIT_DB_PREFIX."liberty_attachments` a WHERE a.`attachment_id`=?"; if( $result = $this->mDb->query($query,array((int) $pAttachmentId)) ) { $ret = array(); @@ -410,7 +410,7 @@ Disable for now - instead fend off new uploads once quota is exceeded. Need a ni $attachmentInfo = $this->getAttachment( $pAttachmentId ); if( @$this->verifyId( $attachmentInfo['attachment_id'] ) && @$this->verifyId( $attachmentInfo['foreign_id'] ) && @$this->verifyId( $attachmentInfo['attachment_plugin_guid'] ) ) { - $query = "SELECT * FROM `".BIT_DB_PREFIX."tiki_attachments` WHERE `foreign_id` = ? AND `attachment_plugin_guid` = ? AND `attachment_id` <> ?"; + $query = "SELECT * FROM `".BIT_DB_PREFIX."liberty_attachments` WHERE `foreign_id` = ? AND `attachment_plugin_guid` = ? AND `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 0f7cc73..0e43a2d 100644 --- a/LibertyBase.php +++ b/LibertyBase.php @@ -3,7 +3,7 @@ * Base class for Management of Liberty Content * * @package liberty - * @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertyBase.php,v 1.6 2005/08/30 22:25:07 squareing Exp $ + * @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertyBase.php,v 1.7 2006/02/01 18:42:12 squareing Exp $ * @author spider <spider@steelsun.com> */ // +----------------------------------------------------------------------+ @@ -55,7 +55,7 @@ class LibertyBase extends BitBase { if( BitBase::verifyId( $pContentId ) ) { if( empty( $pContentGuid ) ) { - $pContentGuid = $gLibertySystem->mDb->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."liberty_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 e72f70c..2b86d93 100644 --- a/LibertyComment.php +++ b/LibertyComment.php @@ -3,7 +3,7 @@ * Management of Liberty Content * * @package liberty - * @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertyComment.php,v 1.8 2006/01/25 15:40:25 spiderr Exp $ + * @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertyComment.php,v 1.9 2006/02/01 18:42:12 squareing Exp $ * @author spider <spider@steelsun.com> */ @@ -49,15 +49,15 @@ class LibertyComment extends LibertyContent { } if ($this->mCommentId) { - $mid = 'WHERE tc.`comment_id` = ?'; + $mid = 'WHERE lc.`comment_id` = ?'; $bindVars = array($this->mCommentId); } else { $mid = 'WHERE tcn.`content_id` = ?'; $bindVars = array($this->mContentId); } - $sql = "SELECT tc.*, tcn.*, uu.`email`, uu.`real_name`, uu.`login` AS `user` - FROM `".BIT_DB_PREFIX."tiki_comments` tc LEFT OUTER JOIN `".BIT_DB_PREFIX."tiki_content` tcn ON (tc.`content_id` = tcn.`content_id`) + $sql = "SELECT lc.*, tcn.*, uu.`email`, uu.`real_name`, uu.`login` AS `user` + FROM `".BIT_DB_PREFIX."liberty_comments` lc LEFT OUTER JOIN `".BIT_DB_PREFIX."liberty_content` tcn ON (lc.`content_id` = tcn.`content_id`) LEFT OUTER JOIN `".BIT_DB_PREFIX."users_users` uu ON (tcn.`user_id` = uu.`user_id`) $mid"; if( $row = $this->mDb->getRow($sql, $bindVars) ) { @@ -81,7 +81,7 @@ class LibertyComment extends LibertyContent { if( LibertyContent::store( $pStorageHash ) ) { if ($this->verifyComment($pStorageHash)) { $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 (?,?,?)"; + $sql = "INSERT INTO `".BIT_DB_PREFIX."liberty_comments` (`comment_id`, `content_id`, `parent_id`) VALUES (?,?,?)"; $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']; @@ -90,7 +90,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` = ?"; + $sql = "UPDATE `".BIT_DB_PREFIX."liberty_comments` SET `parent_id` = ?, `content_id`= ? WHERE `comment_id` = ?"; $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']; @@ -101,7 +101,7 @@ class LibertyComment extends LibertyContent { } function deleteComment() { - $sql = "SELECT `comment_id` FROM `".BIT_DB_PREFIX."tiki_comments` WHERE `parent_id` = ?"; + $sql = "SELECT `comment_id` FROM `".BIT_DB_PREFIX."liberty_comments` WHERE `parent_id` = ?"; $rs = $this->mDb->query($sql, array($this->mContentId)); $rows = $rs->getRows(); @@ -110,10 +110,10 @@ class LibertyComment extends LibertyContent { $comment->deleteComment(); } - $sql = "DELETE FROM `".BIT_DB_PREFIX."tiki_comments` WHERE `comment_id` = ?"; + $sql = "DELETE FROM `".BIT_DB_PREFIX."liberty_comments` WHERE `comment_id` = ?"; $rs = $this->mDb->query($sql, array($this->mCommentId)); - $sql = "DELETE FROM `".BIT_DB_PREFIX."tiki_content` WHERE `content_id` = ?"; + $sql = "DELETE FROM `".BIT_DB_PREFIX."liberty_content` WHERE `content_id` = ?"; $rs = $this->mDb->query($sql, array($this->mContentId)); } @@ -166,17 +166,17 @@ class LibertyComment extends LibertyContent { $mid = ''; $bindVars = array(); if ( !empty( $pParamHash['content_type_guid'] ) ) { - $mid .= " AND tc.`content_type_guid`=? "; + $mid .= " AND lc.`content_type_guid`=? "; $bindVars[] = $pParamHash['content_type_guid']; } if ( @$this->verifyId( $pParamHash['user_id'] ) ) { - $mid .= " AND tc.`user_id`=? "; + $mid .= " AND lc.`user_id`=? "; $bindVars[] = $pParamHash['user_id']; } - $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"; + $query = "SELECT DISTINCT( lc.`content_id` ), lc.`title` AS `content_title`, lc.`created`, tcmc.`last_modified`, tcmc.`title`, uu.`login` AS `user`, uu.`real_name` + FROM `".BIT_DB_PREFIX."liberty_comments` lcom INNER JOIN `".BIT_DB_PREFIX."liberty_content` tcmc ON (lcom.`content_id`=tcmc.`content_id` ), `".BIT_DB_PREFIX."liberty_content` lc, `".BIT_DB_PREFIX."users_users` uu + WHERE lcom.`parent_id`=lc.`content_id` AND uu.`user_id`=tcmc.`user_id` $mid ORDER BY $sort_mode"; if( $result = $this->mDb->query($query, $bindVars, $pParamHash['max_records'], $pParamHash['offset']) ) { $ret = $result->GetRows(); } @@ -194,9 +194,9 @@ class LibertyComment extends LibertyContent { } $commentCount = 0; if ($contentId) { - $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` = ?"; + $sql = "SELECT lcom.*, tcmc.`parent_id` AS `child_content_id` + FROM `".BIT_DB_PREFIX."liberty_comments` lcom LEFT OUTER JOIN `".BIT_DB_PREFIX."liberty_comments` tcmc ON (lcom.`content_id`=tcmc.`parent_id`) + WHERE lcom.`parent_id` = ?"; $rows = $this->mDb->getAssoc($sql, array($contentId)); $commentCount += count($rows); foreach ($rows as $row) { @@ -264,8 +264,8 @@ 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"; + $sql = "SELECT lcom.`comment_id` FROM `".BIT_DB_PREFIX."liberty_comments` lcom, `".BIT_DB_PREFIX."liberty_content` lc + WHERE lcom.`parent_id` = ? AND lcom.`content_id` = lc.`content_id` ORDER BY lc.`created` $sort_order"; if( $rows = $this->mDb->getAll( $sql, array($contentId), $pMaxComments, $pOffset ) ) { foreach ($rows as $row) { $comment = new LibertyComment( $row['comment_id'] ); diff --git a/LibertyContent.php b/LibertyContent.php index e1b4904..57ee5bf 100644 --- a/LibertyContent.php +++ b/LibertyContent.php @@ -3,7 +3,7 @@ * Management of Liberty content * * @package liberty -* @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertyContent.php,v 1.35 2006/01/31 21:53:48 spiderr Exp $ +* @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertyContent.php,v 1.36 2006/02/01 18:42:12 squareing Exp $ * @author spider <spider@steelsun.com> */ @@ -86,7 +86,7 @@ class LibertyContent extends LibertyBase { } /** - * Assume a derived class has joined on the tiki_content table, and loaded it's columns already. + * Assume a derived class has joined on the liberty_content table, and loaded it's columns already. */ function load($pContentId = NULL) { if( !empty( $this->mInfo['content_type_guid'] ) ) { @@ -101,10 +101,10 @@ class LibertyContent extends LibertyBase { } /** - * Verify the core class data required to update the tiki_content table entries + * Verify the core class data required to update the liberty_content table entries * * Verify will build an array [content_store] with all of the required values - * and populate it with the relevent data to create/update the tiki_content + * and populate it with the relevent data to create/update the liberty_content * table record * * @param array Array of content data to be stored <br> @@ -224,7 +224,7 @@ class LibertyContent extends LibertyBase { global $gLibertySystem; if( LibertyContent::verify( $pParamHash ) ) { $this->mDb->StartTrans(); - $table = BIT_DB_PREFIX."tiki_content"; + $table = BIT_DB_PREFIX."liberty_content"; if( !@$this->verifyId( $pParamHash['content_id'] ) ) { $pParamHash['content_store']['content_id'] = $this->mDb->GenID( 'tiki_content_id_seq' ); $pParamHash['content_id'] = $pParamHash['content_store']['content_id']; @@ -264,7 +264,7 @@ class LibertyContent extends LibertyBase { function expungeComments() { 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` = ?"; + $query = "SELECT `comment_id` FROM `".BIT_DB_PREFIX."liberty_comments` WHERE `parent_id` = ?"; $result = $this->mDb->query($query, array( $this->mContentId ) ); $commentIds = $result->getRows(); foreach ($commentIds as $commentId) { @@ -295,7 +295,7 @@ class LibertyContent extends LibertyBase { $result = $this->mDb->query( $query, array( $this->mContentId ) ); // Remove content - $query = "DELETE FROM `".BIT_DB_PREFIX."tiki_content` WHERE `content_id` = ?"; + $query = "DELETE FROM `".BIT_DB_PREFIX."liberty_content` WHERE `content_id` = ?"; $result = $this->mDb->query( $query, array( $this->mContentId ) ); $this->mDb->CompleteTrans(); @@ -656,7 +656,7 @@ class LibertyContent extends LibertyBase { global $gBitUser,$gBitSystem; if( empty( $_REQUEST['post_comment_submit'] ) && empty( $_REQUEST['post_comment_request'] ) ) { if( $this->mContentId && ( $gBitUser->mUserId != $this->mInfo['user_id'] ) ) { - $query = "UPDATE `".BIT_DB_PREFIX."tiki_content` SET `hits`=`hits`+1, `last_hit`= ? WHERE `content_id` = ?"; + $query = "UPDATE `".BIT_DB_PREFIX."liberty_content` SET `hits`=`hits`+1, `last_hit`= ? WHERE `content_id` = ?"; $result = $this->mDb->query( $query, array( $gBitSystem->getUTCTime(), $this->mContentId ) ); } } @@ -672,11 +672,11 @@ class LibertyContent extends LibertyBase { global $gBitSystem; $ret = NULL; if( $gBitSystem->isPackageActive( 'wiki' ) ) { - $pageWhere = $pCaseSensitive ? 'tc.`title`' : 'LOWER( tc.`title` )'; + $pageWhere = $pCaseSensitive ? 'lc.`title`' : 'LOWER( lc.`title` )'; $bindVars = array( ($pCaseSensitive ? $pPageName : strtolower( $pPageName ) ) ); - $query = "SELECT `page_id`, tp.`content_id`, `description`, tc.`last_modified`, tc.`title` - FROM `".BIT_DB_PREFIX."wiki_pages` tp, `".BIT_DB_PREFIX."tiki_content` tc - WHERE tc.`content_id`=tp.`content_id` AND $pageWhere = ?"; + $query = "SELECT `page_id`, tp.`content_id`, `description`, lc.`last_modified`, lc.`title` + FROM `".BIT_DB_PREFIX."wiki_pages` tp, `".BIT_DB_PREFIX."liberty_content` lc + WHERE lc.`content_id`=tp.`content_id` AND $pageWhere = ?"; $ret = $this->mDb->getAll($query, $bindVars ); if( empty( $ret ) ) { $ret = NULL; // we don't want an empty array @@ -905,14 +905,14 @@ class LibertyContent extends LibertyBase { $bindVars = array(); if( !empty( $pListHash['content_type_guid'] ) ) { - $mid .= ' AND tc.`content_type_guid`=? '; + $mid .= ' AND lc.`content_type_guid`=? '; $bindVars[] = $pListHash['content_type_guid']; } $this->prepGetList( $pListHash ); - $query = "SELECT DISTINCT(uu.`user_id`) AS hash_key, uu.`user_id`, SUM( tc.`hits` ) AS `ag_hits`, uu.`login` AS `user`, uu.`real_name` - FROM `".BIT_DB_PREFIX."tiki_content` tc INNER JOIN `".BIT_DB_PREFIX."users_users` uu ON( uu.`user_id`=tc.`user_id` ) - WHERE uu.`user_id` != ".ANONYMOUS_USER_ID." AND tc.`hits` > 0 $mid + $query = "SELECT DISTINCT(uu.`user_id`) AS hash_key, uu.`user_id`, SUM( lc.`hits` ) AS `ag_hits`, uu.`login` AS `user`, uu.`real_name` + FROM `".BIT_DB_PREFIX."liberty_content` lc INNER JOIN `".BIT_DB_PREFIX."users_users` uu ON( uu.`user_id`=lc.`user_id` ) + WHERE uu.`user_id` != ".ANONYMOUS_USER_ID." AND lc.`hits` > 0 $mid GROUP BY uu.`user_id`, uu.`login`, uu.`real_name` ORDER BY `ag_hits` DESC"; $ret = $this->mDb->getRow( $query, $bindVars, $pListHash['max_records'], $pListHash['offset'] ); @@ -968,27 +968,27 @@ class LibertyContent extends LibertyBase { $gateFrom = ''; if( is_array( $pListHash['find'] ) ) { // you can use an array of titles - $mid = " AND tc.`title` IN ( ".implode( ',',array_fill( 0,count( $pListHash['find'] ),'?' ) ).")"; + $mid = " AND lc.`title` IN ( ".implode( ',',array_fill( 0,count( $pListHash['find'] ),'?' ) ).")"; $bindVars[] = $pListHash['find']; } elseif( !empty($pListHash['find'] ) && is_string( $pListHash['find'] ) ) { // or a string - $mid = " AND UPPER(tc.`title`) like ? "; + $mid = " AND UPPER(lc.`title`) like ? "; $bindVars[] = ( '%' . strtoupper( $pListHash['find'] ) . '%' ); } // this is necessary to display useful information in the liberty RSS feed if( !empty( $pListHash['include_data'] ) ) { - $select = ", tc.`data`, tc.`format_guid`"; + $select = ", lc.`data`, lc.`format_guid`"; } // calendar specific selection method - use timestamps to limit selection if( !empty( $pListHash['start'] ) && !empty( $pListHash['stop'] ) ) { - $mid .= " AND ( tc.`".$pListHash['calendar_sort_mode']."` > ? AND tc.`".$pListHash['calendar_sort_mode']."` < ? ) "; + $mid .= " AND ( lc.`".$pListHash['calendar_sort_mode']."` > ? AND lc.`".$pListHash['calendar_sort_mode']."` < ? ) "; $bindVars[] = $pListHash['start']; $bindVars[] = $pListHash['stop']; } if( @$this->verifyId( $pListHash['user_id'] ) ) { - $mid .= " AND tc.`user_id` = ? "; + $mid .= " AND lc.`user_id` = ? "; $bindVars[] = $pListHash['user_id']; } @@ -996,14 +996,14 @@ class LibertyContent extends LibertyBase { $mid .= ' AND `content_type_guid`=? '; $bindVars[] = $pListHash['content_type_guid']; } elseif( !empty( $pListHash['content_type_guid'] ) && is_array( $pListHash['content_type_guid'] ) ) { - $mid .= " AND tc.`content_type_guid` IN ( ".implode( ',',array_fill ( 0, count( $pListHash['content_type_guid'] ),'?' ) )." )"; + $mid .= " AND lc.`content_type_guid` IN ( ".implode( ',',array_fill ( 0, count( $pListHash['content_type_guid'] ),'?' ) )." )"; $bindVars = array_merge( $bindVars, $pListHash['content_type_guid'] ); } if( $gBitSystem->isPackageActive( 'gatekeeper' ) ) { - $gateSelect .= ' ,ts.`security_id`, ts.`security_description`, ts.`is_private`, ts.`is_hidden`, ts.`access_question`, ts.`access_answer` '; - $gateFrom .= " LEFT OUTER JOIN `".BIT_DB_PREFIX."gatekeeper_security_map` cg ON (tc.`content_id`=cg.`content_id`) LEFT OUTER JOIN `".BIT_DB_PREFIX."gatekeeper_security` ts ON (ts.`security_id`=cg.`security_id` )"; - $mid .= ' AND (cg.`security_id` IS NULL OR tc.`user_id`=?) '; + $gateSelect .= ' ,ls.`security_id`, ls.`security_description`, ls.`is_private`, ls.`is_hidden`, ls.`access_question`, ls.`access_answer` '; + $gateFrom .= " LEFT OUTER JOIN `".BIT_DB_PREFIX."gatekeeper_security_map` cg ON (lc.`content_id`=cg.`content_id`) LEFT OUTER JOIN `".BIT_DB_PREFIX."gatekeeper_security` ls ON (ls.`security_id`=cg.`security_id` )"; + $mid .= ' AND (cg.`security_id` IS NULL OR lc.`user_id`=?) '; $bindVars[] = $gBitUser->mUserId; if( $gBitSystem->isPackageActive( 'fisheye' ) ) { // This is really ugly to have in here, and really would be better off somewhere else. @@ -1011,9 +1011,9 @@ class LibertyContent extends LibertyBase { // this is the only place it can go to properly enforce gatekeeper protections. Hopefully a new content generic // solution will be available in ReleaseTwo - spiderr if( $this->mDb->isAdvancedPostgresEnabled() ) { -// $gateFrom .= " LEFT OUTER JOIN `".BIT_DB_PREFIX."fisheye_gallery_image_map` fgim ON (fgim.`item_content_id`=tc.`content_id`)"; - $mid .= " AND (SELECT ts.`security_id` FROM connectby('fisheye_gallery_image_map', 'gallery_content_id', 'item_content_id', tc.`content_id`, 0, '/') AS t(`cb_gallery_content_id` int, `cb_item_content_id` int, level int, branch text), `".BIT_DB_PREFIX."gatekeeper_security_map` cgm, `".BIT_DB_PREFIX."gatekeeper_security` ts - WHERE ts.`security_id`=cgm.`security_id` AND cgm.`content_id`=`cb_gallery_content_id` LIMIT 1) IS NULL"; +// $gateFrom .= " LEFT OUTER JOIN `".BIT_DB_PREFIX."fisheye_gallery_image_map` fgim ON (fgim.`item_content_id`=lc.`content_id`)"; + $mid .= " AND (SELECT ls.`security_id` FROM connectby('fisheye_gallery_image_map', 'gallery_content_id', 'item_content_id', lc.`content_id`, 0, '/') AS t(`cb_gallery_content_id` int, `cb_item_content_id` int, level int, branch text), `".BIT_DB_PREFIX."gatekeeper_security_map` cgm, `".BIT_DB_PREFIX."gatekeeper_security` ls + WHERE ls.`security_id`=cgm.`security_id` AND cgm.`content_id`=`cb_gallery_content_id` LIMIT 1) IS NULL"; } } } @@ -1030,7 +1030,7 @@ class LibertyContent extends LibertyBase { ))) { $orderTable = ''; } else { - $orderTable = 'tc.'; + $orderTable = 'lc.'; } @@ -1045,23 +1045,23 @@ class LibertyContent extends LibertyBase { uuc.`login` AS`creator_user`, uuc.`real_name` AS `creator_real_name`, uuc.`user_id` AS `creator_user_id`, - tc.`hits`, - tc.`last_hit`, - tc.`event_time`, - tc.`title`, - tc.`last_modified`, - tc.`content_type_guid`, - tc.`ip`, - tc.`created`, - tc.`content_id` + lc.`hits`, + lc.`last_hit`, + lc.`event_time`, + lc.`title`, + lc.`last_modified`, + lc.`content_type_guid`, + lc.`ip`, + lc.`created`, + lc.`content_id` $select $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 + FROM `".BIT_DB_PREFIX."liberty_content` lc $gateFrom, `".BIT_DB_PREFIX."users_users` uue, `".BIT_DB_PREFIX."users_users` uuc + WHERE lc.`modifier_user_id`=uue.`user_id` AND lc.`user_id`=uuc.`user_id` $mid ORDER BY ".$orderTable.$this->mDb->convert_sortmode($pListHash['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"; + $query_cant = "select count(lc.`content_id`) FROM `".BIT_DB_PREFIX."liberty_content` lc $gateFrom, `".BIT_DB_PREFIX."users_users` uu WHERE uu.`user_id`=lc.`user_id` $mid"; // previous cant query - updated by xing - // $query_cant = "select count(*) from `".BIT_DB_PREFIX."wiki_pages` tp INNER JOIN `".BIT_DB_PREFIX."tiki_content` tc ON (tc.`content_id` = tp.`content_id`) $mid"; + // $query_cant = "select count(*) from `".BIT_DB_PREFIX."wiki_pages` tp INNER JOIN `".BIT_DB_PREFIX."liberty_content` lc ON (lc.`content_id` = tp.`content_id`) $mid"; $result = $this->mDb->query($query,$bindVars,$pListHash['max_records'],$pListHash['offset']); $cant = $this->mDb->getOne($query_cant,$bindVars); $ret = array(); @@ -1141,11 +1141,11 @@ class LibertyContent extends LibertyBase { if( $this->isValid() ) { $ret = array(); $structures_added = array(); - $query = 'SELECT ts.*, tc.`title`, tcr.`title` AS `root_title` - FROM `'.BIT_DB_PREFIX.'tiki_content` tc, `'.BIT_DB_PREFIX.'tiki_structures` ts - 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`=?'; + $query = 'SELECT ls.*, lc.`title`, tcr.`title` AS `root_title` + FROM `'.BIT_DB_PREFIX.'liberty_content` lc, `'.BIT_DB_PREFIX.'liberty_structures` ls + INNER JOIN `'.BIT_DB_PREFIX.'liberty_structures` tsr ON( tsr.`structure_id`=ls.`root_structure_id` ) + INNER JOIN `'.BIT_DB_PREFIX.'liberty_content` tcr ON( tsr.`content_id`=tcr.`content_id` ) + WHERE lc.`content_id`=ls.`content_id` AND ls.`content_id`=?'; if( $result = $this->mDb->query( $query,array( $this->mContentId ) ) ) { while ($res = $result->fetchRow()) { $ret[] = $res; @@ -1263,7 +1263,7 @@ class LibertyContent extends LibertyBase { * @todo LEGACY FUNCTIONS that need to be cleaned / moved / or deprecated & deleted */ function isCached($url) { - $query = "select `cache_id` from `".BIT_DB_PREFIX."tiki_link_cache` where `url`=?"; + $query = "select `cache_id` from `".BIT_DB_PREFIX."liberty_link_cache` where `url`=?"; // sometimes we can have a cache_id of 0(?!) - seen it with my own eyes, spiderr $ret = $this->mDb->getOne($query, array( $url ) ); return $ret; @@ -1301,7 +1301,7 @@ class LibertyContent extends LibertyBase { if (!$this->isCached( $url ) && $data) { global $gBitSystem; $refresh = $gBitSystem->getUTCTime(); - $query = "insert into `".BIT_DB_PREFIX."tiki_link_cache`(`url`,`data`,`refresh`) values(?,?,?)"; + $query = "insert into `".BIT_DB_PREFIX."liberty_link_cache`(`url`,`data`,`refresh`) values(?,?,?)"; $result = $this->mDb->query($query, array($url,BitDb::db_byte_encode($data),$refresh) ); return !isset($error); } @@ -1331,10 +1331,10 @@ class LibertyContent extends LibertyBase { $bindVars = array( $this->mContentId ); if( $pStructureId ) { array_push( $bindVars, $pStructureId ); - $whereSql = ' AND ts.`root_structure_id`=? '; + $whereSql = ' AND ls.`root_structure_id`=? '; } - $query = "SELECT `structure_id` FROM `".BIT_DB_PREFIX."tiki_structures` ts - WHERE ts.`content_id`=? $whereSql"; + $query = "SELECT `structure_id` FROM `".BIT_DB_PREFIX."liberty_structures` ls + WHERE ls.`content_id`=? $whereSql"; $cant = $this->mDb->getOne( $query, $bindVars ); return $cant; } diff --git a/LibertyStructure.php b/LibertyStructure.php index 3d8de48..c5b757a 100755 --- a/LibertyStructure.php +++ b/LibertyStructure.php @@ -3,7 +3,7 @@ * Management of Liberty Content * * @package liberty - * @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertyStructure.php,v 1.18 2006/01/31 20:18:26 bitweaver Exp $ + * @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertyStructure.php,v 1.19 2006/02/01 18:42:13 squareing Exp $ * @author spider <spider@steelsun.com> */ @@ -43,16 +43,16 @@ class LibertyStructure extends LibertyBase { global $gLibertySystem, $gBitSystem; $contentTypes = $gLibertySystem->mContentTypes; $ret = NULL; - $query = 'SELECT ts.*, tc.`user_id`, tc.`title`, tc.`content_type_guid`, uu.`login`, uu.`real_name` - FROM `'.BIT_DB_PREFIX.'tiki_structures` ts - INNER JOIN `'.BIT_DB_PREFIX.'tiki_content` tc ON (ts.`content_id`=tc.`content_id`) - LEFT JOIN `'.BIT_DB_PREFIX.'users_users` uu ON ( uu.`user_id` = tc.`user_id` )'; + $query = 'SELECT ls.*, lc.`user_id`, lc.`title`, lc.`content_type_guid`, uu.`login`, uu.`real_name` + FROM `'.BIT_DB_PREFIX.'liberty_structures` ls + INNER JOIN `'.BIT_DB_PREFIX.'liberty_content` lc ON (ls.`content_id`=lc.`content_id`) + LEFT JOIN `'.BIT_DB_PREFIX.'users_users` uu ON ( uu.`user_id` = lc.`user_id` )'; if( @$this->verifyId( $pStructureId ) ) { - $query .= ' WHERE ts.`structure_id`=?'; + $query .= ' WHERE ls.`structure_id`=?'; $bindVars = array( $pStructureId ); } elseif( @$this->verifyId( $pContentId ) ) { - $query .= ' WHERE ts.`content_id`=?'; + $query .= ' WHERE ls.`content_id`=?'; $bindVars = array( $pContentId ); } @@ -93,7 +93,7 @@ class LibertyStructure extends LibertyBase { // This is a utility function mainly used for upgrading sites. function setTreeRoot( $pRootId, $pTree ) { foreach( $pTree as $structRow ) { - $this->mDb->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."liberty_structures` SET `root_structure_id`=? WHERE `structure_id`=?", array( $pRootId, $structRow["structure_id"] ) ); if( !empty( $structRow["sub"] ) ) { $this->setTreeRoot( $pRootId, $structRow["sub"] ); } @@ -159,11 +159,11 @@ class LibertyStructure extends LibertyBase { if( @BitBase::verifyId( $pRootStructureId ) ) { // Get all nodes for this structure - $query = "SELECT ts.*, tc.`user_id`, tc.`title`, tc.`content_type_guid`, uu.`login`, uu.`real_name` - 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 ( uu.`user_id` = tc.`user_id` ) - WHERE ts.`root_structure_id` = ? ORDER BY `pos` ASC"; + $query = "SELECT ls.*, lc.`user_id`, lc.`title`, lc.`content_type_guid`, uu.`login`, uu.`real_name` + FROM `".BIT_DB_PREFIX."liberty_structures` ls + INNER JOIN `".BIT_DB_PREFIX."liberty_content` lc ON ( ls.`content_id` = lc.`content_id` ) + INNER JOIN `".BIT_DB_PREFIX."users_users` uu ON ( uu.`user_id` = lc.`user_id` ) + WHERE ls.`root_structure_id` = ? ORDER BY `pos` ASC"; $result = $this->mDb->query( $query, array( $pRootStructureId ) ); $subs = array(); @@ -266,7 +266,7 @@ class LibertyStructure extends LibertyBase { global $gLibertySystem, $gBitSystem; $ret = array(); if( @BitBase::verifyId( $pStructureId ) ) { - $query = "SELECT ts.`root_structure_id` FROM `".BIT_DB_PREFIX."tiki_structures` ts WHERE ts.`structure_id` = ?"; + $query = "SELECT ls.`root_structure_id` FROM `".BIT_DB_PREFIX."liberty_structures` ls WHERE ls.`structure_id` = ?"; $root_structure_id = $this->mDb->getOne( $query, array( $pStructureId ) ); $pStructureHash = $this->getStructure( $root_structure_id ); $ret = $this->createSubTree( $pStructureHash, ( ( $pRootTree ) ? $root_structure_id : $pStructureId ) ); @@ -281,7 +281,7 @@ class LibertyStructure extends LibertyBase { if( !empty( $pListHash['find'] ) ) { $findesc = '%' . $pListHash['find'] . '%'; - $mid = " (`parent_id` is null or `parent_id`=0) and (tc.`title` like ?)"; + $mid = " (`parent_id` is null or `parent_id`=0) and (lc.`title` like ?)"; $bindVars=array($findesc); } else { $mid = " (`parent_id` is null or `parent_id`=0) "; @@ -289,20 +289,20 @@ class LibertyStructure extends LibertyBase { } if( @$this->verifyId( $pListHash['user_id'] ) ) { - $mid .= " AND tc.`user_id` = ? "; + $mid .= " AND lc.`user_id` = ? "; array_push( $bindVars, $pListHash['user_id'] ); } if( !empty( $pListHash['content_type_guid'] ) ) { - $mid .= " AND tc.`content_type_guid`=? "; + $mid .= " AND lc.`content_type_guid`=? "; array_push( $bindVars, $pListHash['content_type_guid'] ); } - $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` ) + $query = "SELECT ls.`structure_id`, ls.`parent_id`, ls.`content_id`, `page_alias`, `pos`, lc.`title`, `hits`, `data`, `last_modified`, lc.`modifier_user_id`, `ip`, lc.`user_id` AS `creator_user_id`, uu.`login` AS `user`, uu.`real_name` , uu.`email` + FROM `".BIT_DB_PREFIX."liberty_structures` ls INNER JOIN `".BIT_DB_PREFIX."liberty_content` lc ON ( ls.`content_id` = lc.`content_id` ) INNER JOIN `".BIT_DB_PREFIX."users_users` uu ON ( lc.`user_id` = uu.`user_id` ) WHERE $mid 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` ) + FROM `".BIT_DB_PREFIX."liberty_structures` ls INNER JOIN `".BIT_DB_PREFIX."liberty_content` lc ON ( ls.`content_id` = lc.`content_id` ) WHERE $mid"; $result = $this->mDb->query($query,$bindVars,$pListHash['max_records'],$pListHash['offset']); $cant = $this->mDb->getOne($query_cant,$bindVars); @@ -339,14 +339,14 @@ class LibertyStructure extends LibertyBase { $pParamHash['alias'] = ''; } if( isset( $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'])); + $pParamHash['max'] = $this->mDb->getOne("select `pos` from `".BIT_DB_PREFIX."liberty_structures` where `structure_id`=?",array((int)$pParamHash['after_ref_id'])); } else { - $pParamHash['max'] = $this->mDb->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."liberty_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`=?"; + $query = "update `".BIT_DB_PREFIX."liberty_structures` set `pos`=`pos`+1 where `pos`>? and `parent_id`=?"; $result = $this->mDb->query($query,array((int)$pParamHash['max'], (int)$pParamHash['parent_id'])); } $pParamHash['max']++; @@ -401,12 +401,12 @@ class LibertyStructure extends LibertyBase { function storeStructure( $pParamHash ) { if( $this->verifyStructure( $pParamHash ) ) { // now that the structure is ready to be stored, we remove the old structure first and then insert the new one. - $query = "DELETE FROM `".BIT_DB_PREFIX."tiki_structures` WHERE `root_structure_id`=? AND `structure_id`<>?"; + $query = "DELETE FROM `".BIT_DB_PREFIX."liberty_structures` WHERE `root_structure_id`=? AND `structure_id`<>?"; $result = $this->mDb->query( $query, array( (int)$pParamHash['root_structure_id'], (int)$pParamHash['root_structure_id'] ) ); $query = ""; $this->mDb->StartTrans(); foreach( $pParamHash['structure_store'] as $node ) { - $this->mDb->associateInsert( BIT_DB_PREFIX."tiki_structures", $node ); + $this->mDb->associateInsert( BIT_DB_PREFIX."liberty_structures", $node ); } $this->mDb->CompleteTrans(); } @@ -473,7 +473,7 @@ class LibertyStructure extends LibertyBase { if( !@$this->verifyId( $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(?,?,?,?,?,?)"; + $query = "INSERT INTO `".BIT_DB_PREFIX."liberty_structures`( `structure_id`, `parent_id`,`content_id`, `root_structure_id`, `page_alias`, `pos` ) values(?,?,?,?,?,?)"; $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']; @@ -491,10 +491,10 @@ class LibertyStructure extends LibertyBase { $parentNode = $this->getNode( $this->mInfo["parent_id"] ); if( @$this->verifyId( $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`=?"; + $query = "update `".BIT_DB_PREFIX."liberty_structures` set `pos`=`pos`+1 where `pos`>? and `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`=?"; + $query = "update `".BIT_DB_PREFIX."liberty_structures` set `parent_id`=?, `pos`=(? + 1) where `structure_id`=?"; $this->mDb->query($query, array( $parentNode['parent_id'], $parentNode['pos'], $this->mStructureId ) ); } } @@ -505,21 +505,21 @@ class LibertyStructure extends LibertyBase { function moveNodeEast() { 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"; + $query = "select `structure_id`, `pos` from `".BIT_DB_PREFIX."liberty_structures` where `pos`<? and `parent_id`=? order by `pos` desc"; $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"; + $query = "select `pos` from `".BIT_DB_PREFIX."liberty_structures` where `parent_id`=? order by `pos` desc"; $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`=?"; + $query = "update `".BIT_DB_PREFIX."liberty_structures` set `parent_id`=?, `pos`=(? + 1) where `structure_id`=?"; $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`=?"; + $query = "update `".BIT_DB_PREFIX."liberty_structures` set `pos`=`pos`-1 where `pos`>? and `parent_id`=?"; $this->mDb->query( $query, array( $this->mInfo['pos'], $this->mInfo['parent_id'] ) ); } $this->mDb->CompleteTrans(); @@ -529,12 +529,12 @@ class LibertyStructure extends LibertyBase { function moveNodeSouth() { 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"; + $query = "select `structure_id`, `pos` from `".BIT_DB_PREFIX."liberty_structures` where `pos`>? and `parent_id`=? order by `pos` asc"; $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`=?"; + $query = "update `".BIT_DB_PREFIX."liberty_structures` set `pos`=? where `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"]) ); } @@ -545,12 +545,12 @@ class LibertyStructure extends LibertyBase { function moveNodeNorth() { 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"; + $query = "select `structure_id`, `pos` from `".BIT_DB_PREFIX."liberty_structures` where `pos`<? and `parent_id`=? order by `pos` desc"; $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`=?"; + $query = "update `".BIT_DB_PREFIX."liberty_structures` set `pos`=? where `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"]) ); } @@ -630,7 +630,7 @@ class LibertyStructure extends LibertyBase { // Now recursively remove if( @$this->verifyId( $structure_id ) ) { $query = "SELECT * - FROM `".BIT_DB_PREFIX."tiki_structures` + FROM `".BIT_DB_PREFIX."liberty_structures` WHERE `parent_id`=?"; $result = $this->mDb->query( $query, array( (int)$structure_id ) ); // Iterate down through the child nodes @@ -641,23 +641,23 @@ class LibertyStructure extends LibertyBase { // Only delete a page if other structures arent referencing it if( $delete ) { $page_info = $this->getNode( $structure_id ); - $query = "SELECT COUNT(*) FROM `".BIT_DB_PREFIX."tiki_structures` WHERE `content_id`=?"; + $query = "SELECT COUNT(*) FROM `".BIT_DB_PREFIX."liberty_structures` WHERE `content_id`=?"; $count = $this->mDb->getOne( $query, array( (int)$page_info["page_id"] ) ); if( $count = 1 ) { $this->remove_all_versions( $page_info["page_id"] ); } } - // If we are removing the root node, remove the entry in tiki_content as well + // If we are removing the root node, remove the entry in liberty_content as well $query = "SELECT `content_id` - FROM `".BIT_DB_PREFIX."tiki_structures` + FROM `".BIT_DB_PREFIX."liberty_structures` WHERE `structure_id`=? AND `structure_id`=`root_structure_id`"; $content_id = $this->mDb->getOne( $query, array( (int)$structure_id ) ); - $query = "DELETE FROM `".BIT_DB_PREFIX."tiki_content` WHERE `content_id`=?"; + $query = "DELETE FROM `".BIT_DB_PREFIX."liberty_content` WHERE `content_id`=?"; $result = $this->mDb->query( $query, array( (int)$content_id) ); // Remove the structure node - $query = "DELETE FROM `".BIT_DB_PREFIX."tiki_structures` WHERE `structure_id`=?"; + $query = "DELETE FROM `".BIT_DB_PREFIX."liberty_structures` WHERE `structure_id`=?"; $result = $this->mDb->query( $query, array( (int)$structure_id) ); return true; } @@ -667,15 +667,15 @@ class LibertyStructure extends LibertyBase { function remove_from_structure($structure_id) { // Now recursively remove $query = "select `structure_id` "; - $query .= "from `".BIT_DB_PREFIX."tiki_structures` as ts, `".BIT_DB_PREFIX."wiki_pages` as tp "; - $query .= "where tp.`content_id`=ts.`content_id` and `parent_id`=?"; + $query .= "from `".BIT_DB_PREFIX."liberty_structures` as ls, `".BIT_DB_PREFIX."wiki_pages` as tp "; + $query .= "where tp.`content_id`=ls.`content_id` and `parent_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`=?"; + $query = "delete from `".BIT_DB_PREFIX."liberty_structures` where `structure_id`=?"; $result = $this->mDb->query($query, array( $structure_id ) ); return true; } @@ -687,7 +687,7 @@ class LibertyStructure extends LibertyBase { */ function s_get_parent_info($structure_id) { // Try to get the parent of this page - $parent_id = $this->mDb->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."liberty_structures` where `structure_id`=?",array((int)$structure_id)); if (!$parent_id) return null; @@ -698,7 +698,7 @@ class LibertyStructure extends LibertyBase { function getContentIds( $pStructureId, &$pToc, $pLevel=0 ) { $ret = array(); - $query = "SELECT * from `".BIT_DB_PREFIX."tiki_structures` where `parent_id`=? ORDER BY pos, page_alias, content_id"; + $query = "SELECT * from `".BIT_DB_PREFIX."liberty_structures` where `parent_id`=? ORDER BY pos, page_alias, content_id"; $result = $this->mDb->query( $query, array( (int)$pStructureId ) ); while ( $row = $result->fetchRow() ) { array_push( $pToc, $row['content_id'] ); @@ -707,7 +707,7 @@ class LibertyStructure extends LibertyBase { } function getContentArray( $pStructureId, &$pToc, $pLevel=0 ) { - $query = "SELECT * from `".BIT_DB_PREFIX."tiki_structures` where `structure_id`=?"; + $query = "SELECT * from `".BIT_DB_PREFIX."liberty_structures` where `structure_id`=?"; $result = $this->mDb->query( $query, array( (int)$pStructureId ) ); while ( $row = $result->fetchRow() ) { array_push( $pToc, $row['content_id'] ); @@ -739,11 +739,11 @@ class LibertyStructure extends LibertyBase { function build_subtree_toc($id,$slide=false,$order='asc',$tocPrefix='') { global $gLibertySystem, $gBitSystem; $back = array(); - $cant = $this->mDb->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."liberty_structures` where `parent_id`=?",array((int)$id)); if ($cant) { - $query = "SELECT `structure_id`, `page_alias`, tc.`user_id`, tc.`title`, tc.`content_type_guid`, uu.`login`, uu.`real_name` - FROM `".BIT_DB_PREFIX."tiki_structures` ts INNER JOIN `".BIT_DB_PREFIX."tiki_content` tc ON ( tc.`content_id`=ts.`content_id` ) - LEFT JOIN `".BIT_DB_PREFIX."users_users` uu ON ( uu.`user_id` = tc.`user_id` ) + $query = "SELECT `structure_id`, `page_alias`, lc.`user_id`, lc.`title`, lc.`content_type_guid`, uu.`login`, uu.`real_name` + FROM `".BIT_DB_PREFIX."liberty_structures` ls INNER JOIN `".BIT_DB_PREFIX."liberty_content` lc ON ( lc.`content_id`=ls.`content_id` ) + LEFT JOIN `".BIT_DB_PREFIX."users_users` uu ON ( uu.`user_id` = lc.`user_id` ) WHERE `parent_id`=? ORDER BY ".$this->mDb->convert_sortmode("pos_".$order); $result = $this->mDb->query($query,array((int)$id)); @@ -812,8 +812,8 @@ class LibertyStructure extends LibertyBase { //Is this page the head page for a structure? function get_struct_ref_if_head($title) { $query = "SELECT `structure_id` - FROM `".BIT_DB_PREFIX."tiki_structures` ts, `".BIT_DB_PREFIX."wiki_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`=?"; + FROM `".BIT_DB_PREFIX."liberty_structures` ls, `".BIT_DB_PREFIX."wiki_pages` tp,`".BIT_DB_PREFIX."liberty_content` lc + WHERE tp.`content_id`=ls.`content_id` AND lc.`content_id` = tp.`content_id` AND (`parent_id` is null or `parent_id`=0) and lc.`title`=?"; $structure_id = $this->mDb->getOne($query,array($title)); return $structure_id; } @@ -822,7 +822,7 @@ class LibertyStructure extends LibertyBase { // If we have children then get the first child if ($deep) { $query = "SELECT `structure_id` - FROM `".BIT_DB_PREFIX."tiki_structures` ts + FROM `".BIT_DB_PREFIX."liberty_structures` ls WHERE `parent_id`=? ORDER BY ".$this->mDb->convert_sortmode("pos_asc"); $result1 = $this->mDb->query($query,array((int)$structure_id)); @@ -842,7 +842,7 @@ class LibertyStructure extends LibertyBase { return null; $query = "SELECT `structure_id` - FROM `".BIT_DB_PREFIX."tiki_structures` ts + FROM `".BIT_DB_PREFIX."liberty_structures` ls WHERE `parent_id`=? and `pos`>? ORDER BY ".$this->mDb->convert_sortmode("pos_asc"); $result2 = $this->mDb->query($query,array((int)$parent_id, (int)$page_pos)); @@ -861,7 +861,7 @@ class LibertyStructure extends LibertyBase { //Drill down to last child for this tree node if ($deep) { $query = "select `structure_id` "; - $query .= "from `".BIT_DB_PREFIX."tiki_structures` ts "; + $query .= "from `".BIT_DB_PREFIX."liberty_structures` ls "; $query .= "where `parent_id`=? "; $query .= "order by ".$this->mDb->convert_sortmode("pos_desc"); $result = $this->mDb->query($query,array($structure_id)); @@ -883,7 +883,7 @@ class LibertyStructure extends LibertyBase { return null; $query = "select `structure_id` "; - $query .= "from `".BIT_DB_PREFIX."tiki_structures` ts "; + $query .= "from `".BIT_DB_PREFIX."liberty_structures` ls "; $query .= "where `parent_id`=? and `pos`<? "; $query .= "order by ".$this->mDb->convert_sortmode("pos_desc"); $result = $this->mDb->query($query,array((int)$parent_id, (int)$pos)); @@ -905,9 +905,9 @@ class LibertyStructure extends LibertyBase { */ function s_get_pages($parent_id) { $ret = array(); - $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 = "SELECT `pos`, `structure_id`, `parent_id`, ls.`content_id`, lc.`title`, `page_alias` + FROM `".BIT_DB_PREFIX."liberty_structures` ls, `".BIT_DB_PREFIX."liberty_content` lc + WHERE ls.`content_id` = lc.`content_id` AND `parent_id`=? "; $query .= "order by ".$this->mDb->convert_sortmode("pos_asc"); $result = $this->mDb->query($query,array((int)$parent_id)); while ($res = $result->fetchRow()) { @@ -919,7 +919,7 @@ class LibertyStructure extends LibertyBase { function get_max_children($structure_id) { - $query = "select `structure_id` from `".BIT_DB_PREFIX."tiki_structures` where `parent_id`=?"; + $query = "select `structure_id` from `".BIT_DB_PREFIX."liberty_structures` where `parent_id`=?"; $result = $this->mDb->query($query,array((int)$structure_id)); if (!$result->numRows()) { return ''; @@ -956,9 +956,9 @@ class LibertyStructure extends LibertyBase { */ function _s_get_structure_pages($structure_id) { $ret = array(); - $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`=? + $query = "select `pos`, `structure_id`, `parent_id`, ls.`content_id`, lc.`title`, `page_alias` + FROM `".BIT_DB_PREFIX."liberty_structures` ls, `".BIT_DB_PREFIX."liberty_content` lc + WHERE lc.`content_id` = tp.`content_id` AND tp.`content_id`=ls.`content_id` AND `parent_id`=? ORDER by ".$this->mDb->convert_sortmode("pos_asc"); $result = $this->mDb->query($query,array((int)$structure_id)); @@ -971,13 +971,13 @@ class LibertyStructure extends LibertyBase { } function get_page_alias($structure_id) { - $query = "select `page_alias` from `".BIT_DB_PREFIX."tiki_structures` where `structure_id`=?"; + $query = "select `page_alias` from `".BIT_DB_PREFIX."liberty_structures` where `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`=?"; + $query = "update `".BIT_DB_PREFIX."liberty_structures` set `page_alias`=? where `structure_id`=?"; $this->mDb->query($query, array($pageAlias, (int)$structure_id)); } @@ -1016,8 +1016,8 @@ class LibertyStructure extends LibertyBase { foreach($pages as $page) { $query = "SELECT * - FROM `".BIT_DB_PREFIX."wiki_pages` tp, `".BIT_DB_PREFIX."tiki_content` tc - WHERE tc.`content_id` = tp.`content_id` AND tc.`title`=?"; + FROM `".BIT_DB_PREFIX."wiki_pages` tp, `".BIT_DB_PREFIX."liberty_content` lc + WHERE lc.`content_id` = tp.`content_id` AND lc.`title`=?"; $result = $this->mDb->query($query,array($page)); $res = $result->fetchRow(); $docs[] = $res["title"]; @@ -1068,14 +1068,14 @@ class LibertyStructure extends LibertyBase { } function structure_to_tree($structure_id) { - $query = "select * from `".BIT_DB_PREFIX."tiki_structures` ts,`".BIT_DB_PREFIX."wiki_pages` tp where tp.`content_id`=ts.`content_id` and `structure_id`=?"; + $query = "select * from `".BIT_DB_PREFIX."liberty_structures` ls,`".BIT_DB_PREFIX."wiki_pages` tp where tp.`content_id`=ls.`content_id` and `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."wiki_pages` tp where tp.`content_id`=ts.`content_id` and `parent_id`=?"; + $query = "select * from `".BIT_DB_PREFIX."liberty_structures` ls, `".BIT_DB_PREFIX."wiki_pages` tp where tp.`content_id`=ls.`content_id` and `parent_id`=?"; $result = $this->mDb->query($query,array((int)$structure_id)); if($result->numRows()) { $code.="Array("; diff --git a/LibertySystem.php b/LibertySystem.php index 45a4899..6f83ace 100755 --- a/LibertySystem.php +++ b/LibertySystem.php @@ -3,7 +3,7 @@ * System class for handling the liberty package * * @package liberty -* @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertySystem.php,v 1.12 2006/01/25 15:40:25 spiderr Exp $ +* @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertySystem.php,v 1.13 2006/02/01 18:42:13 squareing Exp $ * @author spider <spider@steelsun.com> */ @@ -61,7 +61,7 @@ class LibertySystem extends LibertyBase { } function loadPlugins() { - if( $rs = $this->mDb->query( "SELECT * FROM `".BIT_DB_PREFIX."tiki_plugins`", NULL, BIT_QUERY_DEFAULT, BIT_QUERY_DEFAULT ) ) { + if( $rs = $this->mDb->query( "SELECT * FROM `".BIT_DB_PREFIX."liberty_plugins`", NULL, BIT_QUERY_DEFAULT, BIT_QUERY_DEFAULT ) ) { while( $row = $rs->fetchRow() ) { $this->mPlugins[$row['plugin_guid']] = $row; } @@ -83,18 +83,18 @@ class LibertySystem extends LibertyBase { $handler = &$this->mPlugins[$guid]; //shorthand var alias 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`=?"; + $sql = "UPDATE `".BIT_DB_PREFIX."liberty_plugins` SET `is_active`='x' WHERE `plugin_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`=?"; + $sql = "UPDATE `".BIT_DB_PREFIX."liberty_plugins` SET `is_active`='y' WHERE `plugin_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 ( ?, ?, ?, ? )"; + $sql = "INSERT INTO `".BIT_DB_PREFIX."liberty_plugins` ( `plugin_guid`, `plugin_type`, `plugin_description`, `is_active` ) VALUES ( ?, ?, ?, ? )"; $this->mDb->query( $sql, array( $guid, $handler['plugin_type'], $handler['description'], $handler['is_active'] ) ); } } @@ -102,7 +102,7 @@ class LibertySystem extends LibertyBase { } function loadContentTypes( $pCacheTime=BIT_QUERY_CACHE_TIME ) { - if( $rs = $this->mDb->query( "SELECT * FROM `".BIT_DB_PREFIX."tiki_content_types`", NULL, BIT_QUERY_DEFAULT, BIT_QUERY_DEFAULT ) ) { + if( $rs = $this->mDb->query( "SELECT * FROM `".BIT_DB_PREFIX."liberty_content_types`", NULL, BIT_QUERY_DEFAULT, BIT_QUERY_DEFAULT ) ) { while( $row = $rs->fetchRow() ) { $this->mContentTypes[$row['content_type_guid']] = $row; } @@ -115,12 +115,12 @@ class LibertySystem extends LibertyBase { } $pTypeParams['content_type_guid'] = $pGuid; if( empty( $this->mContentTypes[$pGuid] ) && !empty( $pTypeParams ) ) { - $result = $this->mDb->associateInsert( BIT_DB_PREFIX."tiki_content_types", $pTypeParams ); + $result = $this->mDb->associateInsert( BIT_DB_PREFIX."liberty_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->mDb->associateUpdate( BIT_DB_PREFIX."tiki_content_types", $pTypeParams, array( 'name'=>'content_type_guid', 'value'=>$pGuid ) ); + $result = $this->mDb->associateUpdate( BIT_DB_PREFIX."liberty_content_types", $pTypeParams, array( 'name'=>'content_type_guid', 'value'=>$pGuid ) ); } } } @@ -176,14 +176,14 @@ class LibertySystem extends LibertyBase { // @parameter pPluginGuids an array of all the plugin guids that are active. Any left out are *inactive*! function setActivePlugins( $pPluginGuids ) { if( is_array( $pPluginGuids ) ) { - $sql = "UPDATE `".BIT_DB_PREFIX."tiki_plugins` SET `is_active`='n' WHERE `is_active`!='x'"; + $sql = "UPDATE `".BIT_DB_PREFIX."liberty_plugins` SET `is_active`='n' WHERE `is_active`!='x'"; $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`=?"; + $sql = "UPDATE `".BIT_DB_PREFIX."liberty_plugins` SET `is_active`='y' WHERE `plugin_guid`=?"; $this->mDb->query( $sql, array( $guid ) ); $this->mPlugins[$guid]['is_active'] = 'y'; } diff --git a/admin/schema_inc.php b/admin/schema_inc.php index d39f3f4..b16e4ae 100644 --- a/admin/schema_inc.php +++ b/admin/schema_inc.php @@ -3,7 +3,7 @@ // Common Content tables $tables = array( -'tiki_plugins' => " +'liberty_plugins' => " plugin_guid C(16) PRIMARY, plugin_type C(16) NOTNULL, is_active C(1) NOTNULL DEFAULT 'y', @@ -11,7 +11,7 @@ $tables = array( maintainer_url C(250) ", -'tiki_content_types' => " +'liberty_content_types' => " content_type_guid C(16) PRIMARY, content_description C(250) NOTNULL, maintainer_url C(250), @@ -20,7 +20,7 @@ $tables = array( handler_file C(128) ", -'tiki_content' => " +'liberty_content' => " content_id I4 PRIMARY, user_id I4 NOTNULL, modifier_user_id I4 NOTNULL, @@ -35,33 +35,33 @@ $tables = array( title C(160), ip C(39), data X - CONSTRAINTS ', CONSTRAINT `tiki_content_type_ref` FOREIGN KEY (`content_type_guid`) REFERENCES `".BIT_DB_PREFIX."tiki_content_types`( `content_type_guid` ) - , CONSTRAINT `tiki_content_guid_ref` FOREIGN KEY (`format_guid`) REFERENCES `".BIT_DB_PREFIX."tiki_plugins`( `plugin_guid` )' + CONSTRAINTS ', CONSTRAINT `liberty_content_type_ref` FOREIGN KEY (`content_type_guid`) REFERENCES `".BIT_DB_PREFIX."liberty_content_types`( `content_type_guid` ) + , CONSTRAINT `liberty_content_guid_ref` FOREIGN KEY (`format_guid`) REFERENCES `".BIT_DB_PREFIX."liberty_plugins`( `plugin_guid` )' ", 'liberty_content_prefs' => " content_id I4 PRIMARY, name C(40) PRIMARY, value C(250) - CONSTRAINTS ', CONSTRAINT `lib_content_prefs_content_ref` FOREIGN KEY (`content_id`) REFERENCES `".BIT_DB_PREFIX."tiki_content` (`content_id`)' + CONSTRAINTS ', CONSTRAINT `lib_content_prefs_content_ref` FOREIGN KEY (`content_id`) REFERENCES `".BIT_DB_PREFIX."liberty_content` (`content_id`)' ", -'tiki_comments' => " +'liberty_comments' => " comment_id I4 PRIMARY, content_id I4 NOTNULL, parent_id I4 NOTNULL - CONSTRAINTS ', CONSTRAINT `tiki_comments_content_ref` FOREIGN KEY (`content_id`) REFERENCES `".BIT_DB_PREFIX."tiki_content`( `content_id` ) - , CONSTRAINT `tiki_comments_parent_ref` FOREIGN KEY (`parent_id`) REFERENCES `".BIT_DB_PREFIX."tiki_content`( `content_id` )' + CONSTRAINTS ', CONSTRAINT `liberty_comments_content_ref` FOREIGN KEY (`content_id`) REFERENCES `".BIT_DB_PREFIX."liberty_content`( `content_id` ) + , CONSTRAINT `liberty_comments_parent_ref` FOREIGN KEY (`parent_id`) REFERENCES `".BIT_DB_PREFIX."liberty_content`( `content_id` )' ", -'tiki_link_cache' => " +'liberty_link_cache' => " cache_id I4 AUTO PRIMARY, url C(250), data B, refresh I8 ", -'tiki_attachments' => " +'liberty_attachments' => " attachment_id I4 PRIMARY, attachment_plugin_guid C(16) NOTNULL, content_id I4 NOTNULL, @@ -71,20 +71,20 @@ $tables = array( hits I4, error_code I4, caption C(250) - CONSTRAINTS ', CONSTRAINT `tiki_attachment_content_ref` FOREIGN KEY (`content_id`) REFERENCES `".BIT_DB_PREFIX."tiki_content`( `content_id` ) - , CONSTRAINT `tiki_attachment_type_ref` FOREIGN KEY (`attachment_plugin_guid`) REFERENCES `".BIT_DB_PREFIX."tiki_plugins`( `plugin_guid` )' + CONSTRAINTS ', CONSTRAINT `liberty_attachment_content_ref` FOREIGN KEY (`content_id`) REFERENCES `".BIT_DB_PREFIX."liberty_content`( `content_id` ) + , CONSTRAINT `liberty_attachment_type_ref` FOREIGN KEY (`attachment_plugin_guid`) REFERENCES `".BIT_DB_PREFIX."liberty_plugins`( `plugin_guid` )' ", -'tiki_blobs' => ' - blob_id I4 PRIMARY, - user_id I4 NOTNULL, - blob_size I8 NOTNULL, - blob_name C(250) NOTNULL, - blob_data_type C(100) NOTNULL, - blob_data B NOTNULL -', +//'tiki_blobs' => ' +// blob_id I4 PRIMARY, +// user_id I4 NOTNULL, +// blob_size I8 NOTNULL, +// blob_name C(250) NOTNULL, +// blob_data_type C(100) NOTNULL, +// blob_data B NOTNULL +//', -'tiki_files' => " +'liberty_files' => " file_id I4 PRIMARY, user_id I4 NOTNULL, storage_path C(250), @@ -92,7 +92,7 @@ $tables = array( mime_type C(64) ", -'tiki_structures' => " +'liberty_structures' => " structure_id I4 AUTO PRIMARY, root_structure_id I4 NOTNULL, content_id I4 NOTNULL, @@ -100,7 +100,7 @@ $tables = array( pos I4, page_alias C(240), parent_id I4 - CONSTRAINTS ', CONSTRAINT `tiki_root_structure_id_ref` FOREIGN KEY (`root_structure_id`) REFERENCES `".BIT_DB_PREFIX."tiki_structures`( `structure_id` )' + CONSTRAINTS ', CONSTRAINT `liberty_root_structure_id_ref` FOREIGN KEY (`root_structure_id`) REFERENCES `".BIT_DB_PREFIX."liberty_structures`( `structure_id` )' " ); @@ -121,30 +121,30 @@ $gBitInstaller->registerPackageInfo( LIBERTY_PKG_NAME, array( // ### Indexes $indices = array ( - 'tiki_content_title_idx' => array( 'table' => 'tiki_content', 'cols' => 'title', 'opts' => NULL ), - 'tiki_content_user_idx' => array( 'table' => 'tiki_content', 'cols' => 'user_id', 'opts' => NULL ), - 'tiki_content_moduser_idx' => array( 'table' => 'tiki_content', 'cols' => 'modifier_user_id', 'opts' => NULL ), - 'tiki_content_hits_idx' => array( 'table' => 'tiki_content', 'cols' => 'hits', 'opts' => NULL ), - 'tiki_comments_object_idx' => array( 'table' => 'tiki_comments', 'cols' => 'content_id', 'opts' => NULL ), - 'tiki_comments_parent_idx' => array( 'table' => 'tiki_comments', 'cols' => 'parent_id', 'opts' => NULL ), - 'tiki_attachments_hits_idx' => array( 'table' => 'tiki_attachments', 'cols' => 'hits', 'opts' => NULL ), - 'tiki_attachments_user_id_idx' => array( 'table' => 'tiki_attachments', 'cols' => 'user_id', 'opts' => NULL ), - 'tiki_attachments_content_id_idx' => array( 'table' => 'tiki_attachments', 'cols' => 'content_id', 'opts' => NULL ), - 'tiki_st_co_foreign_guid_idx' => array( 'table' => 'tiki_attachments', 'cols' => 'content_id, foreign_id, attachment_plugin_guid', 'opts' => array( 'UNIQUE' ) ), - 'tiki_plugins_guid_idx' => array( 'table' => 'tiki_plugins', 'cols' => 'plugin_guid', 'opts' => array( 'UNIQUE' ) ), - 'tiki_structures_root_idx' => array( 'table' => 'tiki_structures', 'cols' => 'root_structure_id', 'opts' => NULL), - 'tiki_structures_parent_idx' => array( 'table' => 'tiki_structures', 'cols' => 'parent_id', 'opts' => NULL), - 'tiki_structures_content_idx' => array( 'table' => 'tiki_structures', 'cols' => 'content_id', 'opts' => NULL ) + 'content_title_idx' => array( 'table' => 'liberty_content', 'cols' => 'title', 'opts' => NULL ), + 'content_user_idx' => array( 'table' => 'liberty_content', 'cols' => 'user_id', 'opts' => NULL ), + 'content_moduser_idx' => array( 'table' => 'liberty_content', 'cols' => 'modifier_user_id', 'opts' => NULL ), + 'content_hits_idx' => array( 'table' => 'liberty_content', 'cols' => 'hits', 'opts' => NULL ), + 'comments_object_idx' => array( 'table' => 'liberty_comments', 'cols' => 'content_id', 'opts' => NULL ), + 'comments_parent_idx' => array( 'table' => 'liberty_comments', 'cols' => 'parent_id', 'opts' => NULL ), + 'attachments_hits_idx' => array( 'table' => 'liberty_attachments', 'cols' => 'hits', 'opts' => NULL ), + 'attachments_user_id_idx' => array( 'table' => 'liberty_attachments', 'cols' => 'user_id', 'opts' => NULL ), + 'attachments_content_id_idx' => array( 'table' => 'liberty_attachments', 'cols' => 'content_id', 'opts' => NULL ), + 'st_co_foreign_guid_idx' => array( 'table' => 'liberty_attachments', 'cols' => 'content_id, foreign_id, attachment_plugin_guid', 'opts' => array( 'UNIQUE' ) ), + 'plugins_guid_idx' => array( 'table' => 'liberty_plugins', 'cols' => 'plugin_guid', 'opts' => array( 'UNIQUE' ) ), + 'structures_root_idx' => array( 'table' => 'liberty_structures', 'cols' => 'root_structure_id', 'opts' => NULL), + 'structures_parent_idx' => array( 'table' => 'liberty_structures', 'cols' => 'parent_id', 'opts' => NULL), + 'structures_content_idx' => array( 'table' => 'liberty_structures', 'cols' => 'content_id', 'opts' => NULL ) ); $gBitInstaller->registerSchemaIndexes( LIBERTY_PKG_NAME, $indices ); // ### Sequences $sequences = array ( - 'tiki_content_id_seq' => array( 'start' => 1 ), - 'tiki_comments_comment_id_seq' => array( 'start' => 1 ), - 'tiki_files_file_id_seq' => array( 'start' => 1 ), - 'tiki_attachments_id_seq' => array( 'start' => 1 ), - 'tiki_structures_id_seq' => array( 'start' => 4 ) + 'content_id_seq' => array( 'start' => 1 ), + 'comments_comment_id_seq' => array( 'start' => 1 ), + 'files_file_id_seq' => array( 'start' => 1 ), + 'attachments_id_seq' => array( 'start' => 1 ), + 'structures_id_seq' => array( 'start' => 4 ) ); $gBitInstaller->registerSchemaSequences( LIBERTY_PKG_NAME, $sequences ); diff --git a/plugins/data.clock.php b/plugins/data.clock.php index 4835d29..5c6fd28 100644 --- a/plugins/data.clock.php +++ b/plugins/data.clock.php @@ -4,7 +4,7 @@ * assigned_modules * * @author xing - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ * @package liberty * @subpackage plugins_data * @copyright Copyright (c) 2004, bitweaver.org @@ -68,16 +68,16 @@ function data_clock( $data, $params ) { $format = '%c'; } if ($params['timestamp']) { - $ts = strtotime($params['timestamp']); + $ls = strtotime($params['timestamp']); } else { - $ts = time(); + $ls = time(); } if ($params['timezone']) { $_ENV['TZ'] = $params['timezone']; putenv("TZ=$_ENV[TZ]"); } - $result = strftime($format, $ts); + $result = strftime($format, $ls); $_ENV['TZ'] = $save_tz; putenv("TZ=$save_tz"); diff --git a/plugins/format.tikiwiki.php b/plugins/format.tikiwiki.php index d63c88f..f451821 100644 --- a/plugins/format.tikiwiki.php +++ b/plugins/format.tikiwiki.php @@ -1,6 +1,6 @@ <?php /** - * @version $Revision: 1.20 $ + * @version $Revision: 1.21 $ * @package liberty */ global $gLibertySystem; @@ -58,13 +58,13 @@ function tikiwiki_expunge( $pContentId ) { function tikiwiki_rename( $pContentId, $pOldName, $pNewName, &$pCommonObject ) { $query = "SELECT `from_content_id`, `data` FROM `".BIT_DB_PREFIX."liberty_content_links` tl - INNER JOIN `".BIT_DB_PREFIX."tiki_content` tc ON( tl.`from_content_id`=tc.`content_id` ) + INNER JOIN `".BIT_DB_PREFIX."liberty_content` lc ON( tl.`from_content_id`=lc.`content_id` ) WHERE `to_content_id` = ?"; if( $result = $pCommonObject->mDb->query($query, array( $pContentId ) ) ) { while( $row = $result->fetchRow() ) { $data = preg_replace( '/(\W|\(\()('.$pOldName.')(\W|\)\))/', '\\1'.$pNewName.'\\3', $row['data'] ); if( md5( $data ) != md5( $row['data'] ) ) { - $query = "UPDATE `".BIT_DB_PREFIX."tiki_content` SET `data`=? WHERE `content_id`=?"; + $query = "UPDATE `".BIT_DB_PREFIX."liberty_content` SET `data`=? WHERE `content_id`=?"; $pCommonObject->mDb->query($query, array( $data, $row['from_content_id'] ) ); } } @@ -156,7 +156,7 @@ class TikiWikiParser extends BitBase { foreach( $linkPages as $page ) { 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."wiki_pages` tp INNER JOIN `".BIT_DB_PREFIX."tiki_content` tc ON (tc.`content_id` = tp.`content_id`) WHERE tc.`title`=?"; + $query = "SELECT tp.`content_id` FROM `".BIT_DB_PREFIX."wiki_pages` tp INNER JOIN `".BIT_DB_PREFIX."liberty_content` lc ON (lc.`content_id` = tp.`content_id`) WHERE lc.`title`=?"; $result = $this->mDb->query( $query, array( $page ) ); if( $result->numRows() ) { $res = $result->fetchRow(); @@ -187,11 +187,11 @@ class TikiWikiParser extends BitBase { $pTitle = strtolower( $pTitle ); if( !empty( $pContentId ) ) { if( empty( $this->mPageLookup ) ) { - $query = "SELECT LOWER( tc.`title` ) AS `hash_key`, `page_id`, tc.`content_id`, `description`, tc.`last_modified`, tc.`title` + $query = "SELECT LOWER( lc.`title` ) AS `hash_key`, `page_id`, lc.`content_id`, `description`, lc.`last_modified`, lc.`title` FROM `".BIT_DB_PREFIX."liberty_content_links` tl - INNER JOIN `".BIT_DB_PREFIX."tiki_content` tc ON( tl.`to_content_id`=tc.`content_id` ) - INNER JOIN `".BIT_DB_PREFIX."wiki_pages` tp ON( tp.`content_id`=tc.`content_id` ) - WHERE tl.`from_content_id`=? ORDER BY tc.`title`"; + INNER JOIN `".BIT_DB_PREFIX."liberty_content` lc ON( tl.`to_content_id`=lc.`content_id` ) + INNER JOIN `".BIT_DB_PREFIX."wiki_pages` tp ON( tp.`content_id`=lc.`content_id` ) + WHERE tl.`from_content_id`=? ORDER BY lc.`title`"; if( $result = $this->mDb->query( $query, array( $pContentId ) ) ) { $lastTitle = ''; while( $row = $result->fetchRow() ) { @@ -218,11 +218,11 @@ class TikiWikiParser extends BitBase { global $gBitSystem; $ret = array(); if( $gBitSystem->isFeatureActive( 'wiki' ) && @BitBase::verifyId( $pContentId ) ) { - $query = "SELECT `page_id`, tc.`content_id`, `description`, tc.`last_modified`, tc.`title` + $query = "SELECT `page_id`, lc.`content_id`, `description`, lc.`last_modified`, lc.`title` FROM `".BIT_DB_PREFIX."liberty_content_links` tl - INNER JOIN `".BIT_DB_PREFIX."tiki_content` tc ON( tl.`to_content_id`=tc.`content_id` ) - INNER JOIN `".BIT_DB_PREFIX."wiki_pages` tp ON( tp.`content_id`=tc.`content_id` ) - WHERE tl.`from_content_id`=? ORDER BY tc.`title`"; + INNER JOIN `".BIT_DB_PREFIX."liberty_content` lc ON( tl.`to_content_id`=lc.`content_id` ) + INNER JOIN `".BIT_DB_PREFIX."wiki_pages` tp ON( tp.`content_id`=lc.`content_id` ) + WHERE tl.`from_content_id`=? ORDER BY lc.`title`"; if( $result = $this->mDb->query( $query, array( $pContentId ) ) ) { $lastTitle = ''; while( $row = $result->fetchRow() ) { diff --git a/plugins/storage.bitfile.php b/plugins/storage.bitfile.php index 1701cf0..7a74770 100644 --- a/plugins/storage.bitfile.php +++ b/plugins/storage.bitfile.php @@ -1,6 +1,6 @@ <?php /** - * @version $Revision: 1.10 $ + * @version $Revision: 1.11 $ * @package liberty * @subpackage plugins_storage */ @@ -44,15 +44,15 @@ function bit_files_store( &$pStoreRow ) { if( isset( $pref ) ) { 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` = ?"; + $sql = "UPDATE `".BIT_DB_PREFIX."liberty_files SET `storage_path`=?, `mime_type`=?, `size`=? WHERE `file_id` = ?"; $gBitSystem->mDb->query( $sql, array( $pStoreRow['dest_file_path'], $pStoreRow['type'], $pStoreRow['size'], $pStoreRow['foreign_id'] ) ); } else { $pStoreRow['file_id'] = $gBitSystem->mDb->GenID( 'tiki_files_file_id_seq' ); - $sql = "INSERT INTO `".BIT_DB_PREFIX."tiki_files` ( `storage_path`, `file_id`, `mime_type`, `size`, `user_id` ) VALUES ( ?, ?, ?, ?, ? )"; + $sql = "INSERT INTO `".BIT_DB_PREFIX."liberty_files` ( `storage_path`, `file_id`, `mime_type`, `size`, `user_id` ) VALUES ( ?, ?, ?, ?, ? )"; $userId = !empty( $pStoreRow['upload']['user_id'] ) ? $pStoreRow['upload']['user_id'] : $gBitUser->mUserId; $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` = ?"; + $sql = "UPDATE `".BIT_DB_PREFIX."liberty_attachments` SET `foreign_id`=? WHERE `attachment_id` = ?"; $gBitSystem->mDb->query( $sql, array( $pStoreRow['file_id'], $pStoreRow['attachment_id'] ) ); } return $ret; @@ -65,7 +65,7 @@ function bit_files_load( $pRow ) { $ret = NULL; if( !empty( $pRow['foreign_id'] ) && is_numeric( $pRow['foreign_id'] )) { $query = "SELECT * - FROM `".BIT_DB_PREFIX."tiki_attachments` a INNER JOIN `".BIT_DB_PREFIX."tiki_files` tf ON (tf.`file_id` = a.`foreign_id`) + FROM `".BIT_DB_PREFIX."liberty_attachments` a INNER JOIN `".BIT_DB_PREFIX."liberty_files` lf ON (lf.`file_id` = a.`foreign_id`) WHERE a.`foreign_id` = ? AND a.`content_id` = ?"; if( $ret = $gBitSystem->mDb->getRow($query, array( $pRow['foreign_id'], $pRow['content_id'] )) ) { $canThumbFunc = liberty_get_function( 'can_thumbnail' ); @@ -102,10 +102,10 @@ function bit_files_expunge( $pStorageId ) { $ret = FALSE; if (is_numeric($pStorageId)) { - $sql = "SELECT * FROM `".BIT_DB_PREFIX."tiki_attachments` WHERE `attachment_id` = ?"; + $sql = "SELECT * FROM `".BIT_DB_PREFIX."liberty_attachments` WHERE `attachment_id` = ?"; $row = $gBitSystem->mDb->getRow($sql, array($pStorageId)); if ($row) { - $sql = "SELECT * FROM `".BIT_DB_PREFIX."tiki_files` WHERE `file_id` = ?"; + $sql = "SELECT * FROM `".BIT_DB_PREFIX."liberty_files` WHERE `file_id` = ?"; $fileRow = $gBitSystem->mDb->getRow($sql, array($row['foreign_id']) ); if ($fileRow) { $absolutePath = BIT_ROOT_PATH.'/'.$fileRow['storage_path']; @@ -114,9 +114,9 @@ function bit_files_expunge( $pStorageId ) { if (file_exists($absolutePath)) { unlink($absolutePath); } - $query = "DELETE FROM `".BIT_DB_PREFIX."tiki_attachments` WHERE `attachment_id` = ?"; + $query = "DELETE FROM `".BIT_DB_PREFIX."liberty_attachments` WHERE `attachment_id` = ?"; $gBitSystem->mDb->query($query, array($pStorageId)); - $query = "DELETE FROM `".BIT_DB_PREFIX."tiki_files` WHERE `file_id` = ?"; + $query = "DELETE FROM `".BIT_DB_PREFIX."liberty_files` WHERE `file_id` = ?"; $gBitSystem->mDb->query($query, array($row['foreign_id']) ); $ret = TRUE; } diff --git a/plugins/storage.lulu.php b/plugins/storage.lulu.php index d9f3c8e..b94387d 100644 --- a/plugins/storage.lulu.php +++ b/plugins/storage.lulu.php @@ -1,6 +1,6 @@ <?php /** - * @version $Revision: 1.5 $ + * @version $Revision: 1.6 $ * @package liberty * @subpackage plugins_storage */ @@ -44,7 +44,7 @@ $gLibertySystem->registerPlugin( PLUGIN_GUID_LULU, $pluginParams ); function lulu_expunge($pAttachmentId) { global $gBitSystem; - $sql = "DELETE FROM `".BIT_DB_PREFIX."tiki_attachments` WHERE `attachment_id` = ?"; + $sql = "DELETE FROM `".BIT_DB_PREFIX."liberty_attachments` WHERE `attachment_id` = ?"; $gBitSystem->mDb->query($sql, array($pAttachmentId)); return TRUE; |
