diff options
| -rw-r--r-- | BitArticle.php | 32 | ||||
| -rw-r--r-- | BitArticleTopic.php | 18 | ||||
| -rw-r--r-- | BitArticleType.php | 12 | ||||
| -rw-r--r-- | art_lib.php | 78 |
4 files changed, 70 insertions, 70 deletions
diff --git a/BitArticle.php b/BitArticle.php index d878a49..97fb768 100644 --- a/BitArticle.php +++ b/BitArticle.php @@ -1,6 +1,6 @@ <?php /** -* $Header: /cvsroot/bitweaver/_bit_articles/BitArticle.php,v 1.3 2005/08/07 10:39:37 lsces Exp $ +* $Header: /cvsroot/bitweaver/_bit_articles/BitArticle.php,v 1.4 2005/08/07 16:33:54 lsces Exp $ * * Copyright (c) 2004 bitweaver.org * Copyright (c) 2003 tikwiki.org @@ -8,7 +8,7 @@ * 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 * -* $Id: BitArticle.php,v 1.3 2005/08/07 10:39:37 lsces Exp $ +* $Id: BitArticle.php,v 1.4 2005/08/07 16:33:54 lsces Exp $ */ /** @@ -19,7 +19,7 @@ * * @author wolffy <wolff_borg@yahoo.com.au> * -* @version $Revision: 1.3 $ $Date: 2005/08/07 10:39:37 $ $Author: lsces $ +* @version $Revision: 1.4 $ $Date: 2005/08/07 16:33:54 $ $Author: lsces $ * * @class BitArticle */ @@ -89,7 +89,7 @@ class BitArticle extends LibertyAttachable { "LEFT OUTER JOIN `".BIT_DB_PREFIX."tiki_attachments` tat ON (tat.attachment_id = ta.image_attachment_id) " . "LEFT OUTER JOIN `".BIT_DB_PREFIX."tiki_files` tf ON (tf.file_id = tat.foreign_id) " . "WHERE ta.`$lookupColumn`=?"; - $result = $this->getDb()->query($query, array($lookupId ) ); + $result = $this->mDb->query($query, array($lookupId ) ); if ($result && $result->numRows() ) { $this->mInfo = $result->fields; @@ -141,7 +141,7 @@ class BitArticle extends LibertyAttachable { if (!empty($this->mArticleId)) { $sql = "UPDATE `".BIT_DB_PREFIX."tiki_articles` SET `status_id` = ? WHERE `article_id` = ?"; - $rs = $this->getDb()->query($sql, array($pStatusId, $this->mArticleId)); + $rs = $this->mDb->query($sql, array($pStatusId, $this->mArticleId)); return $pStatusId; } } @@ -162,7 +162,7 @@ class BitArticle extends LibertyAttachable { { if ($this->verify($pParamHash ) && LibertyAttachable::store($pParamHash ) ) { $table = BIT_DB_PREFIX."tiki_articles"; - $this->getDb()->StartTrans(); + $this->mDb->StartTrans(); if ($this->mArticleId ) { $locId = array("name" => "article_id", "value" => $pParamHash['article_id'] ); $result = $this->associateUpdate($table, $pParamHash['article_store'], $locId ); @@ -172,7 +172,7 @@ class BitArticle extends LibertyAttachable { // if pParamHash['article_id'] is set, some is requesting a particular article_id. Use with caution! $pParamHash['article_store']['article_id'] = $pParamHash['article_id']; } else { - $pParamHash['article_store']['article_id'] = $this->getDb()->GenID('tiki_articles_article_id_seq'); + $pParamHash['article_store']['article_id'] = $this->mDb->GenID('tiki_articles_article_id_seq'); } $this->mArticleId = $pParamHash['article_store']['article_id']; @@ -180,7 +180,7 @@ class BitArticle extends LibertyAttachable { } - $this->getDb()->CompleteTrans(); + $this->mDb->CompleteTrans(); $this->load(); } return(count($this->mErrors ) == 0 ); @@ -366,14 +366,14 @@ class BitArticle extends LibertyAttachable { { $ret = FALSE; if ($this->isValid() ) { - /* $this->getDb()->StartTrans(); + /* $this->mDb->StartTrans(); $query = "DELETE FROM `".BIT_DB_PREFIX."tiki_samples` WHERE `content_id` = ?"; - $result = $this->getDb()->query($query, array($this->mContentId ) ); + $result = $this->mDb->query($query, array($this->mContentId ) ); if (LibertyAttachable::expunge() ) { $ret = TRUE; - $this->getDb()->CompleteTrans(); + $this->mDb->CompleteTrans(); } else { - $this->getDb()->RollbackTrans(); + $this->mDb->RollbackTrans(); }*/ } return $ret; @@ -449,7 +449,7 @@ class BitArticle extends LibertyAttachable { $query_cant = "SELECT COUNT(*) FROM `".BIT_DB_PREFIX."tiki_articles` ta INNER JOIN `".BIT_DB_PREFIX."tiki_content` tc ON (tc.`content_id` = ta.`content_id`) ". (!empty($mid ) ? $mid.' AND ' : ' WHERE ')." tc.`content_type_guid` = '".BITARTICLE_CONTENT_TYPE_GUID."'"; - $result = $this->getDb()->query($query,$bindvars,$max_records,$offset); + $result = $this->mDb->query($query,$bindvars,$max_records,$offset); $ret = array(); $comment = &new LibertyComment(); while ($res = $result->fetchRow()) { @@ -465,7 +465,7 @@ class BitArticle extends LibertyAttachable { } $pParamHash["data"] = $ret; - $pParamHash["cant"] = $this->getDb()->getOne($query_cant,$bindvars); + $pParamHash["cant"] = $this->mDb->getOne($query_cant,$bindvars); LibertyContent::postGetList($pParamHash ); @@ -490,11 +490,11 @@ class BitArticle extends LibertyAttachable { function listTypes() { $query = "SELECT * FROM `" . BIT_DB_PREFIX . "tiki_article_types`"; - $result = $this->getDb()->query( $query, array() ); + $result = $this->mDb->query( $query, array() ); $ret = array(); while ( $res = $result->fetchRow() ) { - $res['article_cnt'] = $this->getDb()->getOne( "select count(*) from `" . BIT_DB_PREFIX . "tiki_articles` where `article_type_id` = ?", array( $res['article_type_id'] ) ); + $res['article_cnt'] = $this->mDb->getOne( "select count(*) from `" . BIT_DB_PREFIX . "tiki_articles` where `article_type_id` = ?", array( $res['article_type_id'] ) ); $ret[] = $res; } diff --git a/BitArticleTopic.php b/BitArticleTopic.php index 53d0c4d..5ed13b5 100644 --- a/BitArticleTopic.php +++ b/BitArticleTopic.php @@ -31,7 +31,7 @@ class BitArticleTopic extends BitBase $sql = "SELECT at.*". "FROM `".BIT_DB_PREFIX."tiki_article_topics` at ". $whereSQL; - $rs = $this->getDb()->query($sql, $bindVars); + $rs = $this->mDb->query($sql, $bindVars); $this->mInfo = $rs->fields; $this->mTopicId = $this->mInfo['topic_id']; @@ -88,7 +88,7 @@ class BitArticleTopic extends BitBase if ($this->verify($iParamHash)) { if (!$iParamHash['topic_id']) { - $topicId = $this->getDb()->GenID('tiki_article_topics_topic_id_seq'); + $topicId = $this->mDb->GenID('tiki_article_topics_topic_id_seq'); } else { $topicId = $this->mTopicId; } @@ -116,10 +116,10 @@ class BitArticleTopic extends BitBase } if ($iParamHash['topic_id']) { - $this->getDb()->associateUpdate(BIT_DB_PREFIX."tiki_article_topics", $iParamHash, array('name' => 'topic_id', 'value'=> $iParamHash['topic_id'])); + $this->mDb->associateUpdate(BIT_DB_PREFIX."tiki_article_topics", $iParamHash, array('name' => 'topic_id', 'value'=> $iParamHash['topic_id'])); } else { $iParamHash['topic_id'] = $topicId; - $this->getDb()->associateInsert(BIT_DB_PREFIX."tiki_article_topics", $iParamHash); + $this->mDb->associateInsert(BIT_DB_PREFIX."tiki_article_topics", $iParamHash); } } $this->mTopicId = $iParamHash['topic_id']; @@ -186,7 +186,7 @@ class BitArticleTopic extends BitBase @unlink($this->getTopicImageStoragePath()); } $sql = "UPDATE `".BIT_DB_PREFIX."tiki_article_topics` SET `has_topic_image` = 'n' WHERE `topic_id` = ?"; - $rs = $this->getDb()->query($sql, array($this->mTopicId)); + $rs = $this->mDb->query($sql, array($this->mTopicId)); $this->mInfo['has_topic_image'] = 'n'; } } @@ -201,7 +201,7 @@ class BitArticleTopic extends BitBase function setActivation($iIsActive = FALSE) { $sql = "UPDATE `".BIT_DB_PREFIX."tiki_article_topics` SET `active` = '".($iIsActive ? 'y' : 'n')."' WHERE `topic_id` = ?"; - $rs = $this->getDb()->query($sql, array($this->mTopicId)); + $rs = $this->mDb->query($sql, array($this->mTopicId)); $this->mInfo['active'] = ($iIsActive ? 'y' : 'n'); } @@ -211,7 +211,7 @@ class BitArticleTopic extends BitBase } $sql = "SELECT `article_id` FROM `".BIT_DB_PREFIX."tiki_articles` WHERE `topic_id` = ?"; - $rs = $this->getDb()->query($sql, array($this->mTopicId)); + $rs = $this->mDb->query($sql, array($this->mTopicId)); $ret = array(); while ($row = $rs->fetchRow()) { @@ -235,11 +235,11 @@ class BitArticleTopic extends BitBase } } else { $sql = "UPDATE `".BIT_DB_PREFIX."tiki_articles` SET `topic_id` = ? WHERE `topic_id` = ?"; - $rs = $this->getDb()->query($sql, array(NULL, $this->mTopicId)); + $rs = $this->mDb->query($sql, array(NULL, $this->mTopicId)); } $sql = "DELETE FROM `".BIT_DB_PREFIX."tiki_article_topics` WHERE `topic_id` = ?"; - $rs = $this->getDb()->query($sql, array($this->mTopicId)); + $rs = $this->mDb->query($sql, array($this->mTopicId)); } } diff --git a/BitArticleType.php b/BitArticleType.php index fc35d95..2b53911 100644 --- a/BitArticleType.php +++ b/BitArticleType.php @@ -27,12 +27,12 @@ class BitArticleType extends BitBase if ($this->mTypeId) { $sql = "SELECT * FROM `".BIT_DB_PREFIX."tiki_article_types` WHERE `article_type_id` = ?"; - $rs = $this->getDb()->query($sql, array($this->mTypeId)); + $rs = $this->mDb->query($sql, array($this->mTypeId)); $ret = array(); if (!empty($rs->fields)) { $ret = $rs->fields; - $ret['num_articles'] = $this->getDb()->getOne('SELECT COUNT(*) FROM `'.BIT_DB_PREFIX.'tiki_articles` WHERE `article_type_id` = ?', array($ret['article_type_id'])); + $ret['num_articles'] = $this->mDb->getOne('SELECT COUNT(*) FROM `'.BIT_DB_PREFIX.'tiki_articles` WHERE `article_type_id` = ?', array($ret['article_type_id'])); } } $this->mInfo = $ret; @@ -90,7 +90,7 @@ class BitArticleType extends BitBase if ($this->verify($iParamHash)) { if (!$iParamHash['article_type_id']) { if (empty($this->mTopicId)) { - $typeId = $this->getDb()->GenID('tiki_article_types_article_type_id_seq'); + $typeId = $this->mDb->GenID('tiki_article_types_article_type_id_seq'); } else { $typeId = $this->mTopicId; } @@ -99,10 +99,10 @@ class BitArticleType extends BitBase } if ($iParamHash['article_type_id']) { - $this->getDb()->associateUpdate(BIT_DB_PREFIX."tiki_article_types", $iParamHash, array('name' => 'article_type_id', 'value'=> $iParamHash['article_type_id'])); + $this->mDb->associateUpdate(BIT_DB_PREFIX."tiki_article_types", $iParamHash, array('name' => 'article_type_id', 'value'=> $iParamHash['article_type_id'])); } else { $iParamHash['article_type_id'] = $typeId; - $this->getDb()->associateInsert(BIT_DB_PREFIX."tiki_article_types", $iParamHash); + $this->mDb->associateInsert(BIT_DB_PREFIX."tiki_article_types", $iParamHash); } } $this->mTypeId = $iParamHash['article_type_id']; @@ -121,7 +121,7 @@ class BitArticleType extends BitBase } $sql = "DELETE FROM `".BIT_DB_PREFIX."tiki_article_types` WHERE `article_type_id` = ?"; - $rs = $this->getDb()->query($sql, array($iTypeId)); + $rs = $this->mDb->query($sql, array($iTypeId)); } function listTypes() { diff --git a/art_lib.php b/art_lib.php index 48187af..d42014d 100644 --- a/art_lib.php +++ b/art_lib.php @@ -96,7 +96,7 @@ class ArtLib extends BitBase { if ( $count_admin_pvs == 'y' || $bit_p_admin != 'y' ) { $query = "update `" . BIT_DB_PREFIX . "tiki_articles` set `reads`=`reads`+1 where `article_id`=?"; - $result = $this->getDb()->query( $query, array( $article_id ) ); + $result = $this->mDb->query( $query, array( $article_id ) ); } return true; @@ -106,7 +106,7 @@ class ArtLib extends BitBase { if ( $article_id ) { $query = "delete from `" . BIT_DB_PREFIX . "tiki_articles` where `article_id`=?"; - $result = $this->getDb()->query( $query, array( $article_id ) ); + $result = $this->mDb->query( $query, array( $article_id ) ); $this->remove_object( 'article', $article_id ); return true; } @@ -116,7 +116,7 @@ class ArtLib extends BitBase { if ( $sub_id ) { $query = "delete from `" . BIT_DB_PREFIX . "tiki_submissions` where `sub_id`=?"; - $result = $this->getDb()->query( $query, array( ( int ) $sub_id ) ); + $result = $this->mDb->query( $query, array( ( int ) $sub_id ) ); return true; } @@ -135,7 +135,7 @@ class ArtLib extends BitBase { $hash = md5( $title . $heading . $body ); $now = date( "U" ); $query = "select `name` from `" . BIT_DB_PREFIX . "tiki_topics` where `topic_id` = ?"; - $topic_name = $this->getDb()->getOne( $query, array( ( int ) $topic_id ) ); + $topic_name = $this->mDb->getOne( $query, array( ( int ) $topic_id ) ); $size = strlen( $body ); if ( $sub_id ) { @@ -163,17 +163,17 @@ class ArtLib extends BitBase { `rating` = ? where `sub_id` = ?"; - $result = $this->getDb()->query( $query, array( $title, $author_name, ( int ) $topic_id, $topic_name, ( int ) $size, $use_image, $isfloat, $imgname, $imgtype, ( int ) $imgsize, $this->mDb->db_byte_encode( $imgdata ), ( int ) $image_x, ( int ) $image_y, $heading, $body, ( int ) $publish_date, ( int ) $now, $user, $type, ( float ) $rating, ( int ) $sub_id ) ); + $result = $this->mDb->query( $query, array( $title, $author_name, ( int ) $topic_id, $topic_name, ( int ) $size, $use_image, $isfloat, $imgname, $imgtype, ( int ) $imgsize, $this->mDb->db_byte_encode( $imgdata ), ( int ) $image_x, ( int ) $image_y, $heading, $body, ( int ) $publish_date, ( int ) $now, $user, $type, ( float ) $rating, ( int ) $sub_id ) ); } else { // Insert the article $query = "insert into `" . BIT_DB_PREFIX . "tiki_submissions`(`title`,`author_name`,`topic_id`,`use_image`,`image_name`,`image_size`,`image_type`,`image_data`,`publish_date`,`created`,`heading`,`body`,`hash`,`author`,`reads`,`votes`,`points`,`size`,`topic_name`,`image_x`,`image_y`,`type`,`rating`,`isfloat`) values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; - $result = $this->getDb()->query( $query, array( $title, $author_name, ( int ) $topic_id, $use_image, $imgname, ( int ) $imgsize, $imgtype, $this->mDb->db_byte_encode( $imgdata ), ( int ) $publish_date, ( int ) $now, $heading, $body, $hash, $user, 0, 0, 0, ( int ) $size, $topic_name, ( int ) $image_x, ( int ) $image_y, $type, ( float ) $rating, $isfloat ) ); + $result = $this->mDb->query( $query, array( $title, $author_name, ( int ) $topic_id, $use_image, $imgname, ( int ) $imgsize, $imgtype, $this->mDb->db_byte_encode( $imgdata ), ( int ) $publish_date, ( int ) $now, $heading, $body, $hash, $user, 0, 0, 0, ( int ) $size, $topic_name, ( int ) $image_x, ( int ) $image_y, $type, ( float ) $rating, $isfloat ) ); } $query = "select max(`sub_id`) from `" . BIT_DB_PREFIX . "tiki_submissions` where `created` = ? and `title`=? and `hash`=?"; - $id = $this->getDb()->getOne( $query, array( ( int ) $now, $title, $hash ) ); + $id = $this->mDb->getOne( $query, array( ( int ) $now, $title, $hash ) ); $emails = $notificationlib->get_mail_events( 'article_submitted', '*' ); $foo = parse_url( $_SERVER["REQUEST_URI"] ); $machine = httpPrefix() . $foo["path"]; @@ -201,24 +201,24 @@ class ArtLib extends BitBase { $query = "insert into `" . BIT_DB_PREFIX . "tiki_topics`(`name`,`image_name`,`image_type`,`image_size`,`image_data`,`active`,`created`) values(?,?,?,?,?,?,?)"; - $result = $this->getDb()->query( $query, array( $name, $imagename, $imagetype, ( int ) $imagesize, $this->mDb->db_byte_encode( $imagedata ), 'y', ( int ) $now ) ); + $result = $this->mDb->query( $query, array( $name, $imagename, $imagetype, ( int ) $imagesize, $this->mDb->db_byte_encode( $imagedata ), 'y', ( int ) $now ) ); $query = "select max(`topic_id`) from `" . BIT_DB_PREFIX . "tiki_topics` where `created`=? and `name`=?"; - $topic_id = $this->getDb()->getOne( $query, array( ( int ) $now, $name ) ); + $topic_id = $this->mDb->getOne( $query, array( ( int ) $now, $name ) ); return $topic_id; } function remove_topic( $topic_id, $all = 0 ) { $query = "delete from `" . BIT_DB_PREFIX . "tiki_topics` where `topic_id`=?"; - $result = $this->getDb()->query( $query, array( $topic_id ) ); + $result = $this->mDb->query( $query, array( $topic_id ) ); if ( $all == 1 ) { $query = "delete from `" . BIT_DB_PREFIX . "tiki_articles` where `topic_id`=?"; - $result = $this->getDb()->query( $query, array( $topic_id ) ); + $result = $this->mDb->query( $query, array( $topic_id ) ); } else { $query = "update `" . BIT_DB_PREFIX . "tiki_articles` set `topic_id`=?, `topic_name`=? where `topic_id`=?"; - $result = $this->getDb()->query( $query, array( null, null, $topic_id ) ); + $result = $this->mDb->query( $query, array( null, null, $topic_id ) ); } return true; @@ -227,7 +227,7 @@ class ArtLib extends BitBase { function replace_topic_name( $topic_id, $name ) { $query = "update `" . BIT_DB_PREFIX . "tiki_topics` set `name` = ? where `topic_id` = ?"; - $result = $this->getDb()->query( $query, array( $name, $topic_id ) ); + $result = $this->mDb->query( $query, array( $name, $topic_id ) ); return true; } @@ -238,7 +238,7 @@ class ArtLib extends BitBase { $query = "update `" . BIT_DB_PREFIX . "tiki_topics` set `image_name` = ?, `image_type` = ?, `image_size` = ?, `image_data` = ? where `topic_id` = ?"; - $result = $this->getDb()->query( $query, array( $imagename, $imagetype, + $result = $this->mDb->query( $query, array( $imagename, $imagetype, $imagesize, $this->mDb->db_byte_encode( $imagedata ), $topic_id ) ); return true; @@ -247,19 +247,19 @@ class ArtLib extends BitBase { function activate_topic( $topic_id ) { $query = "update `" . BIT_DB_PREFIX . "tiki_topics` set `active`=? where `topic_id`=?"; - $result = $this->getDb()->query( $query, array( 'y', $topic_id ) ); + $result = $this->mDb->query( $query, array( 'y', $topic_id ) ); } function deactivate_topic( $topic_id ) { $query = "update `" . BIT_DB_PREFIX . "tiki_topics` set `active`=? where `topic_id`=?"; - $result = $this->getDb()->query( $query, array( 'n', $topic_id ) ); + $result = $this->mDb->query( $query, array( 'n', $topic_id ) ); } function get_topic( $topic_id ) { $query = "select `topic_id`,`name`,`image_name`,`image_size`,`image_type` from `" . BIT_DB_PREFIX . "tiki_topics` where `topic_id`=?"; - $result = $this->getDb()->query( $query, array( $topic_id ) ); + $result = $this->mDb->query( $query, array( $topic_id ) ); $res = $result->fetchRow(); return $res; @@ -268,14 +268,14 @@ class ArtLib extends BitBase { function get_topic_id($topic) { $topic_id = ''; $query = "select `topic_id` from `tiki_topics` where `name` = ?"; - $topic_id = $this->getDb()->getOne($query, array($topic) ); + $topic_id = $this->mDb->getOne($query, array($topic) ); return $topic_id; } function list_active_topics() { $query = "select * from `" . BIT_DB_PREFIX . "tiki_topics` where `active`=?"; - $result = $this->getDb()->query( $query, array( 'y' ) ); + $result = $this->mDb->query( $query, array( 'y' ) ); $ret = array(); @@ -304,15 +304,15 @@ class ArtLib extends BitBase { if ($creator_edit == 'on') {$creator_edit = 'y';} else {$creator_edit = 'n';} $query = "select count(*) from `".BIT_DB_PREFIX."tiki_article_types` where `type`=?"; - $rowcnt = $this->getDb()->getOne($query,array($type)); + $rowcnt = $this->mDb->getOne($query,array($type)); // if the type already exists, delete it first if ($rowcnt > 0) { $query = "delete from `".BIT_DB_PREFIX."tiki_article_types` where `type`=?"; - $result = $this->getDb()->query($query,array($type)); + $result = $this->mDb->query($query,array($type)); } */ - $result = $this->getDb()->query( "insert into `" . BIT_DB_PREFIX . "tiki_article_types`(`type`) values(?)", array( $type ) ); + $result = $this->mDb->query( "insert into `" . BIT_DB_PREFIX . "tiki_article_types`(`type`) values(?)", array( $type ) ); return true; } @@ -404,18 +404,18 @@ class ArtLib extends BitBase { `show_size` = ?, `creator_edit` = ? where `type` = ?"; - $result = $this->getDb()->query( $query, array( $use_ratings, $show_pre_publ, $show_post_expire, $heading_only, $allow_comments, $comment_can_rate_article, $show_image, $show_avatar, $show_author, $show_pubdate, $show_expdate, $show_reads, $show_size, $creator_edit, $type ) ); + $result = $this->mDb->query( $query, array( $use_ratings, $show_pre_publ, $show_post_expire, $heading_only, $allow_comments, $comment_can_rate_article, $show_image, $show_avatar, $show_author, $show_pubdate, $show_expdate, $show_reads, $show_size, $creator_edit, $type ) ); } function remove_type( $type ) { $query = "delete from `" . BIT_DB_PREFIX . "tiki_article_types` where `type`=?"; - $result = $this->getDb()->query( $query, array( $type ) ); + $result = $this->mDb->query( $query, array( $type ) ); } function get_type( $type ) { $query = "select * from `" . BIT_DB_PREFIX . "tiki_article_types` where `type`=?"; - $result = $this->getDb()->query( $query, array( $type ) ); + $result = $this->mDb->query( $query, array( $type ) ); $res = $result->fetchRow(); return $res; @@ -450,11 +450,11 @@ class ArtLib extends BitBase { $query = "SELECT art.*, u.`avatar_attachment_id`, arttype.`use_ratings`, arttype.`show_pre_publ`, arttype.`show_post_expire`, arttype.`heading_only`, arttype.`allow_comments`, arttype.`show_image`, arttype.`show_avatar`, arttype.`show_author`, arttype.`show_pubdate`, arttype.`show_expdate`, arttype.`show_reads`, arttype.`show_size`, arttype.`creator_edit` FROM `".BIT_DB_PREFIX."tiki_articles` art INNER JOIN `".BIT_DB_PREFIX."tiki_content` tc ON ( art.`content_id`=tc.`content_id` ), `".BIT_DB_PREFIX."tiki_article_types` arttype, `".BIT_DB_PREFIX."users_users` u $mid - ORDER BY ".$this->getDb()->convert_sortmode( $sort_mode ); + ORDER BY ".$this->mDb->convert_sortmode( $sort_mode ); $query_cant = "select count(*) from `".BIT_DB_PREFIX."tiki_articles` art INNER JOIN `".BIT_DB_PREFIX."tiki_content` tc ON ( art.`content_id`=tc.`content_id` ), `".BIT_DB_PREFIX."tiki_article_types` arttype, `".BIT_DB_PREFIX."users_users` u $mid"; - $result = $this->getDb()->query( $query, $bindvars, $maxRecords, $offset ); - $cant = $this->getDb()->getOne($query_cant,$bindvars); + $result = $this->mDb->query( $query, $bindvars, $maxRecords, $offset ); + $cant = $this->mDb->getOne($query_cant,$bindvars); $ret = array(); while ($res = $result->fetchRow()) { @@ -524,10 +524,10 @@ class ArtLib extends BitBase { $bindvars[] = $date; } - $query = "select * from `".BIT_DB_PREFIX."tiki_submissions` $mid order by ".$this->getDb()->convert_sortmode($sort_mode); + $query = "select * from `".BIT_DB_PREFIX."tiki_submissions` $mid order by ".$this->mDb->convert_sortmode($sort_mode); $query_cant = "select count(*) from `".BIT_DB_PREFIX."tiki_submissions` $mid"; - $result = $this->getDb()->query($query,$bindvars,$maxRecords,$offset); - $cant = $this->getDb()->getOne($query_cant,$bindvars); + $result = $this->mDb->query($query,$bindvars,$maxRecords,$offset); + $cant = $this->mDb->getOne($query_cant,$bindvars); $ret = array(); while ($res = $result->fetchRow()) { @@ -560,7 +560,7 @@ class ArtLib extends BitBase { FROM `".BIT_DB_PREFIX."tiki_articles` art, `".BIT_DB_PREFIX."tiki_article_types` arttype, `".BIT_DB_PREFIX."users_users` uu where art.`type` = arttype.`type` AND art.`author` = uu.`login` AND art.`article_id`=?"; //$query = "select * from `".BIT_DB_PREFIX."tiki_articles` where `article_id`=?"; - $result = $this->getDb()->query($query,array((int)$article_id)); + $result = $this->mDb->query($query,array((int)$article_id)); if ($result->numRows()) { $res = $result->fetchRow(); $res["image_data"] = $this->mDb->db_byte_decode( $res["image_data"] ); @@ -573,7 +573,7 @@ class ArtLib extends BitBase { function get_submission($sub_id) { $query = "select * from `".BIT_DB_PREFIX."tiki_submissions` where `sub_id`=?"; - $result = $this->getDb()->query($query,array((int) $sub_id)); + $result = $this->mDb->query($query,array((int) $sub_id)); if ($result->numRows()) { $res = $result->fetchRow(); $res["entrating"] = floor($res["rating"]); @@ -593,7 +593,7 @@ class ArtLib extends BitBase { if(empty($imgdata)) $imgdata=''; // Fixed query. -rlpowell $query = "select `name` from `".BIT_DB_PREFIX."tiki_topics` where `topic_id` = ?"; - $topic_name = $this->getDb()->getOne($query, array($topic_id) ); + $topic_name = $this->mDb->getOne($query, array($topic_id) ); $size = strlen($body); // Fixed query. -rlpowell @@ -603,7 +603,7 @@ class ArtLib extends BitBase { $query.= " `image_type` = ?, `image_size` = ?, `image_data` = ?, `isfloat` = ?, `image_x` = ?, `image_y` = ?, `heading` = ?, `body` = ?, "; $query.= " `publish_date` = ?, `expire_date` = ?, `created` = ?, `author` = ?, `type` = ?, `rating` = ? where `article_id` = ?"; - $result = $this->getDb()->query($query, array( $title, $author_name, (int) $topic_id, $topic_name, (int) $size, $use_image, $imgname, $imgtype, (int) $imgsize, $this->mDb->db_byte_encode( $imgdata ), $isfloat, (int) $image_x, (int) $image_y, $heading, $body, (int) $publish_date, (int) $expire_date, (int) $now, $user, $type, (float) $rating, (int) $article_id ) ); + $result = $this->mDb->query($query, array( $title, $author_name, (int) $topic_id, $topic_name, (int) $size, $use_image, $imgname, $imgtype, (int) $imgsize, $this->mDb->db_byte_encode( $imgdata ), $isfloat, (int) $image_x, (int) $image_y, $heading, $body, (int) $publish_date, (int) $expire_date, (int) $now, $user, $type, (float) $rating, (int) $article_id ) ); } else { // Fixed query. -rlpowell // Insert the article @@ -611,11 +611,11 @@ class ArtLib extends BitBase { $query.= " `publish_date`, `expire_date`, `created`, `heading`, `body`, `hash`, `author`, `reads`, `votes`, `points`, `size`, `topic_name`, `image_x`, `image_y`, `type`, `rating`, `isfloat`) "; $query.= " values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; - $result = $this->getDb()->query($query, array( $title, $author_name, (int) $topic_id, $use_image, $imgname, (int) $imgsize, $imgtype, $this->mDb->db_byte_encode( $imgdata ), (int) $publish_date, (int) $expire_date, (int) $now, $heading, $body, $hash, $user, 0, 0, 0, (int) $size, $topic_name, (int) $image_x, (int) $image_y, $type, (float) $rating, $isfloat)); + $result = $this->mDb->query($query, array( $title, $author_name, (int) $topic_id, $use_image, $imgname, (int) $imgsize, $imgtype, $this->mDb->db_byte_encode( $imgdata ), (int) $publish_date, (int) $expire_date, (int) $now, $heading, $body, $hash, $user, 0, 0, 0, (int) $size, $topic_name, (int) $image_x, (int) $image_y, $type, (float) $rating, $isfloat)); // Fixed query. -rlpowell $query2 = "select max(`article_id`) from `".BIT_DB_PREFIX."tiki_articles` where `created` = ? and `title`=? and `hash`=?"; - $article_id = $this->getDb()->getOne($query2, array( (int) $now, $title, $hash ) ); + $article_id = $this->mDb->getOne($query2, array( (int) $now, $title, $hash ) ); } return $article_id; @@ -625,7 +625,7 @@ class ArtLib extends BitBase { function get_topic_image($topic_id) { // Fixed query. -rlpowell $query = "select `image_name` ,`image_size`,`image_type`, `image_data` from `".BIT_DB_PREFIX."tiki_topics` where `topic_id`=?"; - $result = $this->getDb()->query($query, array((int) $topic_id)); + $result = $this->mDb->query($query, array((int) $topic_id)); $res = $result->fetchRow(); $res['image_data'] = $this->mDb->db_byte_decode( $res['image_data'] ); return $res; @@ -634,7 +634,7 @@ class ArtLib extends BitBase { /*shared*/ function get_article_image($id) { $query = "select `image_name` ,`image_size`,`image_type`, `image_data` from `".BIT_DB_PREFIX."tiki_articles` where `article_id`=?"; - $result = $this->getDb()->query($query, array((int) $id)); + $result = $this->mDb->query($query, array((int) $id)); $res = $result->fetchRow(); $res['image_data'] = $this->mDb->db_byte_decode( $res['image_data'] ); return $res; |
