Вход Регистрация
Файл: birthday.php
Строк: 37
<?php

define
('IN_PHPBB'true);
$phpbb_root_path='./';
include(
$phpbb_root_path.'extension.inc');
include(
$phpbb_root_path.'common.'.$phpEx);

$userdata session_pagestart($user_ipPAGE_INDEX);
init_userprefs($userdata);

$sql "SELECT user_id, username, user_birthday, user_level 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 .= ' <a href="' append_sid("profile.$phpEx?mode=viewprofile&amp;" POST_USERS_URL "=" $birthdayrow['user_id']) . '">' $birthdayrow['username'] . ' ('.$user_age.')</a><br/>'.realdate("d.M.Y",$birthdayrow['user_birthday']).'<br/>'

            } 
            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']) . '">' $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);
}
if(
$birthday_today_list==null)
{
    
$birthday_today_list 'Именинников сегодня нет';
}
if(
$birthday_week_list==null)
{
    
$birthday_week_list 'Именинников в ближайшие 30 дней нет';
}


$page_title 'Календарь';
include(
$phpbb_root_path 'includes/page_header.'.$phpEx);
$template->set_filenames(array(
    
'body' => 'birthday_body.tpl')
);

$template->assign_vars(array(
    
'WHOSBIRTHDAY_WEEK' => $birthday_week_list,
    
'WHOSBIRTHDAY_TODAY' => $birthday_today_list
)
);
    

$template->pparse('body');

include(
$phpbb_root_path 'includes/page_tail.'.$phpEx);
    
?>
Онлайн: 0
Реклама