<?php
- class sml_data_authors extends mw_data
- {
+ class sml_data_authors extends mw_data{
# ----------------------------------------------------------------------------------------
# groupes
#
- function groupes($id_user = null, $start = null, $alpha = null){
+ public function groupes($id_user = null, $start = null, $alpha = null){
$sgbd = $this->sgbd();
$env = $this->env();
$groupes = array("list" => array(), "total" => 0);
$sql = "SELECT * FROM(".$SELECT.$FROM.$WHERE.$LIMIT.") res";
$rst = $sgbd->query($sql);
while($v_rst = $sgbd->fetch_assoc($rst)){
+ if(!isset($v_rst["image"])) $v_rst["image"] = "";
$groupes["list"][$v_rst["id"]] = $v_rst;
$groupes["list"][$v_rst["id"]]["image_uri"] = (
$v_rst["image"] ?
return $groupes;
}
- function groupe($id){
+ public function groupe($id){
$sgbd = $this->sgbd();
$env = $this->env();
$groupe = array();
$sql = "SELECT * from #--sml_authors WHERE id=".$this->eq($id);
$rst = $sgbd->query($sql);
if($v_rst = $sgbd->fetch_assoc($rst)){
+ if(!isset($v_rst["image"])) $v_rst["image"] = "";
$groupe = $v_rst;
$groupe["image_uri"] = (
$groupe["image"] ?
}
$sgbd->free_result($rst);
}
- catch(Exception $e) { return false; }
+ catch(Exception $e){
+ return false;
+ }
return $groupe;
}
- function groupe_exists($nom, $other_than_id = null){
+ public function groupe_exists($nom, $other_than_id = null){
$sgbd = $this->sgbd();
$EXISTS = 0;
try{
return $EXISTS;
}
- function add_groupe($id_user, $nom, $image, $description, $email, $contact_form, $captcha){
+ public function add_groupe($id_user, $nom, $image, $description, $email, $contact_form, $captcha){
$sgbd = $this->sgbd();
try{
$sql =
return true;
}
- function set_groupe($id, $nom, $image, $description, $email, $contact_form, $captcha){
+ public function set_groupe($id, $nom, $image, $description, $email, $contact_form, $captcha){
if(($groupe = $this->groupe($id)) === false) return false;
$sgbd = $this->sgbd();
try{
return true;
}
- function del_groupe($id){
+ public function del_groupe($id){
$sgbd = $this->sgbd();
try{
$sql = "SELECT count(*) as n FROM #--sml_sources_authors WHERE id_author=".$this->eq($id);
}
}
-
-?>
\ No newline at end of file