[Phpslash-commit] CVS: phpslash-ft/public_html backend.php3,1.26,1.27
Brought to you by:
joestewart,
nhruby
From: nathan h. <nh...@us...> - 2002-03-19 18:00:12
|
Update of /cvsroot/phpslash/phpslash-ft/public_html In directory usw-pr-cvs1:/tmp/cvs-serv22403/public_html Modified Files: backend.php3 Log Message: more backend tweaks Index: backend.php3 =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/public_html/backend.php3,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** backend.php3 19 Mar 2002 17:17:14 -0000 1.26 --- backend.php3 19 Mar 2002 18:00:09 -0000 1.27 *************** *** 4,46 **** /* $Id$ */ ! /* TODO: add ini_set() call to turn all error reporting off unless $_PSL['debug'] ! * is set. Errors from php will corrupt the XML format and null the feed. ! */ ! ! /* pass the query in the "Source Url" form field in the format of: ! * ! * option1=setting1&option2=setting2 ! ! * Available query options: ! * ! * section = section name ! * topic = topic name ! * author = author name ! * date = starting date in "to_days" format ! * start = "starting" point [0] ! * max = maximum returned [15] ! * order = [time], hits, title, etc. ! * asc = ASC, [DESC] ( Ascending or Descending) ! * query = urlencoded text string ! * ! * view = different export formats ! rss91 - RSS 0.91 ! rss92 - RSS 0.92 ! [rss1] - RSS 1.0 - default ! html - fancybox ! txt - simple text output of title and intro ! block - text delimited by %% ! js - javascript ! jsdata - javascript array ! mozilla - for adding to Netscape 6 My Sidebar ! opml - OPML (http://radio.userland.com) ! wml - WML - for WAP phones ! ! // TODO: nh asks: Do we really need this? ! * d = description - this is the intro text. ! [d] - include description - default ! [s] - site name ! [l] - site name plus description ! [0] - empty description Some of the template views and options are based on those contained in HPE --- 4,41 ---- /* $Id$ */ ! /* ! * pass the query in the "Source Url" form field in the format of: ! * ! * option1=setting1&option2=setting2 ! * Available query options: ! * ! * section = section name ! * topic = topic name ! * author = author name ! * date = starting date in "to_days" format ! * start = "starting" point [0] ! * max = maximum returned [15] ! * order = [time], hits, title, etc. ! * asc = ASC, [DESC] ( Ascending or Descending) ! * query = urlencoded text string ! * ! * view = different export formats ! rss91 - RSS 0.91 ! rss92 - RSS 0.92 ! [rss1] - RSS 1.0 - default ! html - fancybox ! txt - simple text output of title and intro ! block - text delimited by %% ! js - javascript ! jsdata - javascript array ! mozilla - for adding to Netscape 6 My Sidebar ! opml - OPML (http://radio.userland.com) ! wml - WML - for WAP phones ! * d = description - this is the intro text. ! // TODO: nh asks: Do we really need this? ! [d] - include description - default ! [s] - site name ! [l] - site name plus description ! [0] - empty description Some of the template views and options are based on those contained in HPE *************** *** 48,84 **** */ ! $pagetitle = "Backend"; // The name to be displayed in the header ! $xsiteobject = "Backend"; // This Defines The META Tag Object Type ! require("config.php3"); ! // Objects ! // $poll = new Poll; $story = new Story; - $db = new slashDB; - - // Start of Page ! /* parse cmd line variables into array */ while ( list($key, $val) = each($HTTP_GET_VARS )) { if( $val != "") { ! $ary[$key] = $val; } } - // Check to make sure that 'max' is set and is an integer - if(empty($ary['max'] && !(is_int($ary['max']))) { - $ary['max']= 15; - } - // Get those stories $stories = $story->extractStories($ary); - // Update 'max' to represent what $story gave us - if( count($stories) < $ary['max']) { - $ary['max'] = count($stories); - } - // What to build for output switch( $ary['view']) { --- 43,69 ---- */ ! // Get our config require("config.php3"); ! // Make sure we don't propagate errors out the feed :) ! if ($_PSL['debug']) { ! ini_set('error_reporting', 'E_ALL'); ! } else { ! ini_set('error_reporting', 'E_NONE'); ! } ! // Object Creation $story = new Story; ! // Parse cmd line variables into array while ( list($key, $val) = each($HTTP_GET_VARS )) { if( $val != "") { ! $ary[$key] = addslashes($val); } } // Get those stories $stories = $story->extractStories($ary); // What to build for output switch( $ary['view']) { *************** *** 131,149 **** $date = date("H:i m:d:y T"); ! // TODO: Kill this? ! // Say what? We never define more than one $viewtpl ans setfile() ! // understands strings vs. arrays ! $template_ary = array( ! 'storiesbackend' => $viewtpl ! ); ! ! // Create the template object, and set some options $template = new Template($_PSL['templatedir']); $template->debug = 0; - $template->set_file($template_ary); $template->set_unknowns('remove'); ! $template->halt_on_error = 'report'; ! // Start giving placeholders $template->set_var(array( 'SITE_NAME' => $_PSL['site_name'], --- 116,131 ---- $date = date("H:i m:d:y T"); ! // Create the template object, and set some options for silent running $template = new Template($_PSL['templatedir']); $template->debug = 0; $template->set_unknowns('remove'); ! $template->halt_on_error = 'no'; ! // Set the template file we need to use ! $template->set_file('storiesbackend', $viewtpl); ! ! // Start giving placeholders, these aren't parsed till later so ! // placeholders that crop up during the following set_block loops ! // will be parsed with these variables. $template->set_var(array( 'SITE_NAME' => $_PSL['site_name'], *************** *** 156,165 **** 'ROOTDIR' => $_PSL['rooturl'], 'DATE' => $date, ! 'IMAGEDIR' => $_PSL['imageurl'] )); // Process the "each_story" block in the template $template->set_block("storiesbackend", "each_story", "stories"); ! for ($i = 0 ; $i < $ary['max']; $i++) { switch( $ary['d']) { case '0': --- 138,149 ---- 'ROOTDIR' => $_PSL['rooturl'], 'DATE' => $date, ! 'IMAGEDIR' => $_PSL['imageurl'], ! 'TARGET' => $ary['target'], ! 'COUNT' => count($stories) )); // Process the "each_story" block in the template $template->set_block("storiesbackend", "each_story", "stories"); ! for ($i = 0 ; $i < count(stories); $i++) { switch( $ary['d']) { case '0': *************** *** 186,191 **** 'TITLE' => htmlspecialchars($stories[$i]['title']), 'INTRO_TEXT' => $description, - 'TARGET' => $ary['target'], - 'COUNT' => $ary['max'], 'IDX' => $i, 'DATEF' => $stories[$i]['datef'] --- 170,173 ---- |