[geeklog-cvs] geeklog: Updated config theme variable from 'support_theme_2.0' ...
geeklog-cvs at lists.geeklog.net
geeklog-cvs at lists.geeklog.net
Tue May 8 11:03:07 EDT 2012
changeset 8688:42197a577043
url: http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/42197a577043
user: Tom <websitemaster at cogeco.net>
date: Tue May 08 10:59:17 2012 -0400
description:
Updated config theme variable from 'support_theme_2.0' to 'supported_version_theme'. Now uses version numbers.
Added support to new theme engine for breadcrumbs in the header.
diffstat:
plugins/staticpages/functions.inc | 18 +++++++++++-----
public_html/article.php | 5 +++-
public_html/index.php | 12 ++++++++--
public_html/layout/denim/featuredstorytext.thtml | 1 -
public_html/layout/denim/functions.php | 2 +-
public_html/layout/denim/header.thtml | 3 +-
public_html/layout/denim/storytext.thtml | 1 -
public_html/layout/modern_curve/featuredstorytext.thtml | 1 -
public_html/layout/modern_curve/functions.php | 2 +-
public_html/layout/modern_curve/header.thtml | 1 +
public_html/layout/modern_curve/storytext.thtml | 1 -
public_html/lib-common.php | 10 +++++++-
system/lib-story.php | 4 ++-
13 files changed, 41 insertions(+), 20 deletions(-)
diffs (228 lines):
diff -r 7628958d4a9b -r 42197a577043 plugins/staticpages/functions.inc
--- a/plugins/staticpages/functions.inc Mon May 07 15:43:56 2012 -0400
+++ b/plugins/staticpages/functions.inc Tue May 08 10:59:17 2012 -0400
@@ -347,12 +347,13 @@
$spage->set_var('xmlns', ' xmlns="http://www.w3.org/1999/xhtml"');
}
- if ($_SP_CONF['disable_breadcrumbs_staticpages']) {
- $breadcrumb_trail = '';
- } else {
- $breadcrumb_trail = TOPIC_breadcrumbs('staticpages', $page);
+ $breadcrumb_trail = '';
+ if ($_CONF['supported_version_theme'] == '1.8.1') {
+ if (!$_SP_CONF['disable_breadcrumbs_staticpages']) {
+ $breadcrumb_trail = TOPIC_breadcrumbs('staticpages', $page);
+ }
}
- $spage->set_var('breadcrumb_trail', $breadcrumb_trail);
+ $spage->set_var('breadcrumb_trail', $breadcrumb_trail); // Still need to keep this template variable incase main theme does not support 2.0.0 theme engine. Once we drop support of theme engine 1.9.1 then remove
$author_name = COM_getDisplayName($A['owner_id']);
$author_username = DB_getItem($_TABLES['users'], 'username',
@@ -491,8 +492,13 @@
} else {
$rightblock = -1;
}
+
+ $breadcrumbs = '';
+ if (!$_SP_CONF['disable_breadcrumbs_staticpages']) {
+ $breadcrumbs = TOPIC_breadcrumbs('staticpages', $page);
+ }
- $retval = COM_createHTMLDocument($retval, array('what' => $what, 'pagetitle' => $page_title, 'headercode' => $headercode, 'rightblock' => $rightblock));
+ $retval = COM_createHTMLDocument($retval, array('what' => $what, 'pagetitle' => $page_title, 'breadcrumbs' => $breadcrumbs, 'headercode' => $headercode, 'rightblock' => $rightblock));
}
return $retval;
diff -r 7628958d4a9b -r 42197a577043 public_html/article.php
--- a/public_html/article.php Mon May 07 15:43:56 2012 -0400
+++ b/public_html/article.php Tue May 08 10:59:17 2012 -0400
@@ -444,7 +444,10 @@
$story_template->set_var ('trackback', '');
}
$display = $story_template->finish ($story_template->parse ('output', 'article'));
- $display = COM_createHTMLDocument($display, array('pagetitle' => $pagetitle, 'headercode' => $headercode));
+
+ $breadcrumbs = TOPIC_breadcrumbs('article', $story->getSid());
+
+ $display = COM_createHTMLDocument($display, array('pagetitle' => $pagetitle, 'breadcrumbs' => $breadcrumbs, 'headercode' => $headercode));
}
} else {
$display .= COM_refresh($_CONF['site_url'] . '/index.php');
diff -r 7628958d4a9b -r 42197a577043 public_html/index.php
--- a/public_html/index.php Mon May 07 15:43:56 2012 -0400
+++ b/public_html/index.php Tue May 08 10:59:17 2012 -0400
@@ -334,6 +334,8 @@
$D = DB_fetchArray ($data);
$num_pages = ceil ($D['count'] / $limit);
+$breadcrumbs = '';
+
if ( $A = DB_fetchArray( $result ) ) {
$story = new Story();
$story->loadFromArray($A);
@@ -341,11 +343,15 @@
$story->_featured = 1;
}
+
// Display breadcrumb trail
if (!empty($topic)) {
- $display .= TOPIC_breadcrumbs('topic', $topic);
+ $breadcrumbs = TOPIC_breadcrumbs('topic', $topic);
+ if ($_CONF['supported_version_theme'] == '1.8.1') {
+ $display .= $breadcrumbs;
+ }
}
-
+
// display first article
$display .= STORY_renderArticle ($story, 'y');
@@ -414,7 +420,7 @@
. '>';
}
-$display = COM_createHTMLDocument($display, array('headercode' => $header, 'rightblock' => true));
+$display = COM_createHTMLDocument($display, array('breadcrumbs' => $breadcrumbs, 'headercode' => $header, 'rightblock' => true));
// Output page
COM_output($display);
diff -r 7628958d4a9b -r 42197a577043 public_html/layout/denim/featuredstorytext.thtml
--- a/public_html/layout/denim/featuredstorytext.thtml Mon May 07 15:43:56 2012 -0400
+++ b/public_html/layout/denim/featuredstorytext.thtml Tue May 08 10:59:17 2012 -0400
@@ -2,7 +2,6 @@
<!-- featuredstorytext.thtml { -->
<div class="storytext featuredstorytext">
- {breadcrumb_trail}
<h2 class="story_title">{start_storylink_anchortag}{story_title}{end_storylink_anchortag}</h2>
<div class="story_icon">
diff -r 7628958d4a9b -r 42197a577043 public_html/layout/denim/functions.php
--- a/public_html/layout/denim/functions.php Mon May 07 15:43:56 2012 -0400
+++ b/public_html/layout/denim/functions.php Tue May 08 10:59:17 2012 -0400
@@ -96,7 +96,7 @@
{
global $_BLOCK_TEMPLATE, $_CONF;
- $_CONF['support_theme_2.0'] = true; // support new theme format for the later Geeklog2.0
+ $_CONF['supported_version_theme'] = '2.0.0'; // support new theme format for the later Geeklog 2.0
$_CONF['left_blocks_in_footer'] = 1;
diff -r 7628958d4a9b -r 42197a577043 public_html/layout/denim/header.thtml
--- a/public_html/layout/denim/header.thtml Mon May 07 15:43:56 2012 -0400
+++ b/public_html/layout/denim/header.thtml Tue May 08 10:59:17 2012 -0400
@@ -62,5 +62,6 @@
<div id="centerblocks">
<div id="main-content">
<p class="welcome_msg">{welcome_msg} {datetime}</p>
-
+ {breadcrumb_trail}
+
<!-- } header.thtml -->
diff -r 7628958d4a9b -r 42197a577043 public_html/layout/denim/storytext.thtml
--- a/public_html/layout/denim/storytext.thtml Mon May 07 15:43:56 2012 -0400
+++ b/public_html/layout/denim/storytext.thtml Tue May 08 10:59:17 2012 -0400
@@ -2,7 +2,6 @@
<!-- storytext.thtml { -->
<div class="storytext">
- {breadcrumb_trail}
<h2 class="story_title">{start_storylink_anchortag}{story_title}{end_storylink_anchortag}</h2>
<div class="story_icon">
diff -r 7628958d4a9b -r 42197a577043 public_html/layout/modern_curve/featuredstorytext.thtml
--- a/public_html/layout/modern_curve/featuredstorytext.thtml Mon May 07 15:43:56 2012 -0400
+++ b/public_html/layout/modern_curve/featuredstorytext.thtml Tue May 08 10:59:17 2012 -0400
@@ -2,7 +2,6 @@
<!-- featuredstorytext.thtml { -->
<div class="featuredstorytext">
- {breadcrumb_trail}
<h2>{start_storylink_anchortag}{story_title}{end_storylink_anchortag}</h2>
<ul class="icon">
diff -r 7628958d4a9b -r 42197a577043 public_html/layout/modern_curve/functions.php
--- a/public_html/layout/modern_curve/functions.php Mon May 07 15:43:56 2012 -0400
+++ b/public_html/layout/modern_curve/functions.php Tue May 08 10:59:17 2012 -0400
@@ -92,7 +92,7 @@
{
global $_BLOCK_TEMPLATE, $_CONF;
- $_CONF['support_theme_2.0'] = true; // support new theme format for the later Geeklog2.0
+ $_CONF['supported_version_theme'] = '2.0.0'; // support new theme format for the later Geeklog 2.0
/*
* For left/right block support there is no longer any need for the theme to
diff -r 7628958d4a9b -r 42197a577043 public_html/layout/modern_curve/header.thtml
--- a/public_html/layout/modern_curve/header.thtml Mon May 07 15:43:56 2012 -0400
+++ b/public_html/layout/modern_curve/header.thtml Tue May 08 10:59:17 2012 -0400
@@ -53,5 +53,6 @@
<div id="centerblocks">
<p class="welcome_msg">{welcome_msg} {datetime}</p>
<div id="centerblocks-content">
+ {breadcrumb_trail}
<!-- } header.thtml -->
diff -r 7628958d4a9b -r 42197a577043 public_html/layout/modern_curve/storytext.thtml
--- a/public_html/layout/modern_curve/storytext.thtml Mon May 07 15:43:56 2012 -0400
+++ b/public_html/layout/modern_curve/storytext.thtml Tue May 08 10:59:17 2012 -0400
@@ -2,7 +2,6 @@
<!-- storytext.thtml { -->
<div class="storytext">
- {breadcrumb_trail}
<h2>{start_storylink_anchortag}{story_title}{end_storylink_anchortag}</h2>
<ul class="icon">
diff -r 7628958d4a9b -r 42197a577043 public_html/lib-common.php
--- a/public_html/lib-common.php Mon May 07 15:43:56 2012 -0400
+++ b/public_html/lib-common.php Tue May 08 10:59:17 2012 -0400
@@ -453,6 +453,10 @@
$theme_config,
$func
);
+// if the themes supported version of the theme engine not found assume lowest version
+if (!isset($_CONF['supported_version_theme'])) {
+ $_CONF['supported_version_theme'] = '1.8.1';
+}
// Clear out any expired sessions
DB_query( "UPDATE {$_TABLES['sessions']} SET whos_online = 0 WHERE start_time < " . ( time() - $_CONF['whosonline_threshold'] ));
@@ -1599,8 +1603,8 @@
$custom = '';
}
- // If the theme does not support the CSS layout then call the legacy functions.
- if ($_CONF['support_theme_2.0'] != true) {
+ // If the theme does not support the CSS layout then call the legacy functions (Geeklog 1.8.1 and older).
+ if ($_CONF['supported_version_theme'] == '1.8.1') {
return COM_siteHeader($what, $pagetitle, $headercode) . $content
. COM_siteFooter($rightblock, $custom);
}
@@ -2012,6 +2016,8 @@
$headercode = $_SCRIPTS->getHeader() . $headercode;
$header->set_var( 'plg_headercode', $headercode );
+
+ $header->set_var( 'breadcrumb_trail', $breadcrumbs );
COM_hit();
diff -r 7628958d4a9b -r 42197a577043 system/lib-story.php
--- a/system/lib-story.php Mon May 07 15:43:56 2012 -0400
+++ b/system/lib-story.php Tue May 08 10:59:17 2012 -0400
@@ -237,7 +237,9 @@
)
);
} else {
- $article->set_var('breadcrumb_trail', TOPIC_breadcrumbs('article', $story->getSid()));
+ if ($_CONF['supported_version_theme'] == '1.8.1') {
+ $article->set_var('breadcrumb_trail', TOPIC_breadcrumbs('article', $story->getSid()));
+ }
$article->set_var('story_title_link', $story->DisplayElements('title'));
}
More information about the geeklog-cvs
mailing list