Previous Thread
Next Thread
Print Thread
Hop To
#244560 07/26/2011 5:21 PM
Joined: Jan 2008
Posts: 81
D
DougMM Offline OP
journeyman
OP Offline
journeyman
D
Joined: Jan 2008
Posts: 81
I had a spammer come to my board and his account was quickly deleted. Now I have a few members that are seeing Private Message notifications form this spammer but after the spammers account and all posts were deleted they can not view the PM's or get the PM notifications to stop. Does anyone know how I can stop the notifications for these members on my board? UBB 7.4

I have already Rebuilt private messages and that didn't help. mad

Thanks for your help

Joined: Dec 2003
Posts: 6,278
Likes: 45
Offline
Joined: Dec 2003
Posts: 6,278
Likes: 45
In your version 7.4 do you have the option.
Prune Orphaned Private Topics?
In the re builder of course.


Blue Man Group
There is no such thing as stupid questions. Just stupid answers
Joined: Jan 2008
Posts: 81
D
DougMM Offline OP
journeyman
OP Offline
journeyman
D
Joined: Jan 2008
Posts: 81
Just did that, waiting for feed back to see if it worked. I will let you know as soon as I find out. Thank you Ruben..

Joined: Jan 2008
Posts: 81
D
DougMM Offline OP
journeyman
OP Offline
journeyman
D
Joined: Jan 2008
Posts: 81
Nope still a fail, anyone else???

Joined: Aug 2006
Posts: 1,356
Veteran
Offline
Veteran
Joined: Aug 2006
Posts: 1,356
I modified /admin/doclearcache.php with some extra cleanup code, including resetting PM counters.

just before the line:
PHP Code
$userob->clear_cached_perms(); 

I added just before that:

PHP Code
// set all PM counters to zero.
$query = "
		update	{$config['TABLE_PREFIX']}USER_PROFILE
		set	USER_TOTAL_PM=0,
			USER_PM_TOTALS=0
";
$sth = $dbh->do_query($query,__LINE__,__FILE__);

// cycle through all user ID's that have New PM's.

$query = "
	SELECT count(*) AS count, t1.USER_ID
	FROM {$config['TABLE_PREFIX']}PRIVATE_MESSAGE_USERS AS t1, 
		  {$config['TABLE_PREFIX']}PRIVATE_MESSAGE_TOPICS AS t2
	WHERE t1.TOPIC_ID = t2.TOPIC_ID
	AND   t2.TOPIC_LAST_REPLY_TIME > t1.MESSAGE_LAST_READ
	GROUP BY t1.USER_ID
";

$sti = $dbh->do_query($query,__LINE__,__FILE__);
while (list($total_unread,$PM_UserId) = $dbh -> fetch_array($sti)) {
	$query = "
		update	{$config['TABLE_PREFIX']}USER_PROFILE
		set	USER_TOTAL_PM = ?
		where	USER_ID = ?
	";
	$dbh->do_placeholder_query($query,array($total_unread,$PM_UserId),__LINE__,__FILE__);	
}

$query = "
	SELECT count( USER_ID ) AS cnt,USER_ID
	FROM ubbt_PRIVATE_MESSAGE_USERS
	GROUP BY USER_ID
";
$sti = $dbh->do_query($query,__LINE__,__FILE__);
while (list($total_PM,$PM_UserId) = $dbh -> fetch_array($sti)) {
	$query = "
		update	{$config['TABLE_PREFIX']}USER_PROFILE
		set	USER_PM_TOTALS = ?
		where	USER_ID = ?
	";
	$dbh->do_placeholder_query($query,array($total_PM,$PM_UserId),__LINE__,__FILE__);	
}
 

This will reset all PM counts, and new PM counts if you do a clear cache.


[Linked Image from siemons.org]
Joined: Jan 2008
Posts: 81
D
DougMM Offline OP
journeyman
OP Offline
journeyman
D
Joined: Jan 2008
Posts: 81
Error message!

Control panel message

--------------------------------------------------------------------------------

Control panel message
Script: /services9/webpages/util/c/a/capitalstang.site.aplus.net/public/boards/admin/doclearcache.php
Line#: 68
SQL Error: Unknown column 'USER_PM_TOTALS' in 'field list'
SQL Error #: 1054
Query: update cts_USER_PROFILE set USER_TOTAL_PM=0, USER_PM_TOTALS=0


And thank you for your help with this. It is really becoming a problem with my members.

