[6] | 1 | <?php |
---|
| 2 | |
---|
| 3 | class dc_spotlights extends data |
---|
| 4 | { |
---|
| 5 | |
---|
| 6 | function spotlights($start = 0) |
---|
| 7 | { return $this->contenus(array("spotlights"), $start); |
---|
| 8 | } |
---|
| 9 | |
---|
| 10 | function spotlight($id = null) |
---|
| 11 | { if |
---|
| 12 | ( ( $contenus = $this->contenus |
---|
| 13 | ( array("spotlights"), |
---|
| 14 | 0, |
---|
| 15 | 1, |
---|
| 16 | isset($id) ? |
---|
| 17 | " AND #--contenus.id=".$this->eq($id) |
---|
| 18 | : " AND public=1 AND date_publication <= NOW()" |
---|
| 19 | ) |
---|
| 20 | ) !== false |
---|
| 21 | ) |
---|
| 22 | { $spotlight = (($spotlight = current($contenus["list"])) !== false ? $spotlight : (isset($id) ? false : array())); |
---|
| 23 | return $spotlight; |
---|
| 24 | } |
---|
| 25 | return false; |
---|
| 26 | } |
---|
| 27 | |
---|
| 28 | function add_spotlight($titre, $contenu, $auteur, $date_publication, $public) |
---|
| 29 | { if(($id_categorie = $this->id_categorie(array("spotlights"))) !== false) |
---|
| 30 | { if(isset($id_categorie)) |
---|
| 31 | { return $this->add_contenu("", $id_categorie, $titre, "", $contenu, $auteur, $date_publication, $public); |
---|
| 32 | } |
---|
| 33 | } |
---|
| 34 | return false; |
---|
| 35 | } |
---|
| 36 | |
---|
| 37 | function set_spotlight($id, $titre, $contenu, $auteur, $date_publication, $public) |
---|
| 38 | { if(($id_categorie = $this->id_categorie(array("spotlights"))) !== false) |
---|
| 39 | { if(isset($id_categorie)) |
---|
| 40 | { return $this->set_contenu($id, "", $id_categorie, $titre, "", $contenu, $auteur, $date_publication, $public); |
---|
| 41 | } |
---|
| 42 | } |
---|
| 43 | return false; |
---|
| 44 | } |
---|
| 45 | |
---|
| 46 | function del_spotlight($id) |
---|
| 47 | { return $this->del_contenu($id); |
---|
| 48 | } |
---|
| 49 | |
---|
| 50 | } |
---|
| 51 | |
---|
| 52 | ?> |
---|