예제 #1
0
 public static function validateCat($arg, $allowZero = true)
 {
     if ($arg == 0 && $allowZero || GWF_Category::categoryExists($arg)) {
         return false;
     }
     return GWF_Module::loadModuleDB('Cateogry', false, true)->lang('err_cat');
 }
예제 #2
0
파일: Add.php 프로젝트: sinfocol/gwf3
 public function validate_catid(Module_News $module, $catid)
 {
     $catid = (int) $catid;
     if ($catid === 0) {
         return false;
     }
     if (!GWF_Category::categoryExists($catid)) {
         return $this->module->lang('err_cat');
     }
     return false;
 }
예제 #3
0
파일: GWF_News.php 프로젝트: sinfocol/gwf3
 public static function getNews($amount, $catid = 0, $page = 1, $orderby = 'news_date DESC', $hidden = true)
 {
     $catid = (int) $catid;
     $catid = GWF_Category::categoryExists($catid) ? $catid : 0;
     $catQuery = $catid === 0 ? '1' : "news_catid='{$catid}'";
     $hiddenQuery = $hidden === true ? '1' : 'news_options&1=0';
     $condition = "({$catQuery}) AND ({$hiddenQuery})";
     $from = GWF_PageMenu::getFrom($page, $amount);
     return GDO::table(__CLASS__)->selectObjects('*', $condition, $orderby, $amount, $from);
 }