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 01-13-2003 08:06 AM

Hi gopherhockey,
Quote:

Originally posted by gopherhockey
What happened was that a message was generated to EVERY user and a forum message was also posted for every user.

I bet your problem is related to wrong applience of installation step 2. Either one is what happened:
1- You entered the date incorrectly. For example you might have forgotten we are in 2003 now and enter the year as 2002.
2- You entered the date in the wrong format: The correct format is: "YYYY-MM-DD". For example if you entered it like YYYY-DD-MM this would be wrong.

The admin email notice seconds this. It says :
Quote:

Birthdays for day (2002-09-22) celebrated at January 13, 2003, 12:00 am (Server Time)
So it's obvious that the script was regarding "today's date" as "2002-09-22" so today's date in installation step 2 was not entered correctly. Check the first greeting message the hack produced and you'll see what (approximately) date was the script accepting as "today's date" when you first installed it. If it is something like "January 2002", your problem is related to the first reason I mentioned above, if its a date later than this, it should be the second reason..

I strongly believe your problem is not related to the script, it's tested for a real long time in many servers. So don't be afraid to retry it, provided that you install it carefully (especially step 2). Also it's suggested the you run the script in debug mode (3) first, which will make sure your users will not get any mails or PMs until you are confident it's working ok..

Hope this helps..

gopherhockey 01-13-2003 12:26 PM

I kind of knew that people would go after the date thing... thats why I was so careful in reviewing the docs and what I did. It all still checks out - even now when I run the script you gave to "test" the date, it still checks out perfectly. Here is another message it gave me (below). You can see this one, received on the same date & time was for a guy whos birthday was in Nov. of 02. I have about 50 such messages ranging from the entire calendar year, but all sent/posted on Jan 13, 03.

Here is the output of the sql query you had us run:

Edit Delete 2003-01-13

- If I read your instructions right, 03 is year, 01 (Jan) month and 13=day, which all checks out.

Could it be some Win2k thing? I double checked the time on the server, its ok with correct time zone etc.

I know the time/date thing seems obvious, but that isn't the case here. Hmmmm....

