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'); }
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; }
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); }