Exemplo n.º 1
0
 public function process()
 {
     $affiliate = new \model\affiliate($this->getDbconnection());
     if (!is_null($this->getRequestVar('submsave')) && !is_null($this->getRequestVar('antiSpamAnswer'))) {
         if ($this->getRequestVar('antiSpamAnswer') === $this->getSysconfig()->getAntispamAnswer()) {
             $data = $this->getRequestVar('affiliate');
             foreach ($data as $key => $value) {
                 $data[$key] = $this->filterRequest($value, array(1, 4, 7));
             }
             $affiliate->setPageName($data['pageName']);
             $affiliate->setPageUrl($data['pageUrl']);
             $affiliate->setPageAdminName($data['pageAdminName']);
             $affiliate->setPageAdminEmail($data['pageAdminEmail']);
             $affiliate->setPageButton($data['pageButton']);
             $affiliate->setAffiliateCategory($data['affiliateCategory']);
             $affiliate->setAffiliateAddedTime(time());
             $affiliate->setAffiliateEditedTime(0);
             $affiliate->setAffiliateIsMarked(0);
             $affiliate->setAffiliateIsAccpted(0);
             if ($affiliate->save()) {
                 \messages::registerNotice(\language::returnLanguageConstant('APPLY_OK'));
                 $catgory = new \model\category($this->dbconnection, $affiliate->getAffiliateCategory());
                 $mailData = array('mailTo' => $this->getSysconfig()->getAdminMail(), 'mailSubject' => \language::replaceLanguageConstant(\language::returnLanguageConstant('APPLY_MAIL_SUBJECT'), array('{{affiliateKategory}}' => $catgory->getName())), 'mailText' => \language::replaceLanguageConstant(\language::returnLanguageConstant('APPLY_MAIL_TEXT'), array('{{name}}' => $affiliate->getPageAdminName(), '{{page}}' => $affiliate->getPageUrl(), '{{affiliateKategory}}' => $catgory->getName(), '{{acpLink}}' => \base_config::$rootPath)), 'mailFrom' => $affiliate->getPageAdminEmail());
                 \messages::sendEMail($mailData);
             } else {
                 \messages::registerError(\language::returnLanguageConstant('APPLY_FAILED'));
             }
             $affiliate = new \model\affiliate($this->getDbconnection());
         } else {
             \messages::registerError(\language::returnLanguageConstant('APPLY_FAILED_SPAM'));
         }
     }
     $categoryList = new \model\category_list($this->getDbconnection(), false);
     $categories = array();
     foreach ($categoryList->getCategories() as $category) {
         $categories[$category->getName()] = $category->getId();
     }
     $view = new \model\view_public('apply_form');
     $view->assign('affiliate', $affiliate);
     $view->assign('categories', $categories);
     $view->assign('antiSpamQuestion', $this->getSysconfig()->getAntispamQuestion());
     $view->assign('isNotUtf8', $this->isNotUtf8);
     $view->assign('systemVersion', $this->getSysconfig()->getSysVersion());
     $view->setReturnRender($this->returnRender);
     if ($this->returnRender) {
         $data = $view->render();
         return $data;
     }
     $view->render();
 }
Exemplo n.º 2
0
 public function process()
 {
     $fileList = new \model\file_list(\base_config::$bannerDir);
     $view = new \model\view_public('banner_list');
     $view->assign('fileList', $fileList->getFileList());
     $view->assign('maxSize', $this->maxSize);
     $view->assign('isNotUtf8', $this->isNotUtf8);
     $view->assign('systemVersion', $this->getSysconfig()->getSysVersion());
     $view->setReturnRender($this->returnRender);
     if ($this->returnRender) {
         $data = $view->render();
         return $data;
     }
     $view->render();
 }
Exemplo n.º 3
0
 public function process()
 {
     $affiliates = new \model\affiliate_list($this->getDbconnection(), $this->categoryId, $this->acceptedOnly, $this->textOnly);
     $view = new \model\view_public($this->viewName);
     if (count($affiliates->getAffiliates()) > 0) {
         $view->assign('affiliates', $affiliates->getAffiliates());
     } else {
         $view->assign('notaffiliates', true);
     }
     $category = new \model\category($this->getDbconnection(), $this->categoryId);
     $value = $this->openBlank ? 'target="_blank"' : '';
     $categoryName = $this->textOnly == 2 ? $category->getName() . '-text' : $category->getName();
     $view->assign('linkTarget', $value);
     $view->assign('categoryNameClass', strtolower($categoryName));
     $view->assign('showastext', $this->textOnly);
     $view->assign('isNotUtf8', $this->isNotUtf8);
     $view->assign('systemVersion', $this->getSysconfig()->getSysVersion());
     $view->setReturnRender($this->returnRender);
     if ($this->returnRender) {
         $data = $view->render();
         return $data;
     }
     $view->render();
 }