function fill_smarty($main_smarty, $stats = 1) { $vars = ''; check_actions('profile_show', $vars); $main_smarty->assign('user_publicemail', $this->public_email); $main_smarty->assign('user_location', $this->location); $main_smarty->assign('user_occupation', $this->occupation); $main_smarty->assign('user_aim', $this->aim); $main_smarty->assign('user_msn', $this->msn); $main_smarty->assign('user_yahoo', $this->yahoo); $main_smarty->assign('user_gtalk', $this->gtalk); $main_smarty->assign('user_skype', $this->skype); $main_smarty->assign('user_irc', $this->irc); $main_smarty->assign('user_karma', $this->karma); $main_smarty->assign('user_joined', get_date($this->date)); $main_smarty->assign('user_login', $this->username); $main_smarty->assign('user_names', $this->names); $main_smarty->assign('user_username', $this->username); /* global $db; $groups = $db->get_results($sql="SELECT * FROM " . table_group_member . " LEFT JOIN " . table_groups . " ON group_id=member_group_id WHERE member_user_id = {$this->id} AND member_status = 'active' AND group_status = 'Enable'"); //print $sql; for ($i=0; $i<sizeof($groups); $i++) $groups[$i]->link = getmyurl("group_story", $groups[$i]->group_id); $main_smarty->assign('user_groups', $groups); print_r($main_smarty); */ user_group_read($this->id); if ($stats == 1) { $this->all_stats(); $main_smarty->assign('user_total_links', $this->total_links); $main_smarty->assign('user_published_links', $this->published_links); $main_smarty->assign('user_total_comments', $this->total_comments); $main_smarty->assign('user_total_votes', $this->total_votes); $main_smarty->assign('user_published_votes', $this->published_votes); } return $main_smarty; }
function fill_smarty($main_smarty, $stats = 1) { global $db; $vars = ''; check_actions('profile_show', $vars); $main_smarty->assign('user_publicemail', $this->public_email); $main_smarty->assign('user_location', $this->location); $main_smarty->assign('user_occupation', $this->occupation); $main_smarty->assign('user_language', $this->language); $main_smarty->assign('user_facebook', $this->facebook); $main_smarty->assign('user_twitter', $this->twitter); $main_smarty->assign('user_linkedin', $this->linkedin); $main_smarty->assign('user_googleplus', $this->googleplus); $main_smarty->assign('user_skype', $this->skype); $main_smarty->assign('user_pinterest', $this->pinterest); $main_smarty->assign('user_karma', $this->karma); $main_smarty->assign('user_joined', get_date($this->date)); $main_smarty->assign('user_login', $this->username); $main_smarty->assign('user_names', $this->names); $main_smarty->assign('user_username', $this->username); $users = $db->get_results("SELECT user_karma, COUNT(*) FROM " . table_users . " WHERE user_level NOT IN ('Spammer') AND user_karma>0 AND (user_login!='anonymous' OR user_lastip) GROUP BY user_karma ORDER BY user_karma DESC", ARRAY_N); $ranklist = array(); $rank = 1; if ($users) { foreach ($users as $dbuser) { $ranklist[$dbuser[0]] = $rank; $rank += $dbuser[1]; } } $main_smarty->assign('user_rank', $ranklist[$this->karma]); /* global $db; $groups = $db->get_results($sql="SELECT * FROM " . table_group_member . " LEFT JOIN " . table_groups . " ON group_id=member_group_id WHERE member_user_id = {$this->id} AND member_status = 'active' AND group_status = 'Enable'"); //print $sql; for ($i=0; $i<sizeof($groups); $i++) $groups[$i]->link = getmyurl("group_story", $groups[$i]->group_id); $main_smarty->assign('user_groups', $groups); print_r($main_smarty); */ user_group_read($this->id); if ($stats == 1) { $this->all_stats(); $main_smarty->assign('user_total_links', $this->total_links); $main_smarty->assign('user_published_links', $this->published_links); $main_smarty->assign('user_total_comments', $this->total_comments); $main_smarty->assign('user_total_votes', $this->total_votes); $main_smarty->assign('user_published_votes', $this->published_votes); } return $main_smarty; }