Montego Scripts: Forums
 

 

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



Joined: Sep 11, 2006
Posts: 92

PostPosted: Fri Jul 13, 2007 11:49 am Reply with quote

I noticed you forgot to include bodytext in the dynamic titles sql call. It creates a problem when users don't use any home text. Yeah I know thats rare as hell, but it does happen.

Old
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'];
   } elseif ($file == 'article') {
      $sql = 'SELECT title, topic, hometext FROM '.$prefix.'_stories WHERE sid=\''.intval($sid).'\'';
      $result = $db->sql_query($sql);
      $row = $db->sql_fetchrow($result);
      $asDTText['subject'] = $row['title'];
      $asDTText['text'] = substr($row['hometext'], 0, $text_size);
      $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_delim.$asDTText['text'].$dt_delim.$row['topictext'];
   }
}


New
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'];
   } 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'] = substr($row['hometext'].$row['bodytext'], 0, $text_size);
      $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_delim.$asDTText['text'].$dt_delim.$row['topictext'];
   }
}
 
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1391

PostPosted: Fri Jul 13, 2007 8:18 pm Reply with quote

floppy, I will add this to the next revision.

Thanks!

P.S. You are unbanned. Wink

_________________
“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
floppy
Newbie
Newbie



Joined: Sep 11, 2006
Posts: 92

PostPosted: Wed Jul 18, 2007 1:26 pm Reply with quote

No problem. Anything I can do to help Very Happy
 
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Guardian
Site Admin
Site Admin



Joined: Jul 18, 2005
Posts: 401

PostPosted: Thu Jul 19, 2007 1:59 pm Reply with quote

floppy wrote:
No problem. Anything I can do to help Very Happy

I have a garden needs weeding...
 
View user's profile Send private message
floppy
Newbie
Newbie



Joined: Sep 11, 2006
Posts: 92

PostPosted: Thu Jul 19, 2007 2:28 pm Reply with quote

I have a 12 beer minimum for anything that requires me getting down on my knees!!!

Rolling Eyes
 
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1391

PostPosted: Thu Jul 19, 2007 3:19 pm Reply with quote

Shocked
 
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