| [ Index ] |
|
Code source de SPIP 1.9.2c |
1 <?php 2 3 /***************************************************************************\ 4 * SPIP, Systeme de publication pour l'internet * 5 * * 6 * Copyright (c) 2001-2007 * 7 * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James * 8 * * 9 * Ce programme est un logiciel libre distribue sous licence GNU/GPL. * 10 * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * 11 \***************************************************************************/ 12 13 if (!defined("_ECRIRE_INC_VERSION")) return; 14 include_spip('inc/presentation'); 15 include_spip('inc/sites_voir'); 16 include_spip('inc/syndic'); 17 include_spip('inc/mots'); 18 include_spip('inc/date'); 19 include_spip('inc/config'); 20 21 // http://doc.spip.org/@exec_sites_dist 22 function exec_sites_dist() 23 { 24 global $options, $spip_lang_left, $spip_lang_right, $spip_display; 25 26 global $cherche_mot, $select_groupe, $id_syndic; 27 28 $id_syndic = intval($id_syndic); 29 $commencer_page = charger_fonction('commencer_page', 'inc'); 30 if (!autoriser('voir','site',$id_syndic)){ 31 echo $commencer_page("$titre_page","naviguer","sites", $id_rubrique); 32 echo "<strong>"._T('avis_acces_interdit')."</strong>"; 33 echo fin_page(); 34 exit; 35 } 36 37 $result = spip_query("SELECT * FROM spip_syndic WHERE id_syndic=$id_syndic"); 38 39 if ($row = spip_fetch_array($result)) { 40 $id_syndic = $row["id_syndic"]; 41 $id_rubrique = $row["id_rubrique"]; 42 $nom_site = $row["nom_site"]; 43 $url_site = $row["url_site"]; 44 $url_syndic = $row["url_syndic"]; 45 $descriptif = $row["descriptif"]; 46 $syndication = $row["syndication"]; 47 $statut = $row["statut"]; 48 $date_heure = $row["date"]; 49 $date_syndic = $row['date_syndic']; 50 $mod = $row['moderation']; 51 $extra=$row["extra"]; 52 53 $flag_administrable = autoriser('publierdans','rubrique',$id_rubrique); 54 55 $flag_editable = ($flag_administrable OR ($GLOBALS['meta']["proposer_sites"] > 0 AND ($statut == 'prop'))); 56 57 } else {$id_syndic = 0; $nom_site='';} 58 59 if ($nom_site) 60 $titre_page = "« $nom_site »"; 61 else 62 $titre_page = _T('info_site'); 63 64 pipeline('exec_init',array('args'=>array('exec'=>'sites','id_syndic'=>$id_syndic),'data'=>'')); 65 66 67 echo $commencer_page("$titre_page","naviguer","sites", $id_rubrique); 68 69 debut_grand_cadre(); 70 71 echo afficher_hierarchie($id_rubrique); 72 73 fin_grand_cadre(); 74 75 if (!$id_syndic) {echo _T('public:aucun_site'); exit;} 76 77 debut_gauche(); 78 79 debut_boite_info(); 80 81 $res = "\n<div style='font-weight: bold; text-align: center' class='verdana1 spip_xx-small'>" 82 . _T('titre_site_numero') 83 . "<br /><span class='spip_xx-large'>" 84 . $id_syndic 85 . '</span></div>'; 86 echo $res; 87 voir_en_ligne ('site', $id_syndic, $statut); 88 fin_boite_info(); 89 90 91 echo "\n<br /><div align='center'>"; 92 icone (_T('icone_voir_sites_references'), generer_url_ecrire("sites_tous",""), "site-24.gif","rien.gif"); 93 echo "</div>"; 94 95 if ($id_syndic AND $flag_administrable AND ($spip_display != 4)) { 96 $iconifier = charger_fonction('iconifier', 'inc'); 97 echo $iconifier('id_syndic', $id_syndic, 'sites'); 98 } 99 echo pipeline('affiche_gauche',array('args'=>array('exec'=>'sites','id_syndic'=>$id_syndic),'data'=>'')); 100 101 creer_colonne_droite(); 102 echo pipeline('affiche_droite',array('args'=>array('exec'=>'sites','id_syndic'=>$id_syndic),'data'=>'')); 103 104 debut_droite(); 105 106 debut_cadre_relief("site-24.gif"); 107 108 if ($syndication == 'off' OR $syndication == 'sus') { 109 $logo_statut = "puce-orange-anim.gif"; 110 } 111 else if ($statut == 'publie') { 112 $logo_statut = "puce-verte.gif"; 113 } 114 else if ($statut == 'prop') { 115 $logo_statut = "puce-blanche.gif"; 116 } 117 else if ($statut == 'refuse') { 118 $logo_statut = "puce-rouge.gif"; 119 } 120 121 $url_affichee = $url_site; 122 123 if (strlen($url_affichee) > 40) $url_affichee = substr($url_affichee, 0, 30)."..."; 124 125 echo "<div style='text-align: center;'>"; 126 echo "\n<table cellpadding='0' cellspacing='0' border='0' width='100%'>"; 127 echo "<tr><td style='width: 100%' valign='top'>"; 128 gros_titre($nom_site, $logo_statut); 129 echo "<a href='$url_site'><b>$url_affichee</b></a>"; 130 131 if (strlen($descriptif) > 1) { 132 echo "<div align='left' style='padding: 5px; border: 1px dashed #aaaaaa; background-color: #e4e4e4; margin-top: 5px; ' class='verdana1 spip_small'>"; 133 echo "<b>"._T('info_descriptif')."</b> "; 134 echo propre($descriptif); 135 echo " "; 136 echo "</div>"; 137 } 138 echo "</td>"; 139 140 if ($flag_editable) { 141 echo "<td>". http_img_pack('rien.gif', " ", "width='5'") . "</td>\n"; 142 echo "<td align='right'>"; 143 icone(_T('icone_modifier_site'), generer_url_ecrire('sites_edit',"id_syndic=$id_syndic"), "site-24.gif", "edit.gif"); 144 echo "</td>"; 145 } 146 echo "</tr></table><br />\n"; 147 148 if ($flag_editable AND ($options == 'avancees' OR $statut == 'publie')) { 149 if ($statut == 'publie') { 150 151 debut_cadre_enfonce(); 152 $dater = charger_fonction('dater', 'inc'); 153 echo $dater($id_syndic, $flag_editable, $statut, 'syndic', 'sites', $date_heure); 154 fin_cadre_enfonce(); 155 } else { 156 echo "<br />\n<span class='verdana1 spip_medium'>"._T('info_site_propose')." <b>".affdate($date_heure)." </b></span>"; 157 } 158 } 159 160 $editer_mot = charger_fonction('editer_mot', 'inc'); 161 echo $editer_mot('syndic', $id_syndic, $cherche_mot, $select_groupe, $flag_editable); 162 163 echo pipeline('affiche_milieu',array('args'=>array('exec'=>'sites','id_syndic'=>$id_syndic),'data'=>'')); 164 165 if ($flag_administrable) { 166 debut_cadre_relief("racine-site-24.gif"); 167 168 $corps = "\n<div style='text-align: center'><b>" 169 . _T('info_statut_site_1') 170 . "</b> \n" 171 . "<select name='statut' size='1' class='fondl'>\n" 172 . my_sel("prop",_T('info_statut_site_3'),$statut) 173 . my_sel("publie",_T('info_statut_site_2'),$statut) 174 . my_sel("refuse",_T('info_statut_site_4'),$statut) 175 . "</select>\n" 176 . " " 177 . "<input type='submit' value='" 178 . _T('bouton_valider') 179 . "' class='fondo' />\n" 180 . "</div>\n"; 181 182 echo redirige_action_auteur('editer_site', 183 $id_syndic, 184 'sites', 185 "id_syndic=$id_syndic&id_parent=$id_rubrique", 186 $corps); 187 fin_cadre_relief(); 188 } 189 190 191 if ($syndication == "oui" OR $syndication == "off" OR $syndication == "sus") { 192 echo "<p class='verdana1 spip_medium'><a href='".htmlspecialchars($url_syndic)."'>", http_img_pack('feed.png', 'RSS', ''), '</a> <b>'._T('info_site_syndique').'</b></p>'; 193 194 195 if ($syndication == "off" OR $syndication=="sus") { 196 debut_boite_info(); 197 echo _T('avis_site_syndique_probleme', array('url_syndic' => quote_amp($url_syndic))); 198 199 echo redirige_action_auteur('editer_site', 200 $id_syndic, 201 'sites', 202 '', 203 "<input type='hidden' name='reload' value='oui' /> 204 <input type='submit' value=\"" 205 . attribut_html(_T('lien_nouvelle_recuperation')) 206 . "\" class='fondo spip_xx-small' />" 207 ); 208 fin_boite_info(); 209 } 210 echo afficher_syndic_articles(_T('titre_articles_syndiques'), array('FROM' => 'spip_syndic_articles', 'WHERE' => "id_syndic=$id_syndic", 'ORDER BY' => "date DESC"), $id_syndic); 211 212 213 // afficher la date de dernier acces a la syndication 214 215 if ($date_syndic) 216 echo "<div align='left'>". 217 "<span class='verdana1 spip_small'>", _T('info_derniere_syndication').' '.affdate_heure($date_syndic) .".</span></div>\n"; 218 219 echo "<div align='right'>\n"; 220 echo generer_action_auteur('editer_site', 221 $id_syndic, 222 generer_url_ecrire('sites'), 223 "<input type='hidden' name='reload' value='oui' /> 224 <input type='submit' value=\"" 225 . attribut_html(_T('lien_mise_a_jour_syndication')) 226 . "\" class='fondo spip_xx-small' />", 227 " method='post'" 228 ); 229 echo "</div>\n"; 230 231 // Options 232 if ($flag_administrable && $options=='avancees') { 233 234 $moderation = $mod; 235 if ($moderation != 'oui') $moderation='non'; 236 237 $res = ''; 238 239 $res .= "<div align='".$GLOBALS['spip_lang_left']."'>". 240 _T('syndic_choix_moderation') 241 . "<div style='padding-$spip_lang_left: 40px;'>" 242 . afficher_choix('moderation', $moderation, 243 array( 244 'non' => _T('info_publier') .' ('._T('bouton_radio_modere_posteriori').')', 245 'oui' => _T('info_bloquer') .' ('._T('bouton_radio_modere_priori').')' )) 246 . "</div></div>\n"; 247 248 // Oublier les vieux liens ? 249 // Depublier les liens qui ne figurent plus ? 250 251 $res .= "\n<div> </div>" 252 . "\n<div align='".$GLOBALS['spip_lang_left']."'>"._T('syndic_choix_oublier'). '</div>' 253 . "\n<ul align='".$GLOBALS['spip_lang_left']."'>\n"; 254 255 $on = array('oui' => _T('item_oui'), 'non' => _T('item_non')); 256 if (!$miroir = $row['miroir']) $miroir = 'non'; 257 $res .= "\n<li>"._T('syndic_option_miroir').' ' 258 . afficher_choix('miroir', $miroir, $on, " ") 259 . "</li>\n"; 260 261 if (!$oubli = $row['oubli']) $oubli = 'non'; 262 $res .= "\n<li>" 263 . _T('syndic_option_oubli', array('mois' => 2)).' ' 264 . afficher_choix('oubli', $oubli, $on," ") 265 . "</li>\n" 266 . "</ul>\n"; 267 268 // Prendre les resumes ou le texte integral ? 269 if (!$resume = $row['resume']) $resume = 'oui'; 270 $res .= "\n<div align='$spip_lang_left'>" 271 . _T('syndic_choix_resume') 272 . "\n<div style='padding-$spip_lang_left: 40px;'>" 273 . afficher_choix('resume', $resume, 274 array( 'oui' => _T('syndic_option_resume_oui'), 275 'non' => _T('syndic_option_resume_non') )) 276 . "</div></div>\n"; 277 278 // Bouton "Valider" 279 $res .= "\n<div style='text-align:$spip_lang_right'><input type='submit' value='"._T('bouton_valider')."' class='fondo' /></div>\n"; 280 echo debut_cadre_relief('feed.png', false, "", _T('syndic_options').aide('artsyn')), 281 redirige_action_auteur('editer_site', 282 "options/$id_syndic", 283 'sites', 284 '', 285 $res, 286 " method='post'"), 287 fin_cadre_relief(); 288 } 289 } 290 291 // Cas d'un site pour lesquels feedfinder a un ou plusieurs flux, 292 // et l'on propose de choisir 293 else if (preg_match(',^\s*select: (.*),', $url_syndic, $regs)) { 294 295 $res = "<br /><br />\n"; 296 foreach ( 297 array('id_rubrique', 'nom_site', 'url_site', 'descriptif', 'statut') 298 as $var) { 299 $res .= "<input type='hidden' name='$var' value=\"".entites_html($$var)."\" />\n"; 300 } 301 302 $res .= "<div align='$spip_lang_left'>\n"; 303 $res .= "<div><input type='radio' name='syndication' value='non' id='syndication_non' checked='checked' />"; 304 $res .= " <b><label for='syndication_non'>"._T('bouton_radio_non_syndication')."</label></b></div>\n"; 305 $res .= "<div><input type='radio' name='syndication' value='oui' id='syndication_oui' />"; 306 $res .= " <label for='syndication_oui'>"._T('bouton_radio_syndication')."</label></div>\n"; 307 308 $res .= "<select name='url_syndic'>\n"; 309 foreach (explode(' ',$regs[1]) as $feed) { 310 $res .= '<option value="'.entites_html($feed).'">'.$feed."</option>\n"; 311 } 312 $res .= "</select>\n"; 313 $res .= aide("rubsyn"); 314 $res .= "<div align='$spip_lang_right'><input type='submit' value='"._T('bouton_valider')."' class='fondo' /></div>\n"; 315 $res .= "</div>\n"; 316 echo debut_cadre_relief(); 317 echo redirige_action_auteur('editer_site', 318 $id_syndic, 319 'sites', 320 '', 321 $res, 322 " method='post'"); 323 echo fin_cadre_relief(); 324 325 } 326 327 328 if ($GLOBALS['champs_extra'] AND $extra) { 329 include_spip('inc/extra'); 330 echo extra_affichage($extra, "sites"); 331 } 332 333 echo '</div>'; 334 fin_cadre_relief(); 335 336 337 338 ////////////////////////////////////////////////////// 339 // Forums 340 // 341 342 echo "<br /><br />\n<div align='center'>"; 343 344 icone (_T('icone_poster_message'), generer_url_ecrire('forum_envoi', "id=$id_syndic&statut=prive&script=sites") . '#formulaire', "forum-interne-24.gif", "creer.gif"); 345 346 echo "</div>\n"; 347 348 $result_forum = spip_query("SELECT * FROM spip_forum WHERE statut='prive' AND id_syndic=$id_syndic AND id_parent=0 ORDER BY date_heure DESC LIMIT 20"); 349 350 echo afficher_forum($result_forum, "sites","id_syndic=$id_syndic"); 351 352 echo fin_gauche(), fin_page(); 353 } 354 355 356 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
| Généré le : Wed Nov 21 10:20:27 2007 | par Balluche grâce à PHPXref 0.7 |
|