functions_post.php problem with suspended users
Post new topic   Reply to topic   Printer Friendly Page     Forum IndexExplain Please
Author Message
Aforo
I18N / L10N Lead Dev


Joined: Dec 27, 2007
Posts: 146

PostPost subject: functions_post.php problem with suspended users
Posted: Sat Jan 10, 2009 11:36 pm
Reply with quote

I was studing "functions_post.php" and I found a posible enhancement for notifications.

functions_post.php is only used by modules/Forums/posting.php (at least I think so)

I think that the notification function has a small problem when yu are a small forum o when you are starting.

The problem is $user_id_sql
This variable keeps suspended users. In a small site dosn't matter... but when you have 400 suspended users (or more) it's not so nice.

It's not ver efficient compare the user with 400 users (suspended) each time that you send a email to the users.

My proposition is that when you suspend a user (in admin pages) the function must delete all suscriptions of the user (topics, bulletin, forums watch...)

And of this way, functions_post.php doesn't need to look for suspended users.

_________________
Aforo - Google Earth - WebNaranja - DFcms.es

Aforo's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Centos 5/Apache 2.2.3/MySQL:5.0.45/PHP:5.2.10 /9.2
Back to top
View user's profile Visit poster's website
Phoenix
Site Admin


Joined: Apr 19, 2004
Posts: 8729
Location: Netizen

PostPost subject: Re: functions_post.php problem with suspended users
Posted: Sun Jan 11, 2009 1:14 am
Reply with quote

If we discerned between banned and suspended, that would work - problem is that stripping subscriptions is harsh for a temporary suspension.

Might pay to consider BrokenCrust's member delete mod.


Phoenix's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Back to top
View user's profile Visit poster's website
Aforo
I18N / L10N Lead Dev


Joined: Dec 27, 2007
Posts: 146

PostPost subject: Re: functions_post.php problem with suspended users
Posted: Sun Jan 11, 2009 12:41 pm
Reply with quote

Hi, Phoenix. Thak you for your answer.
I'm talking about suspended because suspended for me is a member that haven't rights for receiving any service of website (specially alerts). Most of the time is a spammer (in this case never is temporary). But even when can be a temporally suspension... user must suscribing again to every topic or forum.

I prefer don't delete user because, as I said before, most of the time is a spammer.

Solution can be:
in the file admin/modules/users.php around line 130 insert the next code (only red part):

In
Quote:
if(!($memberinfo = getusrdata($_POST['id']))) {
echo _NOINFOFOR.' <strong>'.$username.'</strong>';
showfooter();
} else {
// for deleting user suscriptions
if($_POST['user_suspend'] == 1) {
$db->sql_query("DELETE FROM `".$prefix."_bbtopics_watch` where user_id='".$_POST['id']."'" );
$db->sql_query("DELETE FROM `".$prefix."_bbforums_watch` where user_id='".$_POST['id']."'" );
}
// End of mine

$module_name = 'Your_Account';
require('modules/Your_Account/edit_profile.php');
saveuser($memberinfo);
}


After you must delete all suspended users suscriptions to topics or forums in Mysql:

Quote:
DELETE FROM `nuke_bbtopics_watch` where user_id='(suspended_user_id)';

And now you don't need "$user_id_sql" query in functions_post.php for each email.

I think that is more efficient.

In a small place you have not problem with "$user_id_sql", in a medium place (as Google Earth with 6.000 users) you start loosing some email (only some emails). But in a big place with more than thousand people suspended can be not so nice.

I'm testing this change in Google Earth. By the moment is ok.

For websites bassed in forum spammers is allways a big problem.

_________________
Aforo - Google Earth - WebNaranja - DFcms.es

Aforo's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Centos 5/Apache 2.2.3/MySQL:5.0.45/PHP:5.2.10 /9.2
Back to top
View user's profile Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   Printer Friendly Page     Forum IndexExplain Please All times are GMT
Page 1 of 1


Jump to:  
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 cannot attach files in this forum
You cannot download files in this forum

stopsoftwarepatents.eu petition banner
User Info [x]

Welcome Anonymous

Nickname
Password
(Register)

Last CVS commits [x]

Languages [x]

Community [x]

Support for DragonflyCMS in a other languages:

Deutsch
Español

X-links [x]
UltraEdit Browse Happy logo Firefox MySQL PostgreSQL Valid CSS! Valid XHTML 1.0! Unicode Encoded Badge NukeBiz Resources Raven DragonflyCMS Dedicated Now InsideSupport Lampe Berger

Preview theme [x]
Each user can view the site with a different theme.
Themes marked with a * also change the forum look.


You are seeing squares or questionmarks on this page?

All content of this website is copyrighted by the Creative Commons NC-SA
The logos and trademarks used on this site are the property of their respective owners
We are not responsible for comments posted by our users, as they are the property of the poster.
Our server runs on a P3 1.2GHz with 512MB RAM with no accelerators
Support GoPHP5.org
This page generated in 0.3795 seconds with 16 DB Queries in 0.0322 seconds
Memory Usage: 2.87 MB
Interactive software released under GNU GPL, Code Credits, Privacy Policy