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)

Heineken77 07-18-2002 03:14 AM

Sweet, installed and no errors this time! You were right about MySQL being down..I've noticed from time to time I'll get an error .. hit refresh and it's fixed. Must be some host/server related issues.

Unfortunately I installed this 10 mins after 12am :( So have to wait 24 hours .. but sure it will work :D

Thanks again bro!
Heineken

Peace 09-05-2002 05:10 PM

The thread is posting in the wrong forum. Which file do I go into to change the forum number? Thanks.

Logician 09-05-2002 05:18 PM

Quote:

Originally posted by Peace
The thread is posting in the wrong forum. Which file do I go into to change the forum number? Thanks.
in index.php:
PHP Code:

// If you choose to create a new thread in your board, enter the forum id:
$greetings_forum 2


Peace 09-06-2002 01:10 AM

Thanks.

Mutt 10-02-2002 01:06 AM

love this hack. I only had 1 problem of multiple messages to the same member being sent, but I already found the solution here. Thanks! The members like it and so do I.

I'm thinking about using this to send calendar reminders. thanks again.

M.C. 12-04-2002 12:03 AM

supa hack! but one request to change: i made in options that hack to make a thread, but i do not want to make thread for everybody birthday, i want to do it only for moderators... i look in options and see

$excluded_usergroups=array(''); but if i put some usergroup here they stop recive greetings and via email & PM as well. I just wont to turn thread creation only for moderators but want let email & PM creation for all groups.

P.S. Sorry for my english. I hope you got that i want... :classic:

Logician 12-04-2002 12:43 PM

Quote:

Originally posted by M.C.
supa hack! but one request to change: i made in options that hack to make a thread, but i do not want to make thread for everybody birthday, i want to do it only for moderators... i look in options and see

I understand what you want but sorry, it's not a 2 minute modification. Requires a change in hack's algorithm and moreover extensive testing to make sure it's working ok..

M.C. 12-04-2002 09:17 PM

Logician, ok... but you will? :rolleyes: ;)

M.C. 12-04-2002 09:37 PM

and one more improvement - can you add in email & PM URL of thread if created? :rolleyes:

Erwin 12-05-2002 01:25 AM

Great hack, mate. Been using it for a few weeks, working great. The members love it.

Kars10 12-05-2002 09:56 AM

Cool Hack!!
Thanks Logician!!
/me klicks installed!

Littlebit 12-05-2002 10:07 PM

Hi guys,
I want to double check...if I'm in time zone -5 and my server is -7, I enter -2 in the $timeset ?
Thank you for sharing a great hack btw!

Logician 12-06-2002 08:59 AM

Quote:

Originally posted by Littlebit
Hi guys,
I want to double check...if I'm in time zone -5 and my server is -7, I enter -2 in the $timeset ?
Thank you for sharing a great hack btw!

if you set it to 0, greetings will be sent close to 12:00 AM server Time. If it's +1, it's 1:00 AM server time. According to this rule, you can set whatever you like.. ;)

Littlebit 12-06-2002 01:26 PM

so if I have it at -2 it will just send them out a bit early? maybe I should just leave it at 0 huh :)

Logician 12-06-2002 02:16 PM

it depends according to which time zone (yours? server?) you want the hack to run and at what time exactly.

If you leave it as 0, it will run close to 00:00 AM server time and 2:00 AM your time..

it's your call anyway..

Littlebit 12-06-2002 05:50 PM

I understand now :) I was thinking too hard about it. lol

over 12-19-2002 12:49 PM

nice work.

Okiewan 12-30-2002 05:30 AM

Very cool hack Logician!
Question about the .wav hack... installed and tested, plays, but it loops continuously and each time the forumhome is visited. ?

Logician 12-30-2002 07:58 AM

Quote:

Originally posted by Okiewan
Very cool hack Logician!
Question about the .wav hack... installed and tested, plays, but it loops continuously

Looping should be a browser issue. For Internet Explorer (4+) "PLAYCOUNT=1" commands makes sure it play once. For Netscape "LOOP=2" does the same. So using both should ensure it plays once in both Netscape and IE. I remember I had tested it before releasing and it was playing once here. But if you have another browser like Opera or Mozilla (or different versions of IE, Netscape), I don't know how they'd behave.

Quote:

and each time the forumhome is visited. ?
Yes that's true. Unfortunately there is no easy way for the script to know it already played the song for this user before, so it plays in every visit of forum home if day is user's birthday..

