diff --git a/ecrire/exec/accueil.php b/ecrire/exec/accueil.php index 83cf4b97cc6a345a4c2dd0e5fe6412b6c60fd6cd..8d7acd13b00d194a97a589e459a8067a504d4da2 100644 --- a/ecrire/exec/accueil.php +++ b/ecrire/exec/accueil.php @@ -191,7 +191,7 @@ function colonne_droite_neq4($id_rubrique, $activer_breves, // Modification du cookie // - if (!$_COOKIE['spip_admin']) { + if (!@$_COOKIE['spip_admin']) { $cookie = rawurlencode("@$connect_login"); $retour = rawurlencode(_DIR_RESTREINT_ABS . _SPIP_ECRIRE_SCRIPT); $lien = generer_url_public('spip_cookie', "cookie_admin=$cookie&url=$retour"); @@ -406,7 +406,7 @@ function exec_accueil_dist() debut_gauche(); if ($spip_display != 4) { - echo personnel_accueil($_COOKIE['spip_admin']); + echo personnel_accueil(@$_COOKIE['spip_admin']); echo pipeline('affiche_gauche',array('args'=>array('exec'=>'accueil','id_rubrique'=>$id_rubrique),'data'=>'')); echo "\n<div> </div>"; $nom = typo($GLOBALS['meta']["nom_site"]); diff --git a/ecrire/exec/forum.php b/ecrire/exec/forum.php index ee9c7bbbb2706896728736cf266cb5c2011871f0..cca4cba04aa2d1a42d8b127e629d3ea2ef075743 100644 --- a/ecrire/exec/forum.php +++ b/ecrire/exec/forum.php @@ -19,75 +19,75 @@ charger_generer_url(); // http://doc.spip.org/@liste_numeros_forum function liste_numeros_forum($script, $debut, $total) { - echo "\n<p>"; + $r = ''; for ($i = 0; $i < $total; $i = $i + 10){ - if ($i > 0) echo " | "; + if ($i > 0) $r .= " | "; if ($i == $debut) - echo "\n<span class='spip_medium'><b>$i</b></span>"; + $r .= "\n<b class='spip_medium'>$i</b>"; else - echo "\n<a href='", generer_url_ecrire($script, "debut=$i"), "'>$i</a>"; + $r .= "\n<a href='" . generer_url_ecrire($script, "debut=$i") . "'>$i</a>"; } - echo "\n</p>\n"; + return "\n<p>$r</p>\n"; } // http://doc.spip.org/@exec_forum_dist function exec_forum_dist() { - global $connect_statut, $debut, $admin; + global $connect_statut; pipeline('exec_init',array('args'=>array('exec'=>'forum'),'data'=>'')); - $debut = intval($debut); + $debut = intval(_request('debut')); + $admin = _request('admin'); - $commencer_page = charger_fonction('commencer_page', 'inc'); - if ($admin) { + $commencer_page = charger_fonction('commencer_page', 'inc'); + if ($admin) { echo $commencer_page(_T('titre_page_forum'), "forum", "privadm"); - $statutforum = 'privadm'; - $logo = "forum-admin-24.gif"; - $script = 'forum_admin'; - } else { - echo $commencer_page(_T('titre_forum'), "forum", "forum-interne"); - $statutforum = 'privrac'; - $logo = "forum-interne-24.gif"; - $script = 'forum'; - } + $statutforum = 'privadm'; + $logo = "forum-admin-24.gif"; + $script = 'forum_admin'; + } else { + echo $commencer_page(_T('titre_forum'), "forum", "forum-interne"); + $statutforum = 'privrac'; + $logo = "forum-interne-24.gif"; + $script = 'forum'; + } debut_gauche(); - echo pipeline('affiche_gauche',array('args'=>array('exec'=>'naviguer','id_rubrique'=>$id_rubrique),'data'=>'')); + echo pipeline('affiche_gauche',array('args'=>array('exec'=>'naviguer'),'data'=>'')); creer_colonne_droite(); - echo pipeline('affiche_droite',array('args'=>array('exec'=>'naviguer','id_rubrique'=>$id_rubrique),'data'=>'')); - - debut_droite(); + echo pipeline('affiche_droite',array('args'=>array('exec'=>'naviguer'),'data'=>'')); - if ($admin) - gros_titre(_T('titre_cadre_forum_administrateur')); - else - gros_titre(_T('titre_cadre_forum_interne')); + debut_droite(); - if ($admin AND $connect_statut != "0minirezo") { - echo _T('avis_non_acces_page'); - exit; - } + if ($admin) + gros_titre(_T('titre_cadre_forum_administrateur')); + else + gros_titre(_T('titre_cadre_forum_interne')); - echo pipeline('affiche_milieu',array('args'=>array('exec'=>'naviguer','id_rubrique'=>$id_rubrique),'data'=>'')); + if ($admin AND $connect_statut != "0minirezo") { + echo _T('avis_non_acces_page'); + exit; + } + echo pipeline('affiche_milieu',array('args'=>array('exec'=>'naviguer'),'data'=>'')); - $result_forum = spip_query("SELECT COUNT(*) AS cnt FROM spip_forum WHERE statut='$statutforum' AND id_parent=0 LIMIT 11"); + $result_forum = spip_query("SELECT COUNT(*) AS cnt FROM spip_forum WHERE statut='$statutforum' AND id_parent=0 LIMIT 11"); - $total = ($row = spip_fetch_array($result_forum)) ? $row['cnt'] : 0; + $total = ($row = spip_fetch_array($result_forum)) ? $row['cnt'] : 0; - if ($total > 10) liste_numeros_forum($script, $debut, $total); + if ($total > 10) echo liste_numeros_forum($script, $debut, $total); - echo "\n<div class='centered'>\n"; - echo icone_inline (_T('icone_poster_message'), generer_url_ecrire("forum_envoi", "statut=$statutforum&script=$script"), $logo, "creer.gif"); - echo "\n</div>"; + echo "\n<div class='centered'>\n"; + echo icone_inline (_T('icone_poster_message'), generer_url_ecrire("forum_envoi", "statut=$statutforum&script=$script"), $logo, "creer.gif"); + echo "\n</div>"; - $limit = $debut ? "LIMIT $debut,10" : "LIMIT 10" ; - $result_forum = spip_query("SELECT * FROM spip_forum WHERE statut='$statutforum' AND id_parent=0 ORDER BY date_heure DESC $limit"); + $limit = $debut ? "LIMIT $debut,10" : "LIMIT 10" ; + $result_forum = spip_query("SELECT * FROM spip_forum WHERE statut='$statutforum' AND id_parent=0 ORDER BY date_heure DESC $limit"); - echo afficher_forum($result_forum,$script,"&debut=$debut"); + echo afficher_forum($result_forum,$script,"&debut=$debut"); - echo fin_gauche(), fin_page(); + echo fin_gauche(), fin_page(); } ?>