Update of /cvsroot/phpslash/phpslash-ft/class
In directory usw-pr-cvs1:/tmp/cvs-serv11829/class
Modified Files:
Story.class functions.inc
Log Message:
extrans, title, and metatag tweaks
Index: Story.class
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/class/Story.class,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** Story.class 2001/11/12 02:34:11 1.19
--- Story.class 2001/11/13 22:01:27 1.20
***************
*** 1032,1037 ****
$this->template->set_var(array(
DEPT => stripslashes($this->db->Record[dept]),
! INTROTEXT => stripslashes($this->db->Record[intro_text]),
! BODYTEXT => stripslashes($this->db->Record[body_text]),
TITLE => stripslashes($this->db->Record[title]),
TIME => $this->db->Record['time'],
--- 1032,1037 ----
$this->template->set_var(array(
DEPT => stripslashes($this->db->Record[dept]),
! INTROTEXT => htmlspecialchars(stripslashes($this->db->Record[intro_text])),
! BODYTEXT => htmlspecialchars(stripslashes($this->db->Record[body_text])),
TITLE => stripslashes($this->db->Record[title]),
TIME => $this->db->Record['time'],
Index: functions.inc
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/class/functions.inc,v
retrieving revision 1.78
retrieving revision 1.79
diff -C2 -d -r1.78 -r1.79
*** functions.inc 2001/10/17 17:11:27 1.78
--- functions.inc 2001/11/13 22:01:27 1.79
***************
*** 352,356 ****
--- 352,358 ----
Parameters : $title -> Title of the page being displayed
$metaobject -> Extra stuff about the page (Admin, Home, Poll)
+ Accepts an array of name/value pairs for metatags
$section -> if supplied, generates blocks for this section
+ Accepts an array to pass to getBlocks
$tpl -> optional alternate template
*******************************************************************************/
***************
*** 368,376 ****
if ($section != '') {
$block = new Block_i;
! $allblocks = $block->getAllBlocksForIndex($section);
} else {
$allblocks = '';
}
/* Templates */
if( empty($tpl) ) {
--- 370,385 ----
if ($section != '') {
$block = new Block_i;
! // should be passing array now days
! if( is_array($section)) {
! $allblocks = $block->getBlocks($section);
! } else {
! $allblocks = $block->getAllBlocksForIndex($section);
! }
} else {
$allblocks = '';
}
+
+
/* Templates */
if( empty($tpl) ) {
***************
*** 389,392 ****
--- 398,416 ----
header => $tpl
));
+
+ $templ->set_block ("header", "each_metatag", "metatag_block");
+ if ( is_array($metaobject)) {
+ $templ->set_var( XSITEOBJECT, $metaobject['object']);
+ unset($metaobject['object']);
+ while( list( $key, $value) = each( $metaobject )) {
+ $templ->set_var (array (
+ METANAME => $key,
+ METADESCRIPTION => $value
+ ));
+ $templ->parse ("metatag_block", "each_metatag", true);
+ }
+ } else {
+ $templ->set_var( XSITEOBJECT, $metaobject);
+ }
$action_url = "\"$_PSL[rooturl]/search.php3\"";
***************
*** 396,404 ****
$templ->set_var(array(
ROOTDIR => $_PSL[rooturl],
IMAGEDIR => $_PSL[imageurl],
SITETITLE => $title,
SEARCH_ACTION_URL => $action_url,
- XSITEOBJECT => $metaobject,
NAVBAR => $navbar->getNavBar(),
TOPICBAR => $topicbar->getTopicBar(),
--- 420,432 ----
$templ->set_var(array(
+ SITE_NAME => $_PSL[site_name],
+ SITE_OWNER => $_PSL[site_owner],
+ SITE_SLOGAN => $_PSL[site_slogan],
+ SITE_TITLE => $_PSL[site_title],
+ SECTION => $_PSL[section],
ROOTDIR => $_PSL[rooturl],
IMAGEDIR => $_PSL[imageurl],
SITETITLE => $title,
SEARCH_ACTION_URL => $action_url,
NAVBAR => $navbar->getNavBar(),
TOPICBAR => $topicbar->getTopicBar(),
***************
*** 554,558 ****
function : breadcrumb ->
Parameters : $ary -> cmd line array
! returns : templated html for a "breadcrumb" link
*******************************************************************************/
function breadcrumb ($ary) {
--- 582,587 ----
function : breadcrumb ->
Parameters : $ary -> cmd line array
! returns : templated html for a "breadcrumb" link and
! sets global name variables
*******************************************************************************/
function breadcrumb ($ary) {
***************
*** 563,566 ****
--- 592,596 ----
$sec = new Section;
$ary[section] = $sec->getName($ary[section_id]);
+ $_PSL[section] = $ary[section];
} else { // if there's no section_id, then default to home_section_id.
$ary[section_id] = $_PSL[home_section_id];
***************
*** 570,577 ****
--- 600,609 ----
$top = new Topic;
$ary[topic] = $top->getName($ary[topic_id]);
+ $_PSL[topic] = $ary[topic];
}
if ($ary[author_id]) {
$author = new Author;
$ary[author] = $author->getName($ary[author_id]);
+ $_PSL[author] = $ary[author];
}
|