Browse Source

Utiliser sql_fetsel si dispo plutot que l'obsolete spip_query

touti-patch-1
Cerdic 2 years ago
parent
commit
99ba233b85
  1. 22
      inc/crayons.php
  2. 2
      paquet.xml

22
inc/crayons.php

@ -444,12 +444,22 @@ function valeur_colonne_table_dist($type, $col, $id) {
list($distant, $table) = distant_table($type);
list($nom_table, $where) = table_where($type, $id);
if ($s = spip_query(
'SELECT `' . implode($col, '`, `') .
'` FROM ' . $nom_table . ' WHERE ' . $where,
$distant
) and $t = sql_fetch($s)) {
$r = array_merge($r, $t);
$row = false;
if (include_spip('base/abstract_sql') and function_exists('sql_fetsel')) {
$row = sql_fetsel('`' . implode($col, '`, `').'`', $nom_table, $where, '', '', '', '', $distant);
}
else {
// legacy code
if ($s = spip_query(
'SELECT `' . implode($col, '`, `') .
'` FROM ' . $nom_table . ' WHERE ' . $where,
$distant
)) {
$row = sql_fetch($s);
}
}
if ($row) {
$r = array_merge($r, $row);
}
}

2
paquet.xml

@ -1,7 +1,7 @@
<paquet
prefix="crayons"
categorie="edition"
version="2.1.0"
version="2.1.1"
etat="stable"
compatibilite="[3.1.0;3.3.*]"
logo="images/crayon-64.png"

Loading…
Cancel
Save