Update of /cvsroot/phpslash/phpslash-ft/public_html
In directory usw-pr-cvs1:/tmp/cvs-serv13990/phpslash-ft/public_html
Modified Files:
index.php3 article.php3
Log Message:
auto column sensing
Index: index.php3
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/public_html/index.php3,v
retrieving revision 1.50
retrieving revision 1.51
diff -C2 -d -r1.50 -r1.51
*** index.php3 2001/12/14 22:14:36 1.50
--- index.php3 2002/01/08 21:38:23 1.51
***************
*** 42,51 ****
$allstories = $story->getStories($ary);
! $allblocks = $block->getBlocks($ary);
$template = new Template($_PSL[templatedir]);
$template->debug = 0;
$template->set_file(array(
! index => "index.tpl"
));
--- 42,72 ----
$allstories = $story->getStories($ary);
! $leftblocks = $block->getBlocks($ary, "left");
! $centerblocks = $block->getBlocks($ary, "center");
! $rightblocks = $block->getBlocks($ary, "right");
+ if (empty($leftblocks)) {
+ if (empty($rightblocks)) {
+ // $centerblocks = $block->getBlocks($ary);
+ // $tplfile = "index1col.tpl";
+ // default to 2 column for transparent upgrade
+ $rightblocks = $block->getBlocks($ary);
+ $tplfile = "index2colright.tpl";
+ } else {
+ $tplfile = "index2colright.tpl";
+ $rightblocks = $related . $rightblocks;
+ }
+ } elseif (empty($rightblocks)) {
+ $tplfile = "index2colleft.tpl";
+ $leftblocks .= $related;
+ } else {
+ $tplfile = "index3col.tpl";
+ $rightblocks = $related . $rightblocks;
+ }
+
$template = new Template($_PSL[templatedir]);
$template->debug = 0;
$template->set_file(array(
! index => $tplfile //"index3col.tpl"
));
***************
*** 55,59 ****
BREADCRUMB => $breadcrumb,
STORY_COLUMN => $allstories,
! BLOCK_COLUMN => $allblocks
));
--- 76,82 ----
BREADCRUMB => $breadcrumb,
STORY_COLUMN => $allstories,
! LEFT_BLOCK_COLUMN => $leftblocks,
! CENTER_BLOCK_COLUMN => $centerblocks,
! RIGHT_BLOCK_COLUMN => $rightblocks
));
Index: article.php3
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/public_html/article.php3,v
retrieving revision 1.53
retrieving revision 1.54
diff -C2 -d -r1.53 -r1.54
*** article.php3 2001/12/16 22:56:45 1.53
--- article.php3 2002/01/08 21:38:23 1.54
***************
*** 68,73 ****
XSITEOBJECT => $xsiteobject
));
! // $t->parse(PAGE, article);
! // $t->p(PAGE);
break;
--- 68,73 ----
XSITEOBJECT => $xsiteobject
));
! $t->parse(PAGE, article);
! $t->p(PAGE);
break;
***************
*** 89,120 ****
$_PSL['metatags']['description'] = substr(strip_tags($story->story_ary["intro_text"]), 0, 150);
! $header = getHeader($ttitle,$_PSL['metatags']);
! $footer = getFooter();
!
! // $titlebar = getTitlebar("100%", $title); // here if you need it.
! /* Display the story */
! // $arrows = $story->getNextPrev($story_id);
!
! $t->set_var(array(
! HEADER => $header,
! EMAILFORM => $emailform,
! TITLE => $title,
! STORY => $story_html,
! STORY_ID => $story_id,
! ARROWS => $arrows,
! IMAGEDIR => $_PSL[imageurl],
! FOOTER => $footer
! ));
!
! /* Now that related stuff */
! $fancy_boxes = $story->getRelated($story_id);
$block = new Block_i;
! $fancy_boxes .= $block->getBlocks($ary);
! $t->set_var(FANCY_BOXES, $fancy_boxes);
! /* Now the comments */
$cmtary[mode] = $mode;
--- 89,132 ----
$_PSL['metatags']['description'] = substr(strip_tags($story->story_ary["intro_text"]), 0, 150);
! // $header = getHeader($ttitle,$_PSL['metatags']);
! // $footer = getFooter();
!
! $titlebar = getTitlebar("100%", $title); // here if you need it.
! $related = $story->getRelated($story_id);
! $arrows = $story->getNextPrev($story_id);
$block = new Block_i;
! $leftblocks = $block->getBlocks($ary, "left" );
! $centerblocks = $block->getBlocks($ary, "center" );
! $rightblocks = $block->getBlocks($ary, "right" );
! if (empty($leftblocks)) {
! if (empty($rightblocks)) {
! // $centerblocks = $block->getBlocks($ary);
! // $centerblocks .= $related;
! // $tplfile = "index1col.tpl";
! // default to 2 column for transparent upgrade
! $rightblocks = $block->getBlocks($ary);
! $rightblocks .= $related;
! $tplfile = "index2colright.tpl";
! } else {
! $tplfile = "index2colright.tpl";
! $rightblocks = $related . $rightblocks;
! }
! } elseif (empty($rightblocks)) {
! $tplfile = "index2colleft.tpl";
! $leftblocks .= $related;
! } else {
! $tplfile = "index3col.tpl";
! $rightblocks = $related . $rightblocks;
! }
!
! $t->set_file(article, $tplfile); //"article.tpl");
!
! $related = $story->getRelated($story_id);
!
! /* Now the comments */
$cmtary[mode] = $mode;
***************
*** 126,131 ****
$t->set_var(COMMENTS, $comments);
-
$updatearticlehits = $_PSL["article_updatehits"];
if ($updatearticlehits) {
--- 138,163 ----
$t->set_var(COMMENTS, $comments);
+ /* Display the story */
+
+ $t->set_var(array(
+ TITLEBAR => $titlebar,
+ TITLE => $title,
+ BREADCRUMB => $breadcrumb,
+ STORY_ID => $story_id,
+ IMAGEDIR => $_PSL[imageurl],
+ STORY_COLUMN => $emailform."\n".$story_html."\n".$comments,
+ LEFT_BLOCK_COLUMN => $leftblocks,
+ CENTER__TOP_BLOCK_COLUMN => $centertopblocks,
+ RIGHT_BLOCK_COLUMN => $rightblocks,
+ HEADER => $header,
+ // EMAILFORM => $emailform,
+ // STORY => $story_html,
+ // ARROWS => $arrows,
+ FOOTER => $footer,
+ // RELATED => $related,
+ ));
+
+
$updatearticlehits = $_PSL["article_updatehits"];
if ($updatearticlehits) {
***************
*** 135,143 ****
$db->query($q);
}
} /* end of switch */
-
- $t->parse(PAGE, article);
- $t->p(PAGE);
} else {
--- 167,177 ----
$db->query($q);
}
+
+ slashhead($ttitle,$_PSL['metatags']);
+ $t->parse(PAGE, article);
+ $t->p(PAGE);
+ slashfoot();
} /* end of switch */
} else {
|