public function process() { $aIdEntry = $this->getParam('aIdEntry'); $number_entry_max = 0; $aId = explode(',', $aIdEntry); $aEntries = array(); $aContestWinning = array(); $TotalWinning = 0; $limit_entries = 0; $link = ''; foreach ($aId as $Id) { $aEntries[] = $aContestWinning = PHpfox::getService('contest.entry')->getContestEntryById($Id); if ($number_entry_max == 0) { $number_entry_max = $aEntries[count($aEntries) - 1]['number_winning_entry_max']; } } if ($aContestWinning) { $TotalWinning = Phpfox::getService('contest.entry')->getTotalWinningEntries($aContestWinning['contest_id'], $aIdEntry); $link = Phpfox::getLib('url')->permaLink('contest', $aContestWinning['contest_id'], $aContestWinning['contest_name']) . "view_winning/"; } if ($TotalWinning + count($aId) > $number_entry_max) { $limit_entries = 1; } $this->template()->assign(array('aEntries' => $aEntries, 'limit_entries' => $limit_entries, 'abc' => $number_entry_max, 'link' => $link)); }
public function hideRoom() { PHpfox::getService('im.process')->hideRoom($this->get('id')); $this->call('deleteCookie(\'im_last_open_window\');'); }
public function getProfileMenu($aUser) { $total_contest = PHpfox::getService('contest.contest')->getCountContestByType('profile', $aUser['user_id']); $aUser['total_contest'] = $total_contest; $this->database()->update(Phpfox::getT('user_field'), array('total_contest' => $total_contest), 'user_id = ' . $aUser['user_id']); $aMenus[] = array('phrase' => Phpfox::getPhrase('contest.contest'), 'url' => 'profile.contest', 'total' => (int) (isset($aUser['total_contest']) ? $aUser['total_contest'] : 0), 'icon' => 'feed/contest.png'); return $aMenus; }