1 | <?php |
---|
2 | |
---|
3 | class da_news extends data |
---|
4 | { |
---|
5 | |
---|
6 | function artiste_news($id_artiste, $start = 0, $public = false, $max = null, $id_contenu = null) |
---|
7 | { if(isset($id_contenu)) |
---|
8 | { if(($contenu = $this->contenu($id_contenu)) !== false) |
---|
9 | { return array |
---|
10 | ( "total" => 1, |
---|
11 | "list" => array($contenu["id"] => $contenu) |
---|
12 | ); |
---|
13 | } |
---|
14 | return false; |
---|
15 | } |
---|
16 | return $this->contenus |
---|
17 | ( array("root", "artistes", "news", $id_artiste), |
---|
18 | $start, |
---|
19 | $max, |
---|
20 | ($public ? " AND public=1 AND date_publication <= NOW()" : ""), |
---|
21 | 0 |
---|
22 | ); |
---|
23 | } |
---|
24 | |
---|
25 | function add_artiste_news($id_artiste, $id_user, $titre, $contenu, $date_publication, $public) |
---|
26 | { if(($id_categorie = $this->id_categorie(array("root", "artistes", "news", $id_artiste))) !== false) |
---|
27 | { if(!isset($id_categorie)) |
---|
28 | { if(($id_artiste_news_root = $this->id_categorie(array("root", "artistes", "news"))) !== false) |
---|
29 | { if(($id_categorie = $this->add_categorie($id_artiste, null, null, null, "", $id_artiste_news_root)) === false) return false; |
---|
30 | } |
---|
31 | else return false; |
---|
32 | } |
---|
33 | return $this->add_contenu(null, $id_categorie, $titre, "", $contenu, $id_user, $date_publication, $public); |
---|
34 | } |
---|
35 | return false; |
---|
36 | } |
---|
37 | |
---|
38 | function set_artiste_news($id_artiste, $id_user, $id, $titre, $contenu, $date_publication, $public) |
---|
39 | { if(($id_categorie = $this->id_categorie(array("root", "artistes", "news", $id_artiste))) !== false) |
---|
40 | { return $this->set_contenu($id, null, $id_categorie, $titre, "", $contenu, $id_user, $date_publication, $public); |
---|
41 | } |
---|
42 | return false; |
---|
43 | } |
---|
44 | |
---|
45 | function del_artiste_news($id) |
---|
46 | { return $this->del_contenu($id); |
---|
47 | } |
---|
48 | |
---|
49 | } |
---|
50 | |
---|
51 | ?> |
---|