Файл: modules/profile/index.php
Строк: 28
<?php
if($act=='edit'):
$UDATA = $System->GetUser($CONFIG['uid']);
$Templater = new Templater;
$Templater->vars = array(
'UID'=>$UDATA['id'],
'EMAIL'=>$UDATA['email'],
'NAME'=>$UDATA['name'],
'BDAY'=>$UDATA['bday'],
'BMONTH'=>$UDATA['bmonth'],
'BYEAR'=>$UDATA['byear']
);
$Templater->Module = 'profile';
$Templater->GetTmpl('edit');
$Templater->Exec();
elseif($act=='show'):
$UDATA = $System->GetUser($_GET['act2']);
$Templater = new Templater;
if($UDATA['id']!='0'){
$res = mysql_query("SELECT COUNT(`tid`) AS `count` FROM `done` WHERE `mode` = 'done' AND `uid`= ".$UDATA['id']);
$xdata = mysql_fetch_assoc($res);
$zres = mysql_query("SELECT COUNT(`id`) AS `count` FROM `users` WHERE `referer`= ".$UDATA['id']);
$zdata = mysql_fetch_assoc($zres);
$res = Core::url_get_contents('https://api.twitter.com/1/users/show.json?user_id='.$UDATA['social:tw']);
$resp = json_decode($res, true);
if($resp['screen_name']){
$twitter_username = $resp['screen_name'];
} else {
$twitter_username = 0;
}
$Templater->vars = array(
'UID'=>$UDATA['id'],
'USERNAME'=>$UDATA['login'],
'LASTNAME'=>$UDATA['lastname'],
'EMAIL'=>$UDATA['email'],
'NAME'=>$UDATA['name'],
'BDAY'=>$UDATA['bday'],
'BMONTH'=>$UDATA['bmonth'],
'BYEAR'=>$UDATA['byear'],
'PHOTO'=>$UDATA['photo'],
'SOCIAL:VK'=>$UDATA['social:vk'],
'SOCIAL:TW'=>$twitter_username,
'TASKS:DONE'=>$xdata['count'],
'REFS'=>$zdata['count']
);
} else {
$Templater->vars = array('UID'=>'0');
}
$Templater->Module = 'profile';
$Templater->GetTmpl('profile');
$Templater->Exec();
//print_r($Templater->ucodes($Templater->tmpl));
endif;