//function that allows admin to set the title of custom objects function favoris_define_titre_objet($objet, $id_objet){ switch($objet){ //example: I created an object "game" case "game" : $res = spip_query("select titre from spip_articles where id_article=$id_objet"); $row = sql_fetch($res); return $row['titre']; break; } return ''; } //function that allows admin to set the url of custom objects function favoris_define_url_objet($objet, $id_objet){ switch($objet){ //example: I created an object "game", which actually doesn't exist in the table spip_urls, but let’s pretend… case "game" : $res = spip_query("select url from spip_urls where id_objet=$id_objet and type='$objet'"); $row = sql_fetch($res); return $row['url']; break; } return ''; }