Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.4 RN Issues
Author Message
mrix
Client



Joined: Dec 04, 2004
Posts: 757

PostPosted: Mon May 10, 2010 2:06 am Reply with quote

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
 
View user's profile Send private message Visit poster's website
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Mon May 10, 2010 6:53 am Reply with quote

Never heard that one before Confused

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?
 
View user's profile Send private message
mrix







PostPosted: Mon May 10, 2010 7:17 am Reply with quote

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
 
dad7732
RavenNuke(tm) Development Team



Joined: Mar 18, 2007
Posts: 1242

PostPosted: Mon May 10, 2010 1:43 pm Reply with quote

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?
 
View user's profile Send private message
Palbin
Site Admin



Joined: Mar 30, 2006
Posts: 2583
Location: Pittsburgh, Pennsylvania

PostPosted: Mon May 10, 2010 3:42 pm Reply with quote

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. 
View user's profile Send private message
mrix







PostPosted: Mon May 10, 2010 3:52 pm Reply with quote

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 Very Happy

Many thanks all much appreciated.

cheers
mrix
 
Palbin







PostPosted: Mon May 10, 2010 4:34 pm Reply with quote

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!';

?>
 
mrix







PostPosted: Mon May 10, 2010 4:42 pm Reply with quote

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 Confused
Really appreciate the help.
cheers
mrix
 
Palbin







PostPosted: Mon May 10, 2010 4:48 pm Reply with quote

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.
 
mrix







PostPosted: Tue May 11, 2010 5:01 am Reply with quote

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
 
Palbin







PostPosted: Tue May 11, 2010 7:03 am Reply with quote

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.
 
Palbin







PostPosted: Sun May 16, 2010 9:38 am Reply with quote

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.';

?>
 
Palbin







PostPosted: Sun May 16, 2010 6:15 pm Reply with quote

mrix, try the latest script that I have posted in the link below. Of course backup your DB first.

http://www.ravenphpscripts.com/postp148705.html#148705
 
mrix







PostPosted: Wed May 19, 2010 7:22 am Reply with quote

Unfortunately the script didnt work for me Sad
Cheers
mrix
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.4 RN Issues

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
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©