Last active
March 16, 2016 11:31
-
-
Save phenix-factory/e0fe83f68f949fec44d2 to your computer and use it in GitHub Desktop.
SPIP: auteurs_objet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Fonction générique qui permet de renvoyer les auteurs d'un objet | |
| * | |
| * @param string $objet | |
| * @param int $id_objet | |
| * @param string $cond | |
| * @access public | |
| * @return array | |
| */ | |
| function auteurs_objet($objet, $id_objet, $cond = '') { | |
| // Pour les distrait qui utiliserai id_articles ou articles | |
| // alors qu'il faut utiliser l'objet au singulier | |
| $objet = objet_type($objet); | |
| $where = array( | |
| 'objet='.sql_quote($objet), | |
| 'id_objet='.intval($id_objet) | |
| ); | |
| if (!empty($cond)) { | |
| $where[] = $cond; | |
| } | |
| return sql_allfetsel( | |
| 'id_auteur', | |
| 'spip_auteurs_liens', | |
| $where | |
| ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment