[REQ] Birthday Conditional in Postbit

WARNING: This hack will hijack an existing post array value ($post[age]). If you display age on your forum's postbit, this hack will break that functionality.
I am open to suggestions on how to do this another way.

In showthread.php:

Find:
PHP:
// get first and last post ids for this page (for big reply buttons)

Right before it place:
PHP:
// %%%%%%%%%%%%%%%%%%%%%%% Birthday Conditional Hack %%%%%%%%%%%%%%%%%%%%%%%% 

        $smonth = vbdate('n', TIMENOW, false, false); 
        $sday = vbdate('j', TIMENOW, false, false); 
        $sdate = explode('-', $post['birthday']); 
         
        if ($smonth == $sdate[0] AND $sday == $sdate[1]) 
        { 
            $post['age'] = 'YES'; 
        } 
        else 
        { 
            $post['age'] = 'NO'; 
        } 
// %%%%%%%%%%%%%%%%%%%% End Birthday Conditional Hack %%%%%%%%%%%%%%%%%%%%%%

Now in your postbit or postbit_legacy template, you can use the conditional:
Code:
<if condition="$post['age']=='YES'">

I just made it put a small birthday cake image next to their name with this code:
Code:
<if condition="$post['age']=='YES'"><img src="$stylevar[imgdir_misc]/birthday_small.gif" alt="IT'S MY BIRTHDAY!!"></if>
 
Back
Top