[ Index ]
 

Code source de SPIP 1.8.3

Accédez au Source d'autres logiciels libres | Soutenez Angelica Josefina !

title

Body

[fermer]

/ecrire/ -> forum_envoi.php3 (source)

   1  <?php
   2  
   3  /***************************************************************************\
   4   *  SPIP, Systeme de publication pour l'internet                           *
   5   *                                                                         *
   6   *  Copyright (c) 2001-2005                                                *
   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  
  14  include  ("inc.php3");
  15  include_ecrire  ("inc_barre.php3");
  16  include_ecrire  ("inc_forum.php3");
  17  
  18  
  19  if ($modif_forum != "oui")
  20      $titre_message = ereg_replace("^([^>])", "> \\1", $titre_message);
  21  
  22  $nom = corriger_caracteres($connect_nom);
  23  $adresse_retour = rawurldecode($adresse_retour);
  24  
  25  if ($valider_forum AND ($statut!='')) {
  26      $titre_message = corriger_caracteres($titre_message);
  27      $texte = corriger_caracteres($texte);
  28      $query = "INSERT INTO spip_forum
  29      (titre, texte, date_heure, nom_site, url_site, statut, id_auteur,
  30      auteur, email_auteur, id_rubrique, id_parent, id_article, id_breve,
  31      id_message, id_syndic)
  32      VALUES ('".texte_script($titre_message)."',
  33      '".texte_script($texte)."', NOW(),
  34      '".texte_script($nom_site)."',
  35      '".texte_script($url_site)."',
  36      '".texte_script($statut)."',
  37      $connect_id_auteur,
  38      '".texte_script($nom)."',
  39      '$connect_email',
  40      '$id_rubrique', '$id_parent', '$id_article', '$id_breve',
  41      '$id_message', '$id_syndic')";
  42      $result = spip_query($query);
  43  
  44      calculer_threads();
  45  
  46      if ($id_message > 0) {
  47          $query = "UPDATE spip_auteurs_messages SET vu = 'non'
  48              WHERE id_message='$id_message'";
  49          $result = spip_query($query);
  50      }
  51      redirige_par_entete($adresse_retour);
  52  }
  53  
  54  if ($id_message) debut_page(_T('titre_page_forum_envoi'), "asuivre", "messagerie");
  55  else debut_page(_T('titre_page_forum_envoi'), "redacteurs");
  56  debut_gauche();
  57  debut_droite();
  58  
  59  
  60  if ($id_parent) {
  61      $query = "SELECT * FROM spip_forum WHERE id_forum=$id_parent";
  62      $result = spip_query($query);
  63      if ($row = spip_fetch_array($result)) {
  64          $id_article = $row['id_article'];
  65          $id_breve = $row['id_breve'];
  66          $id_rubrique = $row['id_rubrique'];
  67          $id_message = $row['id_message'];
  68          $id_syndic = $row['id_syndic'];
  69          $statut = $row['statut'];
  70          $titre_parent = $row['titre'];
  71          $texte_parent = $row['texte'];
  72          $auteur_parent = $row['auteur'];
  73          $id_auteur_parent = $row['id_auteur'];
  74          $date_heure_parent = $row['date_heure'];
  75          $nom_site_parent = $row['nom_site'];
  76          $url_site_parent = $row['url_site'];
  77      }
  78  }
  79  
  80  
  81  
  82  if ($titre_parent) {
  83      debut_cadre_forum("forum-interne-24.gif", false, "", typo($titre_parent));
  84      echo "<span class='arial2'>$date_heure_parent</span>";
  85      echo " ".typo($auteur_parent);
  86  
  87      if ($id_auteur_parent AND $activer_messagerie != "non" AND $connect_activer_messagerie != "non") {
  88          $bouton = bouton_imessage($id_auteur_parent, $row);
  89          if ($bouton) echo "&nbsp;".$bouton;
  90      }
  91  
  92      echo justifier(propre($texte_parent));
  93  
  94      if (strlen($url_site_parent) > 10 AND $nom_site_parent) {
  95          echo "<p align='left'><font face='Verdana,Arial,Sans,sans-serif'><b><a href='$url_site_parent'>$nom_site_parent</a></b></font>";
  96      }
  97  
  98      fin_cadre_forum();
  99  
 100      if ($modif_forum == "oui") {
 101          echo "<table width=100% cellpadding=0 cellspacing=0 border=0><tr>";
 102          echo "<td width='10' height='13' valign='top' background='" . _DIR_IMG_PACK . "forum-vert.gif'>",
 103            http_img_pack('rien.gif', ' ', "width='10' height='13' border='0'"),
 104            "</td>\n";
 105          echo "\n<td width=100% valign='top' rowspan='2'>";
 106      }
 107  }
 108  
 109  
 110  if ($modif_forum == "oui") {
 111      debut_cadre_thread_forum("", false, "", typo($titre_message));
 112  
 113      echo propre($texte);
 114  
 115      if (strlen($nom_site)>0) {
 116          echo "<p><a href='$url_site'>$nom_site</a>";
 117      }
 118  
 119      echo "<form action='forum_envoi.php3' name='formulaire' method='post'>";
 120      echo "<p><div align='right'><INPUT CLASS='fondo' TYPE='submit' NAME='valider_forum' VALUE='"._T('bouton_envoyer_message')."'></div>";
 121  
 122      fin_cadre_thread_forum();
 123      if ($titre_parent) {
 124          echo "</td></tr><tr>";
 125          echo "<td width=10 valign='top' background='" . _DIR_IMG_PACK . "rien.gif'>",
 126            http_img_pack("forum-droite$spip_lang_rtl.gif",
 127                  addslashes($titre_parent),
 128                  "width='10' height='13' border='0'"), "</td>\n";
 129          echo "</tr></table>";
 130      }
 131  }
 132  else {
 133      echo "<FORM ACTION='forum_envoi.php3' name='formulaire' METHOD='post'>";
 134  }
 135  
 136      echo "<div>&nbsp;</div>";
 137  
 138  
 139  debut_cadre_formulaire(($statut == 'privac') ? "" : 'background-color: #dddddd;');
 140  
 141  echo "<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 BACKGROUND='' WIDTH=\"100%\"><TR><TD>";
 142  $forum_stat = $statut;
 143  if ($forum_stat == "prive") $logo = "forum-interne-24.gif";
 144   else if ($forum_stat == "privadm") $logo = "forum-admin-24.gif";
 145   else if ($forum_stat == "privrac") $logo = "forum-interne-24.gif";
 146   else $logo = "forum-public-24.gif";
 147  
 148  icone(_T('icone_retour'), $adresse_retour, $logo);
 149  echo "</TD>";
 150  
 151  echo "<TD><IMG SRC='" . _DIR_IMG_PACK . "rien.gif' WIDTH=10 BORDER=0></td><TD WIDTH=\"100%\">";
 152  echo "<B>"._T('info_titre')."</B><BR>";
 153  $titre_message = entites_html($titre_message);
 154  echo "<INPUT TYPE='text' CLASS='formo' NAME='titre_message' VALUE=\"$titre_message\" SIZE='40'><P>\n";
 155  echo "</TD></TR></TABLE>";
 156  
 157  if (!$modif_forum OR $modif_forum == "oui") {
 158      echo "<INPUT TYPE='Hidden' NAME='modif_forum' VALUE='oui'>\n";
 159  }
 160  
 161  echo "<INPUT TYPE='Hidden' NAME='adresse_retour' VALUE=\"$adresse_retour\">\n";
 162  echo "<INPUT TYPE='Hidden' NAME='id_rubrique' VALUE=\"$id_rubrique\">\n";
 163  echo "<INPUT TYPE='Hidden' NAME='id_parent' VALUE=\"$id_parent\">\n";
 164  echo "<INPUT TYPE='Hidden' NAME='id_article' VALUE=\"$id_article\">\n";
 165  echo "<INPUT TYPE='Hidden' NAME='id_breve' VALUE=\"$id_breve\">\n";
 166  echo "<INPUT TYPE='Hidden' NAME='id_message' VALUE=\"$id_message\">\n";
 167  echo "<INPUT TYPE='Hidden' NAME='id_syndic' VALUE=\"$id_syndic\">\n";
 168  echo "<INPUT TYPE='Hidden' NAME='statut' VALUE=\"$statut\">\n";
 169  
 170  
 171  echo "<p><B>"._T('info_texte_message')."</B><BR>";
 172  echo _T('info_creation_paragraphe')."<BR>";
 173  echo afficher_barre('document.formulaire.texte', true);
 174  echo "<TEXTAREA NAME='texte' ".$GLOBALS['browser_caret']." ROWS='15' CLASS='formo' COLS='40' wrap=soft>";
 175  echo entites_html($texte);
 176  echo "</TEXTAREA><P>\n";
 177  
 178  if ($statut != 'perso' AND $options == "avancees") {
 179      echo "<B>"._T('info_lien_hypertexte')."</B><BR>";
 180      echo _T('texte_lien_hypertexte')."<BR>";
 181      echo _T('texte_titre_02')."<BR>";
 182      echo "<INPUT TYPE='text' CLASS='forml' NAME='nom_site' VALUE=\"".entites_html($nom_site)."\" SIZE='40'><BR>";
 183  
 184      $lien_url="http://";
 185      echo _T('info_url')."<BR>";
 186      echo "<INPUT TYPE='text' CLASS='forml' NAME='url_site' VALUE=\"".entites_html($url_site)."\" SIZE='40'><P>";
 187  }
 188  
 189  echo "<DIV ALIGN='right'><INPUT CLASS='fondo' TYPE='submit' NAME='Valider' VALUE='"._T('bouton_voir_message')."'></div>";
 190  echo "</FORM>";
 191  
 192  fin_page();
 193  fin_cadre_formulaire();
 194  
 195  ?>


Généré le : Thu Feb 22 22:27:47 2007 par Balluche grâce à PHPXref 0.7