vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Automatic Greeting Email/PM/Threads for Member Birthdays (https://vborg.vbsupport.ru/showthread.php?t=39663)

Logician 06-09-2002 10:00 PM

Automatic Greeting Email/PM/Threads for Member Birthdays
 
This hack will automatically greet the birthdays of your board members by sending them:
  • Private Messages
  • Emails
  • Both
  • or by creating a birthday celebration thread in a specific forum.
Features:
* Does NOT require cron jobs so everybody can use it regardless of their server settings/rights.
* You can send PMs, emails (or both) or you can choose to send them PM if they can receive PM or else send email.
* The Hack can create special greeting threads for birthdays. (optional)
* Some usergroups (like banned users) can be excluded from automatic greetings.
* Admin can choose to receive a daily report via Email or PM about the greeted birthdays. (optional)
* Compatible with ALL vbulletin versions I know.
* Carefully coded to not to increase your SQL load and its quite performance-friendly. (More info about performance issues)
* New Added Feature: To greet only members who have more than X messages or who have visited your board in the last X days, see here
* New Added Feature: You can change his style in the day user has his birthday. Check here)
* New Added Feature: You can play Happy Birthday Song to your members in their birthdays. Check here

The hack is beta tested by many users for a long time before the release and proven to be quite stable. (BTW. thx to all beta testers especially to Dark_Wizard, Boofo, DslTeam, C-Pr0mpt for returning feedback).

WARNING: I strongly suggest:
a) Be careful while installing this hack (especially in step 2). If you install it wrongly, your members may get a lot of irrelevant greetings.
b) To make sure you installed it correctly, turn on DEBUG mode AND administrator notifications in the options of the hack while you are installing it. So the hack will NOT send any notifications to members but only send daily reports to admin. Keep an eye on these reports for a few days and if you made sure you installed it correctly and it works ok, you can safely turn off debug mode.


Enjoy the hack and if you install the hack please click INSTALL, thank you..

Logician \\=^))

Logician 06-09-2002 10:04 PM

IMO screenshot for such a hack is very unneccessary, but if you are "I dont believe UNLESS I see" type, here you go: :)

* Private Message Hack sends to your users (customizable)
* Daily Admin Report (optional) produced by the Hack

Needless to say these PMs in the screenshots are automatically created by the hack without any admin interference/action.

Floris 06-09-2002 10:11 PM

One word: THISISWAYCOOLANDMOSTDEFINITLYGOINGFORHACKOFTHEMONT HJULY

Nicely done and I think I will soon take the time to install this. I have been doing everything manually now, but this will be a fantastic solution! Very cool.

Boofo 06-09-2002 10:42 PM

And here I thought my wife was the only one who could say that much in one breath. ;)

Quote:

Originally posted by xiphoid
One word: THISISWAYCOOLANDMOSTDEFINITLYGOINGFORHACKOFTHEMONT HJULY


Boofo 06-09-2002 10:55 PM

You might want to check this again. Option 4 is missing from the list. :) (No way to create a thread).

Quote:

Originally posted by Logician
This hack will automatically greet the birthdays of your board members by sending them:
  • Private Messages
  • Emails
  • Both
  • or by creating a birthday celebration thread in a specific forum.
Features:
* Does NOT require cron jobs so everybody can use it regardless of their server settings/rights.
* You can send PMs, emails (or both) or you can choose to send them PM if they can receive PM or else send email.
* The Hack can create special greeting threads for birthdays. (optional)
* Some usergroups (like banned users) can be excluded from automatic greetings.
* Admin can choose to receive a daily report via Email or PM about the greeted birthdays. (optional)
* Compatible with ALL vbulletin versions I know.
* Carefully coded to not to increase your SQL load and its quite performance-friendly.

The hack is beta tested by many users over a month before the release and proven to be stable. (BTW. thx to all beta testers especially to Dark_Wizard, Boofo, DslTeam, C-Pr0mpt for returning feedback)

