@@ -30,21 +30,21 @@ |
||
| 30 | 30 | |
| 31 | 31 | $now = time(); |
| 32 | 32 | if (!isset($GLOBALS['meta']['dernier_envoi_neuf'])) |
| 33 | - ecrire_meta('dernier_envoi_neuf',date('Y-m-d H:i:s',$now - (3600 * 24 * $jours_neuf))); |
|
| 33 | + ecrire_meta('dernier_envoi_neuf', date('Y-m-d H:i:s', $now - (3600 * 24 * $jours_neuf))); |
|
| 34 | 34 | |
| 35 | - $page = recuperer_fond('nouveautes',array('date'=>$GLOBALS['meta']['dernier_envoi_neuf'],'jours_neuf'=>$jours_neuf),array('raw'=>true)); |
|
| 35 | + $page = recuperer_fond('nouveautes', array('date'=>$GLOBALS['meta']['dernier_envoi_neuf'], 'jours_neuf'=>$jours_neuf), array('raw'=>true)); |
|
| 36 | 36 | |
| 37 | - if (strlen(trim($page['texte']))){ |
|
| 37 | + if (strlen(trim($page['texte']))) { |
|
| 38 | 38 | // recuperer les entetes envoyes par #HTTP_HEADER |
| 39 | 39 | $headers = ""; |
| 40 | - if (isset($page['entetes']) AND count($page['entetes'])){ |
|
| 40 | + if (isset($page['entetes']) AND count($page['entetes'])) { |
|
| 41 | 41 | foreach ($page['entetes'] as $k => $v) |
| 42 | - $headers .= (strlen($v)?"$k: $v":$k)."\n"; |
|
| 42 | + $headers .= (strlen($v) ? "$k: $v" : $k)."\n"; |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | include_spip("inc/notifications"); |
| 46 | - notifications_envoyer_mails($adresse_neuf,$page['texte'],"","",$headers); |
|
| 47 | - ecrire_meta('dernier_envoi_neuf',date('Y-m-d H:i:s',$now)); |
|
| 46 | + notifications_envoyer_mails($adresse_neuf, $page['texte'], "", "", $headers); |
|
| 47 | + ecrire_meta('dernier_envoi_neuf', date('Y-m-d H:i:s', $now)); |
|
| 48 | 48 | } |
| 49 | 49 | else |
| 50 | 50 | spip_log("mail nouveautes : rien de neuf depuis $jours_neuf jours"); |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | // sachant qu'on a un delai de 48h, on renvoie aujourd'hui a 4h du mat |
| 25 | 25 | // avec une periode de flou entre 2h et 6h pour ne pas saturer un hebergeur |
| 26 | 26 | // qui aurait beaucoup de sites SPIP |
| 27 | - return -(mktime(2,0,0) + rand(0, 3600*4)); |
|
| 27 | + return -(mktime(2, 0, 0) + rand(0, 3600 * 4)); |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | // heure de reference pour le garbage collector = 24h auparavant |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | $tables[] = array_shift($row); |
| 48 | 48 | |
| 49 | 49 | if ($tables) { |
| 50 | - $table_op = intval($GLOBALS['meta']['optimiser_table']+1) % sizeof($tables); |
|
| 50 | + $table_op = intval($GLOBALS['meta']['optimiser_table'] + 1) % sizeof($tables); |
|
| 51 | 51 | ecrire_meta('optimiser_table', $table_op); |
| 52 | 52 | $q = $tables[$table_op]; |
| 53 | 53 | spip_log("debut d'optimisation de la table $q"); |
@@ -65,14 +65,14 @@ discard block |
||
| 65 | 65 | // L'index du SELECT doit s'appeler "id" |
| 66 | 66 | |
| 67 | 67 | // http://doc.spip.org/@optimiser_sansref |
| 68 | -function optimiser_sansref($table, $id, $sel, $and="") |
|
| 68 | +function optimiser_sansref($table, $id, $sel, $and = "") |
|
| 69 | 69 | { |
| 70 | 70 | $in = array(); |
| 71 | - while ($row = sql_fetch($sel)) $in[$row['id']]=true; |
|
| 71 | + while ($row = sql_fetch($sel)) $in[$row['id']] = true; |
|
| 72 | 72 | sql_free($sel); |
| 73 | 73 | |
| 74 | 74 | if ($in) { |
| 75 | - sql_delete($table, sql_in($id,array_keys($in)) . ($and?" AND $and":"")); |
|
| 75 | + sql_delete($table, sql_in($id, array_keys($in)).($and ? " AND $and" : "")); |
|
| 76 | 76 | spip_log("Numeros des entrees $id supprimees dans la table $table: $in"); |
| 77 | 77 | } |
| 78 | 78 | return count($in); |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | AND R.id_rubrique IS NULL |
| 108 | 108 | AND A.maj < $mydate"); |
| 109 | 109 | |
| 110 | - $n+= optimiser_sansref('spip_articles', 'id_article', $res); |
|
| 110 | + $n += optimiser_sansref('spip_articles', 'id_article', $res); |
|
| 111 | 111 | |
| 112 | 112 | // les articles a la poubelle |
| 113 | 113 | sql_delete("spip_articles", "statut='poubelle' AND maj < $mydate"); |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | include_spip('action/editer_liens'); |
| 120 | 120 | // optimiser les liens de tous les auteurs vers des objets effaces |
| 121 | 121 | // et depuis des auteurs effaces |
| 122 | - $n+= objet_optimiser_liens(array('auteur'=>'*'),'*'); |
|
| 122 | + $n += objet_optimiser_liens(array('auteur'=>'*'), '*'); |
|
| 123 | 123 | |
| 124 | 124 | # effacer les auteurs poubelle qui ne sont lies a rien |
| 125 | 125 | $res = sql_select("A.id_auteur AS id", |
@@ -129,11 +129,11 @@ discard block |
||
| 129 | 129 | "L.id_auteur IS NULL |
| 130 | 130 | AND A.statut='5poubelle' AND A.maj < $mydate"); |
| 131 | 131 | |
| 132 | - $n+= optimiser_sansref('spip_auteurs', 'id_auteur', $res); |
|
| 132 | + $n += optimiser_sansref('spip_auteurs', 'id_auteur', $res); |
|
| 133 | 133 | |
| 134 | 134 | # supprimer les auteurs 'nouveau' qui n'ont jamais donne suite |
| 135 | 135 | # au mail de confirmation (45 jours pour repondre, ca devrait suffire) |
| 136 | - sql_delete("spip_auteurs", "statut='nouveau' AND maj < ". sql_quote(date('Y-m-d', time()-45*24*3600))); |
|
| 136 | + sql_delete("spip_auteurs", "statut='nouveau' AND maj < ".sql_quote(date('Y-m-d', time() - 45 * 24 * 3600))); |
|
| 137 | 137 | |
| 138 | 138 | |
| 139 | 139 | $n = pipeline('optimiser_base_disparus', array( |
@@ -33,10 +33,10 @@ discard block |
||
| 33 | 33 | $chars = array(160 => '~', 187 => '»', 171 => '«', 148 => '”', 147 => '“', 176 => '°'); |
| 34 | 34 | $chars_trans = array_keys($chars); |
| 35 | 35 | $chars = array_values($chars); |
| 36 | - $chars_trans = implode(' ',array_map('chr',$chars_trans)); |
|
| 36 | + $chars_trans = implode(' ', array_map('chr', $chars_trans)); |
|
| 37 | 37 | $chars_trans = unicode2charset(charset2unicode($chars_trans, 'iso-8859-1', 'forcer')); |
| 38 | - $chars_trans = explode(" ",$chars_trans); |
|
| 39 | - foreach($chars as $k=>$r) |
|
| 38 | + $chars_trans = explode(" ", $chars_trans); |
|
| 39 | + foreach ($chars as $k=>$r) |
|
| 40 | 40 | $trans[$chars_trans[$k]] = $r; |
| 41 | 41 | } |
| 42 | 42 | |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | |
| 60 | 60 | $cherche2 = array( |
| 61 | 61 | '/([^-\n]|^)--([^-]|$)/S', |
| 62 | - ',(' ._PROTOCOLES_STD . ')~((://[^"\'\s\[\]\}\)<>]+)~([?]))?,S', |
|
| 62 | + ',('._PROTOCOLES_STD.')~((://[^"\'\s\[\]\}\)<>]+)~([?]))?,S', |
|
| 63 | 63 | '/~/' |
| 64 | 64 | ); |
| 65 | 65 | $remplace2 = array( |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | |
| 16 | 16 | // ne devrait jamais se produire |
| 17 | 17 | if ($options['statut'] == $options['statut_ancien']) { |
| 18 | - spip_log("statut inchange",'notifications'); |
|
| 18 | + spip_log("statut inchange", 'notifications'); |
|
| 19 | 19 | return; |
| 20 | 20 | } |
| 21 | 21 | |
@@ -23,8 +23,8 @@ discard block |
||
| 23 | 23 | |
| 24 | 24 | $modele = ""; |
| 25 | 25 | if ($options['statut'] == 'publie') { |
| 26 | - if ($GLOBALS['meta']["post_dates"]=='non' |
|
| 27 | - AND strtotime($options['date'])>time()) |
|
| 26 | + if ($GLOBALS['meta']["post_dates"] == 'non' |
|
| 27 | + AND strtotime($options['date']) > time()) |
|
| 28 | 28 | $modele = "notifications/article_valide"; |
| 29 | 29 | else |
| 30 | 30 | $modele = "notifications/article_publie"; |
@@ -33,15 +33,15 @@ discard block |
||
| 33 | 33 | if ($options['statut'] == 'prop' AND $options['statut_ancien'] != 'publie') |
| 34 | 34 | $modele = "notifications/article_propose"; |
| 35 | 35 | |
| 36 | - if ($modele){ |
|
| 36 | + if ($modele) { |
|
| 37 | 37 | $destinataires = array(); |
| 38 | 38 | if ($GLOBALS['meta']["suivi_edito"] == "oui") |
| 39 | - $destinataires = explode(',',$GLOBALS['meta']["adresse_suivi"]); |
|
| 39 | + $destinataires = explode(',', $GLOBALS['meta']["adresse_suivi"]); |
|
| 40 | 40 | |
| 41 | 41 | |
| 42 | 42 | $destinataires = pipeline('notifications_destinataires', |
| 43 | 43 | array( |
| 44 | - 'args'=>array('quoi'=>$quoi,'id'=>$id_article,'options'=>$options) |
|
| 44 | + 'args'=>array('quoi'=>$quoi, 'id'=>$id_article, 'options'=>$options) |
|
| 45 | 45 | , |
| 46 | 46 | 'data'=>$destinataires) |
| 47 | 47 | ); |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | /** |
| 16 | 16 | * Un exec d'erreur |
| 17 | 17 | */ |
| 18 | -function exec_404_dist(){ |
|
| 18 | +function exec_404_dist() { |
|
| 19 | 19 | |
| 20 | 20 | $exec = _request('exec'); |
| 21 | 21 | |
@@ -24,20 +24,20 @@ discard block |
||
| 24 | 24 | $extra = ""; |
| 25 | 25 | |
| 26 | 26 | include_spip('inc/presentation'); // alleger les inclusions avec un inc/presentation_mini |
| 27 | - $commencer_page = charger_fonction('commencer_page','inc'); |
|
| 27 | + $commencer_page = charger_fonction('commencer_page', 'inc'); |
|
| 28 | 28 | echo $commencer_page($titre); |
| 29 | 29 | |
| 30 | - echo debut_gauche("404_$exec",true); |
|
| 31 | - echo pipeline('affiche_gauche',array('args'=>array('exec'=>'404','exec_erreur'=>$exec),'data'=>'')); |
|
| 30 | + echo debut_gauche("404_$exec", true); |
|
| 31 | + echo pipeline('affiche_gauche', array('args'=>array('exec'=>'404', 'exec_erreur'=>$exec), 'data'=>'')); |
|
| 32 | 32 | |
| 33 | - echo creer_colonne_droite("404",true); |
|
| 34 | - echo pipeline('affiche_droite',array('args'=>array('exec'=>'404','exec_erreur'=>$exec),'data'=>'')); |
|
| 33 | + echo creer_colonne_droite("404", true); |
|
| 34 | + echo pipeline('affiche_droite', array('args'=>array('exec'=>'404', 'exec_erreur'=>$exec), 'data'=>'')); |
|
| 35 | 35 | |
| 36 | - echo debut_droite("404",true); |
|
| 37 | - echo "<h1 class='grostitre'>"._T('fichier_introuvable',array('fichier'=>$exec))."</h1>"; |
|
| 38 | - echo pipeline('affiche_milieu',array('args'=>array('exec'=>'404','exec_erreur'=>$exec),'data'=>'')); |
|
| 36 | + echo debut_droite("404", true); |
|
| 37 | + echo "<h1 class='grostitre'>"._T('fichier_introuvable', array('fichier'=>$exec))."</h1>"; |
|
| 38 | + echo pipeline('affiche_milieu', array('args'=>array('exec'=>'404', 'exec_erreur'=>$exec), 'data'=>'')); |
|
| 39 | 39 | |
| 40 | - echo fin_gauche(),fin_page(); |
|
| 40 | + echo fin_gauche(), fin_page(); |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | ?> |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | redirige_url_ecrire("install"); |
| 25 | 25 | |
| 26 | 26 | // Si reinstallation necessaire, message ad hoc |
| 27 | - if (_request('reinstall')=='oui'){ |
|
| 27 | + if (_request('reinstall') == 'oui') { |
|
| 28 | 28 | include_spip('inc/minipres'); |
| 29 | 29 | $r = minipres(_T('titre_page_upgrade'), |
| 30 | 30 | "<p><b>" |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | include_spip('inc/plugin'); |
| 40 | 40 | actualise_plugins_actifs(); |
| 41 | 41 | include_spip('inc/headers'); |
| 42 | - $res = generer_url_ecrire('admin_plugin','var_mode=recalcul'); |
|
| 42 | + $res = generer_url_ecrire('admin_plugin', 'var_mode=recalcul'); |
|
| 43 | 43 | echo redirige_formulaire($res); |
| 44 | 44 | } |
| 45 | 45 | else { |
@@ -47,13 +47,13 @@ discard block |
||
| 47 | 47 | if (!isset($GLOBALS['meta']['version_installee'])) |
| 48 | 48 | $GLOBALS['meta']['version_installee'] = 0.0; |
| 49 | 49 | else $GLOBALS['meta']['version_installee'] = |
| 50 | - (double)str_replace(',', '.', $GLOBALS['meta']['version_installee']); |
|
| 50 | + (double) str_replace(',', '.', $GLOBALS['meta']['version_installee']); |
|
| 51 | 51 | # NB: str_replace car, sur club-internet, il semble que version_installe soit |
| 52 | 52 | # enregistree au format '1,812' et non '1.812' |
| 53 | 53 | |
| 54 | 54 | // Erreur downgrade |
| 55 | 55 | // (cas de double installation de fichiers SPIP sur une meme base) |
| 56 | - if ($spip_version_base<$GLOBALS['meta']['version_installee']) |
|
| 56 | + if ($spip_version_base < $GLOBALS['meta']['version_installee']) |
|
| 57 | 57 | $commentaire = _T('info_mise_a_niveau_base_2'); |
| 58 | 58 | // Commentaire standard upgrade |
| 59 | 59 | else $commentaire = _T('texte_mise_a_niveau_base_1'); |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | /** |
| 16 | 16 | * Un exec d'acces interdit |
| 17 | 17 | */ |
| 18 | -function exec_403_dist(){ |
|
| 18 | +function exec_403_dist() { |
|
| 19 | 19 | |
| 20 | 20 | $exec = _request('exec'); |
| 21 | 21 | |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | $extra = ""; |
| 25 | 25 | |
| 26 | 26 | $contenu = "<h1>"._T('info_acces_interdit')."</h1>" |
| 27 | - . _L("Vous n'avez pas le droit d'accéder à la page <b>@exec@</b>.",array('exec'=>_request('exec'))); |
|
| 27 | + . _L("Vous n'avez pas le droit d'accéder à la page <b>@exec@</b>.", array('exec'=>_request('exec'))); |
|
| 28 | 28 | |
| 29 | 29 | if (_request('var_zajax')) { |
| 30 | 30 | include_spip('inc/actions'); |
@@ -33,20 +33,20 @@ discard block |
||
| 33 | 33 | else { |
| 34 | 34 | include_spip('inc/presentation'); // alleger les inclusions avec un inc/presentation_mini |
| 35 | 35 | |
| 36 | - $commencer_page = charger_fonction('commencer_page','inc'); |
|
| 36 | + $commencer_page = charger_fonction('commencer_page', 'inc'); |
|
| 37 | 37 | echo $commencer_page($titre); |
| 38 | 38 | |
| 39 | - echo debut_gauche("403_$exec",true); |
|
| 40 | - echo recuperer_fond('prive/squelettes/navigation/dist',array()); |
|
| 41 | - echo pipeline('affiche_gauche',array('args'=>array('exec'=>'403','exec_erreur'=>$exec),'data'=>'')); |
|
| 39 | + echo debut_gauche("403_$exec", true); |
|
| 40 | + echo recuperer_fond('prive/squelettes/navigation/dist', array()); |
|
| 41 | + echo pipeline('affiche_gauche', array('args'=>array('exec'=>'403', 'exec_erreur'=>$exec), 'data'=>'')); |
|
| 42 | 42 | |
| 43 | - echo creer_colonne_droite("403",true); |
|
| 44 | - echo pipeline('affiche_droite',array('args'=>array('exec'=>'403','exec_erreur'=>$exec),'data'=>'')); |
|
| 43 | + echo creer_colonne_droite("403", true); |
|
| 44 | + echo pipeline('affiche_droite', array('args'=>array('exec'=>'403', 'exec_erreur'=>$exec), 'data'=>'')); |
|
| 45 | 45 | |
| 46 | - echo debut_droite("403",true); |
|
| 47 | - echo pipeline('affiche_milieu',array('args'=>array('exec'=>'403','exec_erreur'=>$exec),'data'=>$contenu)); |
|
| 46 | + echo debut_droite("403", true); |
|
| 47 | + echo pipeline('affiche_milieu', array('args'=>array('exec'=>'403', 'exec_erreur'=>$exec), 'data'=>$contenu)); |
|
| 48 | 48 | |
| 49 | - echo fin_gauche(),fin_page(); |
|
| 49 | + echo fin_gauche(), fin_page(); |
|
| 50 | 50 | } |
| 51 | 51 | } |
| 52 | 52 | |
@@ -21,21 +21,21 @@ |
||
| 21 | 21 | echo minipres(); |
| 22 | 22 | } else { |
| 23 | 23 | include_spip('base/dump'); |
| 24 | - $res = base_lister_toutes_tables('',array(),array(),true); |
|
| 24 | + $res = base_lister_toutes_tables('', array(), array(), true); |
|
| 25 | 25 | if (!$res) { |
| 26 | 26 | include_spip('inc/minipres'); |
| 27 | 27 | spip_log("Erreur base de donnees"); |
| 28 | - echo minipres(_T('info_travaux_titre'), _T('titre_probleme_technique'). "<p><tt>".sql_errno()." ".sql_error()."</tt></p>"); |
|
| 28 | + echo minipres(_T('info_travaux_titre'), _T('titre_probleme_technique')."<p><tt>".sql_errno()." ".sql_error()."</tt></p>"); |
|
| 29 | 29 | } else { |
| 30 | 30 | $res = base_saisie_tables('delete', $res); |
| 31 | 31 | include_spip('inc/headers'); |
| 32 | - $res = "\n<ol style='text-align:left'><li>\n" . |
|
| 33 | - join("</li>\n<li>", $res) . |
|
| 32 | + $res = "\n<ol style='text-align:left'><li>\n". |
|
| 33 | + join("</li>\n<li>", $res). |
|
| 34 | 34 | '</li></ol>'; |
| 35 | 35 | $admin = charger_fonction('admin', 'inc'); |
| 36 | 36 | $res = $admin('delete_all', _T('titre_page_delete_all'), $res); |
| 37 | 37 | if (!$res) |
| 38 | - redirige_url_ecrire('install',''); |
|
| 38 | + redirige_url_ecrire('install', ''); |
|
| 39 | 39 | else echo $res; |
| 40 | 40 | } |
| 41 | 41 | } |
@@ -9,17 +9,17 @@ |
||
| 9 | 9 | include_spip('inc/minipres'); |
| 10 | 10 | echo minipres(); |
| 11 | 11 | } else { |
| 12 | - $plug = _DIR_RACINE . _request('plugin'); |
|
| 13 | - $get_infos = charger_fonction('get_infos','plugins'); |
|
| 12 | + $plug = _DIR_RACINE._request('plugin'); |
|
| 13 | + $get_infos = charger_fonction('get_infos', 'plugins'); |
|
| 14 | 14 | $dir = ""; |
| 15 | - if (strncmp($plug,_DIR_PLUGINS,strlen(_DIR_PLUGINS))==0) |
|
| 15 | + if (strncmp($plug, _DIR_PLUGINS, strlen(_DIR_PLUGINS)) == 0) |
|
| 16 | 16 | $dir = _DIR_PLUGINS; |
| 17 | - elseif (strncmp($plug,_DIR_PLUGINS_DIST,strlen(_DIR_PLUGINS_DIST))==0) |
|
| 17 | + elseif (strncmp($plug, _DIR_PLUGINS_DIST, strlen(_DIR_PLUGINS_DIST)) == 0) |
|
| 18 | 18 | $dir = _DIR_PLUGINS_DIST; |
| 19 | 19 | if ($dir) |
| 20 | - $plug = substr($plug,strlen($dir)); |
|
| 21 | - $info = $get_infos($plug,false,$dir); |
|
| 22 | - $afficher_plugin = charger_fonction("afficher_plugin","plugins"); |
|
| 20 | + $plug = substr($plug, strlen($dir)); |
|
| 21 | + $info = $get_infos($plug, false, $dir); |
|
| 22 | + $afficher_plugin = charger_fonction("afficher_plugin", "plugins"); |
|
| 23 | 23 | ajax_retour(affiche_bloc_plugin($plug, $info, $dir)); |
| 24 | 24 | } |
| 25 | 25 | } |