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)

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 11:59 PM.

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.01302 seconds
  • Memory Usage 1,775KB
  • 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
  • (1)bbcode_code_printable
  • (6)bbcode_php_printable
  • (9)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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