summaryrefslogtreecommitdiff
path: root/LibertyComment.php
diff options
context:
space:
mode:
authorChristian Fowler <spider@viovio.com>2006-01-25 15:40:26 +0000
committerChristian Fowler <spider@viovio.com>2006-01-25 15:40:26 +0000
commit934e8af6fda5409746ae5a72bb3b98b443b2234f (patch)
treea21b127ba6bdee070d2c0afac6cf507c7dac56c2 /LibertyComment.php
parent1f8dc935f0bbdf396a149f8f27f25d73bfe3acc9 (diff)
downloadliberty-934e8af6fda5409746ae5a72bb3b98b443b2234f.tar.gz
liberty-934e8af6fda5409746ae5a72bb3b98b443b2234f.tar.bz2
liberty-934e8af6fda5409746ae5a72bb3b98b443b2234f.zip
Added uspport for multiple database backend support. This necessitates removal of all use of ->EOF and ->fields on the result sets. Also, queries that snag a single row and then use $rs->fields should
revert to the simpler getRow() funciton in the BitDb classes. BitDb.php was broken into kernel/BitDbBase.php and kernel/BitDbAdodb.php. kernel/BitDbPear.php was added wiht functionality for Pear::DB Also, the bitweavercore cvs module now works. So you can install a total barebones bitweaver - even without the wiki package. The main fix was to insure pageExists was only executing if wiki package was active so it would not select from non-existant tables
Diffstat (limited to 'LibertyComment.php')
-rw-r--r--LibertyComment.php17
1 files changed, 7 insertions, 10 deletions
diff --git a/LibertyComment.php b/LibertyComment.php
index 71eb08a..e72f70c 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.7 2005/12/26 12:25:03 squareing Exp $
+ * @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertyComment.php,v 1.8 2006/01/25 15:40:25 spiderr Exp $
* @author spider <spider@steelsun.com>
*/
@@ -60,12 +60,10 @@ 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->mDb->query($sql, $bindVars);
-
- if ($rs && $rs->numRows()) {
- $this->mInfo = $rs->fields;
- $this->mContentId = $rs->fields['content_id'];
- $this->mCommentId = $rs->fields['comment_id'];
+ if( $row = $this->mDb->getRow($sql, $bindVars) ) {
+ $this->mInfo = $row;
+ $this->mContentId = $row['content_id'];
+ $this->mCommentId = $row['comment_id'];
}
return count($this->mInfo);
}
@@ -268,10 +266,9 @@ 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->mDb->query( $sql, array($contentId), $pMaxComments, $pOffset ) ) {
- $rows = $rs->getRows();
+ if( $rows = $this->mDb->getAll( $sql, array($contentId), $pMaxComments, $pOffset ) ) {
foreach ($rows as $row) {
- $comment = new LibertyComment($row['comment_id']);
+ $comment = new LibertyComment( $row['comment_id'] );
$comment->mInfo['level'] = $curLevel;
$curLevel++;
$comment->mInfo['children'] = $this->getComments_threaded($comment->mInfo['content_id']);