0 Members and 1 Guest are viewing this topic.

*

Vink

  • *****
  • 329
    • NedDate.nl
  • osDate Version: osDate v2.1.9a
MOD: Zodiac on profiles
« on: June 08, 2016, 10:18:55 AM »
Hi,
If you want to automatically show the users Zodiac on his/her profile
you can do it with this Mod.

in showprofile.php find:
Code: [Select]
if (!$user || $user['id'] != $_REQUEST['id']) {
/* No such user. Display error message and exit */
$t->assign('error_message', get_lang('no_such_user'));
$t->assign('errid',"999");
$t->assign('rendered_page', $t->fetch('nickpage.tpl'));
$t->display('index.tpl');
exit;
}
and add after that:
Code: [Select]
function zodiac ( $birthdate )
{
   $zodiac = "";
         
   list ( $year, $month, $day ) = explode ( "-", $birthdate );
         
   if     ( ( $month == 3 && $day > 20 ) || ( $month == 4 && $day < 20 ) ) { $zodiac = "Aries"; }
   elseif ( ( $month == 4 && $day > 19 ) || ( $month == 5 && $day < 21 ) ) { $zodiac = "Taurus"; }
   elseif ( ( $month == 5 && $day > 20 ) || ( $month == 6 && $day < 21 ) ) { $zodiac = "Gemini"; }
   elseif ( ( $month == 6 && $day > 20 ) || ( $month == 7 && $day < 23 ) ) { $zodiac = "Cancer"; }
   elseif ( ( $month == 7 && $day > 22 ) || ( $month == 8 && $day < 23 ) ) { $zodiac = "Leo"; }
   elseif ( ( $month == 8 && $day > 22 ) || ( $month == 9 && $day < 23 ) ) { $zodiac = "Virgo"; }
   elseif ( ( $month == 9 && $day > 22 ) || ( $month == 10 && $day < 23 ) ) { $zodiac = "Libra"; }
   elseif ( ( $month == 10 && $day > 22 ) || ( $month == 11 && $day < 22 ) ) { $zodiac = "Scorpio"; }
   elseif ( ( $month == 11 && $day > 21 ) || ( $month == 12 && $day < 22 ) ) { $zodiac = "Sagittarius"; }
   elseif ( ( $month == 12 && $day > 21 ) || ( $month == 1 && $day < 20 ) ) { $zodiac = "Capricorn"; }
   elseif ( ( $month == 1 && $day > 19 ) || ( $month == 2 && $day < 19 ) ) { $zodiac = "Aquarius"; }
   elseif ( ( $month == 2 && $day > 18 ) || ( $month == 3 && $day < 21 ) ) { $zodiac = "Pisces"; }

   return $zodiac;
}

$zodiac = zodiac($user['birth_date']);
$t->assign('zodiac', $zodiac);

also find:
Code: [Select]
$user = $osDB->getRow('SELECT id, username , level, country , firstname , ect ectand add the birth_date to it.
 
Now you can show where you want the Users Zodiac in your nickpage_basic_address.tpl with:  {$zodiac}

Regards
Vink
osDate 2.19a | PHP 5.3.8 | MySQL  5.0.91

*

Pharg

  • *****
  • 3,153
    • OsDateFourm
  • osDate Version: osDateEvo v1.3
Re: MOD: Zodiac on profiles
« Reply #1 on: June 08, 2016, 10:31:47 AM »
Hi Vink,

Thanks for the awesome Zodiac mod  :)

Don't know why the 1st osDate developers ever took out Zodiac's from it to be honest, it's a cool feature a lot of
people like to know about each other.
Regards,
Pharg ( Phill )

Don't Personal Message me unless it's about a sensitive matter!!

REMEMBER TO ALWAYS BACKUP BEFORE MAKING ANY CHANGES!!

osDateEvo v1.3 | PHP: 5.3.42 & PHP: 7.2 | MySQL: 5.5.35

*

Vink

  • *****
  • 329
    • NedDate.nl
  • osDate Version: osDate v2.1.9a
Re: MOD: Zodiac on profiles
« Reply #2 on: June 08, 2016, 10:58:00 AM »
Hi Phill,
Thanks.. cool future  :)
Made it even more attractive with a Zodiac icon behind the Zodiac.

In nickpage_basic_address.tpl add after your {$zodiac}
Code: [Select]
               
                        {if $zodiac == 'Aries'}<img src="{$image_dir}zodiac/aries.gif" height="16" align="absmiddle">{/if}
{if $zodiac == 'Taurus'}<img src="{$image_dir}zodiac/taurus.gif" height="16" align="absmiddle">{/if}
{if $zodiac == 'Gemini'}<img src="{$image_dir}zodiac/gemini.gif" height="16" align="absmiddle">{/if}
{if $zodiac == 'Cancer'}<img src="{$image_dir}zodiac/cancer.gif" height="16" align="absmiddle">{/if}
{if $zodiac == 'Leo'}<img src="{$image_dir}zodiac/leo.gif" height="16" align="absmiddle">{/if}
{if $zodiac == 'Virgo'}<img src="{$image_dir}zodiac/virgo.gif" height="16" align="absmiddle">{/if}
{if $zodiac == 'Libra'}<img src="{$image_dir}zodiac/libra.gif" height="16" align="absmiddle">{/if}
{if $zodiac == 'Scorpio'}<img src="{$image_dir}zodiac/scorpio.gif" height="16" align="absmiddle">{/if}
{if $zodiac == 'Sagittarius'}<img src="{$image_dir}zodiac/sagittarius.gif" height="16" align="absmiddle">{/if}
{if $zodiac == 'Capricorn'}<img src="{$image_dir}zodiac/capricorn.gif" height="16" align="absmiddle">{/if}
{if $zodiac == 'Aquarius'}<img src="{$image_dir}zodiac/aquarius.gif" height="16" align="absmiddle">{/if}
{if $zodiac == 'Pisces'}<img src="{$image_dir}zodiac/pisces.gif" height="16" align="absmiddle">{/if}


Make a new dir in your image dir called:  zodiac
and Google for the zodiac icons you want to use.
 
« Last Edit: June 08, 2016, 03:11:23 PM by Vink »
Regards
Vink
osDate 2.19a | PHP 5.3.8 | MySQL  5.0.91