Joined: Jan 2008
Posts: 81
D
DougMM Offline OP
journeyman
OP Offline
journeyman
D
Joined: Jan 2008
Posts: 81
This is what I have now that is showing the error.

<?php
// Whoops! If you see this text in your browser,
// your web hosting provider has not installed PHP.
//
// You will be unable to use UBB until PHP has been properly installed.
//
// You may wish to ask your web hosting provider to install PHP.
// Both Windows and Unix versions are available on the PHP website,
// http://www.php.net/
//
//
//
// Ultimate Bulletin Board
// Script Version 7.4
//
// Program authors: Rick Baker, Charles Capps
// Copyright (C) 2008 Groupee, Inc..
//
// You may not distribute this program in any manner, modified or
// otherwise, without the express, written consent from
// Groupee, Inc..
//
// You may make modifications, but only for your own use and
// within the confines of the UBB License Agreement
// (see our website for that).
//
// Note: If you modify ANY code within your UBB, we at Groupee, Inc
// cannot offer you support -- thus modify at your own peril smile

// Require the library
require ("../libs/admin.inc.php");
require ("../languages/{$config['LANGUAGE']}/admin/generic.php");

// -----------------
// Get the user info

$userob = new user;
$user = $userob -> authenticate("USER_DISPLAY_NAME");

$admin = new Admin;

$admin->doAuth();

$query = "
UPDATE {$config['TABLE_PREFIX']}CACHE
SET CACHE_VALUE = ''
WHERE CACHE_FIELD not in ('max_online','max_online_timestamp')
";
$sth = $dbh->do_query($query,__LINE__,__FILE__);

// Rebuild the content islands
rebuild_islands(1);

// Rebuild the rss feeds
generate_rss_feeds(1);

build_forum_cache();

// Rebuild any custom tags
build_custom_tag_cache();

// set all PM counters to zero.
$query = "
update {$config['TABLE_PREFIX']}USER_PROFILE
set USER_TOTAL_PM=0,
USER_PM_TOTALS=0
";
$sth = $dbh->do_query($query,__LINE__,__FILE__);

// cycle through all user ID's that have New PM's.

$query = "
SELECT count(*) AS count, t1.USER_ID
FROM {$config['TABLE_PREFIX']}PRIVATE_MESSAGE_USERS AS t1,
{$config['TABLE_PREFIX']}PRIVATE_MESSAGE_TOPICS AS t2
WHERE t1.TOPIC_ID = t2.TOPIC_ID
AND t2.TOPIC_LAST_REPLY_TIME > t1.MESSAGE_LAST_READ
GROUP BY t1.USER_ID
";

$sti = $dbh->do_query($query,__LINE__,__FILE__);
while (list($total_unread,$PM_UserId) = $dbh -> fetch_array($sti)) {
$query = "
update {$config['TABLE_PREFIX']}USER_PROFILE
set USER_TOTAL_PM = ?
where USER_ID = ?
";
$dbh->do_placeholder_query($query,array($total_unread,$PM_UserId),__LINE__,__FILE__);
}

$query = "
SELECT count( USER_ID ) AS cnt,USER_ID
FROM ubbt_PRIVATE_MESSAGE_USERS
GROUP BY USER_ID
";
$sti = $dbh->do_query($query,__LINE__,__FILE__);
while (list($total_PM,$PM_UserId) = $dbh -> fetch_array($sti)) {
$query = "
update {$config['TABLE_PREFIX']}USER_PROFILE
set USER_PM_TOTALS = ?
where USER_ID = ?
";
$dbh->do_placeholder_query($query,array($total_PM,$PM_UserId),__LINE__,__FILE__);
}

$userob->clear_cached_perms();

admin_log("CLEAR_CACHE","");


$admin->redirect($ubbt_lang['CACHE_CLEARED'],"{$config['BASE_URL']}/admin/cache.php",$ubbt_lang['CACHE_F_LOC']);

?>

Joined: Aug 2006
Posts: 1,356
Veteran
Offline
Veteran
Joined: Aug 2006
Posts: 1,356
Ah, I was in kind of a doubt if USER_PM_TOTALS was in stock code er not smile

just remove this section in the code:

PHP Code
$query = "
SELECT count( USER_ID ) AS cnt,USER_ID
FROM ubbt_PRIVATE_MESSAGE_USERS
GROUP BY USER_ID
";
$sti = $dbh->do_query($query,__LINE__,__FILE__);
while (list($total_PM,$PM_UserId) = $dbh -> fetch_array($sti)) {
$query = "
update {$config['TABLE_PREFIX']}USER_PROFILE
set USER_PM_TOTALS = ?
where USER_ID = ?
";
$dbh->do_placeholder_query($query,array($total_PM,$PM_UserId),__LINE__,__FILE__);  

I use this field as I have changed the PM limit system in UBB for our board.


[Linked Image from siemons.org]
Joined: Jan 2008
Posts: 81
D
DougMM Offline OP
journeyman
OP Offline
journeyman
D
Joined: Jan 2008
Posts: 81
Thanks again has the same error but on line 69 now?

Script: /services9/webpages/util/c/a/capitalstang.site.aplus.net/public/boards/admin/doclearcache.php
Line#: 69
SQL Error: Unknown column 'USER_PM_TOTALS' in 'field list'
SQL Error #: 1054
Query: update cts_USER_PROFILE set USER_TOTAL_PM=0, USER_PM_TOTALS=0

Joined: Dec 2003
Posts: 6,278
Likes: 45
Offline
Joined: Dec 2003
Posts: 6,278
Likes: 45
With a older version. Your best bet is to open a support ticket. See if ubb can help!


Blue Man Group
There is no such thing as stupid questions. Just stupid answers
Joined: Jan 2008
Posts: 81
D
DougMM Offline OP
journeyman
OP Offline
journeyman
D
Joined: Jan 2008
Posts: 81
Could this be done in phpmyadmin?


Joined: Dec 2003
Posts: 6,278
Likes: 45
Offline
Joined: Dec 2003
Posts: 6,278
Likes: 45
Yes, it probably could but it would be row by row. User by user.
But I believe there would still be pushups to perform.
Such as user cookies would not be updated.
There is a old post here.
https://www.ubbcentral.com/forums/ubbthreads.php/topics/214508/1.html
That may give you help.


Blue Man Group
There is no such thing as stupid questions. Just stupid answers
Joined: Aug 2006
Posts: 1,356
Veteran
Offline
Veteran
Joined: Aug 2006
Posts: 1,356
More stuff to remove smile

Entire peace of new code. Remove my previous modification and add this instead:

just before the line:
PHP Code
$userob->clear_cached_perms(); 

Add:

PHP Code
// set all PM counters to zero.
$query = "
		update	{$config['TABLE_PREFIX']}USER_PROFILE
		set	USER_TOTAL_PM=0
";
$sth = $dbh->do_query($query,__LINE__,__FILE__);

// cycle through all user ID's that have New PM's.

$query = "
	SELECT count(*) AS count, t1.USER_ID
	FROM {$config['TABLE_PREFIX']}PRIVATE_MESSAGE_USERS AS t1, 
		  {$config['TABLE_PREFIX']}PRIVATE_MESSAGE_TOPICS AS t2
	WHERE t1.TOPIC_ID = t2.TOPIC_ID
	AND   t2.TOPIC_LAST_REPLY_TIME > t1.MESSAGE_LAST_READ
	GROUP BY t1.USER_ID
";

$sti = $dbh->do_query($query,__LINE__,__FILE__);
while (list($total_unread,$PM_UserId) = $dbh -> fetch_array($sti)) {
	$query = "
		update	{$config['TABLE_PREFIX']}USER_PROFILE
		set	USER_TOTAL_PM = ?
		where	USER_ID = ?
	";
	$dbh->do_placeholder_query($query,array($total_unread,$PM_UserId),__LINE__,__FILE__);	
}
 


[Linked Image from siemons.org]
Joined: Jan 2008
Posts: 81
D
DougMM Offline OP
journeyman
OP Offline
journeyman
D
Joined: Jan 2008
Posts: 81
That last one worked with no errors Yarp but didn't clear the PM notifications. I'm logged in as a user that is having this problem and it's still flashing new PM's????


This is my updated code that I just did.


<?php
// Whoops! If you see this text in your browser,
// your web hosting provider has not installed PHP.
//
// You will be unable to use UBB until PHP has been properly installed.
//
// You may wish to ask your web hosting provider to install PHP.
// Both Windows and Unix versions are available on the PHP website,
// http://www.php.net/
//
//
//
// Ultimate Bulletin Board
// Script Version 7.4
//
// Program authors: Rick Baker, Charles Capps
// Copyright (C) 2008 Groupee, Inc..
//
// You may not distribute this program in any manner, modified or
// otherwise, without the express, written consent from
// Groupee, Inc..
//
// You may make modifications, but only for your own use and
// within the confines of the UBB License Agreement
// (see our website for that).
//
// Note: If you modify ANY code within your UBB, we at Groupee, Inc
// cannot offer you support -- thus modify at your own peril smile

// Require the library
require ("../libs/admin.inc.php");
require ("../languages/{$config['LANGUAGE']}/admin/generic.php");

// -----------------
// Get the user info

$userob = new user;
$user = $userob -> authenticate("USER_DISPLAY_NAME");

$admin = new Admin;

$admin->doAuth();

$query = "
UPDATE {$config['TABLE_PREFIX']}CACHE
SET CACHE_VALUE = ''
WHERE CACHE_FIELD not in ('max_online','max_online_timestamp')
";
$sth = $dbh->do_query($query,__LINE__,__FILE__);

// Rebuild the content islands
rebuild_islands(1);

// Rebuild the rss feeds
generate_rss_feeds(1);

build_forum_cache();

// Rebuild any custom tags
build_custom_tag_cache();

// set all PM counters to zero.
$query = "
update {$config['TABLE_PREFIX']}USER_PROFILE
set USER_TOTAL_PM=0
";
$sth = $dbh->do_query($query,__LINE__,__FILE__);

// cycle through all user ID's that have New PM's.

$query = "
SELECT count(*) AS count, t1.USER_ID
FROM {$config['TABLE_PREFIX']}PRIVATE_MESSAGE_USERS AS t1,
{$config['TABLE_PREFIX']}PRIVATE_MESSAGE_TOPICS AS t2
WHERE t1.TOPIC_ID = t2.TOPIC_ID
AND t2.TOPIC_LAST_REPLY_TIME > t1.MESSAGE_LAST_READ
GROUP BY t1.USER_ID
";

$sti = $dbh->do_query($query,__LINE__,__FILE__);
while (list($total_unread,$PM_UserId) = $dbh -> fetch_array($sti)) {
$query = "
update {$config['TABLE_PREFIX']}USER_PROFILE
set USER_TOTAL_PM = ?
where USER_ID = ?
";
$dbh->do_placeholder_query($query,array($total_unread,$PM_UserId),__LINE__,__FILE__);
}

$userob->clear_cached_perms();

admin_log("CLEAR_CACHE","");


$admin->redirect($ubbt_lang['CACHE_CLEARED'],"{$config['BASE_URL']}/admin/cache.php",$ubbt_lang['CACHE_F_LOC']);

?>

Joined: Aug 2006
Posts: 1,356
Veteran
Offline
Veteran
Joined: Aug 2006
Posts: 1,356
hmm, that is strange.

There is some database stuff still left I think.

Just PM'd doug to avoid a chat here, if we find a solution, I will post it here.

Last edited by Yarp™; 07/29/2011 5:33 PM.

[Linked Image from siemons.org]
Joined: Aug 2006
Posts: 1,356
Veteran
Offline
Veteran
Joined: Aug 2006
Posts: 1,356
Somehow the reply's on the spam where in the way. The spam messages themselve were deleted just fine, but 2 people replied to them, and those replies somehow were left in the database.

Cleaned it up, reran the script, and fixed.


[Linked Image from siemons.org]
Joined: Jan 2008
Posts: 81
D
DougMM Offline OP
journeyman
OP Offline
journeyman
D
Joined: Jan 2008
Posts: 81
Originally Posted by Yarp™
Somehow the reply's on the spam where in the way. The spam messages themselve were deleted just fine, but 2 people replied to them, and those replies somehow were left in the database.

Cleaned it up, reran the script, and fixed.

Thank you so much Yarp.


Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
v7.7.5 Active Topics Display Name Incorrect
by Jake - 11/17/2020 4:46 PM
custom islands in forums tool
by Ruben - 11/17/2020 3:21 PM
Captcha bug maybe?
by Morgan - 11/16/2020 8:34 AM
Facebook thumbnail issue
by DBryce - 11/08/2020 7:43 PM
No hop to menu in the category pages
by Morgan - 11/05/2020 4:19 PM
Who's Online Now
0 members (), 68 guests, and 76 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
gallery test
gallery test
by Mors, September 23
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Powered by UBB.threads™ PHP Forum Software 7.7.5