gopherhockey 01-13-2003 04:20 AM

I had a strange thing happen to me tonight. I installed the hack on my Windows 2k test server (an offline server I use to test hacks before putting them on my public server - both are identical, but one is on win2k and one is on freebsd).

Anyway - I installed the hack, did all the sql stuff, date verified etc. - I did this around 11:30pm.. so, I only had to wait 30 minutes and figured maybe something would happen.

Sure enough, I got a popup, a ton of PMs, and a TON of forum posts. This on a forum with only 50 some odd users.

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

What could have caused this? What a mess - boy, I'm glad I don't have that many users yet, even on my test system. I'm concerned that I had it set to option 6 and some emails may have also been generated - even on my test system, they would have gone out (confused users tomorrow)

What could cause this? I do'nt want to post this on my production system until I figure this out.

I verified the date I put in my sql query and it was accurate...

Hmmm...

?

Just FYI: I'm running version 2.2.9 in case that matters. Also, here is one of the Greeting Reports:

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

Members who have birthday:

* ShaneK(30)1972-09-22 [Email Sent] [Thread Created]

Thread : http://www.devserver.com/forums/show...p?threadid=103

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

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?

Logician 01-28-2003 10:19 AM

Quote:

Originally posted by Intex
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.

Sounds like a template problem. You can
1- make sure templates are created and their names are exact (check CAPS too!)

2- Create the templates in all template sets, if you have more than one..

Either one should fix the problem.. :glasses:

Okiewan 01-28-2003 10:23 AM

It occassionaly leaves-out the names in posts on my board as well.

Logician 01-28-2003 11:12 AM

Quote:

Originally posted by Okiewan
It occassionaly leaves-out the names in posts on my board as well.
if you mean it does not congratulate the birthday for some members this is related to $excluded_usergroups settings. By default usergroup 3 is set to be ignored so if member is from usergroup 3 (ie waiting for email confirmation), hack will ignore them..

Change the settings if you want otherwise..

Okiewan 01-28-2003 11:16 AM

Not the problem... it leaves ALL names out, meaning, a blank post. Seems to do it every few days.

NuclioN 01-28-2003 11:33 AM

Fatal error: Cannot redeclare make_seed() in /www/global.php(321) : eval()'d code on line 323

???

Logician 01-28-2003 11:55 AM

Quote:

Originally posted by NuclioN
Fatal error: Cannot redeclare make_seed() in /www/global.php(321) : eval()'d code on line 323

???

You have another hack that uses the same function. Just delete these line from my hack code to avoid the clash:
PHP Code:

function make_seed() 
{
list(
$usec$sec) = explode(' 'microtime());
return (float) 
$sec + ((float) $usec 100000);


Quote:

it leaves ALL names out, meaning, a blank post. Seems to do it every few days.
Do you have admin notification on? Turn it on and see if its content is also blank or not? Also try to create templates in all templates sets if you have more than 1..

NuclioN 01-28-2003 12:28 PM

Tnx Logician, it works. :) Clicks install

Intex 01-28-2003 06:19 PM

I actuallly cut and paste the text titles etc. so those should be ok. However I do have two templates and I didn't copy the template to both. Since you mentioned it, I reckon that must be the answer :).

Thx. m8 and keep up the cool hacks.

Quote:

Originally posted by Logician

Sounds like a template problem. You can
1- make sure templates are created and their names are exact (check CAPS too!)

2- Create the templates in all template sets, if you have more than one..

Either one should fix the problem.. :glasses:


ChurchMedia 01-30-2003 05:45 PM

Fantastic hack! I had been emailing users on thier birthdays. Now it's automatic!

I'd like to give them a "birthday present" of 50 points (Lesane's store hack). I know the code is:

Code:

$DB_site->query("UPDATE user SET storep=storep+50 where userid='$userinfo[userid]'");
But I'm not sure where to put it in the index.php file. Any help?

Logician 01-31-2003 08:39 AM

Quote:

I'd like to give them a "birthday present" of 50 points (Lesane's store hack). I know the code is:
I see.. This should work:

edit hack code (index.php), find:

PHP Code:

$celebrated_at_least_one++; 

After that add:

PHP Code:

$DB_site->query("UPDATE user SET storep=storep+50 where userid='$birthday_children[userid]'"); 

Enjoy..


All times are GMT. The time now is 12: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.01500 seconds
  • Memory Usage 1,861KB
  • 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
  • (8)bbcode_php_printable
  • (15)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
  • (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