| Author |
Message |
pezzer1
Newbie


Joined: Nov 26, 2007
Posts: 22
|
Posted:
Tue Mar 11, 2008 11:51 pm |
|
As you know with RN, news articles are divided into both Categories and Topics.
If I click a link to return all articles by particular topic, I get the following.
URL (with shortlinks)
/article-topic-1.html
Title:
ActualFirstTopicTitle - Mydomain.com
URL
/article-topic-2.html
Title:
ActualSecondTopicTitle - Mydomain.com
Now, if I click a link to return all articles by a particular Category, dynamic title doesn't resolve the Category name, only the word "Article" - For Example
URL:
article-category-1.html
Title:
Article - Actual Domain Slogan - Mydomain.com
Unlike the topic, where the dynamic title file pulled the actual topic name and displayed it as a title, the category does not do the same.
I have tried, tried, tried and failed to configure the Dynamic Title file to include categories. Do you have any advice?
Thanks... |
| |
|
|
 |
montego
Site Admin/Owner


Joined: Feb 12, 2005
Posts: 926
|
Posted:
Wed Mar 12, 2008 6:43 am |
|
I have released version 1.2.1 with the latest RavenNuke, which has the category fix in it, but I have not gotten around to releasing it to the public. Sorry. Do this:
=== OPEN FILE ===
includes/dynamic_titles.php
=== FIND CODE ===
| Code: |
/*
* News
*/
elseif ($name == 'News') {
global $file, $sid, $new_topic;
if ($new_topic != '') {
$sql = 'SELECT topictext FROM ' . $prefix . '_topics WHERE topicid=\'' . intval($new_topic) . '\'';
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$newpagetitle = $row['topictext'] . $dt_sDelim . $sitename;
} elseif ($file == 'article') {
$sql = 'SELECT title, topic, hometext, bodytext FROM ' . $prefix . '_stories WHERE sid=\'' . intval($sid) . '\'';
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$asDTText['subject'] = $row['title'];
$asDTText['text'] = $row['hometext'];
$asDTText['bodytext'] = $row['bodytext'];
$sql = 'SELECT topictext FROM ' . $prefix . '_topics WHERE topicid=\'' . intval($row['topic']) . '\'';
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$newpagetitle = $asDTText['subject'] . $dt_sDelim . $asDTText['text'] . ' ' . $asDTText['bodytext'] . $dt_sDelim . $row['topictext'];
}
}
|
=== REPLACE WITH ===
| Code: |
/*
* News
*/
elseif ($name == 'News') {
global $file, $sid, $new_topic, $catid;
if ($new_topic != '') {
$sql = 'SELECT topictext FROM ' . $prefix . '_topics WHERE topicid=\'' . intval($new_topic) . '\'';
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$newpagetitle = $row['topictext'] . $dt_sDelim . $sitename;
} elseif ($file == 'article') {
$sql = 'SELECT title, topic, hometext, bodytext FROM ' . $prefix . '_stories WHERE sid=\'' . intval($sid) . '\'';
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$asDTText['subject'] = $row['title'];
$asDTText['text'] = $row['hometext'];
$asDTText['bodytext'] = $row['bodytext'];
$sql = 'SELECT topictext FROM ' . $prefix . '_topics WHERE topicid=\'' . intval($row['topic']) . '\'';
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$newpagetitle = $asDTText['subject'] . $dt_sDelim . $asDTText['text'] . ' ' . $asDTText['bodytext'] . $dt_sDelim . $row['topictext'];
} elseif ($file == 'categories') {
$sql = 'SELECT title FROM ' . $prefix . '_stories_cat WHERE catid=\'' . intval($catid) . '\'';
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$asDTText['subject'] = $row['title'];
$newpagetitle = $asDTText['subject'] . $dt_sDelim . $sitename;
}
}
|
=== DONE === |
_________________ “To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins |
|
|
 |
pezzer1
Newbie


Joined: Nov 26, 2007
Posts: 22
|
Posted:
Wed Mar 12, 2008 9:39 am |
|
YES!!! That worked perfectly.
Thank you for both your quick response and your continuing development of Dynamic Titles and Shortlinks... |
| |
|
|
 |
montego
Site Admin/Owner


Joined: Feb 12, 2005
Posts: 926
|
Posted:
Wed Mar 12, 2008 10:45 am |
|
Excellent! Thank you for the verification. |
_________________ “To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins |
|
|
 |
|
|