Exemplo n.º 1
0
 public function GetArticleList($Fields = NULL, $Page = 0, $Perpage = 10)
 {
     global $objDb;
     if ($Fields == NULL) {
         $Fields = array("article" => array("id", "title", "uid", "date"), "user" => array("name"));
     }
     /* page management */
     $Offset = $Page * $Perpage;
     $Rows = $objDb->Select($Fields, array("mod_at_articles" => "article", "users" => array("LEFT JOIN", "user", "user.id = article.uid")), "LIMIT " . $Offset . ", " . $Perpage);
     if ($Rows == 0) {
         return false;
     }
     $Data = array();
     $i = 0;
     while ($x = $objDb->FetchArray()) {
         foreach ($x as $Key => $Field) {
             if ($Key == "date") {
                 $Data[$i][$Key] = Main_Dateformat($Field);
             } else {
                 $Data[$i][$Key] = stripslashes($Field);
             }
         }
         $i++;
     }
     return $Data;
 }
Exemplo n.º 2
0
 public function GetNews($Id, $Fields = array("News" => array("id", "title", "content", "uid", "date"), "user" => array("name")))
 {
     global $objDb;
     $Rows = $objDb->Select($Fields, array("mod_nw_news" => "News", "users" => array("LEFT JOIN", "user", "user.id = News.uid")), "WHERE News.`id` = '" . $Id . "'");
     if ($Rows == 0) {
         return false;
     }
     $Data = $objDb->FetchArray();
     foreach ($Data as $Key => $Field) {
         if ($Key == "date") {
             $Data[$Key] = Main_Dateformat($Field);
         } else {
             $Data[$Key] = stripslashes($Field);
         }
     }
     return $Data;
 }