Update of /cvsroot/phpslash/phpslash-ft/class
In directory usw-pr-cvs1:/tmp/cvs-serv327
Modified Files:
Story.class Story_base.class Block_render_query.class
Section.class Topic.class
Log Message:
db object correction
Index: Story.class
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/class/Story.class,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** Story.class 2001/10/17 17:11:26 1.18
--- Story.class 2001/11/12 02:34:11 1.19
***************
*** 15,20 ****
*/
! /* First let's bring in my parent class */
! require($_PSL[classdir] . '/Story_base.class');
class Story extends Story_base {
--- 15,20 ----
*/
! /* First let's bring in my parent class - moved to config.php3 - jvs - 1111/2001 */
! // require($_PSL[classdir] . '/Story_base.class');
class Story extends Story_base {
***************
*** 25,29 ****
var $parent_name = "Story_base";
var $template;
! var $db;
var $auth;
var $perm;
--- 25,29 ----
var $parent_name = "Story_base";
var $template;
! // var $db;
var $auth;
var $perm;
***************
*** 36,41 ****
global $auth, $perm, $_PSL;
! $this->db = new slashDB;
$this->perm = $perm;
$this->auth = $auth;
--- 36,44 ----
global $auth, $perm, $_PSL;
+
+ // call base class constructor
+ $this->Story_base();
! // $this->db = new slashDB;
$this->perm = $perm;
$this->auth = $auth;
Index: Story_base.class
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/class/Story_base.class,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Story_base.class 2001/10/01 16:13:36 1.2
--- Story_base.class 2001/11/12 02:34:11 1.3
***************
*** 31,35 ****
* CONSTRUCTORS
*/
!
/*
* METHODS
--- 31,37 ----
* CONSTRUCTORS
*/
! function Story_base () {
! $this->db = new slashDB;
! }
/*
* METHODS
Index: Block_render_query.class
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/class/Block_render_query.class,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Block_render_query.class 2001/10/09 23:21:45 1.3
--- Block_render_query.class 2001/11/12 02:34:11 1.4
***************
*** 53,58 ****
function query( $block_info) {
! $stories = new Story;
$default_tpl = "queryblock.tpl";
--- 53,61 ----
function query( $block_info) {
! $stories = new Story_base;
+ $amp = $this->psl['amp'];
+ $site_homesection = $this->psl['site_homesection'];
+
$default_tpl = "queryblock.tpl";
***************
*** 85,91 ****
if (is_array($stories_ary)) {
for ($i = 0 ; $i < count($stories_ary) ; $i++) {
$template->set_var(array(
! STORY_ID => $stories_ary[$i][story_id],
TITLE => $stories_ary[$i][title],
INTRO_TEXT => $stories_ary[$i][intro_text],
--- 88,110 ----
if (is_array($stories_ary)) {
for ($i = 0 ; $i < count($stories_ary) ; $i++) {
+
+ $story_id = $stories_ary[$i][story_id];
+ if ($ary['section_id'] != "") {
+ $story_id .= $amp . "section_id=" . $ary['section_id'];
+ } elseif ( ($ary['section'] != "") AND ( $ary['section'] != $site_homesection)) {
+ $section = new Section;
+ $section_name = $section->getId($ary['section']);
+ $story_id .= $amp . "section=" . $section_name;
+ }
+ if ($topic_id != "") {
+ $story_id .= $amp . "topic_id=" . $ary['topic_id'];
+ } elseif ($ary['topic'] != "") {
+ $topic = new Topic;
+ $topic_name = $topic->getId($ary['topic']);
+ $story_id .= $amp . "topic=" . $topic_name;
+ }
$template->set_var(array(
! STORY_ID => $story_id,
TITLE => $stories_ary[$i][title],
INTRO_TEXT => $stories_ary[$i][intro_text],
Index: Section.class
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/class/Section.class,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** Section.class 2001/11/07 21:35:34 1.5
--- Section.class 2001/11/12 02:34:11 1.6
***************
*** 204,208 ****
$q = "SELECT section_name
FROM psl_section
! WHERE section_id = $id";
$this->db->query($q);
$this->db->next_record();
--- 204,208 ----
$q = "SELECT section_name
FROM psl_section
! WHERE section_id = '$id'";
$this->db->query($q);
$this->db->next_record();
***************
*** 226,230 ****
$q = "SELECT section_id
FROM psl_section
! WHERE section_name = $name";
$this->db->query($q);
$this->db->next_record();
--- 226,230 ----
$q = "SELECT section_id
FROM psl_section
! WHERE section_name = '$name'";
$this->db->query($q);
$this->db->next_record();
Index: Topic.class
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/class/Topic.class,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Topic.class 2001/11/07 21:35:34 1.6
--- Topic.class 2001/11/12 02:34:11 1.7
***************
*** 399,403 ****
$q = "SELECT topic_name
FROM psl_topic
! WHERE topic_id = $id";
$this->db->query($q);
$this->db->next_record();
--- 399,403 ----
$q = "SELECT topic_name
FROM psl_topic
! WHERE topic_id = '$id'";
$this->db->query($q);
$this->db->next_record();
***************
*** 421,425 ****
$q = "SELECT topic_id
FROM psl_topic
! WHERE topic_name = $name";
$this->db->query($q);
$this->db->next_record();
--- 421,425 ----
$q = "SELECT topic_id
FROM psl_topic
! WHERE topic_name = '$name'";
$this->db->query($q);
$this->db->next_record();
|