summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Fowler <spider@viovio.com>2006-02-08 23:24:28 +0000
committerChristian Fowler <spider@viovio.com>2006-02-08 23:24:28 +0000
commitf79a5cdd8905832db9d8eb18a7605bcb61ac3940 (patch)
tree6a7219749105b8046bb676a4bd626e6b0a6a3c59
parent80c3623e3f7cd54831be078834f8e6a30c5c25f8 (diff)
downloadliberty-f79a5cdd8905832db9d8eb18a7605bcb61ac3940.tar.gz
liberty-f79a5cdd8905832db9d8eb18a7605bcb61ac3940.tar.bz2
liberty-f79a5cdd8905832db9d8eb18a7605bcb61ac3940.zip
major change of BitDbBase::associateUpdate method - it now takes a simpler array( 'column1' => 'value1', columnN' => 'valueN' ) as the third parameter. This allows much simpler updating based on multiple columns in the WHERE clause
-rw-r--r--LibertyContent.php5
-rwxr-xr-xLibertySystem.php4
-rw-r--r--admin/schema_inc.php4
-rw-r--r--plugins/format.tikiwiki.php10
4 files changed, 10 insertions, 13 deletions
diff --git a/LibertyContent.php b/LibertyContent.php
index b423fa5..4a688f1 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.49 2006/02/08 22:42:25 lsces Exp $
+* @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertyContent.php,v 1.50 2006/02/08 23:24:27 spiderr Exp $
* @author spider <spider@steelsun.com>
*/
@@ -252,8 +252,7 @@ class LibertyContent extends LibertyBase {
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->mDb->associateUpdate( $table, $pParamHash['content_store'], $locId );
+ $result = $this->mDb->associateUpdate( $table, $pParamHash['content_store'], array("content_id" => $pParamHash['content_id'] ) );
}
if( !empty( $pParamHash['force_history'] ) || ( empty( $pParamHash['minor'] ) && !empty( $this->mInfo['version'] ) && $pParamHash['field_changed'] )) {
diff --git a/LibertySystem.php b/LibertySystem.php
index c786e92..07169dc 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.14 2006/02/08 08:12:00 lsces Exp $
+* @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertySystem.php,v 1.15 2006/02/08 23:24:27 spiderr Exp $
* @author spider <spider@steelsun.com>
*/
@@ -121,7 +121,7 @@ class LibertySystem extends LibertyBase {
$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."liberty_content_types", $pTypeParams, array( 'name'=>'content_type_guid', 'value'=>$pGuid ) );
+ $result = $this->mDb->associateUpdate( BIT_DB_PREFIX."liberty_content_types", $pTypeParams, array( 'content_type_guid'=>$pGuid ) );
}
}
}
diff --git a/admin/schema_inc.php b/admin/schema_inc.php
index 751d8ea..3371479 100644
--- a/admin/schema_inc.php
+++ b/admin/schema_inc.php
@@ -50,9 +50,9 @@ $tables = array(
data X
CONSTRAINT '
, 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` )
- , CONSTRAINT `liberty_content_group_ref` FOREIGN KEY (`group_id`) REFERENCES `".BIT_DB_PREFIX."users_groups`( `group_id` )'
+ , CONSTRAINT `liberty_content_guid_ref` FOREIGN KEY (`format_guid`) REFERENCES `".BIT_DB_PREFIX."liberty_plugins`( `plugin_guid` )'
",
+ // , CONSTRAINT `liberty_content_group_ref` FOREIGN KEY (`group_id`) REFERENCES `".BIT_DB_PREFIX."users_groups`( `group_id` )'
'liberty_content_history' => "
content_id I4 PRIMARY,
diff --git a/plugins/format.tikiwiki.php b/plugins/format.tikiwiki.php
index 28b5164..e28bf1f 100644
--- a/plugins/format.tikiwiki.php
+++ b/plugins/format.tikiwiki.php
@@ -1,6 +1,6 @@
<?php
/**
- * @version $Revision: 1.25 $
+ * @version $Revision: 1.26 $
* @package liberty
*/
global $gLibertySystem;
@@ -157,13 +157,11 @@ 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."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();
- $key = $pParamHash['content_id'] . "-" . $res['content_id'];
+ if( $contentId = $this->mDb->getOne( $query, array( $page ) ) ) {
+ $key = $pParamHash['content_id'] . "-" . $contentId;
if (empty($links_already_inserted_table[$key])) {
$query = "insert into `".BIT_DB_PREFIX."liberty_content_links`(`from_content_id`,`to_content_id`) values(?, ?)";
- $result = $this->mDb->query($query, array( $pParamHash['content_id'], $res['content_id'] ) );
+ $result = $this->mDb->query($query, array( $pParamHash['content_id'], $contentId ) );
}
$links_already_inserted_table[$key] = 1;
}