Ajout d'une fonction pour trouver la blockchaine d'un couple : objet /

id_objet
This commit is contained in:
Christophe 2019-12-18 11:27:57 +01:00
parent f9b6ad0d25
commit 0b709d39cd

View file

@ -12,3 +12,18 @@
if (!defined('_ECRIRE_INC_VERSION')) { if (!defined('_ECRIRE_INC_VERSION')) {
return; return;
} }
function trouver_blocklog($id_objet, $objet){
$from = array(
'spip_blocklogs as B',
'spip_blocklogs_liens as L'
);
$where = array(
'L.id_objet='.intval($id_objet),
'L.objet='.sql_quote($objet),
'L.id_blocklog=B.id_blocklog'
);
$blockchaine = sql_getfetsel('blockchaine', $from, $where, '', 'B.id_blocklog DESC', 1);
return $blockchaine;
}