Enjoy the hack and if you install the hack please click INSTALL thank you..

Logician \\=^))


Allstar DC 06-10-2002 04:13 AM

logican, this hack is working great.

sorry for not giving any feed back before
i had so many probs with my board that i totally forgot about it :(

lordofgun 06-10-2002 04:49 AM

Is there an option where this would only post a Happy Birthday thread to member with a certain number of posts? I don't want to clutter my boards with hundreds of happy birthday messages for members whoi have never posted.

Thanks in advance! GREAT HACK!

JulianD 06-10-2002 05:38 AM

Thanks for the hack! I will install it on my localboard and see how it goes :)

Logician 06-10-2002 06:09 AM

Quote:

Originally posted by Boofo
You might want to check this again. Option 4 is missing from the list. :) (No way to create a thread).

@Boofo: Nope it's there: Just as a new independent option: ;)
If you want it to create threads, set this option a few lines below:
PHP Code:

// Do you want the hack to automatically create a thread to greet the birthdays as well?
// 1-- > Yes, 0 --> No
$thread_create=

@lordofgun: I'll soon give you a code to integrate this feature..

Boofo 06-10-2002 06:19 AM

Ahhhh, you hid it on me. :) There was no number 4 in the options at the top (where it used to be) so it threw me off. Thank you very much, yeni (that is the word, if I remeber, right...if I don't remember right, forgive me for whatever I just said. :)).

I would like the code for the users posts also, when you have it. Thanks! :)

Quote:

Originally posted by Logician

@Boofo: Nope it's there: Just as a new independent option: ;)
If you want it to create threads, set this option a few lines below:
PHP Code:

// Do you want the hack to automatically create a thread to greet the birthdays as well?
// 1-- > Yes, 0 --> No
$thread_create=

@lordofgun: I'll soon give you a code to integrate this feature..


LamBras 06-10-2002 07:34 AM

Installed, now waiting for midnight :)

Thanks for the brilliant idea, this increases a lot the personal bound between users and the page!

bandersen 06-10-2002 12:13 PM

Installed.... waiting for midnight too :)
Thank you!

When I run queries using Firefly's hack I sometimes make it - other times not. This time..."success" came the third time. Is this normal?

Logician 06-10-2002 12:32 PM

Quote:

Originally posted by bandersen
When I run queries using Firefly's hack I sometimes make it - other times not. This time..."success" came the third time. Is this normal?
Well, it doesnt seem normal but you need to ask Firefly about his hack :)

Quote:

Installed.... waiting for midnight too :)
Dont wait for the exact midnight time.. Wait for "tomorrow"..It can take the hack a few hours after midnight to greet the birthdays depending on the "serverload" option you set in the options. ;)

WebMasterAJ 06-10-2002 01:46 PM

Quote:

Originally posted by lordofgun
Is there an option where this would only post a Happy Birthday thread to member with a certain number of posts? I don't want to clutter my boards with hundreds of happy birthday messages for members whoi have never posted.

Thanks in advance! GREAT HACK!

Would you be able to send me this hack as well? This looks freakin awesome, but I don't want birthdays for people that have 0 posts ;)

GREAT HACK! THANKS!

Birdie501 06-10-2002 02:00 PM

this sounds really cool! i gonna install when you updated the file with the function "certain number of posts"

Respect!

djr 06-10-2002 06:40 PM

Quote:

Originally posted by WebMasterAJ


Would you be able to send me this hack as well? This looks freakin awesome, but I don't want birthdays for people that have 0 posts ;)

Why wouldn't you? It's a great way to get your non-posting members posting again. They will feel all warm and fuzzy when reading a special birthday PM or e-mail or even thread! :cool:

Boofo 06-10-2002 06:43 PM

Good point. :)

Quote:

Originally posted by djr


Why wouldn't you? It's a great way to get your non-posting members posting again. They will feel all warm and fuzzy when reading a special birthday PM or e-mail or even thread! :cool:


