Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
birthday in thread Details »
birthday in thread
Mod Version: 1.00, by Mas*Mind (Member) Mas*Mind is offline
Developer Last Online: Sep 2003 I like it Show Printable Version Email this Page

This modification is in the archives.
vB Version: Rating: (0 vote - 0 average) Installs: 8
Released: 15 Jun 2001 Last Update: Never Downloads: 0
Not Supported  

Description: This hack prints some message or displays a picture in a post when that particular user has a birthday on that moment.

Version tested: 2.01, but will probaby work on all 2.0 versions

instructions:

  1. Create a new file called birthday.php with the following content:

    <?php

    $today_day = date("d",mktime(date("H"),date("i"),date("s"),date("m"),date("d"),date("Y"))+($b buserinfo[timezoneoffset]-$timeoffset)*3600);
    $today_month = date("m",mktime(date("H"),date("i"),date("s"),date("m"),date("d"),date("Y"))+($b buserinfo[timezoneoffset]-$timeoffset)*3600);
    $today_year = date("Y",mktime(date("H"),date("i"),date("s"),date("m"),date("d"),date("Y"))+($b buserinfo[timezoneoffset]-$timeoffset)*3600);
    $userday = explode("-",$post[birthday]);

    if($today_day == $userday[2] && $today_month == $userday[1])
    { $bday = explode("-",$userinfo[birthday]);
    if(date("Y")>$bday[0] and $bday[0]>1901 && $bday[0]!='0000')
    { $birthday = @date($calformat1,mktime(0,0,0,$bday[1],$bday[2],$bday[0]));
    }
    else
    { // lets send a valid year as some PHP3 don't like year to be 0
    // $calformat2 should not contania year identifier so the year doesn't matter
    $birthday = @date($calformat2,mktime(0,0,0,$bday[1],$bday[2],1993));
    }
    if($birthday=="")
    { $birthday="$bday[1]-$bday[2]-$bday[0]";
    }
    if($today_year > $userday[0] && $userday[0] != '0000')
    { $age = $today_year-$userday[0];
    }

    eval ("\$post[has_a_birthday] = \"".gettemplate("postbit_birthday")."\";");
    }

    ?>
  2. create a new template called postbit_birthday

    with some text like:

    Congrats! It's $post[username]'s birthday!

    (you can use the following variables in this template:

    $birthday: Will contain the birthday of the user in a nice format
    $age: Will only contain a value (obviously the age of this user) when the user has filled in his birthyear
  3. backup showthread.php
  4. open showthread.php

    and add:

    // Begin birthdayhack
    include("birthday.php");
    // End birthdayhack


    before:

    eval("\$post[profile] = \"".gettemplate("postbit_profile")."\";");
  5. save showthread.php
  6. insert $post[has_a_birthday] somewhere in the postbit template

enjoy

Download Now

Only licensed members can download files, Click Here for more information.

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Comments
  #2  
Old 15 Jun 2001, 18:50
Blue2000 Blue2000 is offline
 
Join Date: Oct 2001
nice one dude.. Look alright that does.

do you have a demo?
Reply With Quote
  #3  
Old 15 Jun 2001, 19:27
Dakota's Avatar
Dakota Dakota is offline
 
Join Date: Oct 2001
You can see it in action on my forum.

Great hack. you did a good job on it.
Reply With Quote
  #4  
Old 15 Jun 2001, 19:56
mister mister is offline
 
Join Date: Oct 2001
just installed it, works great, thanks!
__________________
Brandon Martus

http://www.pubarso.com/
http://www.listen-to.com/
Reply With Quote
  #5  
Old 15 Jun 2001, 20:37
kicks
Guest
 
Thanks Mas*Mind
Reply With Quote
  #6  
Old 15 Jun 2001, 22:31
cditty's Avatar
cditty cditty is offline
 
Join Date: Oct 2001
I just tried to install it and I get an error on line 25 of birthday.php.

All I did was cut & paste from here. Wierd.

This is the line:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Any ideas?
__________________

My Hacks
Coming Soon

Games 4 Your Site - Games and Programs to attract users to your site.
Red Hot Sweeps
- The Yahoo of Contests & Sweepstakes
Red Hot Boutiques - The best shopping deals on the Net
Reply With Quote
  #7  
Old 15 Jun 2001, 23:57
maverick1236 maverick1236 is offline
 
Join Date: Oct 2001
Unhappy Same here

Mines on line 26......
Reply With Quote
  #8  
Old 16 Jun 2001, 00:49
Mas*Mind's Avatar
Mas*Mind Mas*Mind is offline
 
Join Date: Oct 2001
yup....the [php] code screws code up:

eval ("\$post[has_a_birthday] = \"".gettemplate("postbit_birthday")."";

should be:

eval ("\$post[has_a_birthday] = \"".gettemplate("postbit_birthday")."\";");
Reply With Quote
  #9  
Old 16 Jun 2001, 02:08
maverick1236 maverick1236 is offline
 
Join Date: Oct 2001
new error

now the problem is here: in showthread.php
// Begin birthdayhack
include("birthday.php");
// End birthdayhack


something is screwed up with the code here-im getting errors

any ideas?
Reply With Quote
  #10  
Old 16 Jun 2001, 03:15
cditty's Avatar
cditty cditty is offline
 
Join Date: Oct 2001
Working for me. Thanks for the revised code.

Maverick, what errors are you getting now?

Chris
__________________

My Hacks
Coming Soon

Games 4 Your Site - Games and Programs to attract users to your site.
Red Hot Sweeps
- The Yahoo of Contests & Sweepstakes
Red Hot Boutiques - The best shopping deals on the Net
Reply With Quote
  #11  
Old 16 Jun 2001, 03:36
maverick1236 maverick1236 is offline
 
Join Date: Oct 2001
this one :(

Warning: Failed opening 'birthday.php' for inclusion (include_path='') in e:\program files\nusphere\apache\htdocs\upload\showthread.php on line 479
Reply With Quote
  #12  
Old 16 Jun 2001, 03:40
cditty's Avatar
cditty cditty is offline
 
Join Date: Oct 2001
That means that it can't find it. You sure the birthday.php file is there? Could you have named it .php3 by accident?

Chris
__________________

My Hacks
Coming Soon

Games 4 Your Site - Games and Programs to attract users to your site.
Red Hot Sweeps
- The Yahoo of Contests & Sweepstakes
Red Hot Boutiques - The best shopping deals on the Net
Reply With Quote
  #13  
Old 16 Jun 2001, 05:13
maverick1236 maverick1236 is offline
 
Join Date: Oct 2001
RIGHT!

Right u are-thanks 4 helping me
Reply With Quote
  #14  
Old 16 Jun 2001, 05:28
Dakota's Avatar
Dakota Dakota is offline
 
Join Date: Oct 2001
I had to change

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

to


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

on line 25 of birthday.php
Reply With Quote
  #15  
Old 16 Jun 2001, 05:34
Dakota's Avatar
Dakota Dakota is offline
 
Join Date: Oct 2001
Well its not displaying it correctly, so I will put it in this attachment.
Attached Files
File Type: txt change.txt (74 Bytes, 139 views)
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

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


New To Site? Need Help?

All times are GMT. The time now is 11:59.

Layout Options | Width: Wide Color: