Update of /cvsroot/phpslash/phpslash-ft/public_html
In directory usw-pr-cvs1:/tmp/cvs-serv7820/public_html
Modified Files:
backend.php3 test.php3
Log Message:
backend cleanups
Index: backend.php3
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/public_html/backend.php3,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** backend.php3 19 Mar 2002 16:48:06 -0000 1.25
--- backend.php3 19 Mar 2002 17:17:14 -0000 1.26
***************
*** 25,31 ****
*
* view = different export formats
! [rss91] - RSS 0.91 - default
rss92 - RSS 0.92
! rss1 - RSS 1.0
html - fancybox
txt - simple text output of title and intro
--- 25,31 ----
*
* 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
***************
*** 48,54 ****
*/
! // TODO: Remove these
! $pagetitle ="Backend"; # The name to be displayed in the header
! $xsiteobject = "Backend"; # This Defines The META Tag Object Type
require("config.php3");
--- 48,53 ----
*/
! $pagetitle = "Backend"; // The name to be displayed in the header
! $xsiteobject = "Backend"; // This Defines The META Tag Object Type
require("config.php3");
***************
*** 69,137 ****
}
! // TODO: Make this check max to make sure it's an integer
! if(empty($ary['max'])) {
$ary['max']= 15;
}
$stories = $story->extractStories($ary);
switch( $ary['view']) {
! case "js":
! $viewtpl = "backendJS.tpl";
! break;
! case "jsdata":
! $viewtpl = "backendJSData.tpl";
break;
! case "html":
! $viewtpl = "backendHTML.tpl";
break;
! case "txt":
! $viewtpl = "backendTxt.tpl";
break;
! case "block":
! $viewtpl = "backendBlock.tpl";
break;
! case "rss92":
! $viewtpl = "backendRSS92.tpl";
break;
! case "rss1":
! $viewtpl = "backendRSS1.tpl";
! // RSS-1.0 needs a extra listing.
! $link_ary = array();
break;
! case "opml":
! $viewtpl = "backendOpml.tpl";
break;
! case "wml":
! $viewtpl = "backendWml.tpl";
break;
! case "mozilla":
! $viewtpl = "backendMozilla.tpl";
! $target = "_content";
break;
!
! case "rss":
! case "rss91":
default:
! $viewtpl = "backendRSS91.tpl";
break;
}
! if( empty($ary['target'])) {
! $ary['target'] = "_self";
}
$date = date("H:i m:d:y T");
$template_ary = array(
! "storiesbackend" => $viewtpl
);
!
$template = new Template($_PSL['templatedir']);
$template->debug = 0;
$template->set_file($template_ary);
! // $template->set_unknowns("remove");
! $template->halt_on_error = "report";
$template->set_var(array(
'SITE_NAME' => $_PSL['site_name'],
--- 68,149 ----
}
! // 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']) {
! case 'block':
! $viewtpl = 'backendBlock.tpl';
break;
! case 'html':
! $viewtpl = 'backendHTML.tpl';
break;
! case 'js':
! $viewtpl = 'backendJS.tpl';
break;
! case 'jsdata':
! $viewtpl = 'backendJSData.tpl';
break;
! case 'mozilla':
! $viewtpl = 'backendMozilla.tpl';
! $target = '_content';
! break;
! case 'opml':
! $viewtpl = 'backendOpml.tpl';
break;
! case 'rss91':
! $viewtpl = 'backendRSS91.tpl';
break;
! case 'rss92':
! $viewtpl = 'backendRSS92.tpl';
break;
! case 'txt':
! $viewtpl = 'backendTxt.tpl';
break;
! case 'wml':
! $viewtpl = 'backendWml.tpl';
break;
! case 'rss':
! case 'rss1':
default:
! $viewtpl = 'backendRSS1.tpl';
! // RSS-1.0 needs a extra listing.
! $link_ary = array();
break;
}
! // Make a target (only used by JS and JSdata)
! if(empty($ary['target'])) {
! $ary['target'] = '_self';
}
+
+ // The date..
$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'],
***************
*** 147,170 ****
));
! if( count($stories) < $ary['max']) {
! $ary['max'] = count($stories);
! }
$template->set_block("storiesbackend", "each_story", "stories");
for ($i = 0 ; $i < $ary['max']; $i++) {
! switch( $ary['d']) {
!
! case "0":
! $description = "";
break;
! case "s":
$description = $_PSL['site_name'] ;
break;
! case "l":
! $description = $_PSL['site_name'] . " - ";
$description .= htmlspecialchars(strip_tags($stories[$i]["intro_text"]));
// $description .= format_mail(eregi_replace("<([font][^>]*)>", "",$stories[$i]["intro_text"]),"80", "scrub");
break;
! case "d":
! case "1":
default:
$description = htmlspecialchars(strip_tags($stories[$i]["intro_text"]));
--- 159,179 ----
));
! // 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':
! $description = '';
break;
! case 's':
$description = $_PSL['site_name'] ;
break;
! case 'l':
! $description = $_PSL['site_name'] . ' - ';
$description .= htmlspecialchars(strip_tags($stories[$i]["intro_text"]));
// $description .= format_mail(eregi_replace("<([font][^>]*)>", "",$stories[$i]["intro_text"]),"80", "scrub");
break;
! case 'd':
! case '1':
default:
$description = htmlspecialchars(strip_tags($stories[$i]["intro_text"]));
***************
*** 174,184 ****
$template->set_var(array(
! 'STORY_ID' => $stories[$i]["story_id"],
! 'TITLE' => htmlspecialchars($stories[$i]["title"]),
'INTRO_TEXT' => $description,
'TARGET' => $ary['target'],
'COUNT' => $ary['max'],
'IDX' => $i,
! 'DATEF' => $stories[$i]["datef"]
));
--- 183,193 ----
$template->set_var(array(
! 'STORY_ID' => $stories[$i]['story_id'],
! 'TITLE' => htmlspecialchars($stories[$i]['title']),
'INTRO_TEXT' => $description,
'TARGET' => $ary['target'],
'COUNT' => $ary['max'],
'IDX' => $i,
! 'DATEF' => $stories[$i]['datef']
));
***************
*** 186,207 ****
// Grab a copy of the link stuff we need for RSS-1.0
if ($ary['view'] = 'rss1') {
! $link_ary[] = array('storyid' => $stories[$i]["story_id"]);
}
! $template->parse("stories", "each_story", true);
}
// RSS-1.0 requires a item listing in the <channel> tag
if ($ary['view'] = 'rss1') {
! $template->set_block("storiesbackend", "each_item", "items");
for ($i = 0; $i < count($link_ary); $i++) {
$template->set_var(array(
'STORY_ID' => $link_ary[$i]['storyid']
));
! $template->parse("items", "each_item", true);
}
}
! $template->parse('OUT',"storiesbackend");
$template->p('OUT');
--- 195,217 ----
// Grab a copy of the link stuff we need for RSS-1.0
if ($ary['view'] = 'rss1') {
! $link_ary[] = array('storyid' => $stories[$i]['story_id']);
}
! $template->parse('stories', 'each_story', true);
}
// RSS-1.0 requires a item listing in the <channel> tag
if ($ary['view'] = 'rss1') {
! $template->set_block('storiesbackend', 'each_item', 'items');
for ($i = 0; $i < count($link_ary); $i++) {
$template->set_var(array(
'STORY_ID' => $link_ary[$i]['storyid']
));
! $template->parse('items', 'each_item', true);
}
}
! // Send this stuff to the client
! $template->parse('OUT','storiesbackend');
$template->p('OUT');
Index: test.php3
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/public_html/test.php3,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** test.php3 17 May 2001 19:53:17 -0000 1.3
--- test.php3 19 Mar 2002 17:17:14 -0000 1.4
***************
*** 110,114 ****
<h3>Versions</h3>
<ul>
! <li>PHPSlash Version: <?php echo $psl_version ?></li>
<li>PHP Version: <?php echo $version ?></li>
<li>PHP Major Version: <?php echo $major ?></li>
--- 110,114 ----
<h3>Versions</h3>
<ul>
! <li>PHPSlash Version: <?php echo $_PSL['version'] ?></li>
<li>PHP Version: <?php echo $version ?></li>
<li>PHP Major Version: <?php echo $major ?></li>
|