Author |
Message |
mrix
Client
![](modules/Forums/images/avatars/blank.gif)
Joined: Dec 04, 2004
Posts: 757
|
Posted:
Mon May 10, 2010 2:06 am |
|
Hi all, having checked through various forums on my site I have noticed that a fair few pages have no posts only stickies?
Its basically some of the very first pages of that specific forum i:e all pages up to page 53 of one of my forums contain topics but pages 54 to 68 have none at all but only stickies?
Any idea`s why this happened ?
Anyway to rectify it?
thanks for any help.
cheers
mrix |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Raven
Site Admin/Owner
![](modules/Forums/images/avatars/45030c033f18773153cd2.gif)
Joined: Aug 27, 2002
Posts: 17088
|
Posted:
Mon May 10, 2010 6:53 am |
|
Never heard that one before
What version of RN are you using?
What is the earliest date of the post that reflects this? (This will help ascertain when, if there is a bug, the bug might have been introduced. I'm not saying there is or isn't a bug, but the dates will help.
When did you first notice it?
Have you made any forum mods/changes since your last install/update to RN? |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
mrix
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Mon May 10, 2010 7:17 am |
|
Hi there, I have noticed it for months to be honest and it may of been like that longer... To be honest I cant be certain when it changed.
As it only appears in old original pages its not too much of a problem but it would be nice to sort it out if possible.
I am using version 2.4.1
The earliest date where it stopped with old posts was Tue Dec 07, 2004
Strange thing with one forums I went through, all the pages up to 61 were ok then it stopped right and no more pages...... but if I back browsed I see page links up to 75 ? but with no content on?
Something messed up along the way I guess.
I can understand and don`t think much can be done
Cheers
mrix |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
dad7732
RavenNuke(tm) Development Team
![](modules/Forums/images/avatars/gallery/blank.gif)
Joined: Mar 18, 2007
Posts: 1242
|
Posted:
Mon May 10, 2010 1:43 pm |
|
When you installed 2.4.1, did you do the DB Upgrade? And when was the last time you optimized your MySQL DB? Have you noticed any error messages or raw code at the top or bottom of your forum(s)? What theme are you using? |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Palbin
Site Admin
![](modules/Forums/images/avatars/Dilbert/Dilbert_-_Dogbert_King.gif)
Joined: Mar 30, 2006
Posts: 2583
Location: Pittsburgh, Pennsylvania
|
Posted:
Mon May 10, 2010 3:42 pm |
|
Sounds like a topic count problem. Give me some time and I will make a script for you to run. |
_________________ "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan. |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
mrix
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Mon May 10, 2010 3:52 pm |
|
Hi again.
Quote: | When you installed 2.4.1, did you do the DB Upgrade? |
Most definitely.
Quote: | And when was the last time you optimized your MySQL DB? |
I run it every few months.
Quote: |
Have you noticed any error messages or raw code at the top or bottom of your forum(s)? |
No errors at all.
Quote: | What theme are you using? |
An old theme called ClanMTS but it was updated for me to run Ravennuke.
Quote: | Sounds like a topic count problem. Give me some time and I will make a script for you to run. |
If thats possible that would be great
Many thanks all much appreciated.
cheers
mrix |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Palbin
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Mon May 10, 2010 4:34 pm |
|
Make a a file called topic_count_fix.php, and place it in the root of your site with the following code.
MAKE A BACKUP OF YOUR DATABASE FIRST. Not that we are doing anything major here, but I didn't test this.
Delete the file when finished.
Code:
<?PHP
require 'mainfile.php';
global $db, $prefix;
$sql = 'SELECT * FROM `' . $prefix . '_bbforums`';
$result = $db->sql_query($sql);
while($row = $db->sql_fetchrow($result, MYSQL_ASSOC)) {
$sql2 = 'SELECT * FROM `' . $prefix . '_bbtopics` WHERE `forum_id`="' . $row['forum_id'] . '"';
$result2 = $db->sql_query($sql2);
$num_topics = $db ->sql_numrows($result2);
if ($num_topics != $row['forum_topics']) {
$db->sql_query('UPDATE `' . $prefix . '_bbforums` SET `forum_topics`="' . $num_topics . '" WHERE `forum_id`="' . $row['forum_id'] . '"');
echo $row['forum_name'] . ' - Old Count: ' . $row['forum_topics'] . ' | New Count: ' . $num_topics . '<br />';
} else {
echo $row['forum_name'] . '- OK<br />';
}
}
echo '<br /><br />DONE!';
?>
|
|
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
mrix
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Mon May 10, 2010 4:42 pm |
|
Hi I added the script and run it... I got the list saying all the ok`s per forum but still the fourms have the same issue
Really appreciate the help.
cheers
mrix |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Palbin
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Mon May 10, 2010 4:48 pm |
|
If you got all OKs then the topic count was not the problem. If there was a mismatch it would have said something like Forum - Old Count: x | New Count : Y
Let me think about this again. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
mrix
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Tue May 11, 2010 5:01 am |
|
Just a thought if I cant get a script to sort this issue would it be possible to delete the last pages somehow?
Cheers
mrix |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Palbin
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Tue May 11, 2010 7:03 am |
|
I'm thinking it might be that there are topics that were created by users that have since be deleted without properly dealing with their posts/topics. I'll make a script to test this theory and post it here. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Palbin
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sun May 16, 2010 9:38 am |
|
mrix, place this script in the root of your site and run it. Then post back with what it says.
Code:
<?PHP
require 'mainfile.php';
global $db, $prefix;
$sql = 'SELECT `poster_id` FROM `' . $prefix . '_bbposts` WHERE `poster_id` = -1';
$result = $db->sql_query($sql);
if ($result) {
$problem_posts = $db->sql_numrows($result);
} else {
$problem_posts = 0;
}
echo 'DONE!<br /><br />'
, 'There are ' , $problem_posts , ' posts with a -1 poster_id.';
?>
|
|
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Palbin
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sun May 16, 2010 6:15 pm |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
mrix
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed May 19, 2010 7:22 am |
|
Unfortunately the script didnt work for me
Cheers
mrix |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
|