Logician 06-10-2002 06:46 PM

Quote:

Originally posted by Birdie501
[B]i gonna install when you updated the file with the function "certain number of posts"
[B]
I'll give you the code soon, but first my 2 cents: :)
Install this hack as it is and set it to send EMAILS to your users (all of them). This will help remind you and your board to old/non-posting/non-visiting members, which is a good thing, dont you think?

David Bott 06-10-2002 08:25 PM

Ok...Please note...

In this part...

Code:

// Excluded User groups. (That is Usergroup ID, NOT userid!)
// If you dont want to sent greetings for some usergroups enter their usergroups id:
// For example you should consider excluding Banned Users.
// Usage Examples: To exlude user group 12 use: $excluded_usergroups=array("12");
// To exclude user group 12 AND 13 use: $excluded_usergroups=array("12", "13");
// To NOT to exclude any usergroups, simply put a # in the begining of line below:
$excluded_usergroups=array('3');

In the instructions you show double quotes for the data and in the actual line you show single.

Not being a programmer...Which is right please?

Thank you for a very nice addition to our site.

Logician 06-10-2002 08:26 PM

As requested: (Apply ONE of them)

HACK OF THE HACK: ;)

TO GREET ONLY USERS WHO VISITED YOUR BOARD IN THE LAST X DAYS:

Find:

PHP Code:

## Time difference between the time zone you and your server's time. 
## Set is as a positive or negative number such as -3, +5 etc.
$timeset=9

After that add:

PHP Code:

## Greets only users who visited your board in the last X days
$last_visit_day=90

Find:
PHP Code:

$todays_date1date("Y-m-d"mktime (date("H")+$timesetdate("i"), date("s"), date("m"), date("d"), date("Y"))); 

After that add:
PHP Code:

$user_last_visitmktime (date("H")+$timesetdate("i"), date("s"), date("m"), date("d")-$last_visit_daydate("Y")); 

Find:
PHP Code:

    $birthday_children_row=$DB_site->query("SELECT userid, username, birthday, email, receivepm FROM user WHERE birthday LIKE '%$greetingday$excluded_SQL"); 

Replace it as:
PHP Code:

    $birthday_children_row=$DB_site->query("SELECT userid, username, birthday, email, receivepm FROM user WHERE lastvisit > $user_last_visit AND birthday LIKE '%$greetingday$excluded_SQL"); 

TO GREET ONLY USERS WHO HAVE POSTED MORE THAN X MESSAGES:

Find:
PHP Code:

## Time difference between the time zone you and your server's time. 
## Set is as a positive or negative number such as -3, +5 etc.
$timeset=9

After that add:

PHP Code:

## To Greet only users who have more than X messages, set this:
$message_to_greet=90

Find:
PHP Code:

    $birthday_children_row=$DB_site->query("SELECT userid, username, birthday, email, receivepm FROM user WHERE birthday LIKE '%$greetingday$excluded_SQL"); 

Replace it as:
PHP Code:

    $birthday_children_row=$DB_site->query("SELECT userid, username, birthday, email, receivepm FROM user WHERE posts>$message_to_greet AND birthday LIKE '%$greetingday$excluded_SQL"); 

Enjoy! ;)
Logician

bandersen 06-10-2002 08:29 PM

Hey - I got a Birthday Email, PM and thread! Its working. Will adjust the templates a bit.

Feedback: the thread greeting does not count as a thread, and the first "reply" count as the first reply - but still no thread count.

Otherwise it seem to be fine here with me. Thanks!

Logician 06-10-2002 08:29 PM

Quote:

Originally posted by David Bott
Code:

$excluded_usergroups=array("12", "13");
// To NOT to exclude any usergroups, simply put a # in the begining of line below:
$excluded_usergroups=array('3');

In the instructions you show double quotes for the data and in the actual line you show single.
Not being a programmer...Which is right please?

