Tfe

Ongi etorri tfe-ren webgunera...

Old stuff/old_sites/www/include/newnews.php

(Deskargatu)
<div class="full">
<?
    if (empty($_POST['titre']) or
	empty($_POST['section']) or
	empty($_POST['contenu']) or empty($nick)
	)
    {
	echo "
	<h3>Proposition de News</h3>
	<form action=\"index.php?page=newnews\" method=\"post\">
	<dl>
	<dt>Section</dt>
	<dd><input type=\"text\" name=\"section\" value=\"".$_POST['section']."\" /></dd>
	<dt>Titre</dt>
	<dd><input type=\"text\" name=\"titre\" value=\"".$_POST['titre']."\" /></dd>
	<dt>Contenu</dt>
	<dd><textarea rows=\"5\" cols=\"80\" name=\"contenu\">".$_POST['conten']."</textarea></dd>
	<dt>Validation</dt>
	<dd><input name=\"action\" type=\"submit\" value=\"Pre-visualiser\" /> <input name=\"action\" type=\"submit\" value=\"Proposer\" /></dd>
	</dl>
	";
    }
    
    
    else{
	$action = preg_replace("/[^\-a-zA-Z]/","",$_POST['action']);
	if ($action == "Pre-visualiser")
	{
	        
	    echo "<h3>Pre-visualisation</h3><div class=\"news\">
	    <h5>[".text2html($_POST['section'])."] ".text2html($_POST['titre'])."</h5>";
	    affichage($_POST['contenu'],0,0);
	    echo "</div>";
	echo "
	<h3>Proposition de News</h3>
	<form action=\"index.php?page=newnews\" method=\"post\">
	<dl>
	<dt>Section</dt>
	<dd><input type=\"text\" name=\"section\" value=\"".$_POST['section']."\" /></dd>
	<dt>Titre</dt>
	<dd><input type=\"text\" name=\"titre\" value=\"".$_POST['titre']."\" /></dd>
	<dt>Contenu</dt>
	<dd><textarea rows=\"5\" cols=\"80\" name=\"contenu\">".$_POST['contenu']."</textarea></dd>
	<dt>Validation</dt>
	<dd><input name=\"action\" type=\"submit\" value=\"Pre-visualiser\" /> <input name=\"action\" type=\"submit\" value=\"Proposer\" /></dd>
	</dl>
	";
    }
    else
    {
	echo "<h3>Validation de la news</h3>";
	$query = "INSERT INTO mp_prop_news (pseudo,titre,section,contenu) VALUES (
		    '".$nick."',
		    '".text2html($_POST['titre'])."',		    
		    '".text2html($_POST['section'])."',
		    '".text2html($_POST['contenu'])."')";
	mysql_query($query) or die(mysql_error());	    
	echo "<p>Votre proposition de news a bien &eacute;t&eacute; prise en compte. Merci de patienter la validation.</p>";
    
    }
	    
	    
	}
    
    
    
    
    
?>    
</div>