Montego Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic
Author Message
pezzer1
Newbie
Newbie



Joined: Nov 26, 2007
Posts: 22

PostPosted: Tue Mar 11, 2008 11:51 pm Reply with quote

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...
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Wed Mar 12, 2008 6:43 am Reply with quote

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 
View user's profile Send private message Visit poster's website
pezzer1
Newbie
Newbie



Joined: Nov 26, 2007
Posts: 22

PostPosted: Wed Mar 12, 2008 9:39 am Reply with quote

YES!!! That worked perfectly.

Thank you for both your quick response and your continuing development of Dynamic Titles and Shortlinks...
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Wed Mar 12, 2008 10:45 am Reply with quote

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 
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 4 Hours
 
Forums ©
linear-bunch
linear-bunch
linear-bunch