Пример #1
0
 /**
  * Controller
  */
 public function process()
 {
     if ($iId = $this->request()->getInt('view')) {
         if ($sRedirect = Phpfox::getService('report')->getRedirect($iId)) {
             $this->url()->forward($sRedirect);
         }
     }
     if ($aIds = $this->request()->getArray('id')) {
         if ($this->request()->get('ignore')) {
             foreach ($aIds as $iId) {
                 if (!is_numeric($iId)) {
                     continue;
                 }
                 Phpfox::getService('report.data.process')->ignore($iId);
             }
             $this->url()->send('admincp.report', null, Phpfox::getPhrase('report.report_s_successfully_ignored'));
         }
     }
     $iPage = $this->request()->getInt('page');
     $aPages = array(5, 10, 15, 20);
     $aDisplays = array();
     foreach ($aPages as $iPageCnt) {
         $aDisplays[$iPageCnt] = Phpfox::getPhrase('core.per_page', array('total' => $iPageCnt));
     }
     $aSorts = array('added' => Phpfox::getPhrase('core.time'));
     $aFilters = array('search' => array('type' => 'input:text', 'search' => "AND c.name LIKE '%[VALUE]%'"), 'user' => array('type' => 'input:text', 'search' => "AND u.user_name LIKE '%[VALUE]%'"), 'display' => array('type' => 'select', 'options' => $aDisplays, 'default' => '10'), 'sort' => array('type' => 'select', 'options' => $aSorts, 'default' => 'added', 'alias' => 'rd'), 'sort_by' => array('type' => 'select', 'options' => array('DESC' => Phpfox::getPhrase('core.descending'), 'ASC' => Phpfox::getPhrase('core.ascending')), 'default' => 'DESC'));
     $oSearch = Phpfox_Search::instance()->set(array('type' => 'reports', 'filters' => $aFilters, 'search' => 'search'));
     $iLimit = $oSearch->getDisplay();
     list($iCnt, $aReports) = Phpfox::getService('report')->get($oSearch->getConditions(), $oSearch->getSort(), $oSearch->getPage(), $iLimit);
     Phpfox_Pager::instance()->set(array('page' => $iPage, 'size' => $iLimit, 'count' => $oSearch->getSearchTotal($iCnt)));
     $this->template()->setTitle(Phpfox::getPhrase('report.reports'))->setBreadcrumb(Phpfox::getPhrase('report.reports'), $this->url()->makeUrl('admincp.report'))->assign(array('aReports' => $aReports));
 }
Пример #2
0
 /**
  * Controller
  */
 public function process()
 {
     Phpfox::isUser(true);
     if ($iInvite = $this->request()->getInt('del')) {
         $bDel = Phpfox::getService('invite.process')->delete($iInvite, Phpfox::getUserId());
         if ($bDel) {
             $this->url()->send('invite.invitations', null, Phpfox::getPhrase('invite.invitation_deleted'));
         }
         $this->url()->send('invite.invitations', null, Phpfox::getPhrase('invite.invitation_not_found'));
     } elseif ($aInvite = $this->request()->get('val')) {
         $bDel = true;
         foreach ($aInvite as $iInvite) {
             $bDel = $bDel && Phpfox::getService('invite.process')->delete($iInvite, Phpfox::getUserId());
         }
         if ($bDel) {
             $this->url()->send('invite.invitations', null, Phpfox::getPhrase('invite.invitation_deleted'));
         }
         $this->url()->send('invite.invitations', null, Phpfox::getPhrase('invite.invitation_not_found'));
     }
     $iPage = $this->request()->getInt('page');
     $iPageSize = (int) Phpfox::getParam('invite.pendings_to_show_per_page');
     list($iCnt, $aInvites) = Phpfox::getService('invite')->get(Phpfox::getUserId(), $iPage, $iPageSize);
     Phpfox_Pager::instance()->set(array('page' => $iPage, 'size' => $iPageSize, 'count' => $iCnt));
     $this->setParam('global_moderation', array('name' => 'invitations', 'ajax' => 'invite.moderation', 'menu' => array(array('phrase' => 'Delete', 'action' => 'delete'))));
     $this->template()->setTitle(Phpfox::getPhrase('invite.pending_invitations'))->setBreadcrumb(Phpfox::getPhrase('invite.pending_invitations'))->assign(array('aInvites' => $aInvites, 'iPage' => $iPage))->setHeader('cache', array('pager.css' => 'style_css', 'pending.js' => 'module_invite'));
 }
Пример #3
0
 /**
  * Controller
  */
 public function process()
 {
     Phpfox::getUserParam('comment.can_moderate_comments', true);
     $iPage = $this->request()->getInt('page');
     $aPages = array(20, 30, 40, 50);
     $aDisplays = array();
     foreach ($aPages as $iPageCnt) {
         $aDisplays[$iPageCnt] = Phpfox::getPhrase('core.per_page', array('total' => $iPageCnt));
     }
     $aFilters = array('search' => array('type' => 'input:text', 'search' => "AND ls.name LIKE '%[VALUE]%'"), 'display' => array('type' => 'select', 'options' => $aDisplays, 'default' => '20'), 'sort' => array('type' => 'select', 'options' => array('time_stamp' => Phpfox::getPhrase('comment.last_activity'), 'rating ' => Phpfox::getPhrase('comment.rating')), 'default' => 'time_stamp', 'alias' => 'cmt'), 'sort_by' => array('type' => 'select', 'options' => array('DESC' => Phpfox::getPhrase('core.descending'), 'ASC' => Phpfox::getPhrase('core.ascending')), 'default' => 'DESC'));
     $oSearch = Phpfox_Search::instance()->set(array('type' => 'comments', 'filters' => $aFilters, 'search' => 'search'));
     if ($this->request()->get('view') == 'approval') {
         $oSearch->setCondition('AND cmt.view_id = 1');
     } else {
         $oSearch->setCondition('AND cmt.view_id = 9');
     }
     list($iCnt, $aComments) = Phpfox::getService('comment')->get('cmt.*', $oSearch->getConditions(), $oSearch->getSort(), $oSearch->getPage(), $oSearch->getDisplay(), null, true);
     foreach ($aComments as $iKey => $aComment) {
         if (Phpfox::hasCallback($aComment['type_id'], 'getItemName')) {
             $aComments[$iKey]['item_name'] = Phpfox::callback($aComment['type_id'] . '.getItemName', $aComment['comment_id'], $aComment['owner_full_name']);
         }
     }
     Phpfox_Pager::instance()->set(array('page' => $iPage, 'size' => $oSearch->getDisplay(), 'count' => $oSearch->getSearchTotal($iCnt)));
     $this->template()->setTitle(Phpfox::getPhrase('comment.comment_title'))->setBreadcrumb(Phpfox::getPhrase('comment.comment_title'), $this->url()->makeUrl('admincp.comment'))->setHeader('cache', array('comment.css' => 'style_css', 'pager.css' => 'style_css'))->assign(array('aComments' => $aComments, 'bIsCommentAdminPanel' => true));
 }
