PDA

View Full Version : End-User Options - [Cronjob] Email Notification When Users Hit X Amount of Posts


tnguy3n
23 Mar 2005, 15:23
As its title says, this code will automatically email a user once he/she hits a certain amount of posts. It may be useful for some boards which set Registered group have limited privileges and require XX posts to view the board globally...

It's been posted here (http://www.vbulletin.org/forum/showthread.php?p=629928#post629928), i make a duplicate here in case of other users need it.

It's fairly easy to install, just create a cronjob and let it do the job itself. You can set the cronjob to run hourly or every three hours or whenever you like.
DON'T FORGET TO CHANGE text message in Email Body Text + Email Subject Text to fit you site settings.

Installation Time: 2-3 mins (Easy)
New File: 1
Query: 1

ALTER TABLE user ADD promoemail TINYINT(1) DEFAULT '0' NOT NULL;

To change amount of posts, look for this line (in promoemail.php):
$promo_x_posts = 10;

Polo
23 Mar 2005, 17:31
Nice :) Thanks for sharing it with the community tnguy3n :) I was planning to use this hack to congratulate members everytime they reach an X amount of posts..

For example 1000 and the 2000... is it possible to accompolish this?

tnguy3n
23 Mar 2005, 17:40
yup, very possible. all you need to do is to change value 10 to 1000, and message in Email Body Text. :)

Polo
23 Mar 2005, 17:44
yup, very possible. all you need to do is to change value 10 to 1000, and message in Email Body Text. :)
yeah I know... but I was wondering if the message could be sent at different times like when a user reaches 1000 and then 2000....

thanks for the quick reply...

tnguy3n
23 Mar 2005, 18:19
The easiest way is to copy this file and rename it to a diff name, then upload it to /includes/cron, then add another schedule task to send email to users who reach 2000 posts.

Polo
23 Mar 2005, 19:13
The easiest way is to copy this file and rename it to a diff name, then upload it to /includes/cron, then add another schedule task to send email to users who reach 2000 posts.
oh... I see.. i dont know how I didnt thought of that :) thank you so much tnguy3n... this is will come in really handy for me ;)

nexialys
23 Mar 2005, 19:40
simply modify your cronjob like:

// make the count to the numbers you want to identify!
$count_array=array(1000, 2000, 3000, 5000);
if(in_array($user[posts], $count_array))
{
do the email!
}
... but i see in your cronjob that you make a different count... for Polo, my situation can help, but would need a different cron...

Polo
23 Mar 2005, 19:46
i was looking for sometning along those lines nexialys.. however since i'm not a coder..I will stick with tnguy3's suggestion for now.. thanks i appreciate it anyways :)

nexialys
23 Mar 2005, 20:21
to make it complete, we need 2 process:
1- tag the users that have a new count of 1000, 2000 etc when they post... (so in newthread.php and newreply.php)
2- in the cron, "SELECT" the users that are tagged and use the in_array() i posted just before...
2b- when selected and email is sent, untag the users...

this 1000, 2000 etc can be configured with a $vboptions[sometag] that we set in the admincp, so it can be used in all the scripts needed.

Polo
23 Mar 2005, 20:30
are you telling me nexialys?

nexialys
23 Mar 2005, 20:41
i'm telling that it's possible to magnify the effect of this cronjob by adding a new feature... ;)

i hope tnguy3n understand what i'm talking about and will be able to deal with it!

Polo
23 Mar 2005, 20:44
oh ok, thanks for making it clear... i was almost confused there for a moment...

no1SomeGuy
23 Mar 2005, 22:22
Thanks :) works great !

femsawyer
22 Apr 2005, 17:02
Does this email the user or can we configure it to email a specific email address, like admin?

Polo
22 Apr 2005, 17:07
if the cron job runs when the poster has 1001 posts... will the member receive an email?

tnguy3n
23 Apr 2005, 01:27
if the cron job runs when the poster has 1001 posts... will the member receive an email?
@ Polo: It will.
Basically, this cronjob checks and emails users who reach >= 1000 posts (or whatever number your assigned).

Polo
25 Apr 2005, 22:35
@ Polo: It will.
Basically, this cronjob checks and emails users who reach >= 1000 posts (or whatever number your assigned).
but it will not email them more than one time right?

tnguy3n
28 Apr 2005, 19:29
but it will not email them more than one time right?
it just emails the user once.

Polo
28 Apr 2005, 20:35
Excellent... will definetly set up three or more ;) to show appreciation to top posters :)

vb_guru
09 Jul 2006, 19:26
This is great:) Can this be used for vBulletin 3.54? I want to use something like this to send an e-mail to everyone that belongs to a certain user group that I manually assign them to.

Basically, I want to send them an email welcoming them as a special member. It is very important that they only receive this welcome e-mail once.