Or could it be that I entered 2003-01-12 when it was actually 11:30pm my time (central) but was actually probably 2003-01-13 G-time? Maybe somehow beign so close to midnight it was like telling the system I installed it yesterday. (although it still probably wouldn't have done what it did even doing that I imagine)



----

Daily Birthday Greetings Report
Birthdays for day (2002-11-10) celebrated at January 13, 2003, 12:00 am (Server Time)

Members who have birthday:

* Tom S.(35)1967-11-10 [PM Sent] [Thread Created]

Thread : http://www.xxxxxxxxxx.com/forums/sho...p?threadid=106

----------------------------------
Logician Auto Email/PM Birthday Greeting Hack

Logician 01-13-2003 05:41 PM

Quote:

Originally posted by gopherhockey
Could it be some Win2k thing? I double checked the time on the server, its ok with correct time zone etc.

Let's try this:
Edit hack code and find:
PHP Code:

$n_yeardate("Y"mktime (0,0,0$n_month1$n_day1$n_year1)); 

After that add:
PHP Code:

echo "today is : $todays_date1<br><br>";
echo 
"last running time was : $last_action[leftdate]<br><br>";
if (
$last_action) {echo "last action variable is set";} else {echo "last action variable is NOT set";}
exit; 

and let's see what values the hack will return to you. You may need to refresh the main page a few times to get the results according to your $estimated_load setting (or lower it). You don't need to worry about users getting mails because code will exit after values are displayed..

Also run this query and tell me what does it return:
[sql]SELECT * FROM timetick WHERE action='birthday' LIMIT 1[/sql]

gopherhockey 01-13-2003 06:00 PM

Thanks for the suggestions.. I ran them, and here is the results..

The result of the sql query you gave me is this:

id action leftdate leftid
Edit Delete 1 birthday 2003-01-13 0

The result of the echo code you gave me is this:

today is : 2003-01-13

last running time was :

(it shows no last running time)

I reset one of my birthdays to tomorrow (the 14th) to see if this happens all over again at the new day. If it is a one-time only situation I don't mind.. but it would be kind of fun to find out why this happened, even if to possibly help you or others in the future.

Logician 01-13-2003 06:14 PM

I modified the debug code above a little bit. Can u please try again and tell me the displayed result?

It's weird that query returns you the correct time but the debug code for last running time is blank.

BTW. you are sure you applied the hack code to "forum/index.php", not to another file right? Also your "timetick" table is created in the same MYSQL database your test board is installed? If you have more than 1 databases, please make sure your table is in the correct database.

Also make sure if you have this line in the hack code:
PHP Code:

$last_action=$DB_site->query_first("SELECT * FROM timetick WHERE action='birthday' LIMIT 1"); 

and it stands as a new line, not appended right after this line:
PHP Code:

//$todays_date1=vbdate("Y-m-d",time()); 


gopherhockey 01-13-2003 07:51 PM

I ran with the new code (and that line verified to be there as requested) and got:

today is : 2003-01-13

last running time was : 2003-01-13

last action variable is set

---

I definitely don't have any other databases in use.

The only other thing I can think of is that I set the estimated load at 3 before it ran last night (since it gets no other traffic than me, I figured that wouldn't hurt). Also, I did not use your sql tool to enter the data required for the hack but went in to phpmyadmin to do it directly. Those are the only two other deviations I can think of. I wonder if there are many others using your hack with vbulletin on win2k sp3 and 2.2.9.

Let me know if I can try anything else. Should I try setting the time ahead on my server to see if it happens again, or would that just cloud the problem? (I'm rather curious to see if it will kick off all those messages/threads again when the 14th comes)

gopherhockey 01-14-2003 04:10 AM

Just an update - midnight came and went and I received just the one email/thread posting as should have happened... so, whatever initially kicked off all those emails and posts is, hopefully, gone. Strange - but perhaps a good reminder to run it first in test mode as you suggested.

I like the script, very nice. I do plan to install it on my production server.

Logician 01-14-2003 06:41 AM

Quote:

Originally posted by gopherhockey
Just an update - midnight came and went and I received just the one email/thread posting as should have happened... so, whatever initially kicked off all those emails and posts is, hopefully, gone. Strange - but perhaps a good reminder to run it first in test mode as you suggested.

Yes it was expected as it returned the normal values (last running time was same with today's date) in your debug run yesterday.

Your initial problem was related to "last running time" being incorrect. I don't know why it was not correct in the first place when you installed it but I still suspect you might set it wrongly. (especially regarding year). If you confirmed the year after posts are sent, it would display correctly so it does not count. But if you insist the date and its format was correct right after you applied step 2, well then it must be something else that caused it .. Don't have any idea then.. :)

gopherhockey 01-14-2003 04:59 PM

I have done and still do a lot of stupid things in my life, but lying about something like this and wasting everyone's time (espeically the author's) is not one of them.

I set it up as per instructed and got the dates completely right the first time. WHat happened may remain a mystery - perhaps a combo of the OS and software/mysql etc. - who knows.

I hope nobody else runs into this "bug" or whatever it is. I recommend running in test mode first, just in case... if you don't and if you have more users than I do, be ready to delete lots of threads and messages etc.

Perhaps to pull anything constructive out of all this, a person could use the example code you posted earlier to check to be sure both dates are correctly reported... I notice in the installation document you have us run a test that returns one date/time combo. Would it be an advantage to run it in a way that reports both? Or is one written the first time and one written after the first day when the first run completes..?

Here is another though. WHen I initially ran it, I had set my estimated load to 3 instead of 30. Is it possible that on that midnight when I was all click-happy to see it run that I kicked off the thing twice in a row so quickly that one of the instances didn't read the last run time either at all or properly and maybe caused that strange behavior?

Probably not worth further speculation...

Intex 01-28-2003 04:53 AM

I set this up last night and it certainly sent an email, PM and put a thread in a forum as I specified in my options. However it only put the subject title in, i.e. Happy Birthday to Our Members for the thread and no body content, Happy Birthday !!! in the PM but no body content etc.

Any ideas?


All times are GMT. The time now is 01:00 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.01349 seconds
  • Memory Usage 1,783KB
  • 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
  • (4)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (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