Both ok there, pick one you like :)

David Bott 06-10-2002 08:35 PM

Thank you.

Have a simple suggestion seeing you are taking them....

Maybe add an option set the birthday members default style to a special birthday style. Then of course set it back at the end of the day. (next run.) Thus one could be banner free for the day or maybe receive a special offer from a sponsor. (Can do that one via e-mail though.) In any case...you get the idea.

Thank you.

David Bott
http://www.avsforum.com
Home of over 30,000 unique visitors a day on the VB driven site.

Logician 06-10-2002 10:38 PM

Quote:

Originally posted by David Bott
Maybe add an option set the birthday members default style to a special birthday style. Then of course set it back at the end of the day. (next run.) Thus one could be banner free for the day or maybe receive a special offer from a sponsor.
Edited:

Made obsolete with this code:

https://vborg.vbsupport.ru/showthrea...203#post260203

Check there..

Boofo 06-10-2002 10:47 PM

I don't mean to sound dense here, but I guess I'm not sure what this really does or what it means. :)

Quote:

Originally posted by Logician

A quicky.. Here you go:

1- Run this query via logician_query.php:
PHP Code:

ALTER TABLE user ADD oldstyleid SMALLINT(5UNSIGNED DEFAULT '0' NOT NULL

2- Find:

PHP Code:

## Time difference between the time zone you and your server's time. 
## Set is as a positive or negative number such as -3, +5 etc.
$timeset=9

after that add

PHP Code:

// If style id of users who have birtdays will be changed in their birthdays, set the id:
// Use this style for only users that have birthdays! Other users shouldnt access/use this style.
$birthdaystyleid=1

3-find:

PHP Code:

$birthday_children_row=$DB_site->query("SELECT userid, username, birthday, email, receivepm FROM user WHERE birthday LIKE '%$greetingday$excluded_SQL"); 

replace it as:

PHP Code:

$birthday_children_row=$DB_site->query("SELECT userid, username, birthday, email, receivepm, styleid FROM user WHERE birthday LIKE '%$greetingday$excluded_SQL"); 



4- find:
PHP Code:

            //while ($birthday_children=$DB_site->fetch_array($birthday_children_row)) 

before that add:

PHP Code:

    if ($birthdaystyleid>0) {
        
$DB_site->query("UPDATE user SET oldstyleid='$birthday_children[styleid]' WHERE userid='$birthday_children[userid]'");
        
$DB_site->query("UPDATE user SET styleid='$birthdaystyleid' WHERE userid='$birthday_children[userid]'");
        } 

5-find:

PHP Code:

    if ($logician_debug==AND $debug_birthdays==1)    {echo "Days not matched, lets check if there is any birthdays around..<br><br>";}
    
$greettime=$last_action['leftdate']; 

AFTER that add:

PHP Code:

$DB_site->query("UPDATE user SET styleid=oldstyleid WHERE styleid=$birthdaystyleid"); 

That's it.. Now the hack is supposed to replace the user style id of your members in their birthdays and will assign their default style id the day after.

Some important points:
1- Their style id will change (and revert) when hack "runs". That is: if hack is activated at 3.00 am, between 00.00 am to 03.00 am user's style id wont change even if its her birthday. Change will occur at the time hack greeted their birthdays. Same applies to reverting their default style id and their old style id will be back at the time the hack run the day after.

2- Birthday style you set, MUST be unique to birthday members ONLY! That is: it should be neither used by any other users (including you) in your board nor be selectable etc.. The hack will attempt to rewrite the style id of ALL users using this style and if they are not a birthday user, this can cause unwanted results while rewriting.

3- This modification is NOT TESTED very well! Dont apply it to your original board until you test it extensively for a few days in a test board. I checked it out and it SEEMS to work fine here without any problems but I dont accept responsibility for this modification since I coded it in less than 20 mins, it's a real quicky.

4- If you test it and it turns out to be working ok for you too, please return feedback so that others can use it too, thanks..

Enjoy!
Logician


David Bott 06-11-2002 01:35 AM

Thank you.

Now...Might I kindly ask a question. That being...Why is all this code in the index.php file? I mean...if it is only used once a day...why must it all this be in this file that is called over and over and over again? It just seems like a lot of extra overhead.

Now I did not know PHP or coding...But I was just wondering if it all being their does not hurt some? Would it make a difference if the code just checks the date and then if the date has moved to then call the code? Or is that what it is actually doing now?

Please note...I really wanted this hack...and thank you very much for it. (something that should have been in the original Vb)...but I am just wondering. I mean...we get a lot of calls on that page.

On the same note...Should the date check (the function that runs to see if it is time to do it's thing.) maybe have been put into another, lesser used, file? Again...It is checking the date with each and every page call unless I am mistaken. Thus it needs to look up some date each and every call. Not to mention to load the values each time for the options.

Again....I thank you for this...I am just wondering so I can learn the logic and understand.

Thank you for your time.

Logician 06-11-2002 12:23 PM

Quote:

Originally posted by David Bott
Now...Might I kindly ask a question. That being...Why is all this code in the index.php file? I mean...if it is only used once a day...why must it all this be in this file that is called over and over and over again? It just seems like a lot of extra overhead.

Now I did not know PHP or coding...But I was just wondering if it all being their does not hurt some? Would it make a difference if the code just checks the date and then if the date has moved to then call the code? Or is that what it is actually doing now?

I am just wondering so I can learn the logic and understand.

I respect your concerns and all your stated questions are quite relavant. They should have been already asked by all users who installed this hack. ;) So let me clarify the logic and algorithm of the hack and relieve your worries:

First things first: as I mentioned in my first message this hack is carefully coded and QUITE performance-friendly. That is:
* The hack by no means increase your SQL load by unnecessary queries.
* Does not effect your script running time.
* Having a heavy traffic, too many visitors or hack's integration with index.php (the most called vbulletin file) does not change these facts in any way.

Here is how:
Contrary to what expected, the hack does not check the birtdays of the board members everytime index.php runs. This would slow your board and add unnecessary queries since going through with all members birthdays in the database would be a slow process and would cause a heavy load. Instead the hack is designed to first check the date of "today" and the last day of greetings, before elobarating on today's birthdays. This requires 1 SQL query per run. Considering the fact that your index.php deals with (avaragely) 20 to 40 SQL queries in its EVERY run, this 1 extra query (which is a VERY FAST one btw) would be quite bearable. BUT hack does NOT even add this query load to your server! To save you from even this tiny extra load, I added another feature to the hack: Server Load variable you set in the options. This optimizes the hack to run ONLY 3 times (avaragely) a day to check if hack already greeted the birthdays today and if not runs 1 time a day to greet them.

So lets make a simple calculation: if your main page of your board has a daily 1000 visitors,
* Your index.php produces an estimated of 30000 SQL queries a day (without this hack.)
* After you installed the hack your estimated SQL queries will be 30004 ONLY.

Does having a large code in the most running file (index.php) of your server decreases the script running performance in any way? One word: Nope. The hack's code is covered with an "IF conditional" in the begining and even if your index.php runs 1.000.000 times a day, this whole block of code will be skipped (except 3 times in a day) and having it there wouldnt even effect your running time in miliseconds.

So you can use it without any worries about SQL/Server/Script performance. It's really a very well thought and coded hack.. Hope this clarifies the performance issues of the hack.

Regards,
Logician

Logician 06-11-2002 12:28 PM

Hack of the Hack:

This modification will change the style sets of users in their birthdays so you can design a custom style for your users to show in their birthdays (a fancier one for example)

Features:
* Their style set will be assigned to any style set you assigned in the day they have a birthday and it will return to their default style sets the day after.
* The birthday style will be overriden in the forums which have MANDATORY styles.
* Style set will be changed/reverted according to their OWN times (unlike the hack).
* You can set a style set with no banner advertisement or have some special offers etc when user has a birthday. (But be warned: a wise member can change their birthday everyday to have this style forever, so dont make something so tempting!) :)
* This modification is APART from my hack so they are not related or not depending eachother. You can use both together or use just one of them without installing the other.

Installation:
Edit global.php
PHP Code:

// figure out the chosen style settings
unset($codestyleid);
unset(
$style); // prevent some weird issues 

Find:

BEFORE that add:

PHP Code:

// Logician Change Style in users' birthday hack
$today_birthday=substr($bbuserinfo[birthday],-5);
$today_of_user vbdate("m-d",time());
if (
$today_of_user==$today_birthday) {$bbuserinfo['styleid']=X;}
// Logician Change Style in users' birthday hack 

Replace X with the style id you want to set.. That's it, enjoy..

David Bott 06-11-2002 12:38 PM

I thank you very much for your well thought reply and coding of this script.

I have installed on two sites...One ran just fine and I found the birthday greetings as expected. The other site has not run it as of yet and the date is still yesterdays in the timetick area. TO see if it would help...I have changed the load setting to be 5. So...Now I am just waiting to see if it catches up.

BTW...Boy is that load setting kinda confusing. Could you not have made it easier and said "If server load is less than X" and use a real server load number. ;) The default 30 number means nothing to me.

Oh..yes...Does the above style hack replace the other one you mentioned? If so...their does not seem to be any code to put back the users real style at the next move. (Though the above is much easier.) (I am glad you liked the idea.)

(Note...everything I do on our site I need to be concerned with on loads. As mentioned, 30,000 unique visitors a day...12.5 million page views a month.)

