Changeset 93640 in spip-zone
- Timestamp:
- Dec 13, 2015, 2:39:43 PM (5 years ago)
- Location:
- _core_/plugins/forum
- Files:
-
- 28 edited
Legend:
- Unmodified
- Added
- Removed
-
_core_/plugins/forum/action/editer_forum.php
r93612 r93640 53 53 $cles = array(); 54 54 foreach (array('id_objet', 'objet') as $k) { 55 if (isset($c[$k]) AND$c[$k]) {55 if (isset($c[$k]) and $c[$k]) { 56 56 $cles[$k] = $c[$k]; 57 57 } … … 61 61 // (non autorise en standard mais utile pour des crayons) 62 62 // on deplace tout le thread {sauf les originaux}. 63 if (count($cles) AND$id_thread) {63 if (count($cles) and $id_thread) { 64 64 spip_log("update thread id_thread=$id_thread avec " . var_export($cles, 1), 'forum.' . _LOG_INFO_IMPORTANTE); 65 65 sql_updateq("spip_forum", $cles, "id_thread=" . $id_thread . " AND statut!='original'"); … … 69 69 // s'il y a vraiment eu une modif et que le message est public 70 70 // on enregistre le nouveau date_thread 71 if ($err === '' AND$t['statut'] == 'publie') {71 if ($err === '' and $t['statut'] == 'publie') { 72 72 // on ne stocke ni le numero IP courant ni le nouvel id_auteur 73 73 // dans le message modifie (trop penible a l'usage) ; mais du -
_core_/plugins/forum/action/instituer_forum.php
r93612 r93640 51 51 52 52 // Notifier de la publication du message, s'il etait 'prop' 53 if ($old == 'prop' AND$statut == 'publie') {53 if ($old == 'prop' and $statut == 'publie') { 54 54 if ($notifications = charger_fonction('notifications', 'inc')) { 55 55 $notifications('forumvalide', $id_forum); … … 64 64 // car la date_thread aurait cette derniere date alors que pas le message 65 65 // mais c'est au mieux de ce que l'on peut faire quand on depublie un SPAM ou supprime un message 66 if ($statut == 'publie' OR$old == 'publie') {66 if ($statut == 'publie' or $old == 'publie') { 67 67 if ($statut == 'publie' 68 OR!($date_thread = sql_getfetsel("date_heure", "spip_forum",68 or !($date_thread = sql_getfetsel("date_heure", "spip_forum", 69 69 "statut='publie' AND id_thread=" . $row['id_thread'], "", "date_heure DESC", "0,1")) 70 70 ) { … … 95 95 ); 96 96 } 97 98 ?> -
_core_/plugins/forum/action/instituer_lot_forum.php
r93612 r93640 32 32 */ 33 33 if (preg_match(",^(\w+)-,", $arg, $match) 34 ANDin_array($statut = $match[1], array('publie', 'off', 'spam'))34 and in_array($statut = $match[1], array('publie', 'off', 'spam')) 35 35 ) { 36 $arg = substr($arg, strlen($statut) +1);36 $arg = substr($arg, strlen($statut) + 1); 37 37 38 38 $arg = explode('/', $arg); … … 71 71 */ 72 72 elseif (preg_match(",^(\w+)$,", $arg, $match) 73 ANDin_array($statut = $match[1], array('publie', 'off', 'spam'))74 AND$id = _request('ids')75 ANDis_array($id)73 and in_array($statut = $match[1], array('publie', 'off', 'spam')) 74 and $id = _request('ids') 75 and is_array($id) 76 76 ) { 77 77 … … 96 96 97 97 } 98 99 ?> -
_core_/plugins/forum/balise/formulaire_forum.php
r93612 r93640 206 206 207 207 // et si on n'a toujours pas ce qu'on souhaite, on tente de le trouver dans un forum existant... 208 if (($objet == 'forum' OR!$id_objet) and $id_forum) {208 if (($objet == 'forum' or !$id_objet) and $id_forum) { 209 209 if ($objet = sql_fetsel(array('id_objet', 'objet'), 'spip_forum', 'id_forum=' . intval($id_forum))) { 210 210 $id_objet = $objet['id_objet']; … … 217 217 } 218 218 // vraiment la... faut pas exagerer ! 219 if ($objet_obligatoire AND!$id_objet) {219 if ($objet_obligatoire and !$id_objet) { 220 220 return false; 221 221 } … … 223 223 return array($objet, $id_objet, $url); 224 224 } 225 226 ?> -
_core_/plugins/forum/balise/formulaire_forum_prive.php
r93612 r93640 126 126 array($objet, $id_objet, $id_forum, $forcer_previsu, $statut, $retour); 127 127 } 128 129 ?> -
_core_/plugins/forum/base/forum.php
r93612 r93640 148 148 return $tables; 149 149 } 150 151 ?> -
_core_/plugins/forum/formulaires/activer_forums_objet.php
r93612 r93640 31 31 function get_forums_publics($id_objet = 0, $objet = 'article') { 32 32 33 if ($objet == 'article' AND$id_objet) {33 if ($objet == 'article' and $id_objet) { 34 34 $obj = sql_fetsel("accepter_forum", "spip_articles", "id_article=" . intval($id_objet)); 35 35 … … 62 62 "objet=" . sql_quote($objet) . " AND id_objet=" . intval($id_objet) . " AND statut IN ('publie', 'off', 'prop', 'spam')"); 63 63 $editable = ($objet == 'article') ? true : false; 64 if (!$editable AND!$nb_forums) {64 if (!$editable and !$nb_forums) { 65 65 return false; 66 66 } … … 86 86 function formulaires_activer_forums_objet_traiter_dist($id_objet, $objet = 'article') { 87 87 include_spip('inc/autoriser'); 88 if ($objet == 'article' ANDautoriser('modererforum', $objet, $id_objet)) {88 if ($objet == 'article' and autoriser('modererforum', $objet, $id_objet)) { 89 89 $statut = _request('accepter_forum'); 90 90 include_spip('base/abstract_sql'); … … 100 100 return array('message_ok' => _T('config_info_enregistree'), 'editable' => true); 101 101 } 102 103 ?> -
_core_/plugins/forum/formulaires/configurer_forums_contenu.php
r93612 r93640 31 31 $erreurs = array(); 32 32 33 if (!_request('forums_titre') AND !_request('forums_texte') AND!_request('forums_urlref')) {33 if (!_request('forums_titre') and !_request('forums_texte') and !_request('forums_urlref')) { 34 34 $erreurs['forums_titre'] = _T('info_obligatoire'); 35 35 } … … 56 56 return array('message_ok' => _T('config_info_enregistree')); 57 57 } 58 59 ?> -
_core_/plugins/forum/formulaires/configurer_forums_notifications.php
r93612 r93640 25 25 unset($l['forum:info_pas_de_forum']); 26 26 foreach ($l as $desc => $val) { 27 $valeurs['prevenir_auteurs_' . $val] = (($m == 'oui') ORstrpos($m, ",$val,") !== false);27 $valeurs['prevenir_auteurs_' . $val] = (($m == 'oui') or strpos($m, ",$val,") !== false); 28 28 } 29 29 … … 44 44 return array('message_ok' => _T('config_info_enregistree')); 45 45 } 46 47 ?> -
_core_/plugins/forum/formulaires/configurer_forums_participants.php
r93612 r93640 29 29 $purger_skel = false; 30 30 if ($accepter_forum = _request('forums_publics') 31 AND($accepter_forum != $GLOBALS['meta']["forums_publics"])31 and ($accepter_forum != $GLOBALS['meta']["forums_publics"]) 32 32 ) { 33 33 $purger_skel = true; … … 59 59 return array('message_ok' => _T('config_info_enregistree')); 60 60 } 61 62 ?> -
_core_/plugins/forum/formulaires/configurer_forums_prives.php
r93612 r93640 42 42 return $res; 43 43 } 44 45 ?> -
_core_/plugins/forum/formulaires/forum.php
r93612 r93640 93 93 // exiger l'authentification des posteurs pour les forums sur abo 94 94 if ($accepter_forum == "abo") { 95 if (!isset($GLOBALS["visiteur_session"]['statut']) OR!$GLOBALS["visiteur_session"]['statut']) {95 if (!isset($GLOBALS["visiteur_session"]['statut']) or !$GLOBALS["visiteur_session"]['statut']) { 96 96 return array( 97 97 'action' => '', #ne sert pas dans ce cas, on la vide pour mutualiser le cache … … 118 118 119 119 // par défaut, on force la prévisualisation du message avant de le poster 120 if (($forcer_previsu == 'non') OR (empty($forcer_previsu) AND$GLOBALS['meta']["forums_forcer_previsu"] == "non")) {120 if (($forcer_previsu == 'non') or (empty($forcer_previsu) and $GLOBALS['meta']["forums_forcer_previsu"] == "non")) { 121 121 $forcer_previsu = 'non'; 122 122 } else { … … 196 196 function forum_fichier_tmp($arg) { 197 197 # astuce : mt_rand pour autoriser les hits simultanes 198 while (($alea = time() +@mt_rand())+intval($arg)199 AND@file_exists($f = _DIR_TMP . "forum_$alea.lck")) {198 while (($alea = time() + @mt_rand()) + intval($arg) 199 and @file_exists($f = _DIR_TMP . "forum_$alea.lck")) { 200 200 }; 201 201 spip_touch($f); … … 206 206 while (($file = @readdir($dh)) !== false) { 207 207 if (preg_match('/^forum_([0-9]+)\.lck$/', $file) 208 AND (time()-@filemtime(_DIR_TMP . $file) > 4*3600)208 and (time() - @filemtime(_DIR_TMP . $file) > 4 * 3600) 209 209 ) { 210 210 spip_unlink(_DIR_TMP . $file); … … 247 247 248 248 // par défaut, on force la prévisualisation du message avant de le poster 249 if (($forcer_previsu == 'non') OR (empty($forcer_previsu) AND$GLOBALS['meta']["forums_forcer_previsu"] == "non")) {249 if (($forcer_previsu == 'non') or (empty($forcer_previsu) and $GLOBALS['meta']["forums_forcer_previsu"] == "non")) { 250 250 $forcer_previsu = 'non'; 251 251 } else { … … 264 264 265 265 if (isset($_FILES['ajouter_document']) 266 AND$_FILES['ajouter_document']['tmp_name']266 and $_FILES['ajouter_document']['tmp_name'] 267 267 ) { 268 268 … … 274 274 // verifier si on possede la cle (ie on est autorise a poster) 275 275 // (sinon tant pis) ; cf. charger.php pour la definition de la cle 276 OR_request('cle_ajouter_document') != calculer_cle_action($a = "ajouter-document-$objet-$id_objet")276 or _request('cle_ajouter_document') != calculer_cle_action($a = "ajouter-document-$objet-$id_objet") 277 277 ) { 278 278 $erreurs['document_forum'] = _T('forum:documents_interdits_forum'); … … 306 306 if (isset($erreurs['document_forum'])) { 307 307 spip_unlink($tmp . '.bin'); 308 unset 308 unset($_FILES['ajouter_document']); 309 309 } else { 310 310 $doc['tmp_name'] = $tmp . '.bin'; … … 314 314 } // restaurer/supprimer le document eventuellement uploade au tour precedent 315 315 elseif (isset($GLOBALS['visiteur_session']['tmp_forum_document']) 316 AND$tmp = $GLOBALS['visiteur_session']['tmp_forum_document']317 ANDfile_exists($tmp . '.bin')316 and $tmp = $GLOBALS['visiteur_session']['tmp_forum_document'] 317 and file_exists($tmp . '.bin') 318 318 ) { 319 319 if (_request('supprimer_document_ajoute')) { … … 328 328 $min_length = (defined('_FORUM_LONGUEUR_MINI') ? _FORUM_LONGUEUR_MINI : 10); 329 329 if (strlen($texte = _request('texte')) < $min_length 330 AND !$ajouter_mot AND$GLOBALS['meta']['forums_texte'] == 'oui'330 and !$ajouter_mot and $GLOBALS['meta']['forums_texte'] == 'oui' 331 331 ) { 332 332 $erreurs['texte'] = _T($min_length == 10 ? 'forum:forum_attention_dix_caracteres' : 'forum:forum_attention_nb_caracteres_mini', 333 333 array('min' => $min_length)); 334 334 } elseif (defined('_FORUM_LONGUEUR_MAXI') 335 AND_FORUM_LONGUEUR_MAXI > 0336 ANDstrlen($texte) > _FORUM_LONGUEUR_MAXI335 and _FORUM_LONGUEUR_MAXI > 0 336 and strlen($texte) > _FORUM_LONGUEUR_MAXI 337 337 ) { 338 338 $erreurs['texte'] = _T('forum:forum_attention_trop_caracteres', … … 343 343 } 344 344 345 if (array_reduce($_POST, 'reduce_strlen', (20 *1024)) < 0) {345 if (array_reduce($_POST, 'reduce_strlen', (20 * 1024)) < 0) { 346 346 $erreurs['erreur_message'] = _T('forum:forum_message_trop_long'); 347 347 } else { 348 348 // Ne pas autoriser d'envoi hacke si forum sur abonnement 349 349 if (controler_forum($objet, $id_objet) == 'abo' 350 AND!test_espace_prive()350 and !test_espace_prive() 351 351 ) { 352 352 if (!isset($GLOBALS['visiteur_session']) 353 OR!isset($GLOBALS['visiteur_session']['statut'])353 or !isset($GLOBALS['visiteur_session']['statut']) 354 354 ) { 355 355 $erreurs['erreur_message'] = _T('forum_non_inscrit'); … … 361 361 362 362 if (strlen($titre = _request('titre')) < 3 363 AND$GLOBALS['meta']['forums_titre'] == 'oui'363 and $GLOBALS['meta']['forums_titre'] == 'oui' 364 364 ) { 365 365 $erreurs['titre'] = _T('forum:forum_attention_trois_caracteres'); 366 366 } 367 367 368 if (!count($erreurs) AND!_request('confirmer_previsu_forum')) {369 if (!_request('envoyer_message') OR$forcer_previsu <> 'non') {368 if (!count($erreurs) and !_request('confirmer_previsu_forum')) { 369 if (!_request('envoyer_message') or $forcer_previsu <> 'non') { 370 370 $previsu = inclure_previsu($texte, $titre, _request('url_site'), _request('nom_site'), _request('ajouter_mot'), 371 371 $doc, … … 379 379 if (!count($erreurs)) { 380 380 if (!test_espace_prive() 381 AND$forcer_previsu <> 'non'382 ANDforum_insert_noprevisu()381 and $forcer_previsu <> 'non' 382 and forum_insert_noprevisu() 383 383 ) { 384 384 $erreurs['erreur_message'] = _T('forum:forum_acces_refuse'); … … 525 525 526 526 if (defined('_FORUM_AUTORISER_POST_ID_FORUM') 527 AND_FORUM_AUTORISER_POST_ID_FORUM528 AND_request('id_forum')527 and _FORUM_AUTORISER_POST_ID_FORUM 528 and _request('id_forum') 529 529 ) { 530 530 $id_forum = _request('id_forum'); … … 563 563 return $res; 564 564 } 565 566 567 ?> -
_core_/plugins/forum/formulaires/forum_prive.php
r93612 r93640 37 37 } 38 38 // si objet, il faut un titre, sinon on est dans un statut privrac/privadm qui permet un forum sans objet 39 if ($objet AND $id_objet AND!$titre = $f($objet, $id_objet, $id_forum, false)) {39 if ($objet and $id_objet and !$titre = $f($objet, $id_objet, $id_forum, false)) { 40 40 return false; 41 41 } … … 57 57 58 58 // par défaut, on force la prévisualisation du message avant de le poster 59 if (($forcer_previsu == 'non') OR (empty($forcer_previsu) AND$GLOBALS['meta']["forums_forcer_previsu"] == "non")) {59 if (($forcer_previsu == 'non') or (empty($forcer_previsu) and $GLOBALS['meta']["forums_forcer_previsu"] == "non")) { 60 60 $forcer_previsu = 'non'; 61 61 } else { … … 101 101 $min_length = (defined('_FORUM_LONGUEUR_MINI') ? _FORUM_LONGUEUR_MINI : 10); 102 102 if (strlen($texte = _request('texte')) < $min_length 103 AND !_request('ajouter_mot') AND$GLOBALS['meta']['forums_texte'] == 'oui'103 and !_request('ajouter_mot') and $GLOBALS['meta']['forums_texte'] == 'oui' 104 104 ) { 105 105 $erreurs['texte'] = _T($min_length == 10 ? 'forum:forum_attention_dix_caracteres' : 'forum:forum_attention_nb_caracteres_mini', … … 107 107 } else { 108 108 if (defined('_FORUM_LONGUEUR_MAXI') 109 AND_FORUM_LONGUEUR_MAXI > 0110 ANDstrlen($texte) > _FORUM_LONGUEUR_MAXI109 and _FORUM_LONGUEUR_MAXI > 0 110 and strlen($texte) > _FORUM_LONGUEUR_MAXI 111 111 ) { 112 112 $erreurs['texte'] = _T('forum:forum_attention_trop_caracteres', … … 119 119 120 120 if (strlen($titre = _request('titre')) < 3 121 AND$GLOBALS['meta']['forums_titre'] == 'oui'121 and $GLOBALS['meta']['forums_titre'] == 'oui' 122 122 ) { 123 123 $erreurs['titre'] = _T('forum:forum_attention_trois_caracteres'); 124 124 } 125 125 126 if (array_reduce($_POST, 'reduce_strlen', (20 *1024)) < 0) {126 if (array_reduce($_POST, 'reduce_strlen', (20 * 1024)) < 0) { 127 127 $erreurs['erreur_message'] = _T('forum:forum_message_trop_long'); 128 128 } 129 129 130 if (!count($erreurs) AND !_request('envoyer_message') AND!_request('confirmer_previsu_forum')) {130 if (!count($erreurs) and !_request('envoyer_message') and !_request('confirmer_previsu_forum')) { 131 131 $previsu = inclure_forum_prive_previsu($texte, $titre, _request('url_site'), _request('nom_site'), 132 132 _request('ajouter_mot')); … … 200 200 return $res; 201 201 } 202 203 204 ?> -
_core_/plugins/forum/forum_administrations.php
r93612 r93640 37 37 $trouver_table(''); // vider le cache des descriptions ! 38 38 if ($desc = $trouver_table('spip_forum') 39 ANDisset($desc['field']['id_article'])39 and isset($desc['field']['id_article']) 40 40 ) { 41 41 ecrire_meta($nom_meta_base_version, '1.0.0'); … … 118 118 effacer_meta($nom_meta_base_version); 119 119 } 120 121 ?> -
_core_/plugins/forum/forum_autoriser.php
r93612 r93640 39 39 function autoriser_foruminternesuivi_menu_dist($faire, $type = '', $id = 0, $qui = null, $opt = null) { 40 40 if ((($GLOBALS['meta']['forum_prive'] == 'non') && ($GLOBALS['meta']['forum_prive_admin'] == 'non')) 41 OR(($GLOBALS['meta']['forum_prive'] == 'non') && ($qui['statut'] == '1comite'))41 or (($GLOBALS['meta']['forum_prive'] == 'non') && ($qui['statut'] == '1comite')) 42 42 ) { 43 43 return false; … … 123 123 include_spip('inc/forum'); 124 124 if ($racine = racine_forum($id) 125 AND list($objet, $id_objet,) = $racine126 AND$objet125 and list($objet, $id_objet, ) = $racine 126 and $objet 127 127 ) { 128 128 return autoriser('modererforum', $objet, $id_objet); … … 247 247 return true; 248 248 } 249 250 ?> -
_core_/plugins/forum/forum_fonctions.php
r93612 r93640 96 96 return $texte; 97 97 } 98 99 ?> -
_core_/plugins/forum/forum_ieconfig.php
r93612 r93640 37 37 return $table; 38 38 } 39 40 ?> -
_core_/plugins/forum/forum_pipelines.php
r93612 r93640 45 45 $texte .= "\n<br />" . $lien; 46 46 } 47 if (strlen($texte) AND$GLOBALS['meta']['forum_prive_objets'] != 'non') {47 if (strlen($texte) and $GLOBALS['meta']['forum_prive_objets'] != 'non') { 48 48 $cpt2 = sql_countsel("spip_articles", "statut='prop'"); 49 49 if ($cpt2) { … … 118 118 function forum_afficher_fiche_objet($flux) { 119 119 if ($type = $flux['args']['type'] 120 AND$table_sql = table_objet_sql($type)121 ANDin_array($table_sql, explode(',', $GLOBALS['meta']['forum_prive_objets']))120 and $table_sql = table_objet_sql($type) 121 and in_array($table_sql, explode(',', $GLOBALS['meta']['forum_prive_objets'])) 122 122 ) { 123 123 $id = $flux['args']['id']; … … 135 135 $id_rubrique = $flux['args']['id']; 136 136 if (autoriser('publierdans', 'rubrique', $id_rubrique) 137 AND!sql_getfetsel('id_parent', 'spip_rubriques', 'id_rubrique=' . intval($id_rubrique))137 and !sql_getfetsel('id_parent', 'spip_rubriques', 'id_rubrique=' . intval($id_rubrique)) 138 138 ) { 139 139 include_spip('inc/forum'); … … 161 161 function forum_afficher_config_objet($flux) { 162 162 if (($type = $flux['args']['type']) 163 AND$id = $flux['args']['id']163 and $id = $flux['args']['id'] 164 164 ) { 165 165 if (autoriser('modererforum', $type, $id)) { … … 183 183 $statut = $flux['args']['statut']; 184 184 if ($GLOBALS['meta']['forum_prive_objets'] != 'non' 185 AND$statut == 'prop'185 and $statut == 'prop' 186 186 ) { 187 187 $flux['data'] .= "<p class='article_prop'>" . _T('forum:text_article_propose_publication_forum') . '</p>'; … … 200 200 function forum_boite_infos($flux) { 201 201 if ($flux['args']['type'] == 'rubrique' 202 AND$id_rubrique = $flux['args']['id']202 and $id_rubrique = $flux['args']['id'] 203 203 ) { 204 204 if (autoriser('publierdans', 'rubrique', $id_rubrique) 205 205 // [doc] d'ou il vient ce row ? 206 AND (!isset($flux['args']['row']['id_parent']) OR!$flux['args']['row']['id_parent'])206 and (!isset($flux['args']['row']['id_parent']) or !$flux['args']['row']['id_parent']) 207 207 ) { 208 208 include_spip('inc/forum'); … … 222 222 } 223 223 } elseif ($flux['args']['type'] == 'auteur' 224 AND$id_auteur = $flux['args']['id']224 and $id_auteur = $flux['args']['id'] 225 225 ) { 226 226 if ($nb = sql_countsel('spip_forum', "statut!='poubelle' AND id_auteur=" . intval($id_auteur))) { … … 338 338 ## definir a 0 pour desactiver 339 339 if (!defined('_CNIL_PERIODE')) { 340 define('_CNIL_PERIODE', 3600 *24*31*4);340 define('_CNIL_PERIODE', 3600 * 24 * 31 * 4); 341 341 } 342 342 if (_CNIL_PERIODE) { 343 $critere_cnil = 'date_heure<"' . date('Y-m-d', time() -_CNIL_PERIODE) . '"'343 $critere_cnil = 'date_heure<"' . date('Y-m-d', time() - _CNIL_PERIODE) . '"' 344 344 . ' AND statut != "spam"' 345 345 . ' AND (ip LIKE "%.%" OR ip LIKE "%:%")'; # ipv4 ou ipv6 … … 382 382 # Pour les forums, unifier par id_thread et forcer statut='publie' 383 383 if ($flux['args']['type'] == 'forum' 384 AND$points = $flux['data']384 and $points = $flux['data'] 385 385 ) { 386 386 $serveur = $flux['args']['serveur']; … … 414 414 function forum_rubrique_encours($flux) { 415 415 if (strlen($flux['data']) 416 AND$GLOBALS['meta']['forum_prive_objets'] != 'non'416 and $GLOBALS['meta']['forum_prive_objets'] != 'non' 417 417 ) { 418 418 $flux['data'] = _T('forum:texte_en_cours_validation_forum') . $flux['data']; … … 440 440 return $objets; 441 441 } 442 443 ?> -
_core_/plugins/forum/inc/article_accepter_forums_publics.php
r93612 r93640 22 22 return substr($accepter_forum, 0, 3); 23 23 } 24 25 26 ?> -
_core_/plugins/forum/inc/email_notification_forum.php
r93612 r93640 77 77 $traitement = (isset($GLOBALS['table_des_traitements'][$champ]) ? $GLOBALS['table_des_traitements'][$champ] : null); 78 78 if (is_array($traitement) 79 AND (isset($traitement[$table_objet]) ORisset($traitement[0]))79 and (isset($traitement[$table_objet]) or isset($traitement[0])) 80 80 ) { 81 81 $traitement = $traitement[isset($traitement[$table_objet]) ? $table_objet : 0]; … … 84 84 } 85 85 86 $links = $links +extraire_balises($v, 'a');86 $links = $links + extraire_balises($v, 'a'); 87 87 } 88 88 $links = extraire_attribut($links, 'href'); -
_core_/plugins/forum/inc/forum.php
r93612 r93640 131 131 132 132 if ($row['id_parent'] 133 AND$row['id_thread'] != $id_forum133 and $row['id_thread'] != $id_forum 134 134 ) // eviter boucle infinie 135 135 { … … 244 244 } else { 245 245 include_spip('base/objets'); 246 if ($publie AND!objet_test_si_publie($objet, $id_objet)) {246 if ($publie and !objet_test_si_publie($objet, $id_objet)) { 247 247 return false; 248 248 } … … 251 251 } 252 252 253 if ($titre AND$id_forum) {253 if ($titre and $id_forum) { 254 254 $titre_m = sql_getfetsel('titre', 'spip_forum', "id_forum = " . intval($id_forum)); 255 255 if (!$titre_m) { … … 357 357 // http://code.spip.net/@reduce_strlen 358 358 function reduce_strlen($n, $c) { 359 return $n-(is_string($c) ? strlen($c) : 0); 360 } 361 362 ?> 359 return $n - (is_string($c) ? strlen($c) : 0); 360 } -
_core_/plugins/forum/inc/forum_insert.php
r93612 r93640 57 57 if (!in_array($force_statut, array('privrac', 'privadm'))) { 58 58 if (!strlen($objet) 59 OR!intval($id_objet)59 or !intval($id_objet) 60 60 ) { 61 61 spip_log("Erreur insertion forum sur objet='$objet', id_objet=$id_objet", 'forum.' . _LOG_ERREUR); … … 105 105 if (!in_array($statut, array('privrac', 'privadm'))) { 106 106 // si le statut est vide, c'est qu'on ne veut pas de ce presume spam ! 107 if (!$statut OR !$objet OR!$id_objet) {107 if (!$statut or !$objet or !$id_objet) { 108 108 $args = func_get_args(); 109 109 spip_log("Erreur sur forum_insert_base " . var_export($args, 1), 'forum.' . _LOG_ERREUR); … … 149 149 // Ajouter un document 150 150 if (isset($_FILES['ajouter_document']) 151 AND$_FILES['ajouter_document']['tmp_name']151 and $_FILES['ajouter_document']['tmp_name'] 152 152 ) { 153 153 $files[] = array( … … 192 192 return $champs; 193 193 } 194 195 ?> -
_core_/plugins/forum/notifications/forumposte.php
r93612 r93640 31 31 32 32 // plugin notification si present 33 $prevenir_auteurs = isset($GLOBALS['notifications']['prevenir_auteurs']) AND$GLOBALS['notifications']['prevenir_auteurs'];33 $prevenir_auteurs = isset($GLOBALS['notifications']['prevenir_auteurs']) and $GLOBALS['notifications']['prevenir_auteurs']; 34 34 // sinon voie normale 35 if ($t['objet'] == 'article' AND!$prevenir_auteurs) {35 if ($t['objet'] == 'article' and !$prevenir_auteurs) { 36 36 $s = sql_getfetsel('accepter_forum', 'spip_articles', "id_article=" . $t['id_objet']); 37 37 if (!$s) { … … 40 40 41 41 $prevenir_auteurs = (strpos(@$GLOBALS['meta']['prevenir_auteurs'], ",$s,") !== false 42 OR@$GLOBALS['meta']['prevenir_auteurs'] === 'oui'); // compat42 or @$GLOBALS['meta']['prevenir_auteurs'] === 'oui'); // compat 43 43 } 44 44 … … 58 58 59 59 while ($qui = sql_fetch($result)) { 60 if ($qui['email'] ANDautoriser('modererforum', $t['objet'], $t['id_objet'], $qui['id_auteur'])) {60 if ($qui['email'] and autoriser('modererforum', $t['objet'], $t['id_objet'], $qui['id_auteur'])) { 61 61 $tous[] = $qui['email']; 62 62 } … … 67 67 $destinataires = pipeline('notifications_destinataires', 68 68 array( 69 'args' => array('quoi' => $quoi, 'id' => $id_forum, 'options' => $options) 70 , 69 'args' => array('quoi' => $quoi, 'id' => $id_forum, 'options' => $options), 71 70 'data' => $tous 72 71 ) … … 93 92 } 94 93 } 95 96 ?> -
_core_/plugins/forum/notifications/forumvalide.php
r93612 r93640 36 36 if (!$t 37 37 // forum sur un message prive : pas de notification ici (cron) 38 OR@$t['statut'] == 'perso'38 or @$t['statut'] == 'perso' 39 39 ) { 40 40 return; … … 42 42 43 43 // plugin notification si present 44 $prevenir_auteurs = isset($GLOBALS['notifications']['prevenir_auteurs']) AND$GLOBALS['notifications']['prevenir_auteurs'];44 $prevenir_auteurs = isset($GLOBALS['notifications']['prevenir_auteurs']) and $GLOBALS['notifications']['prevenir_auteurs']; 45 45 // sinon voie normale 46 if ($t['objet'] == 'article' AND!$prevenir_auteurs) {46 if ($t['objet'] == 'article' and !$prevenir_auteurs) { 47 47 $s = sql_getfetsel('accepter_forum', 'spip_articles', "id_article=" . $t['id_objet']); 48 48 if (!$s) { … … 51 51 52 52 $prevenir_auteurs = (strpos(@$GLOBALS['meta']['prevenir_auteurs'], ",$s,") !== false 53 OR@$GLOBALS['meta']['prevenir_auteurs'] === 'oui'); // compat53 or @$GLOBALS['meta']['prevenir_auteurs'] === 'oui'); // compat 54 54 } 55 55 … … 107 107 108 108 } 109 110 ?> -
_core_/plugins/forum/prive/modeles/forum_fonctions.php
r93612 r93640 24 24 // sinon on fait une requete groupee pour essayer de ne le faire qu'une fois pour toute la liste 25 25 $emails = sql_allfetsel("DISTINCT email_auteur", "spip_forum", 26 "id_forum>" . intval($id_forum -50) . " AND id_forum<" . intval($id_forum+50));26 "id_forum>" . intval($id_forum - 50) . " AND id_forum<" . intval($id_forum + 50)); 27 27 $emails = array_map('reset', $emails); 28 28 $emails = array_filter($emails); -
_core_/plugins/forum/public/forum.php
r93612 r93640 27 27 // de meme qu'un critere sur {id_forum} ou {id_parent} 28 28 if (!isset($boucle->modificateur['tout']) 29 AND!isset($boucle->modificateur['plat'])30 AND!isset($boucle->modificateur['criteres']['id_forum'])31 AND!isset($boucle->modificateur['criteres']['id_parent'])29 and !isset($boucle->modificateur['plat']) 30 and !isset($boucle->modificateur['criteres']['id_forum']) 31 and !isset($boucle->modificateur['criteres']['id_parent']) 32 32 ) { 33 33 array_unshift($boucle->where, array("'='", "'$id_table." . "id_parent'", 0)); … … 110 110 // a la boucle mere de reserver son id_primary 111 111 if ($p->id_boucle 112 ANDisset($p->boucles[$p->id_boucle])113 AND$primary = $p->boucles[$p->id_boucle]->primary112 and isset($p->boucles[$p->id_boucle]) 113 and $primary = $p->boucles[$p->id_boucle]->primary 114 114 ) { 115 115 $_type = _q($p->boucles[$p->id_boucle]->type_requete); … … 169 169 if ($id_parent = intval($reponse)) { 170 170 if ($type 171 AND$type != 'forums'172 AND$primary171 and $type != 'forums' 172 and $primary 173 173 ) { 174 174 $forum = array('objet' => $type, 'id_objet' => $primary); … … 186 186 187 187 // Ce n'est pas une reponse, on prend la boucle mere 188 if ($type AND$primary) {188 if ($type and $primary) { 189 189 return id_table_objet($type) . '=' . intval($primary); 190 190 } … … 194 194 foreach ($env as $k => $v) { 195 195 if (preg_match(',^id_([a-z_]+)$,S', $k) 196 AND$id = intval($v)196 and $id = intval($v) 197 197 ) { 198 198 return id_table_objet($k) . '=' . $v; … … 229 229 // http://code.spip.net/@lang_parametres_forum 230 230 function lang_parametres_forum($qs, $lang) { 231 if (is_array($lang) ANDpreg_match(',id_([a-z_]+)=([0-9]+),', $qs, $r)) {231 if (is_array($lang) and preg_match(',id_([a-z_]+)=([0-9]+),', $qs, $r)) { 232 232 $id = 'id_' . $r[1]; 233 233 if ($t = $lang[$id]) { … … 237 237 // Si ce n'est pas la meme que celle du site, l'ajouter aux parametres 238 238 239 if ($lang AND$lang <> $GLOBALS['meta']['langue_site']) {239 if ($lang and $lang <> $GLOBALS['meta']['langue_site']) { 240 240 return $qs . "&lang=" . $lang; 241 241 } … … 251 251 return $code; 252 252 } 253 254 ?> -
_core_/plugins/forum/urls/generer_url_ecrire_forum.php
r93612 r93640 18 18 function urls_generer_url_ecrire_forum_dist($id, $args = '', $ancre = '', $public = null, $connect = '') { 19 19 $a = "id_forum=" . intval($id); 20 if (is_null($public) AND!$connect) {20 if (is_null($public) and !$connect) { 21 21 $public = objet_test_si_publie('forum', $id, $connect); 22 22 } 23 $h = ($public OR$connect)23 $h = ($public or $connect) 24 24 ? generer_url_entite_absolue($id, 'forum', $args, $ancre, $connect) 25 25 : (generer_url_ecrire('controler_forum', "debut_forum=@$id" . ($args ? "&$args" : '')) -
_core_/plugins/forum/urls/generer_url_forum.php
r93612 r93640 18 18 if ($id_forum = intval($id_forum)) { 19 19 include_spip('inc/forum'); 20 list($type, $id, ) = racine_forum($id_forum);20 list($type, $id, ) = racine_forum($id_forum); 21 21 if ($type) { 22 22 if (!$ancre) { … … 30 30 return ''; 31 31 } 32 33 ?>
Note: See TracChangeset
for help on using the changeset viewer.