Update of /cvsroot/phpslash/phpslash-ft/class
In directory usw-pr-cvs1:/tmp/cvs-serv19148/phpslash-ft/class
Modified Files:
Author.class Comment.class Section.class Story.class
Topic.class functions.inc slashAuth.class
Log Message:
easier navigation in StoryAdmin, some comment fixes too...
Index: Author.class
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/class/Author.class,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** Author.class 2001/08/31 19:19:51 1.5
--- Author.class 2001/10/17 17:11:26 1.6
***************
*** 284,286 ****
--- 284,306 ----
}
+ function authorSelect($varname,$selected) {
+
+ $q = "SELECT author_id, author_name
+ FROM psl_author";
+ $this->db->query($q);
+ $output = "<SELECT NAME=\"$varname\">\n";
+ $output .= " <OPTION VALUE=\"\">All</OPTION>\n";
+ while ($this->db->next_record()) {
+ $id = $this->db->f("author_id");
+ $name = $this->db->f("author_name");
+ $output .= " <OPTION VALUE=\"$id\" ";
+ if ($id == $selected) {
+ $output .= " SELECTED";
+ }
+ $output .= ">$name</OPTION>\n";
+ }
+ $output .= "</SELECT>\n";
+ return $output;
+ }
+
}; /* end of Author.class */
Index: Comment.class
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/class/Comment.class,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** Comment.class 2001/10/09 23:23:05 1.19
--- Comment.class 2001/10/17 17:11:26 1.20
***************
*** 35,39 ****
*/
function Comment ($ary = array()) {
! global $approvedtags,$_PSL, $perm;
$this->psl = $_PSL;
--- 35,39 ----
*/
function Comment ($ary = array()) {
! global $_PSL, $perm;
$this->psl = $_PSL;
***************
*** 62,67 ****
));
! reset($approvedtags);
! while (list($k,$v) = each($approvedtags)) {
$tags .= "<${k}>\n";
};
--- 62,67 ----
));
! reset($this->psl[approvedtags]);
! while (list($k,$v) = each($this->psl[approvedtags])) {
$tags .= "<${k}>\n";
};
Index: Section.class
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/class/Section.class,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Section.class 2001/07/31 21:41:31 1.3
--- Section.class 2001/10/17 17:11:26 1.4
***************
*** 180,182 ****
--- 180,202 ----
}
+ function sectionSelect($varname,$selected) {
+
+ $q = "SELECT section_id, section_name
+ FROM psl_section";
+ $this->db->query($q);
+ $output = "<SELECT NAME=\"$varname\">\n";
+ $output .= " <OPTION VALUE=\"\">All</OPTION>\n";
+ while ($this->db->next_record()) {
+ $id = $this->db->f("section_id");
+ $name = $this->db->f("section_name");
+ $output .= " <OPTION VALUE=\"$id\" ";
+ if ($id == $selected) {
+ $output .= " SELECTED";
+ }
+ $output .= ">$name</OPTION>\n";
+ }
+ $output .= "</SELECT>\n";
+ return $output;
+ }
+
}; /* end of Section.class */
Index: Story.class
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/class/Story.class,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** Story.class 2001/10/01 16:13:11 1.17
--- Story.class 2001/10/17 17:11:26 1.18
***************
*** 545,549 ****
} /* end of function getStories */
!
function deleteStory($story_id) {
--- 545,549 ----
} /* end of function getStories */
!
function deleteStory($story_id) {
***************
*** 800,806 ****
* Do we need this anywhere outside of admin????
*/
! function listStory($author_id, $first) {
! global $_PSL;
$cmt_list = 10; /* num of stories to display before the "more" link */
--- 800,808 ----
* Do we need this anywhere outside of admin????
*/
! function listStory($ary, $first) {
! $author_id = $ary[author_id];
! $topic_id = $ary[topic_id];
! $section_id = $ary[section_id];
$cmt_list = 10; /* num of stories to display before the "more" link */
***************
*** 813,818 ****
date_format(time,$this->admin_dateformat) AS df
FROM psl_story story,
! psl_author author,
! psl_commentcount commentcount
WHERE story.story_id = commentcount.count_id
AND author.author_id = story.user_id ";
--- 815,826 ----
date_format(time,$this->admin_dateformat) AS df
FROM psl_story story,
! psl_author author,";
! if ($topic_id) {
! $q .= " psl_topic_lut, ";
! }
! if ($section_id) {
! $q .= " psl_section_lut, ";
! }
! $q .= " psl_commentcount commentcount
WHERE story.story_id = commentcount.count_id
AND author.author_id = story.user_id ";
***************
*** 824,827 ****
--- 832,846 ----
AND '$user_id' = author.author_id ";
}
+ if ($author_id) {
+ $q .= "AND '$author_id' = story.user_id ";
+ }
+ if ($topic_id) {
+ $q .= "AND story.story_id = psl_topic_lut.story_id ";
+ $q .= "AND '$topic_id' = psl_topic_lut.topic_id ";
+ }
+ if ($section_id) {
+ $q .= "AND story.story_id = psl_section_lut.story_id ";
+ $q .= "AND '$section_id' = psl_section_lut.section_id ";
+ }
$q .= "ORDER BY time DESC";
***************
*** 831,836 ****
$this->template->set_block("liststory", "row", "rows");
$this->template->set_var(array(
! ACTION_URL => $_PSL[phpself]
));
--- 850,865 ----
$this->template->set_block("liststory", "row", "rows");
+ $author = new Author;
+ $topic = new Topic;
+ $section = new Section;
+ $author_select_html = $author->authorSelect("author_id",$author_id);
+ $topic_select_html = $topic->topicSelect("topic_id",$topic_id);
+ $section_select_html = $section->sectionSelect("section_id",$section_id);
+
$this->template->set_var(array(
! ACTION_URL => $this->psl[phpself],
! TOPIC_SELECT => $topic_select_html,
! SECTION_SELECT => $section_select_html,
! AUTHOR_SELECT => $author_select_html
));
***************
*** 842,848 ****
if ( ($count > $first) and ($count <= ($first+$cmt_list)) ) {
! $view_url = "$_PSL[rooturl]/article.php3?story_id=$story_id";
! $modify_url = "$_PSL[adminurl]/storyAdmin.php3?submit=edit&story_id=$story_id";
! $delete_url = "$_PSL[adminurl]/storyAdmin.php3?submit=delete&story_id=$story_id";
$this->template->set_var(array(
--- 871,877 ----
if ( ($count > $first) and ($count <= ($first+$cmt_list)) ) {
! $view_url = $this->psl[rooturl] . "/article.php3?story_id=$story_id";
! $modify_url = $this->psl[adminurl] . "/storyAdmin.php3?submit=edit&story_id=$story_id";
! $delete_url = $this->psl[adminurl] . "/storyAdmin.php3?submit=delete&story_id=$story_id";
$this->template->set_var(array(
***************
*** 868,872 ****
if ($count > $first) {
$this->template->set_var(array(
! MORE_LINK => "<a href=\"$_PSL[phpself]?op=list&next=$first\">$left ". pslgetText("More")."</a>"
));
}
--- 897,905 ----
if ($count > $first) {
$this->template->set_var(array(
! MORE_LINK => "<a href=\"" . $this->psl[phpself] . "?submit=modify" . $this->psl[amp] .
! "author_id=" . $author_id . $this->psl[amp] .
! "topic_id=" . $topic_id . $this->psl[amp] .
! "section_id=" . $section_id . $this->psl[amp] .
! "next=$first\">$left " . pslgetText("More")."</a>"
));
}
Index: Topic.class
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/class/Topic.class,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Topic.class 2001/07/31 21:41:31 1.4
--- Topic.class 2001/10/17 17:11:27 1.5
***************
*** 376,378 ****
--- 376,399 ----
}
+ function topicSelect($varname,$selected) {
+
+ $q = "SELECT topic_id, topic_name
+ FROM psl_topic";
+ $this->db->query($q);
+ $output = "<SELECT NAME=\"$varname\">\n";
+ $output .= " <OPTION VALUE=\"\">All</OPTION>\n";
+ while ($this->db->next_record()) {
+ $id = $this->db->f("topic_id");
+ $name = $this->db->f("topic_name");
+ $output .= " <OPTION VALUE=\"$id\" ";
+ if ($id == $selected) {
+ $output .= " SELECTED";
+ }
+ $output .= ">$name</OPTION>\n";
+ }
+ $output .= "</SELECT>\n";
+ return $output;
+ }
+
+
}; /* end of Topic.class */
Index: functions.inc
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/class/functions.inc,v
retrieving revision 1.77
retrieving revision 1.78
diff -C2 -d -r1.77 -r1.78
*** functions.inc 2001/10/08 16:47:33 1.77
--- functions.inc 2001/10/17 17:11:27 1.78
***************
*** 84,88 ****
function stripBadHTML($str,$seclev=0) {
! global $approvedtags;
$str = stripslashes($str);
--- 84,90 ----
function stripBadHTML($str,$seclev=0) {
! global $_PSL;
!
! $approvedtags = $_PSL[approvedtags];
$str = stripslashes($str);
Index: slashAuth.class
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/class/slashAuth.class,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** slashAuth.class 2001/10/01 15:13:21 1.1
--- slashAuth.class 2001/10/17 17:11:27 1.2
***************
*** 39,43 ****
$templ->set_var(PHP_SELF, "$_PSL[phpself]");
-
if (isset($this->auth["uname"])) {
$templ->set_var(USERNAME,$this->auth["uname"]);
--- 39,42 ----
|