David

Logician 06-11-2002 01:03 PM

Quote:

Originally posted by David Bott
Oh..yes...Does the above style hack replace the other one you mentioned? If so...their does not seem to be any code to put back the users real style at the next move. (Though the above is much easier.) (I am glad you liked the idea.)
[/B]
They both do the same thing in different ways. But I didnt test the first one well and the second one is much simplier and solid so I suggest using it. (I deleted the first one anyway)

Quote:

(Note...everything I do on our site I need to be concerned with on loads. As mentioned, 30,000 unique visitors a day...12.5 million page views a month.)
Yep I understand the issue and it's why the hack is optimized for such a way to fit everyboard..

Quote:

BTW...Boy is that load setting kinda confusing. Could you not have made it easier and said "If server load is less than X" and use a real server load number. ;) The default 30 number means nothing to me.
I dont like pre-defined settings by the coder. I am a big fan of highly customizable scripts. So I guess it's much better if you tell the hack what's your estimated visitors is and by this way you can make a better adaptation of the hack to your needs and board.

Quote:

I have installed on two sites...One ran just fine and I found the birthday greetings as expected. The other site has not run it as of yet and the date is still yesterdays in the timetick area. TO see if it would help...I have changed the load setting to be 5. So...Now I am just waiting to see if it catches up.
And this proves what I mentioned above, doesnt it? ;)

You'll find the best setting for you after a litte experience. I personally like to adjust the server load variable to such a number that the hack avaragely greets the birtdays at 3 am (that is, it runs in every 3 hours). I suggest:
* set it to a lower number first
* enable admin report
* examine when the hack avaregly greets the birthdays.
* Increase the variable gradually until it stables at around 4am-5am for example (or any time you want).

That's the power of customization hehe

Logician

Parker Clack 06-11-2002 06:46 PM

Logician:

I am a bit confused on the load number myself. By lowering the load number does the program start up closer to midnight? That is if I set this number to 5 is it going to be sending the emails out closer to midnight than the setting of 30 that is in there now?

Even though we are a high volume site our load averages aren't that high on the server. I would just as soon have the birthday greetings (I am using the email option only) sent out closer to midnight than any other time of the day.

