Okay -- I added a cute little graphic and also changed the font colour, as my page background is black and the greeting wasn't showing up otherwise.
Two other questions, if you don't mind --
1. I use the table wrappers mod, and the birthday announcement "sits" on top of the wrapper (there's no space between the table and the greeting). How can I put a line of space below the greeting to improve the look?
2. Can this hack be modified so I can display birthday information to *every* user (so a birthday is announced to everyone on the board)? I have a small private community of just a few users, so I need to make individual birthday announcements regardless. Having the hack make the announcement for me would sure save me some time.
He he... yeah, you got lots of little projects for me.
OK - change the bottom bit of the bday mod in ubbthreads.php to this:
Code
<br />Yikes. That sucks. :p<br />Your site here is so pretty. Really.<br />Very sharp with the boraders and the black background<br />And the cool red logo. ;)<br /><br />OK - change the bday mod code in ubbthreads.php to this:<br />[code]<br /> if ($Today != 0) {<br /> $todaybday .= "<br />";<br /> } <br /> }<br /> list($tbopen,$tbclose) = $html -> table_wrapper();<br /> if (($UserBirthDay == $today) && ($UserBirthMonth == $thismonth)) {<br /> $BirthdayGreeting = "$tbopen <tr><td class=\"lighttable\"><div align=\"center\"><b><font size=\"+2\">Happy Birthday $Username!!</font></b></div></td></tr>$tbclose";<br /> }<br /> if (($Username) && ((!$UserBirthDay) || (!$UserBirthMonth))) {<br /> $BirthdayWarning = "<div align=\"center\"><b><a href=\"{$config['phpurl']}/editbasic.php?Cat=$Cat\">Click Here</a> to Update your Birtday Information in Your Profile!</b></div>";<br /> }<br /> if ($Today) {<br /> $TodayTopBday = "$tbopen <tr><td class=\"lighttable\"><div align=\"center\"><b>$TodayIntro</b> $todaybday</div></td></tr>$tbclose";<br /> }<br /><br />// ------End of Profile Birthday Hack
Then add this:
$TodayTopBday
into the ubbthreads.tmpl file... at the top.. above or below the $BirthdayGreeting
$BirthdayGreeting will be the greeting that the user gets on their birthday. You could customize it with images etc....
$TodayTopBday will be a box at the top, listing "today's birthdays".
I have a prob with the birhtdays in the profile page.
This is what happens..........
When I insert the bithday in the profile and click submit, the bithday goes in the calendar okay but if I return to the profile page it is missing, nothing drastic I suppose just annoying.
I can see a potential problem there without checking anything else. The U_BirthMonth stores data as text and not numbers. So in your example it should have been U_BirthMonth='May',.... and not U_BirthMonth='5'
Can you please check that part? If you are stuck email me and we can have a look at the code closely.
Actually: storing months as Numbers would not be such a bad idea: That would open new possibilities to easily add language files with month names in individual languages....
I'd suggest to store the birthday in a mysql date-field. YYYY-MM-DD is the format. Advantages: - 1 field instead of 3 - language independend - mysql can perform calculations with dates - to get all today's birthday you could simply perform a Select * from table where U_Birthday like '2003-02-".$today'; - i do it that way
I agree... what I wasn't sure at the time, was how to extract just birthday's from a particular month.
You see... some of my users didn't mind giving the whole birthday (month, day & year).... others just gave month and day, and some would only give Month.
I know alot more now, from when I originally made this, so it's probably due for a rewrite using a date field.
Yes, you are right. Some users don't want their age to be displayed. I created an optional field where they can choose, weather day & month or day & month & year should be displayed.
Sure, a rewrite would improve the data handling. But your idea was really great, i must say.
It's pretty popular... and it's funny.... it's popped up on several Boards I visisted.... and it works.... I got lots of PMs on my birthday on various boards.
I think we can get rid of the problem with the year, by setting it to the first year that the epoch time allows or something like 1900. I don't think that if I were 103 I would post in any forum....
I have updated this post with a new birthday pal box. I noticed at a few sites I visited, that there's been a bit of a tablewrapper change and it wasn't looking right everywhere.
Coy7 - you should replace yours. This will make the lighttable/darktable thing work right.
I don't know if anyone has seen this or it has been mentioned on this thread (heck I am really tired now) but for some users I kept on getting a mktime error at the top of the showprofile screen. The reason was the epoch time and the users inputting their year of birth to numbers less than 1970. A simple workaround will sort this.
That one works like a charm. Basically if the date is earlier than 1970 it keeps the difference in years and sets it to 1970. The following calculations will sort out how old you are with the epoch day and all you have to do then is add how many years you have between the actual year and 1970.
This actually started showing an Argentinian friend of mine 33 years old whereas he was 38. Needless to say that none of the girls in the forum complained about this....
There's a bunch of women at one of my sites very mad at me for fixing thier ages. They "LOVED" being 33 again.
She writes: []JOSH my CyberDaddy!! For gawds sake! Who gave you the brite idea that I wanted to be more than 33? I got a b-d coming up. It won't belong long before I'll be twice the glitch. But Man I can still climb the rocks and hills. I still really enjoy life though.[/]
OK - This is an AddOn if you are using the Birthday Mod. It can do two things. It can send people a PM on their birthday, and it can make a post in a forum of your choice announcing "today's birthdays". This gives your members a place to reply with their well wishes. It is fully configurable. You can choose to have it just do the PMs, or Just make the posts, or both. You can control what user number the PMs or Posts come from. You can also edit the content of the PMs and Post.
Commissioned by Coy7.
Instructions: Drop this script into your threads directory, and set up a cron job to run it once a day. Edit the variables at the top of the file to customize the options. Enjoy!
Edit: Updated so that it doesn't make a post when there are no birthdays. Thanks Racantaeur
I asked Josh to design this mod for me because I run a forum mainly inhabited by teenagers, and they love little features that make them feel special, (like the original birthday mod). I'd developed a sense of obligation over the birthday mod, though -- every day on my board I'd see half a dozen users having a birthday, and I felt like I should send them all a personalized greeting from "the board Mom". This new Cron Addon of Josh's alleviates my guilt entirely. I write a generic birthday greeting, put a cute little icon in the message, and it's automatically sent to every birthday guy or gal from my username. It makes me seem like a nice person but lets me be lazy about it, too. Great work Josh!
I think I found a small cosmetic bug. The user is able to set his birthday in his profile but an admin is not.
I tried to do it for someone cause he was to stupid to find the entries but I can't see it also. The I used the 'become this user' option to become him and set it.
Try yourself. Search for a user and click on 'edit profile' and you will not see the field to enter his birthday.
Yeah, I never included that just to minimize the number of scripts modified and make upgrades easier.
You'd have to also modify /admin/showoneuser.php and /admin/dochangeuser.php
But I figured the admin would never normally need to enter this info... as they wouldn't normally know a users birthday. For the occational eejit who can't figure it out... you could become this user or do it very quickly with an SQL command.
The client who paid me to write it didn't care about the admin's ability to edit birthdays. But if you want... feel free.
OK - This is an AddOn if you are using the Birthday Mod. It can do two things. It can send people a PM on their birthday, and it can make a post in a forum of your choice announcing "today's birthdays". This gives your members a place to reply with their well wishes. It is fully configurable. You can choose to have it just do the PMs, or Just make the posts, or both. You can control what user number the PMs or Posts come from. You can also edit the content of the PMs and Post.
Commissioned by Coy7.
Instructions: Drop this script into your threads directory, and set up a cron job to run it once a day. Edit the variables at the top of the file to customize the options. Enjoy! [/]
One thing Josh. I am using the cron to write a PM AND a forum entry. Its working fine with one exception. Its making also a forum entry if there is no one who has birthday.
Can you change the script in this way that its not posting a thread if they are no birthdays?
Would you mind posting your cron job??? Is it PHP or Perl? I have never done this before and am curious. Looked at the doexpire.php and subscriptions.php scripts, which make some sense, but am not sure how they are getting invoked and what sorts of return values are expected.
I think I misread Josh's post... is it true that I just need to have my host setup a cron job that points to the birthdaycron.php script and it will fire off??
Cheers,
Chris
"Some dream of doing great things, while others stay awake and get on with it." Â Â Â Â Â Â -- Anonymous
Would you mind posting your cron job??? Is it PHP or Perl? I have never done this before and am curious. Looked at the doexpire.php and subscriptions.php scripts, which make some sense, but am not sure how they are getting invoked and what sorts of return values are expected.
I think I misread Josh's post... is it true that I just need to have my host setup a cron job that points to the birthdaycron.php script and it will fire off??
Cheers,
Chris [/]
I'll freely admit that Josh set up my cron tasks for me because I'd looked at them and felt out of my league. He also provided the wording for sending to my hosting company (I posted about that it this thread: https://ubbdev.com/threads/php/...view=collapsed&sb=5&o=&vc=1)
So, I guess I'll leave Josh to answer exactly which files need to be modified because I'm not sure, and cuz he's up and no one else is here so maybe he's bored
Yeah, your host didn't allow us access to do that on our own. They had to set it up. But basically we sent them the paths to the scripts that needed to run.
On my server, I have a webmin control panel... and I schedule the task like this:
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.