Пример #4
0
 /**
  * Controller
  */
 public function process()
 {
     ($sPlugin = Phpfox_Plugin::get('ad.component_controller_admincp_process__start')) ? eval($sPlugin) : false;
     $iPage = $this->request()->getInt('page');
     if ($iId = $this->request()->getInt('approve')) {
         if (Phpfox::getService('ad.process')->approve($iId)) {
             $this->url()->send('admincp.ad', null, Phpfox::getPhrase('ad.ad_successfully_approved'));
         }
     }
     if ($iId = $this->request()->getInt('deny')) {
         if (Phpfox::getService('ad.process')->deny($iId)) {
             $this->url()->send('admincp.ad', null, Phpfox::getPhrase('ad.ad_successfully_denied'));
         }
     }
     if ($iId = $this->request()->getInt('delete')) {
         if (Phpfox::getService('ad.process')->delete($iId)) {
             $this->url()->send('admincp.ad', null, Phpfox::getPhrase('ad.ad_successfully_deleted'));
         }
     }
     if ($aVals = $this->request()->getArray('val')) {
         if (Phpfox::getService('ad.process')->updateActivity($aVals)) {
             $this->url()->send('admincp.ad', null, Phpfox::getPhrase('ad.ad_s_successfully_updated'));
         }
     }
     $aPages = array(5, 10, 15, 20);
     $aDisplays = array();
     foreach ($aPages as $iPageCnt) {
         $aDisplays[$iPageCnt] = Phpfox::getPhrase('core.per_page', array('total' => $iPageCnt));
     }
     $aSorts = array('ad_id' => Phpfox::getPhrase('ad.recently_added'));
     $aFilters = array('status' => array('type' => 'select', 'options' => array('1' => Phpfox::getPhrase('ad.pending_approval'), '2' => Phpfox::getPhrase('ad.pending_payment'), '4' => Phpfox::getPhrase('ad.denied')), 'add_any' => true), 'display' => array('type' => 'select', 'options' => $aDisplays, 'default' => '10'), 'sort' => array('type' => 'select', 'options' => $aSorts, 'default' => 'ad_id'), 'sort_by' => array('type' => 'select', 'options' => array('DESC' => Phpfox::getPhrase('core.descending'), 'ASC' => Phpfox::getPhrase('core.ascending')), 'default' => 'DESC'));
     $oSearch = Phpfox_Search::instance()->set(array('type' => 'campaigns', 'filters' => $aFilters, 'search' => 'search'));
     $sStatus = $oSearch->get('status');
     $sView = $this->request()->get('view');
     $iLocation = $this->request()->getInt('location');
     if ($sStatus == '1') {
         $oSearch->setCondition('is_custom = 2');
     } elseif ($sStatus == '2') {
         $oSearch->setCondition('is_custom = 1');
     } elseif ($sStatus == '4') {
         $oSearch->setCondition('is_custom = 4');
     } else {
         switch ($sView) {
             case 'pending':
                 $oSearch->setCondition('is_custom = 2');
                 break;
             default:
                 // $oSearch->setCondition('is_custom IN(0,2,3)');
                 break;
         }
     }
     if ($iLocation > 0) {
         $oSearch->setCondition('AND location = ' . (int) $iLocation);
     }
     $iLimit = $oSearch->getDisplay();
     list($iCnt, $aAds) = Ad_Service_Ad::instance()->get($oSearch->getConditions(), $oSearch->getSort(), $oSearch->getPage(), $iLimit);
     Phpfox_Pager::instance()->set(array('page' => $iPage, 'size' => $iLimit, 'count' => $oSearch->getSearchTotal($iCnt)));
     $this->template()->setTitle(Phpfox::getPhrase('ad.manage_ad_campaigns'))->setBreadcrumb(Phpfox::getPhrase('ad.manage_ad_campaigns'), $this->url()->makeUrl('admincp.ad'))->assign(array('aAds' => $aAds, 'iPendingCount' => (int) Ad_Service_Ad::instance()->getPendingCount(), 'sPendingLink' => Phpfox_Url::instance()->makeUrl('admincp.ad', array('view' => 'pending')), 'bIsSearch' => $this->request()->get('search-id') ? true : false, 'sView' => $sView));
     ($sPlugin = Phpfox_Plugin::get('ad.component_controller_admincp_process__end')) ? eval($sPlugin) : false;
 }
Пример #5
0
 /**
  * Controller
  */
 public function process()
 {
     $aCond = array();
     $iPage = $this->request()->getInt('page');
     $iPageSize = 10;
     $bIsSentbox = $this->request()->get('req2') == 'sent' ? true : false;
     $bIsSearch = false;
     if ($bIsSentbox) {
         $aCond[] = 'm.owner_user_id = ' . Phpfox::getUserId() . ' AND m.owner_type_id = 0';
     } else {
         $aCond[] = 'm.viewer_folder_id = 0 AND m.viewer_user_id = ' . Phpfox::getUserId() . ' AND m.viewer_type_id = 0';
     }
     if (($sSearch = $this->request()->get('search')) || $this->request()->get('search-query')) {
         if ($this->request()->get('search-query')) {
             $sSearch = Phpfox::getLib('session')->get('mfsearch');
         }
         $bIsSearch = true;
         $aCond[] = "AND (m.subject LIKE '%" . Phpfox_Database::instance()->escape($sSearch) . "%' OR m.preview LIKE '%" . Phpfox_Database::instance()->escape($sSearch) . "%')";
         $this->url()->setParam('search-query', 'true');
         Phpfox::getLib('session')->set('mfsearch', $sSearch);
     }
     if ($bIsSearch == false) {
         Phpfox::getLib('session')->remove('mfsearch');
     }
     list($iCnt, $aMessages, $aInputs) = Mail_Service_Mail::instance()->get($aCond, 'm.time_updated DESC', $iPage, $iPageSize, $bIsSentbox);
     Phpfox_Pager::instance()->set(array('page' => $iPage, 'size' => $iPageSize, 'count' => $iCnt));
     $this->template()->assign(array('bMobileInboxIsActive' => true, 'aMessages' => $aMessages, 'bIsSearch' => $bIsSearch, 'bIsSentbox' => $bIsSentbox, 'aMobileSubMenus' => array($this->url()->makeUrl('mail') => Phpfox::getPhrase('mail.mobile_messages'), $this->url()->makeUrl('mail', 'sent') => Phpfox::getPhrase('mail.sent'), $this->url()->makeUrl('mail', 'compose') => Phpfox::getPhrase('mail.compose')), 'sActiveMobileSubMenu' => $this->url()->makeUrl('mail', $this->request()->get('req2') == '' ? null : $this->request()->get('req2'))));
 }
Пример #6
0
 /**
  * Controller
  */
 public function process()
 {
     $aParam = $this->getParam('rss');
     $aLogs = Phpfox::getService('rss.log')->get($aParam);
     $sNames = '';
     $sCounts = '';
     $iMaxLogDisplay = 5;
     $iCnt = 0;
     $iOtherCount = 0;
     foreach ($aLogs as $aLog) {
         $iCnt++;
         if ($iCnt <= $iMaxLogDisplay) {
             $sNames .= $aLog['user_agent_chart'] . '|';
             $sCounts .= $aLog['total_agent_count'] . ',';
         } else {
             $iOtherCount += $aLog['total_agent_count'];
         }
     }
     if ($iOtherCount > 0) {
         $sNames .= Phpfox::getPhrase('rss.other') . '|';
         $sCounts .= $iOtherCount . ',';
     }
     $aUsers = array();
     if (isset($aParam['users'])) {
         list($iCnt, $aUsers) = Phpfox::getService('rss.log')->getUsers($aParam, $this->request()->get('page'), 20);
         Phpfox_Pager::instance()->set(array('page' => $this->request()->get('page'), 'size' => 20, 'count' => $iCnt));
     }
     $this->template()->assign(array('sNames' => rtrim($sNames, '|'), 'sCounts' => rtrim($sCounts, ','), 'aLogs' => $aLogs, 'aUsers' => $aUsers));
 }
Пример #7
0
 /**
  * Controller
  */
 public function process()
 {
     return Phpfox_Error::display('This section has been depreciated');
     Phpfox::getUserParam('comment.can_moderate_comments', true);
     if ($aIds = $this->request()->getArray('id')) {
         if ($this->request()->get('approve')) {
             foreach ($aIds as $iId) {
                 Phpfox::getService('feed.process')->approve($iId);
             }
             $this->url()->send('admincp.feed', array('view' => 'approval'), Phpfox::getPhrase('feed.profile_comment_s_successfully_approved'));
         } else {
             foreach ($aIds as $iId) {
                 Phpfox::getService('feed.process')->deleteFeed($iId);
             }
             $this->url()->send('admincp.feed', array('view' => 'approval'), Phpfox::getPhrase('feed.profile_comment_s_successfully_deleted'));
         }
     }
     $iPage = $this->request()->getInt('page');
     $aPages = array(20, 30, 40, 50);
     $aDisplays = array();
     foreach ($aPages as $iPageCnt) {
         $aDisplays[$iPageCnt] = Phpfox::getPhrase('core.per_page', array('total' => $iPageCnt));
     }
     $aFilters = array('search' => array('type' => 'input:text', 'search' => "AND ls.name LIKE '%[VALUE]%'"), 'display' => array('type' => 'select', 'options' => $aDisplays, 'default' => '20'), 'sort' => array('type' => 'select', 'options' => array('time_stamp' => Phpfox::getPhrase('comment.last_activity'), 'rating ' => Phpfox::getPhrase('comment.rating')), 'default' => 'time_stamp', 'alias' => 'feed'), 'sort_by' => array('type' => 'select', 'options' => array('DESC' => Phpfox::getPhrase('core.descending'), 'ASC' => Phpfox::getPhrase('core.ascending')), 'default' => 'DESC'));
     $oSearch = Phpfox_Search::instance()->set(array('type' => 'feeds', 'filters' => $aFilters, 'search' => 'search'));
     $oSearch->setCondition('AND feed.view_id = 1');
     list($iCnt, $aFeeds) = Feed_Service_Feed::instance()->getForBrowse($oSearch->getConditions(), $oSearch->getSort(), $oSearch->getPage(), $oSearch->getDisplay());
     Phpfox_Pager::instance()->set(array('page' => $iPage, 'size' => $oSearch->getDisplay(), 'count' => $oSearch->getSearchTotal($iCnt)));
     $this->template()->setTitle(Phpfox::getPhrase('comment.comment_title'))->setBreadcrumb(Phpfox::getPhrase('comment.comment_title'), $this->url()->makeUrl('admincp.comment'))->setHeader('cache', array('comment.css' => 'style_css', 'pager.css' => 'style_css'))->assign(array('aFeeds' => $aFeeds, 'bIsCommentAdminPanel' => true));
 }
