Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Automatic Greeting Email/PM/Threads for Member Birthdays Details »»
Automatic Greeting Email/PM/Threads for Member Birthdays
Version: 1.00, by Logician Logician is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 06-09-2002 Last Update: Never Installs: 205
 
No support by the author.

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 \\=^))

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #22  
Old 06-10-2002, 08:29 PM
bandersen's Avatar
bandersen bandersen is offline
 
Join Date: Feb 2002
Location: Oslo
Posts: 211
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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!
Reply With Quote
  #23  
Old 06-10-2002, 08:29 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #24  
Old 06-10-2002, 08:35 PM
David Bott David Bott is offline
 
Join Date: Dec 2001
Posts: 215
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #25  
Old 06-10-2002, 10:38 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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..
Reply With Quote
  #26  
Old 06-10-2002, 10:47 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #27  
Old 06-11-2002, 01:35 AM
David Bott David Bott is offline
 
Join Date: Dec 2001
Posts: 215
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #28  
Old 06-11-2002, 12:23 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #29  
Old 06-11-2002, 12:28 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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..
Reply With Quote
  #30  
Old 06-11-2002, 12:38 PM
David Bott David Bott is offline
 
Join Date: Dec 2001
Posts: 215
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #31  
Old 06-11-2002, 01:03 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:39 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04779 seconds
  • Memory Usage 2,364KB
  • Queries Executed 27 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (11)bbcode_php
  • (8)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete