projects
/
mw_sourceml
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
titre du site par defaut
[mw_sourceml]
/
app
/
data
/
modules
/
sql
/
sml_data_authors.php
diff --git
a/app/data/modules/sql/sml_data_authors.php
b/app/data/modules/sql/sml_data_authors.php
index
72779a8
..
5d1288f
100644
(file)
--- a/
app/data/modules/sql/sml_data_authors.php
+++ b/
app/data/modules/sql/sml_data_authors.php
@@
-1,13
+1,12
@@
<?php
<?php
- class sml_data_authors extends mw_data
- {
+ class sml_data_authors extends mw_data{
# ----------------------------------------------------------------------------------------
# groupes
#
# ----------------------------------------------------------------------------------------
# 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);
$sgbd = $this->sgbd();
$env = $this->env();
$groupes = array("list" => array(), "total" => 0);
@@
-26,6
+25,7
@@
$sql = "SELECT * FROM(".$SELECT.$FROM.$WHERE.$LIMIT.") res";
$rst = $sgbd->query($sql);
while($v_rst = $sgbd->fetch_assoc($rst)){
$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"] ?
$groupes["list"][$v_rst["id"]] = $v_rst;
$groupes["list"][$v_rst["id"]]["image_uri"] = (
$v_rst["image"] ?
@@
-42,7
+42,7
@@
return $groupes;
}
return $groupes;
}
- function groupe($id){
+
public
function groupe($id){
$sgbd = $this->sgbd();
$env = $this->env();
$groupe = array();
$sgbd = $this->sgbd();
$env = $this->env();
$groupe = array();
@@
-50,6
+50,7
@@
$sql = "SELECT * from #--sml_authors WHERE id=".$this->eq($id);
$rst = $sgbd->query($sql);
if($v_rst = $sgbd->fetch_assoc($rst)){
$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"] ?
$groupe = $v_rst;
$groupe["image_uri"] = (
$groupe["image"] ?
@@
-59,11
+60,13
@@
}
$sgbd->free_result($rst);
}
}
$sgbd->free_result($rst);
}
- catch(Exception $e) { return false; }
+ catch(Exception $e){
+ return false;
+ }
return $groupe;
}
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{
$sgbd = $this->sgbd();
$EXISTS = 0;
try{
@@
-79,7
+82,7
@@
return $EXISTS;
}
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 =
$sgbd = $this->sgbd();
try{
$sql =
@@
-100,7
+103,7
@@
return true;
}
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{
if(($groupe = $this->groupe($id)) === false) return false;
$sgbd = $this->sgbd();
try{
@@
-125,7
+128,7
@@
return true;
}
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);
$sgbd = $this->sgbd();
try{
$sql = "SELECT count(*) as n FROM #--sml_sources_authors WHERE id_author=".$this->eq($id);
@@
-143,5
+146,3
@@
}
}
}
}
-
-?>
\ No newline at end of file