| Author |
Message |
floppy
Newbie


Joined: Sep 11, 2006
Posts: 92
|
Posted:
Fri Jul 13, 2007 11:49 am |
|
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'];
}
} |
|
| |
|
|
 |
montego
Site Admin/Owner


Joined: Feb 12, 2005
Posts: 1360
|
Posted:
Fri Jul 13, 2007 8:18 pm |
|
floppy, I will add this to the next revision.
Thanks!
P.S. You are unbanned.  |
_________________ “To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins |
|
|
 |
floppy
Newbie


Joined: Sep 11, 2006
Posts: 92
|
Posted:
Wed Jul 18, 2007 1:26 pm |
|
No problem. Anything I can do to help  |
| |
|
|
 |
Guardian
Site Admin


Joined: Jul 18, 2005
Posts: 387
|
Posted:
Thu Jul 19, 2007 1:59 pm |
|
| floppy wrote: |
No problem. Anything I can do to help  |
I have a garden needs weeding... |
| |
|
|
 |
floppy
Newbie


Joined: Sep 11, 2006
Posts: 92
|
Posted:
Thu Jul 19, 2007 2:28 pm |
|
I have a 12 beer minimum for anything that requires me getting down on my knees!!!
 |
| |
|
|
 |
montego
Site Admin/Owner


Joined: Feb 12, 2005
Posts: 1360
|
Posted:
Thu Jul 19, 2007 3:19 pm |
|
|
|
 |
|
|