Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases

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

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

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

Right u are-thanks 4 helping me
Reply With Quote
  #15  
Old 06-16-2001, 04:28 AM
Dakota's Avatar
Dakota Dakota is offline
 
Join Date: Oct 2001
Posts: 102
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I had to change
PHP Code:
eval ("\$post[has_a_birthday] = \"".gettemplate("postbit_birthday").""
to

PHP Code:
eval("\$post[has_a_birthday] = \"".gettemplate("postbit_birthday")."\"";"); 
on line 25 of birthday.php
Reply With Quote
  #16  
Old 06-16-2001, 04:34 AM
Dakota's Avatar
Dakota Dakota is offline
 
Join Date: Oct 2001
Posts: 102
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well its not displaying it correctly, so I will put it in this attachment.
Reply With Quote
  #17  
Old 06-16-2001, 05:39 AM
tazthedev tazthedev is offline
 
Join Date: Jan 2002
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Warning: Failed opening 'birthday.php' for inclusion (include_path='.') in f:\apache\htdocs\divinefxp\showthread.php on line 430

here's the error i got ...

help
Reply With Quote
  #18  
Old 06-16-2001, 09:24 AM
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

Quote:
Originally posted by tazthedev
Warning: Failed opening 'birthday.php' for inclusion (include_path='.') in f:\apache\htdocs\divinefxp\showthread.php on line 430


here's the error i got ...

help
read a few posts up
Reply With Quote
  #19  
Old 06-16-2001, 09:27 AM
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

Quote:
Originally posted by Dakota
Well its not displaying it correctly, so I will put it in this attachment.
I know, there's some problem with the [php]-code... I allready changed my original instructions
Reply With Quote
  #20  
Old 06-19-2001, 07:34 AM
Sarge
Guest
 
Posts: n/a
Default

does this slow down the page loading much?
anyone know?
Reply With Quote
  #21  
Old 06-19-2001, 09:59 AM
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

nope, not noticable anyway
Reply With Quote
Reply

Thread Tools

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 03:15 PM.


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.04956 seconds
  • Memory Usage 2,303KB
  • Queries Executed 25 (?)
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
  • (2)bbcode_php
  • (2)bbcode_quote
  • (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
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (11)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