Пример #8
0
 /**
  * Controller
  */
 public function process()
 {
     $iRsvp = $this->request()->get('rsvp', 1);
     $iPage = $this->request()->getInt('page');
     $sModule = $this->request()->get('module', false);
     $iItem = $this->request()->getInt('item', false);
     $aCallback = $this->getParam('aCallback', false);
     $iPageSize = 6;
     if (PHPFOX_IS_AJAX) {
         $aCallback = false;
         if ($sModule && $iItem && Phpfox::hasCallback($sModule, 'getEventInvites')) {
             $aCallback = Phpfox::callback($sModule . '.getEventInvites', $iItem);
         }
         $aEvent = Event_Service_Event::instance()->callback($aCallback)->getEvent($this->request()->get('id'), true);
         $this->template()->assign('aEvent', $aEvent);
     } else {
         $aEvent = $this->getParam('aEvent');
         $this->template()->assign('aEvent', $aEvent);
     }
     if ($aCallback !== false) {
         $sModule = $aCallback['module'];
         $iItem = $aCallback['item'];
     }
     list($iCnt, $aInvites) = Event_Service_Event::instance()->getInvites($aEvent['event_id'], $iRsvp, $iPage, $iPageSize);
     Phpfox_Pager::instance()->set(array('ajax' => 'event.listGuests', 'page' => $iPage, 'size' => $iPageSize, 'count' => $iCnt, 'aParams' => array('id' => $aEvent['event_id'], 'module' => $sModule, 'item' => $iItem, 'rsvp' => $iRsvp)));
     $this->template()->assign(array('aInvites' => $aInvites, 'iRsvp' => $iRsvp));
     if (!PHPFOX_IS_AJAX) {
         $sExtra = '';
         if ($aCallback !== false) {
             $sExtra .= '&amp;module=' . $aCallback['module'] . '&amp;item=' . $aCallback['item'];
         }
         $this->template()->assign(array('sHeader' => '', 'aMenu' => array(Phpfox::getPhrase('event.attending') => '#event.listGuests?rsvp=1&amp;id=' . $aEvent['event_id'] . $sExtra, Phpfox::getPhrase('event.maybe') => '#event.listGuests?rsvp=2&amp;id=' . $aEvent['event_id'] . $sExtra, Phpfox::getPhrase('event.can_t_make_it') => '#event.listGuests?rsvp=3&amp;id=' . $aEvent['event_id'] . $sExtra, Phpfox::getPhrase('event.not_responded') => '#event.listGuests?rsvp=0&amp;id=' . $aEvent['event_id'] . $sExtra), 'sBoxJsId' => 'event_guests'));
         return 'block';
     }
 }
Пример #9
0
 /**
  * Controller
  */
 public function process()
 {
     $iPage = $this->getParam('sPage');
     $iPageSize = 10;
     list($iCnt, $aItems) = Phpfox::getService('attachment')->get(array("attachment.user_id = " . Phpfox::getUserId() . ""), 'attachment.time_stamp DESC', $iPage, $iPageSize);
     Phpfox_Pager::instance()->set(array('page' => $iPage, 'size' => $iPageSize, 'count' => $iCnt, 'ajax' => 'attachment.browse'));
     $aUser = Phpfox::getService('user')->get(Phpfox::getUserId(), true);
     $this->template()->assign(array('aItems' => $aItems, 'sUrlPath' => Phpfox::getParam('core.url_attachment'), 'sThumbPath' => Phpfox::getParam('core.url_thumb'), 'sUsage' => $aUser['space_total'], 'bCanUseInline' => false, 'sAttachmentInput' => $this->request()->get('input')));
 }
Пример #10
0
 /**
  * Controller
  */
 public function process()
 {
     $iPage = $this->request()->getInt('page');
     $iPageSize = 5;
     $aCond = array();
     $aCond[] = 'AND friend.user_id = ' . Phpfox::getUserId();
     list($iCnt, $aFriends) = Friend_Service_Friend::instance()->get($aCond, 'friend.time_stamp DESC', $iPage, $iPageSize, true, false, false, $this->request()->getInt('user_id'));
     Phpfox_Pager::instance()->set(array('page' => $iPage, 'size' => $iPageSize, 'count' => $iCnt, 'ajax' => 'friend.getMutualFriends'));
     $this->template()->assign(array('aFriends' => $aFriends, 'iPage' => $iPage));
 }
Пример #11
0
 /**
  * Controller
  */
 public function process()
 {
     $iRsvp = $this->request()->get('rsvp', 1);
     $iPage = $this->request()->getInt('page');
     $iPageSize = 20;
     $aEvent = Event_Service_Event::instance()->getEvent($this->request()->get('id'), true);
     list($iCnt, $aInvites) = Event_Service_Event::instance()->getInvites($aEvent['event_id'], $iRsvp, $iPage, $iPageSize);
     Phpfox_Pager::instance()->set(array('ajax' => 'event.browseList', 'page' => $iPage, 'size' => $iPageSize, 'count' => $iCnt, 'aParams' => array('id' => $aEvent['event_id'], 'rsvp' => $iRsvp)));
     $aLists = array(Phpfox::getPhrase('event.attending') => '1', Phpfox::getPhrase('event.maybe_attending') => '2', Phpfox::getPhrase('event.awaiting_reply') => '0', Phpfox::getPhrase('event.not_attending') => '3');
     $this->template()->assign(array('aEvent' => $aEvent, 'aInvites' => $aInvites, 'bIsInBrowse' => $iPage > 0 ? true : false, 'aLists' => $aLists));
 }
Пример #12
0
 /**
  * Controller
  */
 public function process()
 {
     Phpfox::isUser(true);
     $iPage = $this->request()->getInt('page');
     $iPageSize = 6;
     $aConditions = array();
     $aConditions[] = 'AND p.user_id = ' . Phpfox::getUserId();
     list($iCnt, $aPhotos) = Phpfox::getService('photo')->get($aConditions, 'p.time_stamp DESC', $iPage, $iPageSize);
     // Set the pager for the photos
     Phpfox_Pager::instance()->set(array('page' => $iPage, 'size' => $iPageSize, 'count' => $iCnt, 'ajax' => 'photo.getForAttachment'));
     $this->template()->assign(array('aPhotos' => $aPhotos, 'iCurrentPage' => $iPage, 'sAttachmentObjId' => $this->request()->get('obj-id'), 'sAttachmentInput' => $this->request()->get('input'), 'sCategoryId' => $this->request()->get('category'), 'sIsAttachmentInline' => $this->request()->get('attachment-inline')));
 }
Пример #13
0
 /**
  * Controller
  */
 public function process()
 {
     $iPage = $this->getParam('page', 0);
     $iPageSize = 9;
     $oDb = Phpfox_Database::instance();
     $aConditions = array();
     if ($sFind = $this->getParam('find')) {
         $aConditions[] = 'AND (u.user_name LIKE \'%' . $oDb->escape($sFind) . '%\' OR u.full_name LIKE \'%' . $oDb->escape($sFind) . '%\' OR u.email LIKE \'%' . $oDb->escape($sFind) . '%\')';
     }
     list($iCnt, $aUsers) = Phpfox::getService('user.browse')->conditions($aConditions)->page($iPage)->limit($iPageSize)->sort('u.last_login DESC')->get();
     Phpfox_Pager::instance()->set(array('ajax' => 'user.browseAjax', 'page' => $iPage, 'size' => $iPageSize, 'count' => $iCnt));
     $this->template()->assign(array('aUsers' => $aUsers, 'sPrivacyInputName' => $this->getParam('input'), 'bIsAjaxSearch' => $this->getParam('is_search', false)));
 }
