Update of /cvsroot/phpslash/phpslash-ft/class
In directory sc8-pr-cvs1:/tmp/cvs-serv30216/phpslash-ft/class
Modified Files:
MailingList.class Poll.class Section.class Story.class
Story_admin.class Story_base.class Submission.class
Topic.class
Log Message:
Admin messages should be available for translation now.
Index: MailingList.class
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/class/MailingList.class,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** MailingList.class 20 Dec 2002 22:17:29 -0000 1.14
--- MailingList.class 23 Jan 2003 02:48:02 -0000 1.15
***************
*** 83,90 ****
WHERE id = '$id'");
switch ($ary[freq]) {
- case "daily":
- $q = "INSERT INTO psl_mailinglist_frequency
- VALUES ('$id','DAY','1')";
- break;
case "weekly":
$q = "INSERT INTO psl_mailinglist_frequency
--- 83,86 ----
***************
*** 95,101 ****
VALUES ('$id','MONTH','30')";
break;
default:
! $this->message = "ERROR! ERROR! We're inside of the insertFrequency switch and hit the default. Now exiting!<BR><BR>\n";
! exit;
}
$this->db->query($q);
--- 91,100 ----
VALUES ('$id','MONTH','30')";
break;
+
+ case "daily":
default:
! $q = "INSERT INTO psl_mailinglist_frequency
! VALUES ('$id','DAY','1')";
! break;
}
$this->db->query($q);
Index: Poll.class
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/class/Poll.class,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** Poll.class 13 Jan 2003 18:21:01 -0000 1.26
--- Poll.class 23 Jan 2003 02:48:02 -0000 1.27
***************
*** 104,108 ****
$aff = $this->db->affected_rows();
if ($aff > 1) {
! $this->message = "There was a weird number of affected rows when setting the 'current' field to 1: '$aff'";
return false;
};
--- 104,108 ----
$aff = $this->db->affected_rows();
if ($aff > 1) {
! $this->message = pslgetText("There was a weird number of affected rows when setting the 'current' field to 1: ").$aff;
return false;
};
***************
*** 125,129 ****
return $this->db->f('question_id');
} else {
! $this->message = "Either there were no current polls, or more then one? Affected Rows is: '$aff'";
return false;
}
--- 125,129 ----
return $this->db->f('question_id');
} else {
! $this->message = pslgetText("Either there were no current polls, or more then one? Affected Rows is: ").$aff;
return false;
}
***************
*** 151,155 ****
if (!$this->db->next_record()) {
! $this->message = "Couldn't find your question ($question_id) in the DB";
return false;
} else {
--- 151,155 ----
if (!$this->db->next_record()) {
! $this->message = sprintf(pslgetText("Couldn't find your question (%s) in the DB"), $question_id);
return false;
} else {
***************
*** 219,223 ****
return false;
} elseif (empty($ary['choice_ary'][0]) || empty($ary['choice_ary'][1])) {
! $this->message = 'You need to have at least 2 possible answers, otherwise it wouldn\'t be a very effective poll, would it?';
return false;
}
--- 219,223 ----
return false;
} elseif (empty($ary['choice_ary'][0]) || empty($ary['choice_ary'][1])) {
! $this->message = "You need to have at least 2 possible answers, otherwise it wouldn't be a very effective poll, would it?";
return false;
}
***************
*** 248,252 ****
$this->db->query($q);
} else {
! $this->message = "Sorry, I couldn't find your poll when trying to update.\n";
return false;
}
--- 248,252 ----
$this->db->query($q);
} else {
! $this->message = "Sorry, I couldn't find your poll when trying to update.";
return false;
}
***************
*** 259,263 ****
$ary['question_id'] = generateID("psl_comment_dep_seq");
! $timestamp = time();
$query = "INSERT INTO psl_poll_question
(question_id,
--- 259,263 ----
$ary['question_id'] = generateID("psl_comment_dep_seq");
! $timestamp = time();
$query = "INSERT INTO psl_poll_question
(question_id,
***************
*** 282,286 ****
if ($ary['currentqid'] != '') {
if (!$this->makeCurrent($ary['question_id'])) {
! $this->message = "There was an error in setting "$question" as the current poll: $this->message\n";
return false;
}
--- 282,286 ----
if ($ary['currentqid'] != '') {
if (!$this->makeCurrent($ary['question_id'])) {
! $this->message = sprintf(pslgetText("There was an error in setting %s as the current poll:"), $question). $this->message."\n";
return false;
}
***************
*** 293,297 ****
if ($answer == '') {
! $msg .= "Choice $x was ignored<BR>\n";
} else {
if ($vote == '') {
--- 293,297 ----
if ($answer == '') {
! $msg .= sprintf(pslgetText("Choice %s was ignored."), $x)."<BR>\n";
} else {
if ($vote == '') {
***************
*** 313,317 ****
$this->db->query($q);
$answer = stripslashes($answer);
! $msg .= "Choice $x, "$answer" ($vote), was <em>updated</em><br>\n";
} else {
--- 313,317 ----
$this->db->query($q);
$answer = stripslashes($answer);
! $msg .= sprintf(pslgetText("Choice %s, %s (%s), was updated"), $x, $answer, $vote) ."<br>\n";
} else {
***************
*** 327,331 ****
$vote)";
$this->db->query($q);
! $msg .= "Choice $x, "$answer", was <em>inserted</em><br>\n";
}
}
--- 327,331 ----
$vote)";
$this->db->query($q);
! $msg .= sprintf(pslgetText("Choice %s, %s (%s), was inserted"), $x, $answer, $vote) ."<br>\n";
}
}
***************
*** 365,369 ****
$question_text = $this->db->f('question_text');
} else {
! $this->message = "I couldn't find your Poll, $question_id??";
return false;
}
--- 365,369 ----
$question_text = $this->db->f('question_text');
} else {
! $this->message = pslgetText("I couldn't find your Poll, ").$question_id;
return false;
}
***************
*** 391,395 ****
WHERE question_id = '$question_id'";
if (!$this->db->query($q)) {
! $this->message = 'THere was an error removing the votes';
return false;
}
--- 391,395 ----
WHERE question_id = '$question_id'";
if (!$this->db->query($q)) {
! $this->message = 'There was an error removing the votes';
return false;
}
***************
*** 398,402 ****
$del = $cmt->delete('0',$question_id);
}
! $this->message = "Poll "$question_text" was <em>deleted</em><br>\n";
return true;
}
--- 398,402 ----
$del = $cmt->delete('0',$question_id);
}
! $this->message = sprintf(pslgetText("Poll %s was deleted"), $question_test)."<br>\n";
return true;
}
***************
*** 483,487 ****
$this->db->query($query);
if (!$this->db->next_record()) {
! $this->message = "No Poll Found: '$question_id'";
return false;
} else {
--- 483,487 ----
$this->db->query($query);
if (!$this->db->next_record()) {
! $this->message = pslgetText("No Poll Found: ").$question_id;
return false;
} else {
***************
*** 555,559 ****
$this->db->query($q);
! $this->templ->set_var('TITLEBAR', getTitlebar('100%', $this->psl['site_name'] . ' Polls'));
$this->templ->set_block('listpoll', 'newpollbutton');
--- 555,559 ----
$this->db->query($q);
! $this->templ->set_var('TITLEBAR', getTitlebar('100%', $this->psl['site_name'] . pslgetText(' Polls')));
$this->templ->set_block('listpoll', 'newpollbutton');
Index: Section.class
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/class/Section.class,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** Section.class 20 Dec 2002 22:17:29 -0000 1.13
--- Section.class 23 Jan 2003 02:48:03 -0000 1.14
***************
*** 53,66 ****
$section_id = $this->db->Record['section_id'];
! $admin = "<A HREF=\"" . $this->psl['phpself'] ."?submit=edit". $this->psl['amp'] ."section_id=$section_id\">[Edit]</A>";
! $admin .= " <A HREF=\"" . $this->psl['phpself'] ."?submit=delete". $this->psl['amp'] ."section_id=$section_id\">[Delete]</A>";
$this->sec_templ->set_var(array(
! 'TITLEBAR' => getTitlebar("100%","Change Existing Sections"),
'ACTION_URL' => $this->psl['phpself'],
'SECTION_ID' => $this->db->Record['section_id'],
'SECTION_NAME' => $this->db->Record['section_name'],
'SECTION_DESC' => $this->db->Record['description'],
! 'ADMIN' => $admin
));
if ($count%2 == 0) {
--- 53,66 ----
$section_id = $this->db->Record['section_id'];
! $admin = "<A HREF=\"" . $this->psl['phpself'] ."?submit=edit". $this->psl['amp'] ."section_id=$section_id\">".pslgetText("[Edit]")."</A>";
! $admin .= " <A HREF=\"" . $this->psl['phpself'] ."?submit=delete". $this->psl['amp'] ."section_id=$section_id\">".pslgetText("[Delete]")."</A>";
$this->sec_templ->set_var(array(
! 'TITLEBAR' => getTitlebar("100%","Change Existing Sections"),
'ACTION_URL' => $this->psl['phpself'],
'SECTION_ID' => $this->db->Record['section_id'],
'SECTION_NAME' => $this->db->Record['section_name'],
'SECTION_DESC' => $this->db->Record['description'],
! 'ADMIN' => $admin
));
if ($count%2 == 0) {
***************
*** 326,332 ****
while ($this->db->next_record()) {
$section_array[] = array(
! "id" => $this->db->f("section_id"),
! "name" => $this->db->f("section_name")
! );
}
--- 326,332 ----
while ($this->db->next_record()) {
$section_array[] = array(
! "id" => $this->db->f("section_id"),
! "name" => $this->db->f("section_name")
! );
}
Index: Story.class
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/class/Story.class,v
retrieving revision 1.48
retrieving revision 1.49
diff -C2 -d -r1.48 -r1.49
*** Story.class 20 Dec 2002 22:17:29 -0000 1.48
--- Story.class 23 Jan 2003 02:48:03 -0000 1.49
***************
*** 133,137 ****
'AUTHOR_ID' => $ary['user_id'],
'AUTHOR_NAME' => $ary['name'],
! 'AUTHOR_REALNAME' => $ary['realname'],
'rows' => ""
));
--- 133,137 ----
'AUTHOR_ID' => $ary['user_id'],
'AUTHOR_NAME' => $ary['name'],
! 'AUTHOR_REALNAME' => $ary['realname'],
'rows' => ""
));
***************
*** 247,266 ****
switch($key) {
! case "tpl":
! // debug("Story::getStory::story_option[$key]", $val);
! $tpl = $ary['story_options'][$key];
$ary['story_options'][$key] = '';
! break;
/* Stub for future needs.
case "example":
! debug("Story::getStory::story_option[$key]", $val);
$ary['story_options'][$key] = '';
! break;
*/
default:
! // pluggable user defined function
if ($this->psl['story_options_udf'] != '') {
$ary = $this->psl['story_options_udf']($key,$ary['story_options'][$key] , $ary);
--- 247,266 ----
switch($key) {
! case "tpl":
! // debug("Story::getStory::story_option[$key]", $val);
! $tpl = $ary['story_options'][$key];
$ary['story_options'][$key] = '';
! break;
/* Stub for future needs.
case "example":
! debug("Story::getStory::story_option[$key]", $val);
$ary['story_options'][$key] = '';
! break;
*/
default:
! // pluggable user defined function
if ($this->psl['story_options_udf'] != '') {
$ary = $this->psl['story_options_udf']($key,$ary['story_options'][$key] , $ary);
***************
*** 273,278 ****
break;
! }
! }
}
--- 273,278 ----
break;
! }
! }
}
***************
*** 322,326 ****
all the variables stay there -nh */
if ($this->template->get_var("row") == "") {
! $this->template->set_block($template,"alsotext","alsoblock");
$this->template->set_block($template,"row","rows");
}
--- 322,326 ----
all the variables stay there -nh */
if ($this->template->get_var("row") == "") {
! $this->template->set_block($template,"alsotext","alsoblock");
$this->template->set_block($template,"row","rows");
}
***************
*** 379,383 ****
if (is_array($topic_id_ary)) {
! $this->template->parse("alsoblock", "alsotext", true);
for ($i = 0 ; $i < count($topic_id_ary) ; $i++) {
$this->template->set_var(array(
--- 379,383 ----
if (is_array($topic_id_ary)) {
! $this->template->parse("alsoblock", "alsotext", true);
for ($i = 0 ; $i < count($topic_id_ary) ; $i++) {
$this->template->set_var(array(
***************
*** 632,637 ****
$vars['body_text'] = format_mail($body_text, "76", "");
! $vars['site_host'] = $HTTP_HOST;
! $vars['php_self'] = $this->psl['phpself'];
$vars['story_id'] = $story_id;
$vars['title'] = ereg_replace("<([^>]*)>", "",$this->story_ary['title']);
--- 632,637 ----
$vars['body_text'] = format_mail($body_text, "76", "");
! $vars['site_host'] = $HTTP_HOST;
! $vars['php_self'] = $this->psl['phpself'];
$vars['story_id'] = $story_id;
$vars['title'] = ereg_replace("<([^>]*)>", "",$this->story_ary['title']);
Index: Story_admin.class
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/class/Story_admin.class,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** Story_admin.class 20 Dec 2002 22:17:30 -0000 1.10
--- Story_admin.class 23 Jan 2003 02:48:03 -0000 1.11
***************
*** 87,95 ****
}
! echo "The storyid is: $story_id<BR>\n";
if ($_PSL['module']['Comment']) {
$comment = pslNew("Comment");
$deleted_comments = $comment->delete("0",$story_id);
! echo "You deleted $deleted_comments comments<BR>\n";
}
--- 87,95 ----
}
! $this->message = pslgetText("The storyid is: ").$story_id."<BR>\n";
if ($_PSL['module']['Comment']) {
$comment = pslNew("Comment");
$deleted_comments = $comment->delete("0",$story_id);
! $this->message .= sprintf(pslgetText("You deleted %s comments"), $deleted_comments)."<BR>\n";
}
***************
*** 108,120 ****
if ($this->db->query($section_del)) {
$section_count = $this->db->affected_rows();
! echo "removed $section_count section pointer(s)<BR>\n";
}
if ($this->db->query($topic_del)) {
$topic_count = $this->db->affected_rows();
! echo "removed $topic_count topic pointer(s)<BR>\n";
}
if ($this->db->query($story_del)) {
$story_count = $this->db->affected_rows();
! echo "removed the story<BR>\n";
}
return true;
--- 108,120 ----
if ($this->db->query($section_del)) {
$section_count = $this->db->affected_rows();
! $this->message .= sprintf(pslgetText("removed %s section pointer(s)"), $section_count)."<BR>\n";
}
if ($this->db->query($topic_del)) {
$topic_count = $this->db->affected_rows();
! $this->message .= sprintf(pslgetText("removed %s topic pointer(s)"), $topic_count)."<BR>\n";
}
if ($this->db->query($story_del)) {
$story_count = $this->db->affected_rows();
! $this->message .= pslgetText("removed the story")."<BR>\n";
}
return true;
***************
*** 420,429 ****
if ($i%2 == 0) {
! $this->template->parse("rows","row","true");
! } else {
$this->template->parse("rows","row2","true");
! }
! $i++;
! }
}
--- 420,429 ----
if ($i%2 == 0) {
! $this->template->parse("rows","row","true");
! } else {
$this->template->parse("rows","row2","true");
! }
! $i++;
! }
}
***************
*** 511,600 ****
'TYPE' => "hidden",
'TIME_VALUE' => $ary['datetime']
! ));
! $this->template->parse("datetime_rows","datetime_row",true);
} else {
! $datetime = split( ' ', $ary['datetime']);
! $story_date = split( '-', $datetime[0]);
! $story_time = split( ':', $datetime[1]);
// setup year select box
! for( $i=1998; $i<2009; $i++) {
$this->template->set_var(array(
! 'SELECTED' => '',
! 'STORYYEAR' => $i
));
if( $i == $story_date[0]) {
$this->template->set_var('SELECTED', "selected=\"selected\"");
! }
! $this->template->parse("year_rows","year_row",true);
! }
// setup month select box
! for( $i=1; $i<=12; $i++) {
$this->template->set_var(array(
! 'SELECTED' => '',
! 'STORYMONTH' => sprintf( "%02d", $i)
));
if( $i == $story_date[1]) {
$this->template->set_var('SELECTED', "selected=\"selected\"");
! }
! $this->template->parse("month_rows","month_row",true);
! }
! // setup day select box
! for( $i=1; $i<=31; $i++) {
$this->template->set_var(array(
! 'SELECTED' => '',
! 'STORYDAY' => sprintf( "%02d", $i)
));
if( $i == $story_date[2]) {
$this->template->set_var('SELECTED', "selected=\"selected\"");
! }
! $this->template->parse("day_rows","day_row",true);
! }
// setup hour select box
! for( $i=1; $i<=24; $i++) {
$this->template->set_var(array(
'TYPE' => 'select',
! 'SELECTED' => '',
'STORYHOUR' => $i
));
if( $i == $story_time[0]) {
$this->template->set_var('SELECTED', "selected=\"selected\"");
! }
! $this->template->parse("hour_rows","hour_row",true);
! }
// setup minute select box
! for( $i=1; $i<=60; $i++) {
$this->template->set_var(array(
'TYPE' => 'select',
! 'SELECTED' => '',
! 'STORYMINUTE' => sprintf( "%02d", $i)
));
if( $i == $story_time[1]) {
$this->template->set_var('SELECTED', "selected=\"selected\"");
! }
! $this->template->parse("minute_rows","minute_row",true);
! }
// setup seconds select box
! for( $i=1; $i<=60; $i++) {
$this->template->set_var(array(
'TYPE' => 'select',
! 'SELECTED' => '',
! 'STORYSECOND' => sprintf( "%02d", $i)
));
if( $i == $story_time[2]) {
$this->template->set_var('SELECTED', "selected=\"selected\"");
! }
! $this->template->parse("second_rows","second_row",true);
! }
! $this->template->parse("datetimeset_rows","datetimeset_row",true);
}
$this->template = displayOptions('story', $this->template, "newstory", '');
! if ($ary['content'] == "plain") {
$this->template->set_var('PLAIN_CHKBOX',"CHECKED");
$this->template->set_var('HTML_CHKBOX',"");
--- 511,600 ----
'TYPE' => "hidden",
'TIME_VALUE' => $ary['datetime']
! ));
! $this->template->parse("datetime_rows","datetime_row",true);
} else {
! $datetime = split( ' ', $ary['datetime']);
! $story_date = split( '-', $datetime[0]);
! $story_time = split( ':', $datetime[1]);
// setup year select box
! for( $i=1998; $i<2009; $i++) {
$this->template->set_var(array(
! 'SELECTED' => '',
! 'STORYYEAR' => $i
));
if( $i == $story_date[0]) {
$this->template->set_var('SELECTED', "selected=\"selected\"");
! }
! $this->template->parse("year_rows","year_row",true);
! }
// setup month select box
! for( $i=1; $i<=12; $i++) {
$this->template->set_var(array(
! 'SELECTED' => '',
! 'STORYMONTH' => sprintf( "%02d", $i)
));
if( $i == $story_date[1]) {
$this->template->set_var('SELECTED', "selected=\"selected\"");
! }
! $this->template->parse("month_rows","month_row",true);
! }
! // setup day select box
! for( $i=1; $i<=31; $i++) {
$this->template->set_var(array(
! 'SELECTED' => '',
! 'STORYDAY' => sprintf( "%02d", $i)
));
if( $i == $story_date[2]) {
$this->template->set_var('SELECTED', "selected=\"selected\"");
! }
! $this->template->parse("day_rows","day_row",true);
! }
// setup hour select box
! for( $i=1; $i<=24; $i++) {
$this->template->set_var(array(
'TYPE' => 'select',
! 'SELECTED' => '',
'STORYHOUR' => $i
));
if( $i == $story_time[0]) {
$this->template->set_var('SELECTED', "selected=\"selected\"");
! }
! $this->template->parse("hour_rows","hour_row",true);
! }
// setup minute select box
! for( $i=1; $i<=60; $i++) {
$this->template->set_var(array(
'TYPE' => 'select',
! 'SELECTED' => '',
! 'STORYMINUTE' => sprintf( "%02d", $i)
));
if( $i == $story_time[1]) {
$this->template->set_var('SELECTED', "selected=\"selected\"");
! }
! $this->template->parse("minute_rows","minute_row",true);
! }
// setup seconds select box
! for( $i=1; $i<=60; $i++) {
$this->template->set_var(array(
'TYPE' => 'select',
! 'SELECTED' => '',
! 'STORYSECOND' => sprintf( "%02d", $i)
));
if( $i == $story_time[2]) {
$this->template->set_var('SELECTED', "selected=\"selected\"");
! }
! $this->template->parse("second_rows","second_row",true);
! }
! $this->template->parse("datetimeset_rows","datetimeset_row",true);
}
$this->template = displayOptions('story', $this->template, "newstory", '');
! if ($ary['content'] == "plain") {
$this->template->set_var('PLAIN_CHKBOX',"CHECKED");
$this->template->set_var('HTML_CHKBOX',"");
***************
*** 657,661 ****
(MPL - 11/18/2002) */
$this->db->Record['time'] = date("Y-m-d H:i:s",$this->db->Record['date_available']);
! echo "time: " . $this->db->Record['time'] . "\n<br>";
$this->template->set_var(array(
--- 657,661 ----
(MPL - 11/18/2002) */
$this->db->Record['time'] = date("Y-m-d H:i:s",$this->db->Record['date_available']);
! // echo "time: " . $this->db->Record['time'] . "\n<br>";
$this->template->set_var(array(
***************
*** 676,680 ****
( $user_id != $this->auth->auth['uid'])) {
return false;
! }
/* if storyeditor, enable setting of date, otherwise display date */
--- 676,680 ----
( $user_id != $this->auth->auth['uid'])) {
return false;
! }
/* if storyeditor, enable setting of date, otherwise display date */
***************
*** 683,771 ****
'TYPE' => "hidden",
'TIME_VALUE' => $this->db->Record['time']
! ));
! $this->template->parse("datetime_rows","datetime_row",true);
} else {
! $datetime = split( ' ', $this->db->Record['time']);
! $story_date = split( '-', $datetime[0]);
! $story_time = split( ':', $datetime[1]);
// setup year select box
! for( $i=1998; $i<2009; $i++) {
$this->template->set_var(array(
! 'SELECTED' => '',
! 'STORYYEAR' => $i
));
if( $i == $story_date[0]) {
$this->template->set_var('SELECTED', "selected=\"selected\"");
! }
! $this->template->parse("year_rows","year_row",true);
! }
// setup month select box
! for( $i=1; $i<=12; $i++) {
$this->template->set_var(array(
! 'TYPE' => 'select',
! 'SELECTED' => '',
! 'STORYMONTH' => sprintf( "%02d", $i)
));
if( $i == $story_date[1]) {
$this->template->set_var('SELECTED', "selected=\"selected\"");
! }
! $this->template->parse("month_rows","month_row",true);
! }
! // setup day select box
! for( $i=1; $i<=31; $i++) {
$this->template->set_var(array(
! 'TYPE' => 'select',
! 'SELECTED' => '',
! 'STORYDAY' => sprintf( "%02d", $i)
));
if( $i == $story_date[2]) {
$this->template->set_var('SELECTED', "selected=\"selected\"");
! }
! $this->template->parse("day_rows","day_row",true);
! }
// setup hour select box
! for( $i=1; $i<=24; $i++) {
$this->template->set_var(array(
! 'TYPE' => 'select',
! 'SELECTED' => '',
! 'STORYHOUR' => $i
));
if( $i == $story_time[0]) {
$this->template->set_var('SELECTED', "selected=\"selected\"");
! }
! $this->template->parse("hour_rows","hour_row",true);
! }
// setup minute select box
! for( $i=1; $i<=60; $i++) {
$this->template->set_var(array(
'TYPE' => 'select',
! 'SELECTED' => '',
! 'STORYMINUTE' => sprintf( "%02d", $i)
));
if( $i == $story_time[1]) {
$this->template->set_var('SELECTED', "selected=\"selected\"");
! }
! $this->template->parse("minute_rows","minute_row",true);
! }
// setup seconds select box
! for( $i=1; $i<=60; $i++) {
$this->template->set_var(array(
'TYPE' => 'select',
! 'SELECTED' => '',
! 'STORYSECOND' => sprintf( "%02d", $i)
));
if( $i == $story_time[2]) {
$this->template->set_var('SELECTED', "selected=\"selected\"");
! }
! $this->template->parse("second_rows","second_row",true);
! }
! $this->template->parse("datetimeset_rows","datetimeset_row",true);
}
--- 683,771 ----
'TYPE' => "hidden",
'TIME_VALUE' => $this->db->Record['time']
! ));
! $this->template->parse("datetime_rows","datetime_row",true);
} else {
! $datetime = split( ' ', $this->db->Record['time']);
! $story_date = split( '-', $datetime[0]);
! $story_time = split( ':', $datetime[1]);
// setup year select box
! for( $i=1998; $i<2009; $i++) {
$this->template->set_var(array(
! 'SELECTED' => '',
! 'STORYYEAR' => $i
));
if( $i == $story_date[0]) {
$this->template->set_var('SELECTED', "selected=\"selected\"");
! }
! $this->template->parse("year_rows","year_row",true);
! }
// setup month select box
! for( $i=1; $i<=12; $i++) {
$this->template->set_var(array(
! 'TYPE' => 'select',
! 'SELECTED' => '',
! 'STORYMONTH' => sprintf( "%02d", $i)
));
if( $i == $story_date[1]) {
$this->template->set_var('SELECTED', "selected=\"selected\"");
! }
! $this->template->parse("month_rows","month_row",true);
! }
! // setup day select box
! for( $i=1; $i<=31; $i++) {
$this->template->set_var(array(
! 'TYPE' => 'select',
! 'SELECTED' => '',
! 'STORYDAY' => sprintf( "%02d", $i)
));
if( $i == $story_date[2]) {
$this->template->set_var('SELECTED', "selected=\"selected\"");
! }
! $this->template->parse("day_rows","day_row",true);
! }
// setup hour select box
! for( $i=1; $i<=24; $i++) {
$this->template->set_var(array(
! 'TYPE' => 'select',
! 'SELECTED' => '',
! 'STORYHOUR' => $i
));
if( $i == $story_time[0]) {
$this->template->set_var('SELECTED', "selected=\"selected\"");
! }
! $this->template->parse("hour_rows","hour_row",true);
! }
// setup minute select box
! for( $i=1; $i<=60; $i++) {
$this->template->set_var(array(
'TYPE' => 'select',
! 'SELECTED' => '',
! 'STORYMINUTE' => sprintf( "%02d", $i)
));
if( $i == $story_time[1]) {
$this->template->set_var('SELECTED', "selected=\"selected\"");
! }
! $this->template->parse("minute_rows","minute_row",true);
! }
// setup seconds select box
! for( $i=1; $i<=60; $i++) {
$this->template->set_var(array(
'TYPE' => 'select',
! 'SELECTED' => '',
! 'STORYSECOND' => sprintf( "%02d", $i)
));
if( $i == $story_time[2]) {
$this->template->set_var('SELECTED', "selected=\"selected\"");
! }
! $this->template->parse("second_rows","second_row",true);
! }
! $this->template->parse("datetimeset_rows","datetimeset_row",true);
}
***************
*** 775,782 ****
$this->template->set_var(array(
! 'ACTION_URL' => "storyAdmin.php3",
# 'AUTHOR_ID' => $author_id,
# 'AUTHOR_NAME' => $author_name,
! 'STORY_ID' => $story_id
));
--- 775,782 ----
$this->template->set_var(array(
! 'ACTION_URL' => "storyAdmin.php3",
# 'AUTHOR_ID' => $author_id,
# 'AUTHOR_NAME' => $author_name,
! 'STORY_ID' => $story_id
));
Index: Story_base.class
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/class/Story_base.class,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** Story_base.class 11 Dec 2002 19:39:55 -0000 1.21
--- Story_base.class 23 Jan 2003 02:48:03 -0000 1.22
***************
*** 63,69 ****
story.intro_text,
story.body_text,
! story.hits,
story.topic_cache,
! story.story_options,
psl_author.author_name AS name,
psl_author.author_realname AS realname,
--- 63,69 ----
story.intro_text,
story.body_text,
! story.hits,
story.topic_cache,
! story.story_options,
psl_author.author_name AS name,
psl_author.author_realname AS realname,
***************
*** 193,197 ****
psl_story.hits,
psl_story.story_options,
! psl_author.author_name,
psl_author.author_realname,
psl_author.url,
--- 193,197 ----
psl_story.hits,
psl_story.story_options,
! psl_author.author_name,
psl_author.author_realname,
psl_author.url,
***************
*** 226,230 ****
if( empty($argv_ary['date'])) {
$argv_ary['date'] = date("Y-m-d H:i:s");
! $argv_ary['date_available'] = time();
} else {
// kludge to keep the cal block working - jvs - 04/05/2001
--- 226,230 ----
if( empty($argv_ary['date'])) {
$argv_ary['date'] = date("Y-m-d H:i:s");
! $argv_ary['date_available'] = time();
} else {
// kludge to keep the cal block working - jvs - 04/05/2001
***************
*** 234,239 ****
* 11/15/2002) */
$argv_ary['date'] = intval($argv_ary['date'])+1;
! $argv_ary['date_available'] = strtotime($argv_ary['date']);
! }
while( $each_argv = each($argv_ary) ) {
--- 234,239 ----
* 11/15/2002) */
$argv_ary['date'] = intval($argv_ary['date'])+1;
! $argv_ary['date_available'] = strtotime($argv_ary['date']);
! }
while( $each_argv = each($argv_ary) ) {
***************
*** 285,289 ****
// $q .= "AND to_days('$argv_ary[date]') >= to_days(time) ";
//$q .= "AND ('$argv_ary[date]') >= time ";
! $q .= "AND $argv_ary[date_available] >= psl_story.date_available ";
break;
--- 285,289 ----
// $q .= "AND to_days('$argv_ary[date]') >= to_days(time) ";
//$q .= "AND ('$argv_ary[date]') >= time ";
! $q .= "AND $argv_ary[date_available] >= psl_story.date_available ";
break;
***************
*** 410,414 ****
$stories_ary[$i]['cmtcount'] = $this->db->Record["cmtcount"];
$stories_ary[$i]['story_options'] = unserialize($this->db->Record["story_options"]);
! // debug("Story::extractStories.stories_ary", $stories_ary[$i]);
}
$unique_stories++;
--- 410,414 ----
$stories_ary[$i]['cmtcount'] = $this->db->Record["cmtcount"];
$stories_ary[$i]['story_options'] = unserialize($this->db->Record["story_options"]);
! // debug("Story::extractStories.stories_ary", $stories_ary[$i]);
}
$unique_stories++;
***************
*** 473,486 ****
/* removed because if there's no ID then we insert, else we update...
if ($ary['story_id'] == "") {
! error ("There is no story_id in Story.class::saveStory");
return false;
}
*/
if ($topic_id_ary[0] == "") {
! $this->message = "You need to select at least one <B>topic</B> in Story.class::saveStory";
return false;
}
if ($section_id_ary[0] == "") {
! $this->message = "You need to select at least one <B>section</B> in Story.class::saveStory";
return false;
}
--- 473,486 ----
/* removed because if there's no ID then we insert, else we update...
if ($ary['story_id'] == "") {
! $this->message = pslgetText("There is no story_id in Story.class::saveStory");
return false;
}
*/
if ($topic_id_ary[0] == "") {
! $this->message = "You need to select at least one topic in Story.class::saveStory";
return false;
}
if ($section_id_ary[0] == "") {
! $this->message = "You need to select at least one section in Story.class::saveStory";
return false;
}
***************
*** 521,528 ****
if( $optionname_ary[$i] != "") {
! $optname = $optionname_ary[$i];
! $optval = $optionval_ary[$i];
! $story_options_ary[$optname] = $optval;
! }
}
--- 521,528 ----
if( $optionname_ary[$i] != "") {
! $optname = $optionname_ary[$i];
! $optval = $optionval_ary[$i];
! $story_options_ary[$optname] = $optval;
! }
}
***************
*** 536,546 ****
SET user_id = '$ary[author_id]',
title = '$ary[title]',
! date_available = $ary[timestamp],
! order_no = '$ary[order_no]',
dept = '$ary[dept]',
intro_text = '$ary[intro_text]',
body_text = '$ary[body_text]',
topic_cache = '',
! story_options = '$serial_opts'
WHERE story_id = '$ary[story_id]'";
--- 536,546 ----
SET user_id = '$ary[author_id]',
title = '$ary[title]',
! date_available = $ary[timestamp],
! order_no = '$ary[order_no]',
dept = '$ary[dept]',
intro_text = '$ary[intro_text]',
body_text = '$ary[body_text]',
topic_cache = '',
! story_options = '$serial_opts'
WHERE story_id = '$ary[story_id]'";
***************
*** 566,581 ****
// echo "<B>STORY ID: $ary[story_id]</B><BR><BR>\n";
! # set the formatting options for new submissions only
! if ($ary['content'] == "exttrans") {
! $ary['intro_text'] = htmlentities($ary['intro_text']);
! $ary['body_text'] = htmlentities($ary['body_text']);
! }
! if ($ary['content'] == "plain" or $ary['content'] == "exttrans") {
! $ary['intro_text'] = nl2br($ary['intro_text']);
! $ary['intro_text'] = ereg_replace("<br><br>","<br>",$ary['intro_text']);
! $ary['body_text'] = nl2br($ary[body_text]);
! $ary['body_text'] = ereg_replace("<br><br>","<br>",$ary['body_text']);
! }
--- 566,581 ----
// echo "<B>STORY ID: $ary[story_id]</B><BR><BR>\n";
! # set the formatting options for new submissions only
! if ($ary['content'] == "exttrans") {
! $ary['intro_text'] = htmlentities($ary['intro_text']);
! $ary['body_text'] = htmlentities($ary['body_text']);
! }
! if ($ary['content'] == "plain" or $ary['content'] == "exttrans") {
! $ary['intro_text'] = nl2br($ary['intro_text']);
! $ary['intro_text'] = ereg_replace("<br><br>","<br>",$ary['intro_text']);
! $ary['body_text'] = nl2br($ary[body_text]);
! $ary['body_text'] = ereg_replace("<br><br>","<br>",$ary['body_text']);
! }
***************
*** 590,595 ****
date_available,
hits,
! topic_cache,
! story_options)
VALUES ('$ary[story_id]',
'$ary[author_id]',
--- 590,595 ----
date_available,
hits,
! topic_cache,
! story_options)
VALUES ('$ary[story_id]',
'$ary[author_id]',
***************
*** 601,607 ****
$ary[timestamp],
'0',
! '',
! '$serial_opts')";
! debug("Story_base::saveStory: insert query",$q);
$this->db->query($q);
--- 601,607 ----
$ary[timestamp],
'0',
! '',
! '$serial_opts')";
! // debug("Story_base::saveStory: insert query",$q);
$this->db->query($q);
***************
*** 662,667 ****
function cacheStory( $ary, $field="", $story_id="") {
! debug( "Story.class::cacheStory::ary", $ary);
! debug( "Story.class::cacheStory::field", $field);
$now = time();
--- 662,667 ----
function cacheStory( $ary, $field="", $story_id="") {
! // debug( "Story.class::cacheStory::ary", $ary);
! // debug( "Story.class::cacheStory::field", $field);
$now = time();
***************
*** 669,679 ****
if( !$story_id){
$elapsed = $now - $ary[$field]['update'];
! debug( "Story.class::cacheStory::elapsed", $elapsed);
if ( ($now - $ary[$field]['update']) < $ary[$field]['expire'] ) {
! debug("Story.class::cacheStory::using $field cache", "");
$cache = $ary[$field]['cache'];
} else {
! debug("Story.class::cacheStory::not using $field cache", "");
$cache = "";
}
--- 669,679 ----
if( !$story_id){
$elapsed = $now - $ary[$field]['update'];
! // debug( "Story.class::cacheStory::elapsed", $elapsed);
if ( ($now - $ary[$field]['update']) < $ary[$field]['expire'] ) {
! // debug("Story.class::cacheStory::using $field cache", "");
$cache = $ary[$field]['cache'];
} else {
! // debug("Story.class::cacheStory::not using $field cache", "");
$cache = "";
}
***************
*** 685,701 ****
/* if there are no "expire" fields greater than zero,
then, we're not using the cache and so don't write to db
! */
! if ( ($ary[$field_name]['expire'] > 0) AND
($now - $ary[$field]['update']) > $ary[$field]['expire'] ) {
! $expired = true;
}
}
if( $expired == true) {
! $serial_cache = addslashes(serialize($ary));
$qc = "UPDATE psl_story
SET topic_cache = '$serial_cache'
WHERE story_id = '$story_id'";
! debug("Story.class::cacheStory::updating cache", $qc);
$query_result = $this->db->query($qc);
}
--- 685,701 ----
/* if there are no "expire" fields greater than zero,
then, we're not using the cache and so don't write to db
! */
! if ( ($ary[$field_name]['expire'] > 0) AND
($now - $ary[$field]['update']) > $ary[$field]['expire'] ) {
! $expired = true;
}
}
if( $expired == true) {
! $serial_cache = addslashes(serialize($ary));
$qc = "UPDATE psl_story
SET topic_cache = '$serial_cache'
WHERE story_id = '$story_id'";
! // debug("Story.class::cacheStory::updating cache", $qc);
$query_result = $this->db->query($qc);
}
Index: Submission.class
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/class/Submission.class,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** Submission.class 20 Dec 2002 22:17:30 -0000 1.15
--- Submission.class 23 Jan 2003 02:48:03 -0000 1.16
***************
*** 50,61 ****
$ary['name'] = $this->db->f("name");
$ary['email'] = $this->db->f("email");
! $ary['datef'] = psl_dateTimeLong($this->db->f('date_created'));
$this->message = $this->showSubmission($ary);
! $success = true;
} else {
$this->message = sprintf(pslgetText("No Submission Found: %s"), $submission_id);
! $success = false;
}
--- 50,61 ----
$ary['name'] = $this->db->f("name");
$ary['email'] = $this->db->f("email");
! $ary['datef'] = psl_dateTimeLong($this->db->f('date_created'));
$this->message = $this->showSubmission($ary);
! $success = true;
} else {
$this->message = sprintf(pslgetText("No Submission Found: %s"), $submission_id);
! $success = false;
}
***************
*** 120,124 ****
'EMAIL' => $this->db->Record["email"],
'NAME' => $this->db->Record["name"],
! 'TIME' => psl_time12($this->db->Record["date_created"]),
'DATE' => psl_dateShort($this->db->Record["date_created"])
));
--- 120,124 ----
'EMAIL' => $this->db->Record["email"],
'NAME' => $this->db->Record["name"],
! 'TIME' => psl_time12($this->db->Record["date_created"]),
'DATE' => psl_dateShort($this->db->Record["date_created"])
));
***************
*** 139,143 ****
if ($count > $first) {
$this->templ->set_var(array(
! 'MORE_LINK' => "<a href=\"" . $this->psl['phpself'] . "?next=$first\">$left More</a>"
));
}
--- 139,143 ----
if ($count > $first) {
$this->templ->set_var(array(
! 'MORE_LINK' => "<a href=\"" . $this->psl['phpself'] . "?next=$first\">".$left .pslgetText("More")."</a>"
));
}
***************
*** 299,307 ****
if ($topic_id_ary[0] == "") {
! $this->message = pslgetText("You need to select at least one <B>topic</B> in Submission.class::saveSubmission");
return false;
}
if ($section_id_ary[0] == "") {
! $this->message = pslgetText("You need to select at least one <B>section</B> in Submission.class::saveSubmission");
return false;
}
--- 299,307 ----
if ($topic_id_ary[0] == "") {
! $this->message = pslgetText("You need to select at least one topic in Submission.class::saveSubmission");
return false;
}
if ($section_id_ary[0] == "") {
! $this->message = pslgetText("You need to select at least one section in Submission.class::saveSubmission");
return false;
}
***************
*** 321,325 ****
$ary['email'] = clean($ary['email']);
$ary['subject'] = clean($ary['subject']);
! // $ary['story'] = clean($ary['story']);
$ary['story'] = str_replace("'","'", $ary['story']);
--- 321,325 ----
$ary['email'] = clean($ary['email']);
$ary['subject'] = clean($ary['subject']);
! // $ary['story'] = clean($ary['story']);
$ary['story'] = str_replace("'","'", $ary['story']);
***************
*** 357,369 ****
$ary['story'] = nl2br($ary['story']);
$ary['story'] = ereg_replace("<br><br>","<br>",$ary['story']);
! }
if ($ary['content'] == "exttrans") {
$ary['story'] = htmlentities($ary['story']);
}
!
!
$ary['submission_id'] = generateID("psl_submission_seq");
! $timestamp = time();
$q = "INSERT INTO psl_submission
(story_id,
--- 357,368 ----
$ary['story'] = nl2br($ary['story']);
$ary['story'] = ereg_replace("<br><br>","<br>",$ary['story']);
! }
if ($ary['content'] == "exttrans") {
$ary['story'] = htmlentities($ary['story']);
}
!
$ary['submission_id'] = generateID("psl_submission_seq");
! $timestamp = time();
$q = "INSERT INTO psl_submission
(story_id,
***************
*** 440,444 ****
$affected = $this->db->affected_rows();
# echo "The Query: <BR><BR>$submission<BR><BR>affected $affected row(s)<BR><BR>\n";
! return true;
} else {
--- 439,443 ----
$affected = $this->db->affected_rows();
# echo "The Query: <BR><BR>$submission<BR><BR>affected $affected row(s)<BR><BR>\n";
! return true;
} else {
***************
*** 468,472 ****
$ary = $this->db->Record;
! $ary['intro_text'] = "Submission by <A HREF=\"" . htmlspecialchars($this->db->f("email")) . "\">" . $this->db->f("name") . "</A>\n<P>\n" . dirty($this->db->f("intro_text"));
/* get the topic_id's for this story into an array */
--- 467,471 ----
$ary = $this->db->Record;
! $ary['intro_text'] = pslgetText("Submission by ") ."<a href=\"" . htmlspecialchars($this->db->f("email")) . "\">" . $this->db->f("name") . "</a>\n<p>\n" . dirty($this->db->f("intro_text"));
/* get the topic_id's for this story into an array */
Index: Topic.class
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/class/Topic.class,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** Topic.class 20 Dec 2002 22:17:30 -0000 1.15
--- Topic.class 23 Jan 2003 02:48:03 -0000 1.16
***************
*** 68,76 ****
$topic_id = $this->db->Record[topic_id];
if ($this->perm->have_perm("topicEdit")) {
! $admin = "<A HREF=\"" . $this->psl['phpself'] . "?submit=edit" . $this->psl['amp'] . "topic_id=$topic_id\">[Edit]</A>";
! $admin .= " <A HREF=\"" . $this->psl['phpself'] . "?submit=delete" . $this->psl['amp'] . "topic_id=$topic_id\">[Delete]</A>";
} else {
! $admin = " <A HREF=\"" . $this->psl['phpself'] . "?submit=delete" . $this->psl['amp'] . "topic_id=$topic_id\">[Delete]</A>";
}
$this->topic_templ->set_var(array(
--- 68,76 ----
$topic_id = $this->db->Record[topic_id];
if ($this->perm->have_perm("topicEdit")) {
! $admin = "<A HREF=\"" . $this->psl['phpself'] . "?submit=edit" . $this->psl['amp'] . "topic_id=$topic_id\">".pslgetText("[Edit]")."</A>";
! $admin .= " <A HREF=\"" . $this->psl['phpself'] . "?submit=delete" . $this->psl['amp'] . "topic_id=$topic_id\">".pslgetText("[Delete]")."</A>";
} else {
! $admin = " <A HREF=\"" . $this->psl['phpself'] . "?submit=delete" . $this->psl['amp'] . "topic_id=$topic_id\">".pslgetText("[Delete]")."</A>";
}
$this->topic_templ->set_var(array(
***************
*** 87,97 ****
'ADMIN' => $admin
));
! if ($i%2 == 0) {
$this->topic_templ->parse("rows","row",true);
! } else {
$this->topic_templ->parse("rows","row2",true);
! }
! $i++;
! };
return $this->topic_templ->parse('OUT',array("listtopic"));
// $this->topic_templ->p('OUT');
--- 87,97 ----
'ADMIN' => $admin
));
! if ($i%2 == 0) {
$this->topic_templ->parse("rows","row",true);
! } else {
$this->topic_templ->parse("rows","row2",true);
! }
! $i++;
! }
return $this->topic_templ->parse('OUT',array("listtopic"));
// $this->topic_templ->p('OUT');
***************
*** 229,233 ****
$story_id = $this->db->Record["story_id"];
$topic_name = $this->db->Record["topic_name"];
! $this->message .= "Sorry, ths story is assigned to this topic:";
$this->message .= "<font color=\"red\">'$title'</font><br />\n";
}
--- 229,233 ----
$story_id = $this->db->Record["story_id"];
$topic_name = $this->db->Record["topic_name"];
! $this->message .= pslgetText("Sorry, ths story is assigned to this topic:");
$this->message .= "<font color=\"red\">'$title'</font><br />\n";
}
***************
*** 247,251 ****
$story_id = $this->db->Record["story_id"];
$topic_name = $this->db->Record["topic_name"];
! $this->message .= "Sorry, this submission is assigned to this topic:";
$this->message .= "<font color=\"red\">'$title'</font><br />\n";
}
--- 247,251 ----
$story_id = $this->db->Record["story_id"];
$topic_name = $this->db->Record["topic_name"];
! $this->message .= pslgetText("Sorry, this submission is assigned to this topic:");
$this->message .= "<font color=\"red\">'$title'</font><br />\n";
}
***************
*** 258,262 ****
WHERE topic_id = '$topic_id'";
$this->db->query($q);
! $this->message .= "<i>Topic deleted</i>";
return true;
--- 258,262 ----
WHERE topic_id = '$topic_id'";
$this->db->query($q);
! $this->message .= pslgetText("Topic deleted");
return true;
***************
*** 277,281 ****
if($ary["topic_id"] == "") {
$this->topic_templ->set_var(array(
! 'TITLEBAR' => getTitlebar("100%","Add a new Topic"),
'TOPICIMAGESDIR' => $this->psl['topicimagedir'],
'TOPIC_ID' => "",
--- 277,281 ----
if($ary["topic_id"] == "") {
$this->topic_templ->set_var(array(
! 'TITLEBAR' => getTitlebar("100%","Add a new Topic"),
'TOPICIMAGESDIR' => $this->psl['topicimagedir'],
'TOPIC_ID' => "",
***************
*** 297,301 ****
$this->db->next_record();
$this->topic_templ->set_var(array(
! 'TITLEBAR' => getTitlebar("100%","Edit Topic"),
'IMAGE_SRC' => $image,
'TOPICIMAGESDIR' => $this->psl['topicimagedir'],
--- 297,301 ----
$this->db->next_record();
$this->topic_templ->set_var(array(
! 'TITLEBAR' => getTitlebar("100%","Edit Topic"),
'IMAGE_SRC' => $image,
'TOPICIMAGESDIR' => $this->psl['topicimagedir'],
***************
*** 353,357 ****
if( $option != "all") {
$result = getTitlebar("100%","Display Topic Images");
! $result .= "<A HREF=" . $this->psl['phpself'] . "?submit=display" . $this->psl['amp'] . "option=all>[Display all possible topic images]</A>";
} else {
$this->topic_templ->set_var("TITLEBAR", getTitlebar("100%","Display Topic Images"));
--- 353,357 ----
if( $option != "all") {
$result = getTitlebar("100%","Display Topic Images");
! $result .= "<A HREF=" . $this->psl['phpself'] . "?submit=display" . $this->psl['amp'] . "option=all>".pslgetText("[Display all possible topic images]")."</A>";
} else {
$this->topic_templ->set_var("TITLEBAR", getTitlebar("100%","Display Topic Images"));
***************
*** 453,459 ****
while ($this->db->next_record()) {
$topic_array[] = array(
! "id" => $this->db->f("topic_id"),
! "name" => $this->db->f("topic_name")
! );
}
--- 453,459 ----
while ($this->db->next_record()) {
$topic_array[] = array(
! "id" => $this->db->f("topic_id"),
! "name" => $this->db->f("topic_name")
! );
}
***************
*** 523,601 ****
if ($is_onlinkbar > 0) {
! // this means that the topic id is already
! // on the link bar...
! if ($is_onlinkbar > 1) {
! // when the link is one, we do nothing
! // but when it's greater, we take the ones
! // before, update them, and then
! // put the is_onlinkbar ID in the first
! // slot
! //
! // 1) begin work:
! $q = "BEGIN WORK";
! $this->db->query($q);
! // 2) update values of onlinkbar
! $q = "UPDATE psl_topic
! SET onlinkbar=onlinkbar+1
! WHERE onlinkbar > 0 && onlinkbar < '$is_onlinkbar'";
! $this->db->query($q);
// 3) put this topic_id as first item in bar
! $q = "UPDATE psl_topic
! SET onlinkbar=1
! WHERE topic_id = '$topic_id'";
! $this->db->query($q);
! // 4) commit and release table
! $q = "COMMIT";
! $this->db->query($q);
! // this might not be necessary,
! // but hey, you never know! -luis m
! if ($this->db->affected_rows() > 0) {
! return true;
! }else{
! return false;
! }
! } else {
// is_onlinkbar is ONE, return true.
return true;
! }// end is_onlinkbar > 1
} else {
! // 1) begin work:
! $q = "BEGIN WORK";
! $this->db->query($q);
! // 2) update values of onlinkbar
! $q = "UPDATE psl_topic
! SET onlinkbar=onlinkbar+1
! WHERE onlinkbar != 0";
! $this->db->query($q);
! // 3) purge values higher than LIMIT
! $q = "UPDATE psl_topic
! SET onlinkbar=0
! WHERE onlinkbar > '$limit'";
! $this->db->query($q);
! // 4) put this topic_id as first item in bar
! $q = "UPDATE psl_topic
! SET onlinkbar=1
! WHERE topic_id = '$topic_id'";
! $this->db->query($q);
! // 5) commit and release table
! $q = "COMMIT";
! $this->db->query($q);
! if ($this->db->affected_rows() > 0) {
! return true;
! }else{
! return false;
! }
} // end is_onlinkbar
} // end renormTopi...
[truncated message content] |