Вход Регистрация
Файл: module/birthday.php
Строк: 43
<?php
/*************************************************
 *    apwa.ru       birthday.php
 *                 -------------
 *  Anv@r.all 2011
 ************************************************/

if ( !defined('IN_PHPBB') )
{
    die(
"Hacking attempt");
}
if ( isset(
$HTTP_POST_VARS[POST_USERS_URL]) )
{
    
$u htmlspecialchars($HTTP_POST_VARS[POST_USERS_URL]);
    
redirect(append_sid("profile." $phpEx "?mode=viewprofile&" POST_USERS_URL "=" $u ""TRUE));
}
$sql "SELECT user_id, username, user_birthday, user_nic_color 
        FROM " 
USERS_TABLE
        WHERE user_birthday!=999999  
        ORDER BY DATE_FORMAT(from_unixtime(user_birthday*86400+1),'%m%d') asc"
;
if(
$result $db->sql_query($sql)) 

    if (!empty(
$result)) 
    { 
        
$time_now time();
        
$this_year create_date('Y'$time_now$board_config['board_timezone']);
        
$date_today create_date('Ymd'$time_now$board_config['board_timezone']);
        
$date_forward create_date('Ymd'$time_now+($board_config['birthday_check_day']*2629743), $board_config['board_timezone']);
            while (
$birthdayrow $db->sql_fetchrow($result))
        { 
             
$user_birthday2 $this_year.($user_birthday realdate("md",$birthdayrow['user_birthday'] )); 
             if ( 
$user_birthday2 $date_today 
             {
                      
$user_birthday2 += 10000;
             }        
             if ( 
$user_birthday2 $date_today  && $user_birthday2 <= $date_forward 
             { 
                  
$user_age = ( $this_year.$user_birthday $date_today ) ? $this_year realdate ('Y',$birthdayrow['user_birthday'])+$this_yearrealdate ('Y',$birthdayrow['user_birthday']); 
                  
$birthday_week_list .= '<option value="' $birthdayrow['user_id'] . '" style="color: ' $birthdayrow['user_nic_color'] . '">' $birthdayrow['username'] . ' (' $user_age ') - ' realdate("d.M.Y",$birthdayrow['user_birthday']) . '</option> '
             } 
             else if ( 
$user_birthday2 == $date_today 
             { 
                  
$user_age $this_year realdate 'Y',$birthdayrow['user_birthday'] ); 
                  
$birthday_today_list .= '<a href="' append_sid("profile.$phpEx?mode=viewprofile&amp;" POST_USERS_URL "=" $birthdayrow['user_id']) . '" style="color: ' $birthdayrow['user_nic_color'] . '">' $birthdayrow['username'] . ' (' $user_age ')</a>,'
             }
             
        }
        if (
$birthday_today_list
        {
                
$birthday_today_liststrlen$birthday_today_list)-1] = ' ';
        }       
        if (
$birthday_week_list
        {
                
$birthday_week_liststrlen$birthday_week_list)-1] = ' ';
        }
    } 
    
$db->sql_freeresult($result);
}

$template->set_filenames(array(
    
'birthday' => 'module/birthday_body.tpl')
);

if(
$birthday_week_list)
{
        
$birthday_week_list '<form action="index.php" method="post"><select name="u">' $birthday_week_list '</select>';
        
$birthday_week_list .= '<input type="submit" class="subbutton" name="submit" value="OK"/></form>';
}
        
$template->assign_block_vars('birthday', array(    
        
'WEEK' => sprintf( (($birthday_week_list) ? $lang['Birthday_week'] : $lang['Nobirthday_week']), 30) . $birthday_week_list,
    
'TODAY' => ($birthday_today_list) ? $lang['Birthday_today'] . " " $birthday_today_list "<br/>" $lang['Nobirthday_today'])
);

$template->assign_var_from_handle('MODULE_BIRTHDAY''birthday');
           
?>
Онлайн: 0
Реклама