Пример #14
0
 /**
  * Controller
  */
 public function process()
 {
     // Get the current page. Zero if it's the first page
     $iPage = $this->getParam('page', 1);
     // Get the amount of pages to be shown by page
     $iPageSize = 15;
     // get the total pages, and the pages
     list($iTotal, $aPages) = Phpfox::getService('pages')->getMyLoginPages($iPage, $iPageSize);
     if ($iTotal > $iPageSize) {
         Phpfox_Pager::instance()->set(array('page' => $iPage, 'size' => $iPageSize, 'count' => $iTotal));
     }
     $this->template()->assign(array('aPages' => $aPages, 'sLink' => $this->url()->makeUrl('pages.add'), 'iCurrentPage' => $iPage, 'iTotalPages' => $iTotal / $iPageSize + 1, 'iTotal' => $iTotal));
 }
 /**
  * Controller
  */
 public function process()
 {
     $iPage = $this->request()->getInt('page');
     $aPages = array(20, 30, 40, 50);
     $aDisplays = array();
     foreach ($aPages as $iPageCnt) {
         $aDisplays[$iPageCnt] = Phpfox::getPhrase('core.per_page', array('total' => $iPageCnt));
     }
     $aFilters = array('search' => array('type' => 'input:text', 'search' => "ANDal.name LIKE '%[VALUE]%'"), 'display' => array('type' => 'select', 'options' => $aDisplays, 'default' => '20'), 'sort' => array('type' => 'select', 'options' => array('time_stamp' => Phpfox::getPhrase('admincp.login_time_stamp'), 'ip_address ' => Phpfox::getPhrase('admincp.ip_address')), 'default' => 'time_stamp', 'alias' => 'al'), 'sort_by' => array('type' => 'select', 'options' => array('DESC' => Phpfox::getPhrase('core.descending'), 'ASC' => Phpfox::getPhrase('core.ascending')), 'default' => 'DESC'));
     $oSearch = Phpfox_Search::instance()->set(array('type' => 'onlineguests', 'filters' => $aFilters, 'search' => 'search'));
     list($iCnt, $aUsers) = Phpfox::getService('core.admincp')->getAdminLogins($oSearch->getConditions(), $oSearch->getSort(), $oSearch->getPage(), $oSearch->getDisplay());
     Phpfox_Pager::instance()->set(array('page' => $iPage, 'size' => $oSearch->getDisplay(), 'count' => $oSearch->getSearchTotal($iCnt)));
     $this->template()->setTitle(Phpfox::getPhrase('admincp.admincp_logins'))->setBreadcrumb(Phpfox::getPhrase('admincp.admincp_logins'))->assign(array('aUsers' => $aUsers));
 }
Пример #16
0
 /**
  * Controller
  */
 public function process()
 {
     if (defined('PHPFOX_IS_AJAX_CONTROLLER')) {
         $aUser = Phpfox::getService('user')->get($this->request()->get('profile_id'));
         $this->setParam('aUser', $aUser);
     }
     $iPageSize = 12;
     $iPage = $this->request()->getInt('page');
     $aUser = $this->getParam('aUser');
     $bMutual = $this->request()->get('req3') == 'mutual' ? true : false;
     if (!Phpfox::getService('user.privacy')->hasAccess($aUser['user_id'], 'friend.view_friend')) {
         return Phpfox_Error::display('<div class="extra_info">' . Phpfox::getService('user')->getFirstName($aUser['full_name']) . ' has closed ' . Phpfox::getService('user')->gender($aUser['gender'], true) . ' friends section.</div>');
     }
     $aFilters = array('sort' => array('type' => 'select', 'options' => array(), 'default' => 'full_name', 'alias' => 'u'), 'sort_by' => array('type' => 'select', 'options' => array('DESC' => Phpfox::getPhrase('core.descending'), 'ASC' => Phpfox::getPhrase('core.ascending')), 'default' => 'ASC'), 'search' => array('type' => 'input:text', 'search' => '(u.full_name LIKE \'%[VALUE]%\' OR u.email LIKE \'%[VALUE]%\') AND', 'size' => '15', 'onclick' => 'Search'));
     $oFilter = Phpfox_Search::instance()->set(array('type' => 'friend', 'filters' => $aFilters, 'search' => 'search'));
     if ($bMutual === true) {
         $oFilter->setCondition('friend.is_page = 0 AND friend.user_id = ' . Phpfox::getUserId());
         $this->template()->setBreadcrumb(Phpfox::getPhrase('friend.mutual_friends'), null, true);
     } else {
         $oFilter->setCondition('friend.is_page = 0 AND friend.user_id = ' . (int) $aUser['user_id']);
         if ($this->request()->get('view')) {
             $this->template()->setBreadcrumb(Phpfox::getPhrase('friend.friends_online'), null, true);
         }
     }
     if (($iListId = $this->request()->getInt('list')) && ($aList = Phpfox::getService('friend.list')->getList($iListId, Phpfox::getUserId())) && isset($aList['list_id'])) {
         $this->search()->setCondition('AND fld.list_id = ' . (int) $aList['list_id'] . ' AND friend.user_id = ' . $aUser['user_id']);
         // $this->template()->setTitle($aList['name'])->setBreadcrumb($aList['name'], $this->url()->makeUrl('friend', array('view' => 'list', 'id' => $iListId)), true);
     }
     list($iCnt, $aFriends) = Friend_Service_Friend::instance()->get($oFilter->getConditions(), $oFilter->getSort(), $oFilter->getPage(), $iPageSize, true, true, $this->request()->get('view') ? true : false, $bMutual === true ? $aUser['user_id'] : null);
     $iCnt = $oFilter->getSearchTotal($iCnt);
     Phpfox_Pager::instance()->set(array('page' => $iPage, 'size' => $iPageSize, 'count' => $iCnt));
     $this->setParam('aTotalFriends', $iCnt);
     $this->template()->setMeta('keywords', Phpfox::getPhrase('friend.full_name_s_friends', array('full_name' => $aUser['full_name'])));
     $this->template()->setMeta('keywords', Phpfox::getParam('friend.friend_meta_keywords'));
     $this->template()->setMeta('description', Phpfox::getPhrase('friend.full_name_is_on_site_title_and_has_total_friends', array('full_name' => $aUser['full_name'], 'site_title' => Phpfox::getParam('core.site_title'), 'total' => $iCnt)));
     if ($iCnt) {
         $sCustomFriends = '';
         foreach ($aFriends as $aFriend) {
             $sCustomFriends .= $aFriend['full_name'] . ', ';
         }
         $sCustomFriends = rtrim($sCustomFriends, ', ');
         $this->template()->setMeta('description', Phpfox::getPhrase('friend.full_name_is_connected_with_friends', array('full_name' => $aUser['full_name'], 'friends' => $sCustomFriends)));
     }
     $this->template()->setMeta('description', Phpfox::getPhrase('friend.sign_up_on_site_title_and_connect_with_full_name_message_full_name_or_add_full_name_as_you', array('site_title' => Phpfox::getParam('core.site_title'), 'full_name' => $aUser['full_name'])));
     if (Phpfox::getUserId() == $aUser['user_id']) {
         // $this->template()->assign('lists', Friend_Service_List_List::instance()->get());
         $this->template()->menu('Manage Friends', $this->url()->makeUrl('friend'));
     }
     $this->template()->setTitle(Phpfox::getPhrase('friend.full_name_s_friends', array('full_name' => $aUser['full_name'])))->setBreadcrumb(Phpfox::getPhrase('friend.friends'))->setHeader('cache', array('pager.css' => 'style_css', 'friend.css' => 'style_css'))->assign(array('aFriends' => $aFriends, 'sFriendView' => $this->request()->get('view'), 'activeList' => $this->request()->get('list')));
 }
Пример #17
0
 /**
  * Controller
  */
 public function process()
 {
     Phpfox::getUserParam('photo.can_view_photos', true);
     $aCond = array();
     if (!Phpfox::getUserParam('photo.can_view_private_photos')) {
         $aCond[] = 'AND pa.view_id = 0 AND  pa.group_id = 0 AND pa.privacy = 0';
     }
     $aCond[] = 'AND pa.total_photo > 0';
     $iPage = $this->request()->getInt('page');
     $iPageSize = 8;
     list($iCnt, $aAlbums) = Phpfox::getService('photo.album')->get($aCond, 'pa.time_stamp DESC', $iPage, $iPageSize);
     Phpfox_Pager::instance()->set(array('page' => $iPage, 'size' => $iPageSize, 'count' => $iCnt));
     $this->template()->setTitle(Phpfox::getPhrase('photo.photo_albums'))->setHeader(array('pager.css' => 'style_css'))->setBreadcrumb(Phpfox::getPhrase('photo.photos'), $this->url()->makeUrl('photo'))->setBreadcrumb(Phpfox::getPhrase('photo.albums'), null, true)->assign(array('aAlbums' => $aAlbums));
 }
Пример #18
0
 /**
  * Controller
  */
 public function process()
 {
     Phpfox::isUser(true);
     if ($iDeleteId = $this->request()->get('id')) {
         if (Phpfox::getService('friend.request.process')->delete($iDeleteId, Phpfox::getUserId())) {
             $this->url()->send('friend.pending', null, Phpfox::getPhrase('friend.friends_request_successfully_deleted'));
         }
     }
     $iPage = $this->request()->getInt('page');
     $iPageSize = 12;
     list($iCnt, $aPendingRequests) = Phpfox::getService('friend.request')->getPending($iPage, $iPageSize);
     Phpfox_Pager::instance()->set(array('page' => $iPage, 'size' => $iPageSize, 'count' => $iCnt));
     Friend_Service_Friend::instance()->buildMenu();
     $this->template()->setTitle('Friends')->setBreadcrumb(Phpfox::getPhrase('friend.my_friends'), $this->url()->makeUrl('friend'));
     $this->template()->setTitle(Phpfox::getPhrase('friend.pending_friend_requests'))->setHeader('cache', array('pager.css' => 'style_css', 'friend.css' => 'style_css'))->assign(array('aPendingRequests' => $aPendingRequests));
 }
Пример #19
0
 /**
  * Controller
  */
 public function process()
 {
     Phpfox::isUser(true);
     $aCheckParams = array('url' => $this->url()->makeUrl('friend'), 'start' => 3, 'reqs' => array('2' => array('accept', 'pending')));
     if (Phpfox::getParam('core.force_404_check') && !Phpfox::getService('core.redirect')->check404($aCheckParams)) {
         return Phpfox_Module::instance()->setController('error.404');
     }
     $iPage = $this->request()->getInt('page');
     $iLimit = Phpfox::getParam('friend.total_requests_display');
     $iRequestId = $this->request()->getInt('id');
     list($iCnt, $aFriends) = Phpfox::getService('friend.request')->get($iPage, $iLimit, $iRequestId);
     Phpfox_Pager::instance()->set(array('page' => $iPage, 'size' => $iLimit, 'count' => $iCnt));
     Friend_Service_Friend::instance()->buildMenu();
     $this->setParam('global_moderation', array('name' => 'friend', 'ajax' => 'friend.moderation', 'menu' => array(array('phrase' => Phpfox::getPhrase('friend.accept'), 'action' => 'accept'), array('phrase' => Phpfox::getPhrase('friend.deny'), 'action' => 'deny'))));
     $this->template()->setTitle(Phpfox::getPhrase('friend.friend_requests'))->setBreadcrumb(Phpfox::getPhrase('friend.friends'), $this->url()->makeUrl('friend'))->assign(array('aFriends' => $aFriends, 'iRequestId' => $iRequestId, 'bIsFriendController' => true));
 }
Пример #20
0
 /**
  * Controller
  */
 public function process()
 {
     $iPage = $this->request()->getInt('page');
     $aPages = array(20, 30, 40, 50);
     $aDisplays = array();
     foreach ($aPages as $iPageCnt) {
         $aDisplays[$iPageCnt] = Phpfox::getPhrase('core.per_page', array('total' => $iPageCnt));
     }
     $aFilters = array('search' => array('type' => 'input:text', 'search' => "AND ls.name LIKE '%[VALUE]%'"), 'display' => array('type' => 'select', 'options' => $aDisplays, 'default' => '20'), 'sort' => array('type' => 'select', 'options' => array('last_activity' => Phpfox::getPhrase('admincp.last_activity'), 'ip_address ' => Phpfox::getPhrase('admincp.ip_address')), 'default' => 'last_activity', 'alias' => 'ls'), 'sort_by' => array('type' => 'select', 'options' => array('DESC' => Phpfox::getPhrase('core.descending'), 'ASC' => Phpfox::getPhrase('core.ascending')), 'default' => 'DESC'));
     $oSearch = Phpfox_Search::instance()->set(array('type' => 'onlineguests', 'filters' => $aFilters, 'search' => 'search'));
     $oSearch->setCondition('AND ls.user_id = 0');
     // The following condition was added to match the function log.session->getOnlineStats
     $oSearch->setCondition('AND ls.last_activity > ' . (PHPFOX_TIME - Phpfox::getParam('log.active_session') * 60));
     list($iCnt, $aGuests) = Phpfox::getService('log')->getOnlineGuests($oSearch->getConditions(), $oSearch->getSort(), $oSearch->getPage(), $oSearch->getDisplay());
     Phpfox_Pager::instance()->set(array('page' => $iPage, 'size' => $oSearch->getDisplay(), 'count' => $oSearch->getSearchTotal($iCnt)));
     $this->template()->setTitle(Phpfox::getPhrase('admincp.online_guests'))->setBreadcrumb(Phpfox::getPhrase('admincp.online'), $this->url()->makeUrl('admincp.core.online-guest'))->setBreadcrumb(Phpfox::getPhrase('admincp.guests_bots'), null, true)->assign(array('aGuests' => $aGuests));
 }
Пример #21
0
 /**
  * Controller
  */
 public function process()
 {
     Phpfox::getUserParam('music.can_access_music', true);
     if (($iDeleteAlbum = $this->request()->getInt('id')) && Phpfox::getService('music.album.process')->delete($iDeleteAlbum)) {
         $this->url()->send('music.browse.album', null, Phpfox::getPhrase('music.album_successfully_deleted'));
     }
     $oServiceSongBrowse = Phpfox::getService('music.album.browse');
     $sView = $this->request()->get('view');
     $this->template()->setTitle(Phpfox::getPhrase('music.music_albums'))->setBreadcrumb(Phpfox::getPhrase('music.music'), $this->url()->makeUrl('music'))->setBreadcrumb(Phpfox::getPhrase('music.albums'), $this->url()->makeUrl('music.browse.album'), true);
     Phpfox::getService('music')->getSectionMenu();
     if (defined('PHPFOX_IS_AJAX_CONTROLLER')) {
         $bIsProfile = true;
         $aUser = Phpfox::getService('user')->get($this->request()->get('profile_id'));
         $this->setParam('aUser', $aUser);
     } else {
         $bIsProfile = $this->getParam('bIsProfile');
         if ($bIsProfile === true) {
             $aUser = $this->getParam('aUser');
         }
     }
     $this->search()->set(array('type' => 'music_album', 'field' => 'm.album_id', 'search_tool' => array('table_alias' => 'm', 'search' => array('action' => $bIsProfile === true ? $this->url()->makeUrl($aUser['user_name'], array('music.album', 'view' => $this->request()->get('view'))) : $this->url()->makeUrl('music.browse.album', array('view' => $this->request()->get('view'))), 'default_value' => Phpfox::getPhrase('music.search_albums'), 'name' => 'search', 'field' => 'm.name'), 'sort' => array('latest' => array('m.time_stamp', Phpfox::getPhrase('music.latest')), 'most-viewed' => array('m.total_view', Phpfox::getPhrase('music.most_viewed')), 'most-liked' => array('m.total_like', Phpfox::getPhrase('music.most_liked')), 'most-talked' => array('m.total_comment', Phpfox::getPhrase('music.most_discussed'))), 'show' => array(10, 20, 30))));
     $aBrowseParams = array('module_id' => 'music.album', 'alias' => 'm', 'field' => 'album_id', 'table' => Phpfox::getT('music_album'), 'hide_view' => array('pending', 'my', 'my-album'));
     switch ($sView) {
         case 'my-album':
             Phpfox::isUser(true);
             $this->search()->setCondition('AND m.user_id = ' . Phpfox::getUserId());
             break;
         default:
             $this->search()->setCondition("AND m.view_id = 0 AND m.privacy IN(%PRIVACY%)");
             if ($sView == 'featured') {
                 $this->search()->setCondition('AND m.is_featured = 1');
             }
             break;
     }
     $this->search()->browse()->params($aBrowseParams)->execute();
     Phpfox_Pager::instance()->set(array('page' => $this->search()->getPage(), 'size' => $this->search()->getDisplay(), 'count' => $this->search()->browse()->getCount()));
     $albums = $this->search()->browse()->getRows();
     foreach ($albums as $key => $album) {
         $albums[$key]['songs'] = Music_Service_Music::instance()->getSongs($album['user_id'], $album['album_id']);
     }
     // d($albums); exit;
     $this->template()->menu('Create an Album', $this->url()->makeUrl('music.album.add'));
     $this->template()->setHeader('cache', array('pager.css' => 'style_css', 'comment.css' => 'style_css', 'feed.js' => 'module_feed', 'browse.css' => 'module_music'))->assign(array('aAlbums' => $albums));
     $this->setParam('global_moderation', array('name' => 'musicalbum', 'ajax' => 'music.moderationAlbum', 'menu' => array(array('phrase' => Phpfox::getPhrase('music.delete'), 'action' => 'delete'), array('phrase' => Phpfox::getPhrase('music.feature'), 'action' => 'feature'), array('phrase' => Phpfox::getPhrase('music.un_feature'), 'action' => 'un-feature'))));
 }