Thanks for a great hack.

Parker

Logician 06-11-2002 07:02 PM

Quote:

Originally posted by Parker Clack
I am a bit confused on the load number myself. By lowering the load number does the program start up closer to midnight? That is if I set this number to 5 is it going to be sending the emails out closer to midnight than the setting of 30 that is in there now?

Even though we are a high volume site our load averages aren't that high on the server. I would just as soon have the birthday greetings (I am using the email option only) sent out closer to midnight than any other time of the day.

Please read the message of mine I explained the performance issues and how the hack works. I think you'll find the answers there.

A quick summary:
load number is the estimated visitor number of your board main page. In other words how many times the file index.php is run daily. If you set it correctly you'll help the hack to run only 3 times a day to save your board from an unnessary SQL query. If you higher the number too much, it will run less frequently and sometimes can miss birthdays (in fact it never misses, just greets late). If you set it lower than it should be, greeting time will be closer to midnight but hack will work more frequently (daily) so everytime it works it will run an extra a SQL query. Since index.php has already more than 20 SQL queries, this extra query may not harm anyone and if it is no big deal to you to run 21 queries instead of 20, you can lower it too much and hack will then greet the birthdays VERY CLOSE to midnight.. For my 2 cents on the issue, read my suggestion to David..

Parker Clack 06-11-2002 07:21 PM

Logician:

I read what you said to David and I am still a bit confused about the load issue thing. We have an average of over 300 people on our site at one time all the time with peaks of over 600 and lows of only about 150 even at 3am CST. The load on the server itself averages around 1.7. We have over 150,000+ readers of our site a day. So the index.php file is run ~150,000 a day. So when you talk about the estimated visitor number of your board main page or in other words how many times the file index.php is run daily I am not really sure where to set this number.

Also, several members have set the option to not have the administration send them any emails or when adminemail=1. Can this be included in the script so that if your member doesn't want to receive any emails from the administration that, like those groups that can be excluded, these members can be excluded too?

Thanks again for a great hack and useful tool for our board.

Parker

Logician 06-11-2002 07:54 PM

Quote:

Originally posted by Parker Clack

I read what you said to David and I am still a bit confused about the load issue thing. We have an average of over 300 people on our site at one time all the time with peaks of over 600 and lows of only about 150 even at 3am CST. The load on the server itself averages around 1.7. We have over 150,000+ readers of our site a day. So the index.php file is run ~150,000 a day. So when you talk about the estimated visitor number of your board main page or in other words how many times the file index.php is run daily I am not really sure where to set this number.

If the your index.php runs 150.000 times a day set your server load variable to 150000. That is:

Code:

$estimated_load=150000;
Then flag the admin email option and observe when the hack greets the birthdays for a few days. If greeting time satisfies you, leave it as it is. If it is too late for you, lower it (to 100000 for example) and observe again. You can make adjustments by observing the hack's avarage greeting time and according to this, lowering or highering the option. You'll find where your board and your wishes fits in..

Just remember the basic rule:
If greeting is late for you, lower the number.
If greeting time is too close to midnight, raise it..
If adding an 1 extra query to index.php is not important to you and greeting the birthdays timely (ie very close to midnight) is your primary concern, set this option to 1.

Quote:


Also, several members have set the option to not have the administration send them any emails or when adminemail=1. Can this be included in the script so that if your member doesn't want to receive any emails from the administration that, like those groups that can be excluded, these members can be excluded too?

I guess we'll soon open a special site or at least board for the hacks of this hack lol. Released yesterday and already hacked 4 times. :p

To send birthday greeting emails to only members who asked to receive emails from your site:

1- First set your hack to send emails only. ($greeting_type=1; ) If you apply this modification, hack will greet only users who asked to receive emails from your site, so if they set it to no, they will NOT be greeted via email, PM or thread anyway.

2- Find:
PHP Code:

