Previous Thread
Next Thread
Print Thread
Hop To
Private Message Help! #244560 07/26/2011 5:21 PM
Joined: Jan 2008
Posts: 81
DougMM Offline OP
journeyman
OP Offline
journeyman
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

Re: Private Message Help! [Re: DougMM] #244584 07/27/2011 3:58 PM
Joined: Dec 2003
Posts: 5,998
Ruben Offline
Offline
Joined: Dec 2003
Posts: 5,998
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
Re: Private Message Help! [Re: DougMM] #244586 07/27/2011 6:22 PM
Joined: Jan 2008
Posts: 81
DougMM Offline OP
journeyman
OP Offline
journeyman
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..

Re: Private Message Help! [Re: DougMM] #244587 07/27/2011 7:40 PM
Joined: Jan 2008
Posts: 81
DougMM Offline OP
journeyman
OP Offline
journeyman
Joined: Jan 2008
Posts: 81
Nope still a fail, anyone else???

Re: Private Message Help! [Re: DougMM] #244591 07/28/2011 3:11 AM
Joined: Aug 2006
Posts: 1,356
Yarp™ Offline
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]
Re: Private Message Help! [Re: DougMM] #244604 07/28/2011 5:05 PM
Joined: Jan 2008
Posts: 81
DougMM Offline OP
journeyman
OP Offline
journeyman
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.

Re: Private Message Help! [Re: DougMM] #244605 07/28/2011 6:18 PM
Joined: Jan 2008
Posts: 81
DougMM Offline OP
journeyman
OP Offline
journeyman
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']);

?>

Re: Private Message Help! [Re: DougMM] #244621 07/29/2011 4:13 AM
Joined: Aug 2006
Posts: 1,356
Yarp™ Offline
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]
Re: Private Message Help! [Re: DougMM] #244622 07/29/2011 4:08 PM
Joined: Jan 2008
Posts: 81
DougMM Offline OP
journeyman
OP Offline
journeyman
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

Re: Private Message Help! [Re: DougMM] #244623 07/29/2011 4:16 PM
Joined: Dec 2003
Posts: 5,998
Ruben Offline
Offline
Joined: Dec 2003
Posts: 5,998
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
Re: Private Message Help! [Re: DougMM] #244624 07/29/2011 4:40 PM
Joined: Jan 2008
Posts: 81
DougMM Offline OP
journeyman
OP Offline
journeyman
Joined: Jan 2008
Posts: 81
Could this be done in phpmyadmin?


Re: Private Message Help! [Re: DougMM] #244626 07/29/2011 4:54 PM
Joined: Dec 2003
Posts: 5,998
Ruben Offline
Offline
Joined: Dec 2003
Posts: 5,998
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.
http://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
Re: Private Message Help! [Re: DougMM] #244627 07/29/2011 5:01 PM
Joined: Aug 2006
Posts: 1,356
Yarp™ Offline
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]
Re: Private Message Help! [Re: DougMM] #244628 07/29/2011 5:19 PM
Joined: Jan 2008
Posts: 81
DougMM Offline OP
journeyman
OP Offline
journeyman
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']);

?>

Re: Private Message Help! [Re: DougMM] #244629 07/29/2011 5:26 PM
Joined: Aug 2006
Posts: 1,356
Yarp™ Offline
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]
Re: Private Message Help! [Re: DougMM] #244630 07/29/2011 6:50 PM
Joined: Aug 2006
Posts: 1,356
Yarp™ Offline
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]
Re: Private Message Help! [Re: Yarp™] #244631 07/29/2011 7:15 PM
Joined: Jan 2008
Posts: 81
DougMM Offline OP
journeyman
OP Offline
journeyman
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.


Forum Search
ShoutChat Box
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
Mobile app?
by Baldeagle - 12/06/2019 9:32 PM
How do you change Text Line spacing?
by jorb - 11/23/2019 12:14 AM
What happened to FAQ or Forum Help
by Ruben - 11/20/2019 11:58 AM
Search feature encountering an Error message
by jorb - 11/20/2019 12:06 AM
UBB Dev
by JAISP - 11/03/2019 11:01 AM
Who's Online Now
2 registered members (isaac, Vern Bryant), 103 guests, and 322 spiders.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Amusing Terain Scenics
Amusing Terain Scenics
by isaac, August 19
Sky places
Sky places
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Snapshot build 20191023)