Пример #22
0
 /**
  * Controller
  */
 public function process()
 {
     Phpfox::getUserParam('admincp.can_clear_site_cache', true);
     if ($this->request()->get('unlock')) {
         Phpfox::getLib('cache')->unlock();
         $this->url()->send('admincp.maintain.cache', null, Phpfox::getPhrase('admincp.cache_system_unlocked'));
     }
     if ($this->request()->get('all')) {
         Phpfox_Database::instance()->update(Phpfox::getT('setting'), array('value_actual' => (int) Phpfox::getParam('core.css_edit_id') + 1), 'var_name = \'css_edit_id\'');
         Phpfox::getLib('cache')->remove();
         Phpfox::getLib('template.cache')->remove();
         Phpfox::getLib('cache')->removeStatic();
         $aParams = array('maintain', 'cache', 'clear' => 'done');
         if ($sPlugin = Phpfox_Plugin::get('admincp.component_controller_maintain_1')) {
             eval($sPlugin);
         }
         // $this->url()->send('admincp', $aParams, Phpfox::getPhrase('admincp.cached_cleared'));
         return ['content' => Phpfox::getPhrase('admincp.cached_cleared')];
     }
     if ($aIds = $this->request()->getArray('id')) {
         foreach ($aIds as $sKey => $aItems) {
             foreach ($aItems as $sId) {
                 Phpfox::getLib('cache')->remove($sId, 'path');
             }
         }
         $this->url()->send('admincp', array('maintain', 'cache'), Phpfox::getPhrase('admincp.cached_cleared'));
     }
     $iPage = $this->request()->getInt('page');
     $aPages = array(20, 30, 40, 50);
     $aDisplays = array();
     foreach ($aPages as $iPageCnt) {
         $aDisplays[$iPageCnt] = Phpfox::getPhrase('core.per_page', array('total' => $iPageCnt));
     }
     $aSorts = array('time_stamp' => Phpfox::getPhrase('admincp.timestamp'), 'file_name' => Phpfox::getPhrase('admincp.cache_name'), 'data_size' => Phpfox::getPhrase('admincp.data_size'));
     $aFilters = array('search' => array('type' => 'input:text', 'search' => "AND file_name LIKE '%[VALUE]%'"), 'display' => array('type' => 'select', 'options' => $aDisplays, 'default' => '20'), 'sort' => array('type' => 'select', 'options' => $aSorts, 'default' => 'time_stamp'), 'sort_by' => array('type' => 'select', 'options' => array('DESC' => Phpfox::getPhrase('core.descending'), 'ASC' => Phpfox::getPhrase('core.ascending')), 'default' => 'DESC'));
     $oSearch = Phpfox_Search::instance()->set(array('type' => 'cache', 'filters' => $aFilters, 'search' => 'search'));
     $iLimit = $oSearch->getDisplay();
     list($iCnt, $aCaches) = Phpfox::getLib('cache')->getCachedFiles($oSearch->getConditions(), $oSearch->getSort(), $oSearch->getPage(), $iLimit);
     Phpfox_Pager::instance()->set(array('page' => $iPage, 'size' => $iLimit, 'count' => $oSearch->getSearchTotal($iCnt)));
     if ($this->request()->get('clear')) {
         $aCaches = array();
         $iCnt = 0;
     }
     $this->template()->setTitle('Cache Manager')->setSectionTitle('Cache Manager')->setActionMenu(['Clear Cache' => ['url' => $this->url()->makeUrl('admincp.maintain.cache', ['all' => true]), 'class' => 'popup']])->assign(array('iCacheCnt' => $iCnt, 'aCaches' => $aCaches, 'aStats' => Phpfox::getLib('cache')->getStats(), 'bCacheLocked' => file_exists(PHPFOX_DIR_CACHE . 'cache.lock') ? true : false, 'sUnlockCache' => $this->url()->makeUrl('admincp.maintain.cache', array('unlock' => 'true'))));
 }
Пример #23
0
 /**
  * Controller
  */
 public function process()
 {
     $aModules = Phpfox::massCallback('reparserList');
     foreach ($aModules as $iKey => $aModule) {
         if (!isset($aModule['name'])) {
             unset($aModules[$iKey]);
             $iCnt = 0;
             foreach ($aModule as $iModuleKey => $aCacheModule) {
                 $iCnt++;
                 $aModules = array_merge($aModules, array('custom' . $iCnt => $aCacheModule));
             }
         }
     }
     foreach ($aModules as $iKey => $aModule) {
         if (!isset($aModule['name'])) {
             foreach ($aModule as $iSubKey => $aSub) {
                 $aModules[$iKey . '_' . $iSubKey] = $aSub;
             }
             unset($aModules[$iKey]);
         }
         if (is_array($aModule['table'])) {
             $aModule['table'] = $aModule['table'][0];
         }
         $aModules[$iKey]['total_record'] = Phpfox_Database::instance()->select('COUNT(*)')->from(Phpfox::getT($aModule['table']))->execute('getSlaveField');
         if ($aModules[$iKey]['total_record'] == 0) {
             unset($aModules[$iKey]);
         }
     }
     $iPage = $this->request()->get('page');
     $iLimit = 200;
     if (($sModule = $this->request()->get('module')) && isset($aModules[$sModule])) {
         $iCnt = Phpfox::getService('admincp.maintain')->reParseText($aModules[$sModule], $iPage, $iLimit);
         Phpfox_Pager::instance()->set(array('page' => $iPage, 'size' => $iLimit, 'count' => $iCnt));
         $iTotalPages = (int) Phpfox_Pager::instance()->getTotalPages();
         $iCurrentPage = (int) Phpfox_Pager::instance()->getCurrentPage();
         $iPage = (int) Phpfox_Pager::instance()->getNextPage();
         if ($iTotalPages === $iCurrentPage || $iTotalPages === 0) {
             $this->url()->send('admincp.maintain.reparser', null, Phpfox::getPhrase('admincp.parsing_completed'));
         } else {
             $this->template()->assign(array('bInProcess' => true, 'iCurrentPage' => $iCurrentPage, 'iTotalPages' => $iTotalPages))->setHeader(array('<meta http-equiv="refresh" content="2;url=' . Phpfox_Url::instance()->makeUrl('admincp.maintain.reparser', array('module' => $sModule, 'page' => $iPage)) . '" />'));
         }
     }
     $this->template()->setTitle(Phpfox::getPhrase('admincp.text_reparser'))->setSectionTitle('Content Re-Parser')->assign(array('aReparserLists' => $aModules));
 }
Пример #24
0
 /**
  * Controller
  */
 public function process()
 {
     $iPage = $this->request()->getInt('page');
     $iType = $this->request()->getInt('type', 1);
     $iPageSize = 6;
     if (PHPFOX_IS_AJAX) {
         $aListing = Phpfox::getService('marketplace')->getListing($this->request()->get('id'), true);
         $this->template()->assign('aListing', $aListing);
     } else {
         $aListing = $this->getParam('aListing');
     }
     list($iCnt, $aInvites) = Phpfox::getService('marketplace')->getInvites($aListing['listing_id'], $iType, $iPage, $iPageSize);
     Phpfox_Pager::instance()->set(array('ajax' => 'marketplace.listInvites', 'page' => $iPage, 'size' => $iPageSize, 'count' => $iCnt, 'aParams' => array('id' => $aListing['listing_id'])));
     $this->template()->assign(array('aInvites' => $aInvites, 'iType' => $iType));
     if (!PHPFOX_IS_AJAX) {
         $this->template()->assign(array('sHeader' => Phpfox::getPhrase('marketplace.invites'), 'sBoxJsId' => 'marketplace_members'));
         $this->template()->assign(array('aMenu' => array(Phpfox::getPhrase('marketplace.visited') => '#marketplace.listInvites?type=1&amp;id=' . $aListing['listing_id'], Phpfox::getPhrase('marketplace.not_responded') => '#marketplace.listInvites?type=0&amp;id=' . $aListing['listing_id'])));
         return 'block';
     }
 }