$birthday_children_row=$DB_site->query("SELECT userid, username, birthday, email, receivepm FROM user WHERE birthday LIKE '%$greetingday$excluded_SQL"); 

Replace it as:
PHP Code:

$birthday_children_row=$DB_site->query("SELECT userid, username, birthday, email, receivepm FROM user WHERE  adminemail =1 AND birthday LIKE '%$greetingday$excluded_SQL"); 

That's it. Now hack will greet only users who asked to receive emails from the administrators.

Enjoy..
Logician

Parker Clack 06-11-2002 08:06 PM

Yep, it looks like another site is going to be needed just for this hack soon! :)

Thanks for the explanation and the quick fix for the adminemail option.

Parker

Me2Be 06-12-2002 02:38 AM

Excellent addition, I'm very impressed!

Maybe I missed this, but can this send BOTH a PM and an email? Or is the email just a notification of the PM?

Also, is there ANY possible way to add the age IF it is given, like "congratulations on your 35th birthday" and just "congratulations on your birthday" if nothing is there?

Thirdly (sorry for so many questions), my index.php page is hit about 400,000 times a month (I have a big site), and my load is always 'pressured' during peak times -- will this create an excess load for this?

Lastly, you mentioned that you can have it create a birthday thread -- is that a thread for each person who is having a birthday, or each day's birthdays? (Some of our days have over 40 birthday's on it!)

Thanks so much!! Can you tell I"m excited about this?

Logician 06-12-2002 06:09 AM

Quote:

Maybe I missed this, but can this send BOTH a PM and an email?
yep it can..

Quote:

Also, is there ANY possible way to add the age IF it is given, like "congratulations on your 35th birthday" and just "congratulations on your birthday" if nothing is there?
you can use hack variable $birthday_children[yas] to refer his age in your templates. If no year given it will be "-"..

Quote:

Thirdly (sorry for so many questions), my index.php page is hit about 400,000 times a month (I have a big site), and my load is always 'pressured' during peak times -- will this create an excess load for this?
Nope it wont.. Please check thread, already discussed in detail..

Quote:

Lastly, you mentioned that you can have it create a birthday thread -- is that a thread for each person who is having a birthday, or each day's birthdays? (Some of our days have over 40 birthday's on it!)
Will create 1 thread daily including all birthdays in this thread..

Boofo 06-12-2002 09:13 AM

But is there a way to have it not even show the "-" if we don't want it to? :)

Quote:

Also, is there ANY possible way to add the age IF it is given, like "congratulations on your 35th birthday" and just "congratulations on your birthday" if nothing is there?

you can use hack variable $birthday_children[yas] to refer his age in your templates. If no year given it will be "-"..

Logician 06-12-2002 09:54 AM

Quote:

Originally posted by Boofo
But is there a way to have it not even show the "-" if we don't want it to? :)

Find:

PHP Code:

$birthday_children[yas]=$greetingyear- (integer)substr($birthday_children[birthday],05);
            if (
$birthday_children[yas]>110) {$birthday_children[yas]='-'

Replace it as:

PHP Code:

$birthday_childrenyas=$greetingyear- (integer)substr($birthday_children[birthday],05);
$birthday_children[yas]="I congratulate your new age $birthday_childrenyas!";
if (
$birthday_childrenyas>110) {$birthday_children[yas]=''

Then find and delete these lines below:

PHP Code:

if ($birthday_children[yas]!='-') {$greeting_thread.="(".$birthday_children[yas].")";} 

and 2 instances of :
PHP Code:

if ($birthday_children[yas]!='-') {$admin_report_text.="(".$birthday_children[yas].")";} 


Lionel 06-12-2002 03:14 PM

I installed last night minutes after midnight. I have birthdays today and tomorrow. Nothing is posting yet in the specific thread. :cry:


All times are GMT. The time now is 04:16 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02038 seconds
  • Memory Usage 1,984KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (29)bbcode_php_printable
  • (27)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete