pogenwurst wrote:

Since you're interested in removing accounts that have not been activated you might be interested in knowing that unactivated accounts have a group ID of 3200 and as such "(registered = last_visit)" works but may perform extremely slightly worse than "g_id = 3200".

I'm not quite sure what you intend with "(registered > '.(time()-(60*60*24)).') AND (registered < '.(time()-(60*60)).')". If you wish to remove users that have not activated themselves after an hour, would not simply using ".time() - 3600.' > registered" work?

Finally, from a purely stylistic perspective, you don't need parentheses around each portion of the WHERE clause. You only need to use them if you're grouping multiple restrictions together. For instance, "(foo = bar OR alpha = beta) AND (a < b OR b > c)".

"g_id = 3200". = good point /thx for the advice.

(time()-(60*60*24) is supposed to check the users in the database only back by a certain value of days (this case  24h).
So I don't have to check users I have checked already days before. My be faster than checking all of them. Tell me if I'm
wrong or how to do it better.

stylistic perspective: You are right for sure! We (a friend and me) are both novices to php and therefore don't know better than that.
Hence, advice is always welcome.

2

(9 replies, posted in PunBB 1.2 troubleshooting)

coxis wrote:

Yours css solution is working great Rickard

I like to do that over the css too. So I can leave the codes untouched in case I want to change it back.
Where and what exactly did you change?

How about this:

$db_type = 'mysql';
$db_host = 'localhost';
$db_name = 'xxx';
$db_username = 'xxx';
$db_password = 'xxx';
$db_prefix = '';
$p_connect = false;

//include("dbconnect.php");

$db = @mysql_connect($db_host, $db_username, $db_password)  or die
  ("Keine Verbindung moeglich");


$query = 'DELETE FROM '.$db_prefix.'users WHERE (registered > '.(time()-(60*60*24)).') AND (registered < '.(time()-(60*60)).') AND (registered = last_visit) AND (id > 2) AND (num_posts = 0)';

Any idea on how to optimize this code except for using hard values for time ?

mysql_select_db("pun") or die
  ("Database doesn't exist");

$query = 'DELETE FROM '.$db_prefix.'users WHERE (registered > '.(time()-(60*60*24)).') AND (registered < '.(time()-(60*60)).') AND (registered = last_visit) AND (id > 2)';

@mysql_query($query) or die (mysql_error());

@mysql_close($db);

//print $query;

?>

how about this in a cronjob?

Writing on a script as we speak which does what I want. Then gonna add it to the cron job.

Hi,

I just tried it on my forum. It doesn't exactly what I was looking for.
I'd like to have it automated. Every interested user should be able to check their mails whithin one hour and register. If not, it's most likely
a bot.

Is there a way through a plugin or a few lines to autoremove users which haven't activated their accounts within one our (e.g. bots)?

You're the one to be thanked.
Sometimes things just need to be said.

Worked like a charm by the way.

Now I'm gonna look into that reCAPTCHA integration, although it's 4:30am and I might wanna go to sleep..
There has to be a way to keep em 100% out.

I thought about the censoring again.
1. I have to admit that censoring tld's on the website field might be a bit confusing to users.
2. Let's pretend you want to censor other words like dick, suck and other even more offending words,
why would you allow them in places like "the real name" or "location" if you won't have them in the username
nor in the posts. It's just makes perfect sense to me to disallow em globally, therefore forbid inserting their bad stuff (that would keep spammers away).
Replacing them only, does not keep the bots away. It does though reduce the damage (since googlebots won't find anything useful).
When the bot inserts his data, he leaves happy without realizing that his crap is gonna be replaced. Now that's the place
where we could simply stall him and not letting him insert it in the first place, rather than just replace afterwards what he did.



*expressing gratitude* for your help

Man you're the greatest! *bowing*
Really fool-proof guide you just delivered.

The fields are gone.
Unfortunately it's still being diplayed in the posts. http://xnexus.net/punbb/viewtopic.php?pid=12#p12
Now that wouldn't even matter if the spapbots which know the punbb code couldn't insert their stuff in the first place.
Is it possible for them to do that anyhow ? Like to deliver their stuff on a different basis?

Great response time btw ;-)

After all I just thought about it. And you are right, that would confuse users and keep spammers away.
Let's say I go with scenario 2, what lines have to go to get rid of the website field?

I did it like that:

// Add http:// if the URL doesn't contain it already
            if ($form['url'] != '' && strpos(strtolower($form['url']), 'http://') !== 0)
                $form['url'] = 'http://'.$form['url'];
            if ($pun_config['o_censoring'] == '1' && censor_words($form['url']) != $form['url'])
                message('You aren't allowed to use tld's');   

            break;
        }

Now when I click on profile:
Parse error: parse error, unexpected T_STRING in /srv/www/vhosts/xnexus.net/httpdocs/punbb/profile.php on line 761

What did I miss?

By the way, I posted a couple of minutes ago here. http://punbb.org/forums/viewtopic.php?id=9298
But that's only half as beautiful as scenario 1..

Smartys wrote:

I do, but are you suggesting not allowing a TLD in a website field? Why allow the website field at all then? tongue

Simple because humans can make up something from wewewe.punbb.dot_org and googlebots or other ranking bots won't.
If they can not insert their crap (like during registration, they can't) we win.

My friend was working on AI for strategic games at http://razzar.com/ai/forum/ and I was the host back then.
When googlerankins went up we got so many bots registering that I've had enough and we had to shut down due to lack of time
for maintaining this meanace.

Hi,

I'd actually like to get rid of the website field if I can't get censoring working on that one.
Which lines should be up for deletion?

I just found those lines, checking for censored words during the registration in the Username field:

    // Check username for any censored words
    if ($pun_config['o_censoring'] == '1')
    {
        // If the censored username differs from the username
        if (censor_words($username) != $username)
            message($lang_register['Username censor']);

Now I only need the right place to insert somewhere in profile.php (correct me if I'm wrong)
in order to have it check in the website field of the user profile. This way the user shouldn't
be able to put in censored words (in this case tld's) and everything would be peachy.
Any ideas where to put that in ?

Hi everybody,

first of all: LOVE THIS FORUM!
I installed it just today as a former phpbb admin. First impression: Love it! (in fact, even though I'm a poor student I would donate some bugs if knew whereto)

I found out that censoring words like .com into dot_com and other tld could be an effective way to keep spammers out which promote
all kinds of stuff for ggl rankings.
It works even during the registration procedure. It's just great! You can try it out here: xnexus.com/punbb

It works almost in every environment but on personal user details. If you could get the code to check there too in the same way for censored words
as during the registration process there would be no way at all for bots to register with their crap. It even works on email addresses.
There is no work around yet but to disable "User info in posts"
This is the only drawback I found so far on censoring.

I don't know if you are aware of this but facebook forums are running on punbb using reCAPTCHA on registration.
Anyhow, I contacted a moderator from the facebooks forums today and asked him to share the plugin for reCAPTCHA (no answer yet).
I need to give it a try. Didn't find any better solution for now than that.

We are launching soon a huge website (not the one mentioned above) with estimated over 150k users to fit over time and are running tests on punbb, smf, icebb and bbpress.
As far as I can tell for now, if punbb keeps on running like that there will be no need left to check out the other ones. If someone here has experience with a that big load of users
hosted on punbb and thinks this is the wrong solution performance or database wise then let me know. Suggestions are very welcome!

If there is one of you having a solution for Censoring at all times already or even got reCAPTCHA plugin working please share.

Thank you guys for doing what you did so far. It's great stuff.