示例#1
0
 public function rating()
 {
     /*** JS File Only to Members. For its part, the Rating System will redirect the visitors who are not connected to the registration form. ***/
     if (UserCore::auth()) {
         $this->design->addJs(PH7_LAYOUT . PH7_SYS . PH7_MOD . $this->registry->module . PH7_SH . PH7_TPL . PH7_TPL_MOD_NAME . PH7_SH . PH7_JS, 'script.js');
     }
     /*** Meta Tags ***/
     /**
      * @internal We can include HTML tags in the title since the template will erase them before display.
      */
     $sMenDesc = t('You men!') . '<br />' . t('Vote for the most beautiful women, the sexiest and hottest online dating free site!');
     $sWomenDesc = t('You women!') . '<br />' . t('Vote for the best men, the sexiest and hottest free online dating site!');
     $this->view->page_title = t('Hot On Not - Free Online Dating Site');
     $this->view->meta_description = $sMenDesc . ' ' . $sWomenDesc;
     $this->view->meta_keywords = t('hot, hot or not, hotornot, sexy, rate, rating, voting, women, free, dating, speed dating, flirt');
     $this->view->desc_for_man = $sMenDesc;
     $this->view->desc_for_woman = $sWomenDesc;
     /*** Display ***/
     // If the user is connected, we do not display its own avarar since this user can not vote for himself.
     $iProfileId = UserCore::auth() ? $this->session->get('member_id') : null;
     $oData = $this->oHoNModel->getPicture($iProfileId);
     if (empty($oData)) {
         Framework\Http\Http::setHeadersByCode(404);
         $this->view->error = t('Sorry, We did not find the photo to Hot Or Not Party.');
     } else {
         $this->view->avatarDesign = new AvatarDesignCore();
         // Avatar Design Class
         $this->view->data = $oData;
     }
     $this->output();
 }
 public function __construct()
 {
     parent::__construct();
     if (!Framework\Api\Tool::checkAccess($this->config, $this->httpRequest)) {
         Framework\Http\Http::setHeadersByCode(403);
         exit('Your API key and/or the URL of your external application don\'t match with the one in the pH7CMS\'s configuration system!');
     }
 }
示例#3
0
 protected function clearCache()
 {
     switch ($this->httpRequest->post('type')) {
         case 'general':
             $this->file->deleteDir(PH7_PATH_CACHE . Framework\Cache\Cache::CACHE_DIR);
             break;
         case 'tpl_compile':
             $this->file->deleteDir(PH7_PATH_CACHE . Framework\Layout\Tpl\Engine\PH7Tpl\PH7Tpl::COMPILE_DIR);
             break;
         case 'tpl_html':
             $this->file->deleteDir(PH7_PATH_CACHE . Framework\Layout\Tpl\Engine\PH7Tpl\PH7Tpl::CACHE_DIR);
             break;
         case 'static':
             $this->file->deleteDir(PH7_PATH_CACHE . Framework\Layout\Gzip\Gzip::CACHE_DIR);
             break;
         default:
             Framework\Http\Http::setHeadersByCode(400);
             exit('Bad Request Error');
     }
     echo jsonMsg(1, t('The cache has been deleted!'));
 }
示例#4
0
 public function __construct()
 {
     parent::__construct();
     if (!(new Framework\Security\CSRF\Token())->check('friend')) {
         exit(jsonMsg(0, Form::errorTokenMsg()));
     }
     $this->_oFriendModel = new FriendModel();
     switch ($this->httpRequest->post('type')) {
         case 'add':
             $this->add();
             break;
         case 'approval':
             $this->approval();
             break;
         case 'delete':
             $this->delete();
             break;
         default:
             Framework\Http\Http::setHeadersByCode(400);
             exit('Bad Request Error!');
     }
 }