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
k9-noja
Regular
Regular



Joined: Dec 07, 2009
Posts: 72
Location: holland

PostPosted: Sun May 16, 2010 1:43 am Reply with quote

wel again i have an issu Rolling Eyes

i just removed a member on our site/forum.

now all topics where he put a awnser in it are gone Shocked

it shows on the active topics on the site, but when i clik on it it say's
"No posts exist for this topic"

_________________
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Send e-mail Visit poster's website
Palbin
Site Admin



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

PostPosted: Sun May 16, 2010 8:45 am Reply with quote

How did you delete the user? Did you use Your_Account or the Forums?

Someone else here is also having this same problem. I'll attempt to right a script to fix this, but I don't know how it is gong to work on big DBs.

_________________
"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
k9-noja







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

at first i tryd to delet hem on the forum. but that woudend work.
so i deleted him tru the admin controlpanel "users"
first deactived, then remove.
 
Palbin







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

k9-noja, please refer to the following topic for future discussion. Please run the script I posted in the other topic and post there with your results.

http://www.ravenphpscripts.com/postp148682.html
 
k9-noja







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

Palbin wrote:
k9-noja, please refer to the following topic for future discussion. Please run the script I posted in the other topic and post there with your results.

http://www.ravenphpscripts.com/postp148682.html


oke i got the script, but how do i call it ?
 
k9-noja







PostPosted: Sun May 16, 2010 10:04 am Reply with quote

palbin, i have send you a PM Embarassed
 
Palbin







PostPosted: Sun May 16, 2010 10:37 am Reply with quote

k9-noja, don't worry about backing up your database for now. The script I am posting here will not affect it.

Open up notepad or some other text editor. Put the following code in it and then call it something like post_check.php. Then upload the file via FTP to the root of your site. Then call the script like so http://www.yoursite.com/post_check.php

When you go there it will show something like There are X posts with a -1 poster_id.. I want to know how many posts it says have a -1 value. It could possible be 0.

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

?>


If you need more help please feel free to reply here Smile
 
k9-noja







PostPosted: Sun May 16, 2010 12:59 pm Reply with quote

DONE!

There are 14 posts with a -1 poster_id.
 
Palbin







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

First thing you have to do is backup your DB via phpmyadmin. You will not have to worry about restoring it, but better safe than sorry.

http://www.siteground.com/tutorials/php-mysql/mysql_export.htm

Once you have a backup of your DB create a file called fix_posts.php with the following code in it. Place this file in the root of your site as you did with the previous file.

Code:


<?php

require 'mainfile.php';
global $db, $prefix;

$content = '';

$sql = 'SELECT `post_id` FROM `' . $prefix . '_bbposts` WHERE `poster_id` = -1';
$result = $db->sql_query($sql);
while($row = $db->sql_fetchrow($result, MYSQL_ASSOC)) {
   $db->sql_query('UPDATE `' . $prefix . '_bbposts` SET `poster_id`="1" WHERE `post_id`="' . $row['post_id'] . '" AND `poster_id`="-1"');
   $content .= 'Post ' . $row['post_id'] . ' poster_id updated.<br />';
}

echo $content , '<br /><br />DONE!';

?>


It should list the 14 posts that have been updated. Once you have run the script check your forums to see if the topics show.
 
k9-noja







PostPosted: Mon May 17, 2010 1:17 am Reply with quote

back-up.... check
fix_posts.php. ..... check

run ......

Post 401 poster_id updated.
Post 402 poster_id updated.
Post 405 poster_id updated.
Post 406 poster_id updated.
Post 409 poster_id updated.
Post 415 poster_id updated.
Post 416 poster_id updated.
Post 417 poster_id updated.
Post 418 poster_id updated.
Post 432 poster_id updated.
Post 444 poster_id updated.
Post 445 poster_id updated.
Post 452 poster_id updated.
Post 455 poster_id updated.


DONE!



problem..... not solved Confused
 
montego
Site Admin



Joined: Aug 29, 2004
Posts: 9457
Location: Arizona

PostPosted: Thu May 20, 2010 8:37 am Reply with quote

Deleting users through the Forums should be removed from RN... Wink Sorry. I know this doesn't help the issue at hand, but would help folks go forward from using that feature when they should not. There may be other such features in Forums Admin that should be removed as well.

_________________
Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
k9-noja







PostPosted: Thu May 20, 2010 8:51 am Reply with quote

well i removed him tru the admin pannel of RN.
and thats where the problem started
Laughing
 
Palbin







PostPosted: Thu May 20, 2010 9:19 am Reply with quote

Yes, but not before you tried to use the forums.

I am out of ideas on why the topics are not showing. Unless you are will to provide me with access to your db I'm not sure we can resolve this because I'm really just shooting in the dark.
 
k9-noja







PostPosted: Thu Jun 03, 2010 2:11 am Reply with quote

i want to try to deleat another user, that is not actief on the forum.

i went to admin panel > forums > user admin menagment >
and taged the "delete this user....."

i get the following massage :

Could not delete group for this user

DEBUG MODE

SQL Error : 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 2

DELETE FROM nuke_bbgroups WHERE group_id =

Line : 140
File : admin_users.php



but the user is deleted.
Rolling Eyes
 
Palbin







PostPosted: Thu Jun 03, 2010 4:35 am Reply with quote

In the future do not use the forums to delete users. Use the "Edit Users" section of the main administration (www.yoursite.com/admin.php)
 
snype
Regular
Regular



Joined: Aug 12, 2008
Posts: 58

PostPosted: Thu Jun 03, 2010 6:30 am Reply with quote

What i done to fix this problem i had a couple of years back with my old clan was ask my host for there latest back up of my site this included the databases i then uploaded the user that i deleted back in the nuke_users and that seemed to do the trick from there i just changed his name to DELETED and reset the pass and all other things that he had entered upon registration.

May not be the right way but it worked for me
 
View user's profile Send private message
mrix
Client



Joined: Dec 04, 2004
Posts: 757

PostPosted: Fri Jun 04, 2010 7:09 pm Reply with quote

Thats where my problems lies as over the years I have deleted many members from the forum admin Sad
Cheers
mrix
 
View user's profile Send private message Visit poster's website
Palbin







PostPosted: Fri Jun 04, 2010 7:20 pm Reply with quote

I can probably fix it, but I would need cpanel access to someone's site or at least ftp and phpmyadmin access. The problem is that I can't figure out what is actually causing the problem in the forums to try and fix it. It has to be a problem in the database.
 
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 ©