Пример #25
0
 /**
  * Controller
  */
 public function process()
 {
     if ($aDeleteIds = $this->request()->getArray('id')) {
         if (Phpfox::getService('blog.category.process')->deleteMultiple($aDeleteIds)) {
             $this->url()->send('admincp.blog', null, Phpfox::getPhrase('blog.categories_successfully_deleted'));
         }
     }
     $iPage = $this->request()->getInt('page');
     $aPages = array(5, 10, 15, 20);
     $aDisplays = array();
     foreach ($aPages as $iPageCnt) {
         $aDisplays[$iPageCnt] = Phpfox::getPhrase('core.per_page', array('total' => $iPageCnt));
     }
     $aSorts = array('added' => Phpfox::getPhrase('core.time'), 'used' => Phpfox::getPhrase('blog.most_used'));
     $aFilters = array('search' => array('type' => 'input:text', 'search' => "AND c.name LIKE '%[VALUE]%'"), 'user' => array('type' => 'input:text', 'search' => "AND u.user_name LIKE '%[VALUE]%'"), 'display' => array('type' => 'select', 'options' => $aDisplays, 'default' => '10'), 'created_by' => array('type' => 'select', 'options' => array(array(Phpfox::getPhrase('blog.users'), "AND c.user_id != 0"), array(Phpfox::getPhrase('blog.system'), "AND c.user_id = 0")), 'add_select' => true), 'sort' => array('type' => 'select', 'options' => $aSorts, 'default' => 'added', 'alias' => 'c'), 'sort_by' => array('type' => 'select', 'options' => array('DESC' => Phpfox::getPhrase('core.descending'), 'ASC' => Phpfox::getPhrase('core.ascending')), 'default' => 'DESC'));
     $oSearch = Phpfox_Search::instance()->set(array('type' => 'categories', 'filters' => $aFilters, 'search' => 'search'));
     $iLimit = $oSearch->getDisplay();
     list($iCnt, $aCategories) = Phpfox::getService('blog.category')->get($oSearch->getConditions(), $oSearch->getSort(), $oSearch->getPage(), $iLimit);
     Phpfox_Pager::instance()->set(array('page' => $iPage, 'size' => $iLimit, 'count' => $oSearch->getSearchTotal($iCnt)));
     $this->template()->setTitle(Phpfox::getPhrase('blog.blog'))->setBreadcrumb(Phpfox::getPhrase('blog.blog'), $this->url()->makeUrl('admincp.blog'))->assign(array('aCategories' => $aCategories))->setHeader('cache', array('quick_edit.js' => 'static_script'));
 }
Пример #26
0
 /**
  * Controller
  */
 public function process()
 {
     if ($iDeleteId = $this->request()->getInt('delete')) {
         if (Phpfox::getService('subscribe.purchase.process')->delete($iDeleteId)) {
             $this->url()->send('admincp.subscribe.list', null, Phpfox::getPhrase('subscribe.purchase_order_successfully_deleted'));
         }
     }
     $aPages = array(20, 30, 40, 50);
     $aDisplays = array();
     foreach ($aPages as $iPageCnt) {
         $aDisplays[$iPageCnt] = Phpfox::getPhrase('core.per_page', array('total' => $iPageCnt));
     }
     $sStatus = $this->request()->get('status');
     $aSorts = array('time_stamp' => Phpfox::getPhrase('subscribe.time'), 'status' => Phpfox::getPhrase('subscribe.status'), 'price' => Phpfox::getPhrase('subscribe.price'));
     $aFilters = array('package' => array('type' => 'input:text', 'search' => 'AND sp.package_id = \'[VALUE]\''), 'status' => array('type' => 'select', 'options' => array('completed' => Phpfox::getPhrase('subscribe.active'), 'cancel' => Phpfox::getPhrase('subscribe.canceled'), 'pending' => Phpfox::getPhrase('subscribe.pending_payment'), 'pendingaction' => Phpfox::getPhrase('subscribe.pending_action')), 'add_any' => true, 'search' => $sStatus == 'pendingaction' ? 'AND (sp.status IS NULL OR sp.status = \'\')' : 'AND sp.status = \'[VALUE]\''), 'display' => array('type' => 'select', 'options' => $aDisplays, 'default' => '12'), 'sort' => array('type' => 'select', 'options' => $aSorts, 'default' => 'time_stamp', 'alias' => 'sp'), 'sort_by' => array('type' => 'select', 'options' => array('DESC' => Phpfox::getPhrase('core.descending'), 'ASC' => Phpfox::getPhrase('core.ascending')), 'default' => 'DESC'));
     $oFilter = Phpfox_Search::instance()->live()->setRequests()->set(array('type' => 'subscribe', 'filters' => $aFilters, 'redirect' => true, 'redirect_url' => 'admincp.subscribe.list'));
     $iPage = $this->request()->getInt('page');
     $iPageSize = $oFilter->getDisplay();
     list($iCnt, $aPurchases) = Phpfox::getService('subscribe.purchase')->getSearch($oFilter->getConditions(), $oFilter->getSort(), $oFilter->getPage(), $iPageSize);
     $iCnt = $oFilter->getSearchTotal($iCnt);
     Phpfox_Pager::instance()->set(array('page' => $iPage, 'size' => $iPageSize, 'count' => $iCnt));
     $this->template()->setTitle(Phpfox::getPhrase('subscribe.subscription_purchase_orders'))->setBreadcrumb(Phpfox::getPhrase('subscribe.subscription_packages'), $this->url()->makeUrl('admincp.subscribe'))->setBreadcrumb(Phpfox::getPhrase('subscribe.purchase_orders'), $this->url()->makeUrl('admincp.subscribe.list'), true)->assign(array('aPurchases' => $aPurchases, 'bIsSearching' => $oFilter->isSearching()));
 }
Пример #27
0
 /**
  * Controller
  */
 public function process()
 {
     $aModules = Phpfox::massCallback('updateCounterList');
     $iLimit = 100;
     $iPage = $this->request()->getInt('page');
     $bRefresh = false;
     $iTotalPages = 0;
     $iCurrentPage = 0;
     if ($sModule = $this->request()->get('module')) {
         $iCnt = Phpfox::callback($sModule . '.updateCounter', $this->request()->get('id'), $iPage, $iLimit);
         if ($iCnt !== false) {
             Phpfox_Pager::instance()->set(array('page' => $iPage, 'size' => $iLimit, 'count' => $iCnt));
             $iTotalPages = (int) Phpfox_Pager::instance()->getTotalPages();
             $iCurrentPage = (int) Phpfox_Pager::instance()->getCurrentPage();
             $iPage = (int) Phpfox_Pager::instance()->getNextPage();
             if ($iTotalPages === $iCurrentPage || $iTotalPages === 0) {
                 $this->url()->send('admincp.maintain.counter', null, Phpfox::getPhrase('admincp.update_of_counter_successfully_completed'));
             } else {
                 $bRefresh = true;
                 $this->template()->setHeader('<meta http-equiv="refresh" content="2;url=' . $this->url()->makeUrl('admincp.maintain.counter', array('module' => $sModule, 'page' => $iPage, 'id' => $this->request()->get('id'))) . '">');
             }
         }
     }
     $aLists = array();
     $iSubCount = 0;
     foreach ($aModules as $sModule => $aList) {
         if (isset($aList['name'])) {
             $aList = array($aList);
         }
         foreach ($aList as $mKey => $aItem) {
             $iSubCount++;
             $aList[$mKey]['count'] = $iSubCount;
         }
         $aLists[$sModule] = $aList;
     }
     $this->template()->setTitle(Phpfox::getPhrase('admincp.update_counters'))->setSectionTitle(Phpfox::getPhrase('admincp.update_counters'))->assign(array('aLists' => $aLists, 'bRefresh' => $bRefresh, 'iTotalPages' => $iTotalPages, 'iCurrentPage' => $iCurrentPage));
 }
