00001 <? 00008 class BaseForumThreads extends MyManager 00009 { 00013 public function __construct($class = 'Thread') 00014 { 00015 parent::__construct($class, 30); 00016 } 00017 00021 public function getSearchParamXml() 00022 { 00023 $xml = parent::getSearchParamXml(); 00024 00025 $xml .= '<param name="forum_id" type="int" />'; 00026 00027 return $xml; 00028 } 00029 00033 public function getSearchWhere($params) 00034 { 00035 $sql = parent::getSearchWhere($params); 00036 00037 if ($params['forum_id']) 00038 $sql .= " AND forum_id = '$params[forum_id]' "; 00039 00040 return $sql; 00041 } 00042 00046 public function getSearchOrder($params) 00047 { 00048 if (!$params['sort']) 00049 { 00050 $params['sort'] = 'edit_date'; 00051 $params['order'] = 'desc'; 00052 } 00053 return parent::getSearchOrder($params); 00054 } 00055 00059 public function drawRows($rs) 00060 { 00061 if (count($rs)) 00062 { 00063 echo "<table class=\"forumThreads\">"; 00064 $this->object->drawHeaderRow(); 00065 00066 foreach ($rs AS $obj) 00067 $obj->drawRow(); 00068 00069 echo "</table>"; 00070 } 00071 else 00072 echo "<p>No threads found."; 00073 } 00074 } 00075 ?>