diff --git a/public_html/article.php b/public_html/article.php
index ea514ab80..f09e594d3 100644
--- a/public_html/article.php
+++ b/public_html/article.php
@@ -419,12 +419,6 @@ function extractExternalLinks($text) {
$articleTemplate = COM_newTemplate(CTL_core_templatePath($_CONF['path_layout'] . 'article'));
- // Render article near top so it can use mode if set (ie to figure out page break)
- // Another option here could be to figure out if story is first on page
- $tmpl = $_CONF['showfirstasfeatured'] ? 'featuredarticletext.thtml' : '';
- $articleTemplate->set_var('formatted_article',
- STORY_renderArticle($article, 'n', $tmpl, $query, $articlePage));
-
// Pass Page and Comment Display info to template in case it wants to display anything else with comments
$articleTemplate->set_var('page_number', $articlePage);
$articleTemplate->set_var('page_total', $page_break_count);
@@ -435,7 +429,7 @@ function extractExternalLinks($text) {
$articleTemplate->set_var('story_id', $article->getSid());
$articleTemplate->set_var('story_title', $pagetitle);
- $story_options = array();
+ $story_options = [];
if (($_CONF['hideemailicon'] == 0) && (!COM_isAnonUser() ||
(($_CONF['loginrequired'] == 0) &&
($_CONF['emailstoryloginrequired'] == 0)))
@@ -499,37 +493,12 @@ function extractExternalLinks($text) {
$url);
}
}
- /*
- if (true) { // can subscribe
- $commentSubscribeURL = '';
- $story_options[] = COM_createLink('Nubbies', $commentSubscribeURL, array('rel' => 'nofollow'));
- $story_template->set_var('comment_subscribe_url', $commentSubscribeURL);
- $story_template->set_var('lang_comment_subscribe', 'Nubbies');
- }
- */
- $related = STORY_whatsRelated($article->displayElements('related'),
- $article->displayElements('uid'),
- $article->getSid());
- if (!empty($related)) {
- $related = COM_startBlock($LANG11[1], '',
- COM_getBlockTemplate('whats_related_block', 'header'))
- . $related
- . COM_endBlock(COM_getBlockTemplate('whats_related_block',
- 'footer'));
- }
- if (count($story_options) > 0) {
- $optionsblock = COM_startBlock($LANG11[4], '',
- COM_getBlockTemplate('story_options_block', 'header'))
- . COM_makeList($story_options, PLG_getThemeItem('article-css-list-options', 'article'))
- . COM_endBlock(COM_getBlockTemplate('story_options_block',
- 'footer'));
- } else {
- $optionsblock = '';
- }
- $articleTemplate->set_var('whats_related', $related);
- $articleTemplate->set_var('story_options', $optionsblock);
- $articleTemplate->set_var('whats_related_story_options',
- $related . $optionsblock);
+
+ // Render article near top so it can use mode if set (ie to figure out page break)
+ // Another option here could be to figure out if story is first on page
+ $tmpl = $_CONF['showfirstasfeatured'] ? 'featuredarticletext.thtml' : '';
+ $articleTemplate->set_var('formatted_article',
+ STORY_renderArticle($article, 'n', $tmpl, $query, $articlePage, 1, $story_options));
// Display the comments, if there are any ..
if (($article->displayElements('commentcode') >= 0) && $show_comments) {
@@ -538,31 +507,7 @@ function extractExternalLinks($text) {
CMT_userComments($article->getSid(), $article->displayElements('title'), 'article',
$commentOrder, $mode, 0, $commentPage, false, $delete_option, $article->displayElements('commentcode')));
}
- if ($_CONF['trackback_enabled'] && ($article->displayElements('trackbackcode') >= 0) &&
- $show_comments
- ) {
- if (SEC_hasRights('story.ping')) {
- if (($article->displayElements('draft_flag') == 0) &&
- ($article->displayElements('day') < time())
- ) {
- $url = $_CONF['site_admin_url']
- . '/trackback.php?mode=sendall&id=' . $article->getSid();
- $articleTemplate->set_var('send_trackback_link',
- COM_createLink($LANG_TRB['send_trackback'], $url));
- $articleTemplate->set_var('send_trackback_url', $url);
- $articleTemplate->set_var('lang_send_trackback_text',
- $LANG_TRB['send_trackback']);
- }
- }
- $permalink = COM_buildUrl($_CONF['site_url']
- . '/article.php?story=' . $article->getSid());
- $articleTemplate->set_var('trackback',
- TRB_renderTrackbackComments($article->getSID(), 'article',
- $article->displayElements('title'), $permalink));
- } else {
- $articleTemplate->set_var('trackback', '');
- }
$display .= $articleTemplate->finish($articleTemplate->parse('output', 'article'));
$breadcrumbs = TOPIC_breadcrumbs('article', $article->getSid());
diff --git a/public_html/layout/denim/archivearticletext.thtml b/public_html/layout/denim/archivearticletext.thtml
index e49cc8418..0d0fb5343 100644
--- a/public_html/layout/denim/archivearticletext.thtml
+++ b/public_html/layout/denim/archivearticletext.thtml
@@ -37,10 +37,28 @@
{!endif}
{!endif}
- {!if related_articles_by_keyword}
-
- {related_articles_by_keyword}
- {!endif}
+
+
+ {!if related_articles_by_keyword}
+
+ {related_articles_by_keyword}
+
+ {!endif}
+
+
+ {whats_related}
+
+
+
+ {story_options}
+
+
+ {!if trackback}
+
+ {trackback}
+
+ {!endif}
+
{!endif}
{!if navi_list}
diff --git a/public_html/layout/denim/article/article.thtml b/public_html/layout/denim/article/article.thtml
index 859994273..c59d0b88a 100644
--- a/public_html/layout/denim/article/article.thtml
+++ b/public_html/layout/denim/article/article.thtml
@@ -6,20 +6,6 @@
{# page_number: current page number - page_total: total page count - comments_on_page: if comments will appear on page #}
{!if comments_on_page}
-
-
- {whats_related}
-
-
-
- {story_options}
-
-
-
- {trackback}
-
-
-
{commentbar}
{!endif}
diff --git a/public_html/layout/denim/articletext.thtml b/public_html/layout/denim/articletext.thtml
index 6b142bad6..310c21f42 100644
--- a/public_html/layout/denim/articletext.thtml
+++ b/public_html/layout/denim/articletext.thtml
@@ -37,10 +37,28 @@
{!endif}
{!endif}
- {!if related_articles_by_keyword}
-
- {related_articles_by_keyword}
- {!endif}
+
+
+ {!if related_articles_by_keyword}
+
+ {related_articles_by_keyword}
+
+ {!endif}
+
+
+ {whats_related}
+
+
+
+ {story_options}
+
+
+ {!if trackback}
+
+ {trackback}
+
+ {!endif}
+
{!endif}
{!if navi_list}
diff --git a/public_html/layout/denim/featuredarticletext.thtml b/public_html/layout/denim/featuredarticletext.thtml
index 074f62d1b..10a4a53a2 100644
--- a/public_html/layout/denim/featuredarticletext.thtml
+++ b/public_html/layout/denim/featuredarticletext.thtml
@@ -37,10 +37,28 @@
{!endif}
{!endif}
- {!if related_articles_by_keyword}
-
- {related_articles_by_keyword}
- {!endif}
+
+
+ {!if related_articles_by_keyword}
+
+ {related_articles_by_keyword}
+
+ {!endif}
+
+
+ {whats_related}
+
+
+
+ {story_options}
+
+
+ {!if trackback}
+
+ {trackback}
+
+ {!endif}
+
{!endif}
{!if navi_list}
diff --git a/public_html/layout/denim/functions.php b/public_html/layout/denim/functions.php
index 6db72cec1..6d4c97c2c 100644
--- a/public_html/layout/denim/functions.php
+++ b/public_html/layout/denim/functions.php
@@ -324,6 +324,7 @@ function theme_init_denim()
$_BLOCK_TEMPLATE['configmanager_block'] = 'blockheader-config.thtml,blockfooter-config.thtml';
$_BLOCK_TEMPLATE['configmanager_subblock'] = 'blockheader-config.thtml,blockfooter-config.thtml';
$_BLOCK_TEMPLATE['whats_related_block'] = 'blockheader-related.thtml,blockfooter-related.thtml';
+ $_BLOCK_TEMPLATE['articles_related_block'] = 'blockheader-related.thtml,blockfooter-related.thtml';
$_BLOCK_TEMPLATE['story_options_block'] = 'blockheader-related.thtml,blockfooter-related.thtml';
// Define the blocks that are a list of links styled as an unordered list - using class="blocklist"
@@ -377,6 +378,7 @@ function theme_getThemeItem_denim($item)
case 'core-css-list-feed': // Return 1 or more CSS Classes - For RSS Feed Portal Block - replacing "list-feed"
case 'article-css-list-directory': // Return 1 or more CSS Classes - For Article Directory page - New item as of GL v2.2.1
case 'article-css-list-related': // Return 1 or more CSS Classes - For Article Page What's Related List - replacing 'list-whats-related'
+ case 'article-css-list-related-articles': // Return 1 or more CSS Classes - For Article Page You might also like
case 'article-css-list-older': // Return 1 or more CSS Classes - For Older Articles Block - replacing "list-older-stories"
case 'topic-css-list-related': // Return 1 or more CSS Classes - For Autotags Related Topic items list - New item as of GL v2.2.1
diff --git a/public_html/layout/denim_curve/functions.php b/public_html/layout/denim_curve/functions.php
index dbb44f647..42e234de3 100644
--- a/public_html/layout/denim_curve/functions.php
+++ b/public_html/layout/denim_curve/functions.php
@@ -326,6 +326,7 @@ function theme_init_denim_curve()
$_BLOCK_TEMPLATE['configmanager_block'] = 'blockheader-config.thtml,blockfooter-config.thtml';
$_BLOCK_TEMPLATE['configmanager_subblock'] = 'blockheader-config.thtml,blockfooter-config.thtml';
$_BLOCK_TEMPLATE['whats_related_block'] = 'blockheader-related.thtml,blockfooter-related.thtml';
+ $_BLOCK_TEMPLATE['articles_related_block'] = 'blockheader-related.thtml,blockfooter-related.thtml';
$_BLOCK_TEMPLATE['story_options_block'] = 'blockheader-related.thtml,blockfooter-related.thtml';
// Define the blocks that are a list of links styled as an unordered list - using class="blocklist"
@@ -379,6 +380,7 @@ function theme_getThemeItem_denim_curve($item)
case 'core-css-list-feed': // Return 1 or more CSS Classes - For RSS Feed Portal Block - replacing "list-feed"
case 'article-css-list-directory': // Return 1 or more CSS Classes - For Article Directory page - New item as of GL v2.2.1
case 'article-css-list-related': // Return 1 or more CSS Classes - For Article Page What's Related List - replacing 'list-whats-related'
+ case 'article-css-list-related-articles': // Return 1 or more CSS Classes - For Article Page You might also like
case 'article-css-list-older': // Return 1 or more CSS Classes - For Older Articles Block - replacing "list-older-stories"
case 'topic-css-list-related': // Return 1 or more CSS Classes - For Autotags Related Topic items list - New item as of GL v2.2.1
diff --git a/public_html/layout/denim_three/archivearticletext.thtml b/public_html/layout/denim_three/archivearticletext.thtml
index de08e3c71..e999a408a 100644
--- a/public_html/layout/denim_three/archivearticletext.thtml
+++ b/public_html/layout/denim_three/archivearticletext.thtml
@@ -37,10 +37,28 @@
{!endif}
{!endif}
- {!if related_articles_by_keyword}
-
- {related_articles_by_keyword}
- {!endif}
+
+
+ {!if related_articles_by_keyword}
+
+ {related_articles_by_keyword}
+
+ {!endif}
+
+
+ {whats_related}
+
+
+
+ {story_options}
+
+
+ {!if trackback}
+
+ {trackback}
+
+ {!endif}
+
{!endif}
{!if navi_list}
diff --git a/public_html/layout/denim_three/article/article.thtml b/public_html/layout/denim_three/article/article.thtml
index 628abbbf6..6abcff37f 100644
--- a/public_html/layout/denim_three/article/article.thtml
+++ b/public_html/layout/denim_three/article/article.thtml
@@ -6,20 +6,6 @@
{# page_number: current page number - page_total: total page count - comments_on_page: if comments will appear on page #}
{!if comments_on_page}
-
-
- {whats_related}
-
-
-
- {story_options}
-
-
-
- {trackback}
-
-
-
{commentbar}
{!endif}
diff --git a/public_html/layout/denim_three/articletext.thtml b/public_html/layout/denim_three/articletext.thtml
index 7d36f5c59..11199bb62 100644
--- a/public_html/layout/denim_three/articletext.thtml
+++ b/public_html/layout/denim_three/articletext.thtml
@@ -37,10 +37,28 @@
{!endif}
{!endif}
- {!if related_articles_by_keyword}
-
- {related_articles_by_keyword}
- {!endif}
+
+
+ {!if related_articles_by_keyword}
+
+ {related_articles_by_keyword}
+
+ {!endif}
+
+
+ {whats_related}
+
+
+
+ {story_options}
+
+
+ {!if trackback}
+
+ {trackback}
+
+ {!endif}
+
{!endif}
{!if navi_list}
diff --git a/public_html/layout/denim_three/featuredarticletext.thtml b/public_html/layout/denim_three/featuredarticletext.thtml
index 11ba3952f..d1084319c 100644
--- a/public_html/layout/denim_three/featuredarticletext.thtml
+++ b/public_html/layout/denim_three/featuredarticletext.thtml
@@ -37,10 +37,28 @@
{!endif}
{!endif}
- {!if related_articles_by_keyword}
-
- {related_articles_by_keyword}
- {!endif}
+
+
+ {!if related_articles_by_keyword}
+
+ {related_articles_by_keyword}
+
+ {!endif}
+
+
+ {whats_related}
+
+
+
+ {story_options}
+
+
+ {!if trackback}
+
+ {trackback}
+
+ {!endif}
+
{!endif}
{!if navi_list}
diff --git a/public_html/layout/denim_three/functions.php b/public_html/layout/denim_three/functions.php
index 504926aef..e36c84ee7 100644
--- a/public_html/layout/denim_three/functions.php
+++ b/public_html/layout/denim_three/functions.php
@@ -272,6 +272,7 @@ function theme_init_denim_three()
$_BLOCK_TEMPLATE['configmanager_block'] = 'blockheader-config.thtml,blockfooter-config.thtml';
$_BLOCK_TEMPLATE['configmanager_subblock'] = 'blockheader-config.thtml,blockfooter-config.thtml';
$_BLOCK_TEMPLATE['whats_related_block'] = 'blockheader-related.thtml,blockfooter-related.thtml';
+ $_BLOCK_TEMPLATE['articles_related_block'] = 'blockheader-related.thtml,blockfooter-related.thtml';
$_BLOCK_TEMPLATE['story_options_block'] = 'blockheader-related.thtml,blockfooter-related.thtml';
// Define the blocks that are a list of links styled as an unordered list - using class="blocklist"
@@ -325,6 +326,7 @@ function theme_getThemeItem_denim_three($item)
case 'core-css-list-feed': // Return 1 or more CSS Classes - For RSS Feed Portal Block - replacing "list-feed"
case 'article-css-list-directory': // Return 1 or more CSS Classes - For Article Directory page - New item as of GL v2.2.1
case 'article-css-list-related': // Return 1 or more CSS Classes - For Article Page What's Related List - replacing 'list-whats-related'
+ case 'article-css-list-related-articles': // Return 1 or more CSS Classes - For Article Page You might also like
case 'article-css-list-older': // Return 1 or more CSS Classes - For Older Articles Block - replacing "list-older-stories"
case 'topic-css-list-related': // Return 1 or more CSS Classes - For Autotags Related Topic items list - New item as of GL v2.2.1
diff --git a/public_html/layout/glnet_curve/functions.php b/public_html/layout/glnet_curve/functions.php
index a254b3f5c..44da24983 100644
--- a/public_html/layout/glnet_curve/functions.php
+++ b/public_html/layout/glnet_curve/functions.php
@@ -330,6 +330,7 @@ function theme_init_glnet_curve()
$_BLOCK_TEMPLATE['configmanager_block'] = 'blockheader-config.thtml,blockfooter-config.thtml';
$_BLOCK_TEMPLATE['configmanager_subblock'] = 'blockheader-config.thtml,blockfooter-config.thtml';
$_BLOCK_TEMPLATE['whats_related_block'] = 'blockheader-related.thtml,blockfooter-related.thtml';
+ $_BLOCK_TEMPLATE['articles_related_block'] = 'blockheader-related.thtml,blockfooter-related.thtml';
$_BLOCK_TEMPLATE['story_options_block'] = 'blockheader-related.thtml,blockfooter-related.thtml';
// GLNET CUSTOM
@@ -386,6 +387,7 @@ function theme_getThemeItem_glnet_curve($item)
case 'core-css-list-feed': // Return 1 or more CSS Classes - For RSS Feed Portal Block - replacing "list-feed"
case 'article-css-list-directory': // Return 1 or more CSS Classes - For Article Directory page - New item as of GL v2.2.1
case 'article-css-list-related': // Return 1 or more CSS Classes - For Article Page What's Related List - replacing 'list-whats-related'
+ case 'article-css-list-related-articles': // Return 1 or more CSS Classes - For Article Page You might also like
case 'article-css-list-older': // Return 1 or more CSS Classes - For Older Articles Block - replacing "list-older-stories"
case 'topic-css-list-related': // Return 1 or more CSS Classes - For Autotags Related Topic items list - New item as of GL v2.2.1
diff --git a/public_html/layout/modern_curve/archivearticletext.thtml b/public_html/layout/modern_curve/archivearticletext.thtml
index b050be1ac..179c11e00 100644
--- a/public_html/layout/modern_curve/archivearticletext.thtml
+++ b/public_html/layout/modern_curve/archivearticletext.thtml
@@ -47,10 +47,13 @@
{!endif}
{!endif}
- {!if related_articles_by_keyword}
-
- {related_articles_by_keyword}
- {!endif}
+ {related_articles_by_keyword}
+
+ {whats_related}
+
+ {story_options}
+
+ {trackback}
{!endif}
{!if navi_list}
diff --git a/public_html/layout/modern_curve/article/article.thtml b/public_html/layout/modern_curve/article/article.thtml
index b00397c3a..71f67d02e 100644
--- a/public_html/layout/modern_curve/article/article.thtml
+++ b/public_html/layout/modern_curve/article/article.thtml
@@ -4,10 +4,6 @@
{# page_number: current page number - page_total: total page count - comments_on_page: if comments will appear on page #}
{!if comments_on_page}
- {whats_related}
- {story_options}
-
- {trackback}
{commentbar}
{!endif}
diff --git a/public_html/layout/modern_curve/articletext.thtml b/public_html/layout/modern_curve/articletext.thtml
index 0ef13405d..312dace19 100644
--- a/public_html/layout/modern_curve/articletext.thtml
+++ b/public_html/layout/modern_curve/articletext.thtml
@@ -47,10 +47,13 @@
{!endif}
{!endif}
- {!if related_articles_by_keyword}
-
- {related_articles_by_keyword}
- {!endif}
+ {related_articles_by_keyword}
+
+ {whats_related}
+
+ {story_options}
+
+ {trackback}
{!endif}
{!if navi_list}
diff --git a/public_html/layout/modern_curve/featuredarticletext.thtml b/public_html/layout/modern_curve/featuredarticletext.thtml
index e9f0f4b7a..29f0eb9ba 100644
--- a/public_html/layout/modern_curve/featuredarticletext.thtml
+++ b/public_html/layout/modern_curve/featuredarticletext.thtml
@@ -47,10 +47,13 @@
{!endif}
{!endif}
- {!if related_articles_by_keyword}
-
- {related_articles_by_keyword}
- {!endif}
+ {related_articles_by_keyword}
+
+ {whats_related}
+
+ {story_options}
+
+ {trackback}
{!endif}
{!if navi_list}
diff --git a/public_html/layout/modern_curve/functions.php b/public_html/layout/modern_curve/functions.php
index 81c24d237..f20ed699e 100644
--- a/public_html/layout/modern_curve/functions.php
+++ b/public_html/layout/modern_curve/functions.php
@@ -223,6 +223,7 @@ function theme_init_modern_curve()
$_BLOCK_TEMPLATE['configmanager_block'] = 'blockheader-config.thtml,blockfooter-config.thtml';
$_BLOCK_TEMPLATE['configmanager_subblock'] = 'blockheader-config.thtml,blockfooter-config.thtml';
$_BLOCK_TEMPLATE['whats_related_block'] = 'blockheader-related.thtml,blockfooter-related.thtml';
+ $_BLOCK_TEMPLATE['articles_related_block'] = 'blockheader-related.thtml,blockfooter-related.thtml';
$_BLOCK_TEMPLATE['story_options_block'] = 'blockheader-related.thtml,blockfooter-related.thtml';
// Define the blocks that are a list of links styled as an unordered list - using class="blocklist"
@@ -270,6 +271,7 @@ function theme_getThemeItem_modern_curve($item)
case 'comment-width-user-avatar': // Return width in pixels of user photos in comments - New item as of GL v2.2.1
case 'article-css-list-directory': // Return 1 or more CSS Classes - For Article Directory page - New item as of GL v2.2.1
case 'article-css-list-related': // Return 1 or more CSS Classes - For Article Page What's Related List - replacing 'list-whats-related'
+ case 'article-css-list-related-articles': // Return 1 or more CSS Classes - For Article Page You might also like
case 'article-css-list-older': // Return 1 or more CSS Classes - For Older Articles Block - replacing "list-older-stories"
case 'topic-css-list-related': // Return 1 or more CSS Classes - For Autotags Related Topic items list - New item as of GL v2.2.1
diff --git a/system/classes/article.class.php b/system/classes/article.class.php
index 7595facb4..865b57d22 100644
--- a/system/classes/article.class.php
+++ b/system/classes/article.class.php
@@ -2030,10 +2030,10 @@ public function getRelatedArticlesByKeywords($articleId, $keywordList, $limit =
global $_CONF, $LANG24, $_TABLES;
$work = array();
-
+
// Lets search the 50 latest articles that match the keyword
// This will return the most related
- $searchlimit = 50;
+ $searchlimit = 50;
$articleId = trim($articleId);
$keywords = explode(',', $keywordList);
@@ -2101,14 +2101,11 @@ public function getRelatedArticlesByKeywords($articleId, $keywordList, $limit =
$retval = array();
foreach ($work as $item) {
- $retval[] = '- '
- . '' . $this->_displayEscape($item['title']). ''
- . '
' . PHP_EOL;
+ $retval[] = '' . $this->_displayEscape($item['title']). '';
}
- $retval = '' . $LANG24[92] . '
' . PHP_EOL
- . '' . PHP_EOL . implode('', $retval) . '
' . PHP_EOL;
+ $retval = COM_makeList($retval, PLG_getThemeItem('article-css-list-related-articles', 'core'));
}
return $retval;
diff --git a/system/lib-article.php b/system/lib-article.php
index e83332e99..99ccb85de 100644
--- a/system/lib-article.php
+++ b/system/lib-article.php
@@ -62,12 +62,13 @@
* @param string $query A search query, if one was specified.
* @param string $articlePage Current page being displayed for articles. Used only with $index of 'n' and if page breaks enabled (else always assume 1)
* @param string $articleCountOnPage Current article count being displayed on page. Used for topics to display blocks between articles
+ * @param array $story_options Array of article options for the block. Only displayed on full article page
* @return string Article as formatted HTML.
* Note: Formerly named COM_Article, and re-written totally since then.
*/
-function STORY_renderArticle($story, $index = '', $storyTpl = 'articletext.thtml', $query = '', $articlePage = 1, $articleCountOnPage = 1)
+function STORY_renderArticle($story, $index = '', $storyTpl = 'articletext.thtml', $query = '', $articlePage = 1, $articleCountOnPage = 1, $story_options = [])
{
- global $_CONF, $_TABLES, $_USER, $LANG01, $LANG05, $LANG11, $LANG_TRB,
+ global $_CONF, $_TABLES, $_USER, $LANG01, $LANG05, $LANG11, $LANG24, $LANG_TRB,
$_IMAGE_TYPE, $_STRUCT_DATA;
static $storyCounter = 0;
@@ -654,15 +655,75 @@ function STORY_renderArticle($story, $index = '', $storyTpl = 'articletext.thtml
PLG_templateSetVars('storytext', $article);
}
- // Add related articles
- if ($index === 'n' && $_CONF['meta_tags'] > 0) {
- $article->set_var(
- 'related_articles_by_keyword',
- $story->getRelatedArticlesByKeywords(
+
+ if ($index === 'n') {
+ // Related Articles block (You might also like)
+ if ($_CONF['meta_tags'] > 0) {
+ $relatedArticles = $story->getRelatedArticlesByKeywords(
$story->getSid(),
- $story->DisplayElements('meta_keywords')
- )
- );
+ $story->DisplayElements('meta_keywords'));
+ if (!empty($relatedArticles)) {
+ $relatedArticles = COM_startBlock($LANG24[92], '',
+ COM_getBlockTemplate('articles_related_block', 'header'))
+ . $relatedArticles
+ . COM_endBlock(COM_getBlockTemplate('articles_related_block', 'footer'));
+ }
+
+ $article->set_var('related_articles_by_keyword', $relatedArticles);
+ }
+
+ // What's Related Block
+ $related = STORY_whatsRelated($story->displayElements('related'),
+ $story->displayElements('uid'),
+ $story->getSid());
+ if (!empty($related)) {
+ $related = COM_startBlock($LANG11[1], '',
+ COM_getBlockTemplate('whats_related_block', 'header'))
+ . $related
+ . COM_endBlock(COM_getBlockTemplate('whats_related_block',
+ 'footer'));
+ }
+ $article->set_var('whats_related', $related);
+
+ // Article Options Block
+ if (count($story_options) > 0) {
+ $optionsblock = COM_startBlock($LANG11[4], '',
+ COM_getBlockTemplate('story_options_block', 'header'))
+ . COM_makeList($story_options, PLG_getThemeItem('article-css-list-options', 'article'))
+ . COM_endBlock(COM_getBlockTemplate('story_options_block',
+ 'footer'));
+ } else {
+ $optionsblock = '';
+ }
+ $article->set_var('story_options', $optionsblock);
+ $article->set_var('whats_related_story_options', $related . $optionsblock);
+
+ // Trackback
+ if ($_CONF['trackback_enabled'] && ($story->displayElements('trackbackcode') >= 0) &&
+ $show_comments
+ ) {
+ if (SEC_hasRights('story.ping')) {
+ if (($story->displayElements('draft_flag') == 0) &&
+ ($story->displayElements('day') < time())
+ ) {
+ $url = $_CONF['site_admin_url']
+ . '/trackback.php?mode=sendall&id=' . $story->getSid();
+ $article->set_var('send_trackback_link',
+ COM_createLink($LANG_TRB['send_trackback'], $url));
+ $article->set_var('send_trackback_url', $url);
+ $article->set_var('lang_send_trackback_text',
+ $LANG_TRB['send_trackback']);
+ }
+ }
+
+ $permalink = COM_buildUrl($_CONF['site_url']
+ . '/article.php?story=' . $story->getSid());
+ $article->set_var('trackback',
+ TRB_renderTrackbackComments($story->getSID(), 'article',
+ $story->displayElements('title'), $permalink));
+ } else {
+ $article->set_var('trackback', '');
+ }
}
PLG_templateSetVars($article_filevar, $article);