Пример #28
0
 public function process()
 {
     Phpfox::getUserParam('mail.can_read_private_messages', true);
     if ($iDeleteId = $this->request()->getInt('delete')) {
         if (Mail_Service_Process::instance()->adminDelete($iDeleteId)) {
             $this->url()->send('admincp.mail.private', null, Phpfox::getPhrase('mail.message_successfully_deleted'));
         }
     }
     $aPages = array(12, 15, 18, 21);
     $aDisplays = array();
     foreach ($aPages as $iPageCnt) {
         $aDisplays[$iPageCnt] = Phpfox::getPhrase('core.per_page', array('total' => $iPageCnt));
     }
     $aUserGroups = array();
     foreach (Phpfox::getService('user.group')->get() as $aUserGroup) {
         $aUserGroups[$aUserGroup['user_group_id']] = $aUserGroup['title'];
     }
     $aAge = array();
     for ($i = 18; $i <= 68; $i++) {
         $aAge[$i] = $i;
     }
     if (Phpfox::getParam('mail.threaded_mail_conversation')) {
         $aOptions = array('1' => array(Phpfox::getPhrase('mail.text'), "AND mt.text LIKE '%[VALUE]%'"));
     } else {
         $aOptions = array('1' => array(Phpfox::getPhrase('mail.subject_amp_text'), "AND (m.subject LIKE '%[VALUE]%' OR mt.text_parsed LIKE '%[VALUE]%')"), '2' => array(Phpfox::getPhrase('mail.subject'), "AND m.subject LIKE '%[VALUE]%'"), '3' => array(Phpfox::getPhrase('mail.text'), "AND mt.text LIKE '%[VALUE]%'"));
     }
     $iDay = date('d');
     $iMonth = date('m');
     $iYear = date('Y');
     $aFilters = array('display' => array('type' => 'select', 'options' => $aDisplays, 'default' => '12'), 'sort' => array('type' => 'select', 'options' => array(), 'default' => 'time_updated', 'alias' => 'm'), 'sort_by' => array('type' => 'select', 'options' => array('DESC' => Phpfox::getPhrase('core.descending'), 'ASC' => Phpfox::getPhrase('core.ascending')), 'default' => 'DESC'), 'keyword' => array('type' => 'input:text', 'size' => 20), 'type' => array('type' => 'input:radio', 'default_view' => '1', 'prefix' => '<div>', 'suffix' => '</div>', 'options' => $aOptions, 'depend' => 'keyword'), 'group' => array('type' => 'select', 'options' => $aUserGroups, 'add_any' => true, 'search' => 'AND sender.user_group_id = \'[VALUE]\''), 'status' => array('type' => 'select', 'options' => array('1' => Phpfox::getPhrase('mail.all_members'), '2' => Phpfox::getPhrase('mail.featured_members')), 'default_view' => '1', 'search' => 'FEATURED_[VALUE]'), 'view' => array('type' => 'input:radio', 'options' => array('online' => Phpfox::getPhrase('mail.online'), 'updated' => Phpfox::getPhrase('mail.updated'))), 'show' => array('type' => 'select', 'options' => array('1' => Phpfox::getPhrase('mail.name_and_photo_only'), '2' => Phpfox::getPhrase('mail.name_photo_and_users_details')), 'default_view' => Phpfox::getParam('user.user_browse_display_results_default') == 'name_photo_detail' ? '2' : '1'), 'sender' => array('type' => 'input:text', 'size' => 20, 'search' => 'SENDER=\'[VALUE]\''), 'receiver' => array('type' => 'input:text', 'size' => 20, 'search' => 'RECEIVER=\'[VALUE]\''));
     $oFilter = Phpfox_Search::instance()->set(array('type' => 'browse', 'filters' => $aFilters, 'search' => 'keyword'));
     $iPage = $this->request()->getInt('page', 1);
     define('PHPFOX_IS_PRIVATE_MAIL', true);
     list($aMessages, $iCnt) = Mail_Service_Mail::instance()->getPrivate($oFilter->getConditions(), 10, $oFilter->getSort(), $iPage);
     Phpfox_Pager::instance()->set(array('page' => $iPage, 'size' => 10, 'count' => $oFilter->getSearchTotal($iCnt)));
     $this->template()->setTitle(Phpfox::getPhrase('mail.private_messages'))->setHeader('cache', array('mail.css' => 'style_css'))->setBreadCrumb(Phpfox::getPhrase('mail.private_messages'))->setBreadcrumb(Phpfox::getPhrase('mail.view_private_messages'), null, true)->assign(array('aMessages' => $aMessages));
 }
Пример #29
0
 /**
  * Controller
  */
 public function process()
 {
     $bIsEdit = false;
     if ($sLangId = $this->request()->get('id')) {
         if (($aLanguage = Phpfox::getService('language')->getLanguage($sLangId)) && isset($aLanguage['language_id'])) {
             $bIsEdit = true;
             $this->template()->assign(array('aForms' => $aLanguage));
         }
     }
     if ($sLanguageId = $this->request()->get('import-phrase')) {
         $iPage = $this->request()->getInt('page', 0);
         $iLimit = 500;
         $iCnt = Phpfox::getService('language.phrase.process')->importPhrases($sLanguageId, $iPage, $iLimit);
         Phpfox_Pager::instance()->set(array('page' => $iPage, 'size' => $iLimit, 'count' => $iCnt));
         $iTotalPages = (int) Phpfox_Pager::instance()->getTotalPages();
         $iCurrentPage = (int) Phpfox_Pager::instance()->getCurrentPage();
         $iPage = (int) Phpfox_Pager::instance()->getNextPage();
         if ($iTotalPages === $iCurrentPage || $iTotalPages === 0) {
             $this->url()->send('admincp.language', null, Phpfox::getPhrase('language.language_package_successfully_added'));
         }
         $this->template()->setHeader('<meta http-equiv="refresh" content="2;url=' . $this->url()->makeUrl('admincp.language.add', array('import-phrase' => $sLanguageId, 'page' => $iPage)) . '">')->assign(array('bImportingPhrases' => true, 'iCurrentPage' => $iCurrentPage, 'iTotalPages' => $iTotalPages));
     } else {
         if ($aVals = $this->request()->getArray('val')) {
             if ($bIsEdit) {
                 if (Phpfox::getService('language.process')->update($sLangId, $aVals)) {
                     $this->url()->send('admincp.language.add', array('id' => $sLangId), Phpfox::getPhrase('language.language_package_successfully_updated'));
                 }
             } else {
                 if ($sLanguageId = Phpfox::getService('language.process')->add($aVals)) {
                     $this->url()->send('admincp.language.add', array('import-phrase' => $sLanguageId));
                 }
             }
         }
     }
     $this->template()->setTitle($bIsEdit ? Phpfox::getPhrase('language.editing_language_package') . ': ' . $aLanguage['title'] : Phpfox::getPhrase('language.create_a_new_language_package'))->setBreadcrumb($bIsEdit ? Phpfox::getPhrase('language.editing_language_package') . ': ' . $aLanguage['title'] : Phpfox::getPhrase('language.create_language_package'), $this->url()->current(), true)->assign(array('aLanguages' => Phpfox::getService('language')->getAll(), 'bIsEdit' => $bIsEdit));
 }
Пример #30
0
 /**
  * Controller
  */
 public function process()
 {
     Phpfox::isUser(true);
     $iPageSize = 10;
     $iPage = $this->request()->getInt('page');
     $bIsSearch = false;
     $aCond = array();
     $aCond[] = 'AND friend.user_id = ' . Phpfox::getUserId();
     if (($sSearch = $this->request()->get('search')) || $this->request()->get('search-query')) {
         if ($this->request()->get('search-query')) {
             $sSearch = Phpfox::getLib('session')->get('mfsearch');
         }
         $bIsSearch = true;
         $aCond[] = "AND (u.full_name LIKE '%" . Phpfox_Database::instance()->escape($sSearch) . "%' OR u.email LIKE '%" . Phpfox_Database::instance()->escape($sSearch) . "%' OR u.user_name LIKE '%" . Phpfox_Database::instance()->escape($sSearch) . "%')";
         $this->url()->setParam('search-query', 'true');
         Phpfox::getLib('session')->set('mfsearch', $sSearch);
     }
     if ($bIsSearch == false) {
         Phpfox::getLib('session')->remove('mfsearch');
     }
     list($iCnt, $aFriends) = Friend_Service_Friend::instance()->get($aCond, 'u.full_name ASC', $iPage, $iPageSize);
     Phpfox_Pager::instance()->set(array('page' => $iPage, 'size' => $iPageSize, 'count' => $iCnt));
     $this->template()->assign(array('aFriends' => $aFriends, 'bMobileFriendIsActive' => true, 'bIsSearch' => $bIsSearch, 'bIsFriendSelect' => $this->request()->get('req2') == 'select' ? true : false));
 }