Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: , by Mas*Mind Mas*Mind is offline
Developer Last Online: Sep 2003 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 06-14-2001 Last Update: Never Installs: 8
 
No support by the author.

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"))+($bbuserinfo[timezoneoffset]-$timeoffset)*3600);
    $today_month = date("m",mktime(date("H"),date("i"),date("s"),date ("m"),date("d"),date("Y"))+($bbuserinfo[timezoneoffset]-$timeoffset)*3600);
    $today_year = date("Y",mktime(date("H"),date("i"),date("s"),date ("m"),date("d"),date("Y"))+($bbuserinfo[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

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 06-15-2001, 05:50 PM
Blue2000 Blue2000 is offline
 
Join Date: Oct 2001
Posts: 88
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

nice one dude.. Look alright that does.

do you have a demo?
Reply With Quote
  #3  
Old 06-15-2001, 06:27 PM
Dakota's Avatar
Dakota Dakota is offline
 
Join Date: Oct 2001
Posts: 102
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can see it in action on my forum.

Great hack. you did a good job on it.
Reply With Quote
  #4  
Old 06-15-2001, 06:56 PM
mister mister is offline
 
Join Date: Oct 2001
Location: Detroit, MI
Posts: 92
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

just installed it, works great, thanks!
Reply With Quote
  #5  
Old 06-15-2001, 07:37 PM
kicks
Guest
 
Posts: n/a
Default

Thanks Mas*Mind
Reply With Quote
  #6  
Old 06-15-2001, 09:31 PM
cditty's Avatar
cditty cditty is offline
 
Join Date: Oct 2001
Location: Memphis TN
Posts: 159
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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:
PHP Code:
eval ("\$post[has_a_birthday] = \"".gettemplate("postbit_birthday")."";"); 
Any ideas?
Reply With Quote
  #7  
Old 06-15-2001, 10:57 PM
maverick1236 maverick1236 is offline
 
Join Date: Oct 2001
Location: NY
Posts: 183
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Mines on line 26......
Reply With Quote
  #8  
Old 06-15-2001, 11:49 PM
Mas*Mind's Avatar
Mas*Mind Mas*Mind is offline
 
Join Date: Oct 2001
Location: Amsterdam, The Netherlands, currently living in Cape Town, South Africa
Posts: 103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 06-16-2001, 01:08 AM
maverick1236 maverick1236 is offline
 
Join Date: Oct 2001
Location: NY
Posts: 183
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 06-16-2001, 02:15 AM
cditty's Avatar
cditty cditty is offline
 
Join Date: Oct 2001
Location: Memphis TN
Posts: 159
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Working for me. Thanks for the revised code.

Maverick, what errors are you getting now?

Chris
Reply With Quote
Reply


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

Forum Jump


All times are GMT. The time now is 10:49 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05014 seconds
  • Memory Usage 2,289KB
  • Queries Executed 23 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete