- <?php 
- //Script para evitar que no se realize nada sin haber presionado previamente el botoncito del mal.. jijiiji 
- if ($_GET['action'] == "true"){ 
-   
- } 
- ?> 
- <form method="GET" action="index.php"> 
- <fieldset><legend>Acciones:</legend> 
-   <table width="100%"> 
-     <tr> 
-       <td width="29%"><input type="radio" name="noticia" value="modificar" /> 
-       Modificar Noticia</td> 
-       <td width="27%"><input type="radio" name="noticia" value="eliminar" />  
-         Eliminar Noticia 
- </td> 
-       <td width="39%"><input type="radio" name="noticia" value="crear" /> 
-       Crear nueva noticia        </td> 
-     <td width="5%" align="center"><input type="submit" name="btn" id="btn" value="Enviar" /></td> 
-   </tr> 
- </table> 
- </fieldset> 
- </form> 
- <?php  
- if ($_GET['noticia']=="modificar"){ 
- ?> 
- <form method="GET" action="index.php"> 
- <fieldset><legend>Modificar Noticia:</legend> 
-   <table width="100%"> 
-     <tr> 
-       <td width="6%">Noticia:</td> 
-       <td width="89%"><select name="noticia" id="noticia"> 
-   
- <?php 
- //traer las noticias ya existentes carajo !! 
- //Imprimir el combolist 
-     print "<option value=".$noticias['id']." >".$noticias['titulo']."</option>"; 
- } 
- ?> 
-       </select></td> 
-     <td width="5%" align="center"><input type="submit" name="btn" id="btn" value="Enviar" /></td> 
-   </tr> 
- </table> 
- </fieldset> 
- </form> 
- <?php    
- } 
- ?> 
-   
- <?php  
- if ($_GET['noticia']=="eliminar"){ 
- ?> 
- <form method="GET" action="index.php"> 
- <fieldset> 
-   <legend>Eliminar:</legend> 
-   <table width="100%"> 
-     <tr> 
-       <td width="6%">Noticia:</td> 
-       <td width="89%"><select name="noticia" id="noticia"> 
-   
- <?php 
- //traer las noticias ya existentes carajo !! 
- //Imprimir el combolist 
-     print "<option value=".$noticias['id']." >".$noticias['titulo']."</option>"; 
- } 
- ?> 
-       </select></td> 
-     <td width="5%" align="center"><input type="submit" name="btn" id="btn" value="Enviar" /></td> 
-   </tr> 
- </table> 
- </fieldset> 
- </form> 
- <?php    
- } 
- ?> 
-   
- <?php  
- if($_GET['noticia']=="crear"){ 
-     ?> 
- <form method="GET" action="index.php"> 
- <fieldset> 
-   <legend>Generar Noticia:</legend> 
-   <table width="100%"> 
-     <tr> 
-       <td width="46%"><input type="radio" name="noticia" value="nueva" /> 
-       Noticia Nueva</td> 
-       <td width="49%"><input type="radio" name="noticia" value="phpbb" /> 
- Noticia extraida del phpBB3 
-   <input type="hidden" name="action" id="actioon" value="true" /></td> 
-     <td width="5%" align="center"><input type="submit" name="btn" id="btn" value="Enviar" /></td> 
-   </tr> 
- </table> 
- </fieldset> 
- </form>  
- <?php  
- } 
- ?> 
-   
- <?php 
- //Si se elegio NUEVA NOTICIA 
- if ($_GET['noticia'] == "nueva"){ 
- ?> 
-   
- <form action="" method="GET" enctype="multipart/form-data" name="form1" id="form1"> 
- <fieldset> 
-   <legend>Generando una nueva noticia:</legend> 
-   
-   <table width="100%"> 
-     <tr> 
-       <td width="10%"> Elija la Categoria:     </td> 
-       <td width="85%"> 
-         <select name="categoria" id="categoria"> 
-           <option value="analisis">Analisis</option> 
-           <option value="entrevista">Entrevistas</option> 
-           <option value="novedad">Novedades</option> 
-           <option value="concierto">Conciertos</option> 
-         </select> 
-       </td> 
-       <td width="5%" align="center"> </td> 
-     </tr> 
-     <tr> 
-       <td>Titulo:</td> 
-       <td><input name="titulo" type="text" id="titulo" size="50" maxlength="50" /></td> 
-       <td align="center"> </td> 
-     </tr> 
-     <tr> 
-       <td valign="top">Contenido:</td> 
-       <td><textarea name="comentario" cols="100" rows="10" id="comentario"></textarea></td> 
-       <td align="center"> </td> 
-     </tr> 
-     <tr> 
-       <td valign="top">Imagen:</td> 
-       <td><input type="file" name="img" id="img" /> 
-         <input type="hidden" name="action" id="actioon2" value="NoticiaNueva" /> 
-         <input type="hidden" name="noticia" id="actioon3" value="nueva" /></td> 
-       <td align="center"><input type="submit" name="btn" id="btn" value="Enviar" /></td> 
-     </tr> 
-   </table> 
- </fieldset> 
- </form> 
- <?php 
- } 
- //Si se elegio extraerla del FORO 
- if ($_GET['noticia'] == "phpbb"){ 
- ?> 
- <form id="form2" name="form1" method="GET" action=""> 
-   <fieldset> 
-     <legend>Extrayendo una noticia del foro: </legend> 
-     <table width="100%"> 
-       <tr> 
-         <td width="10%"> Elija la Categoria: </td> 
-         <td width="85%"> 
-         <select name="categoria" id="categoria"> 
-           <option value="analisis">Analisis</option> 
-           <option value="entrevista">Entrevistas</option> 
-           <option value="novedad">Novedades</option> 
-           <option value="concierto">Conciertos</option> 
-         </select></td> 
-         <td width="5%" align="center"> </td> 
-       </tr> 
-       <tr> 
-         <td>Escriba el ID:</td> 
-         <td><input name="foroID" type="text" id="foroID" size="10" maxlength="10" /></td> 
-         <td align="center"> </td> 
-       </tr> 
-       <tr> 
-         <td>Imagen:</td> 
-         <td><input type="file" name="img" id="img" /> 
-         <input type="hidden" name="action" id="actioon4" value="NoticiaPHPbb" /> 
-         <input type="hidden" name="noticia" id="actioon5" value="phpbb" /></td> 
-         <td align="center"><input type="submit" name="btn" id="btn" value="Enviar" /></td> 
-       </tr> 
-     </table> 
-   </fieldset> 
- </form> 
- <p> 
-   <?php  
- } 
- //Almacenando las nuevas noticias generadas 
- if($_GET['action']=="NoticiaNueva"){ 
-      
-     //Validando que no haya campos en blancos 
-     if($_GET['categoria']==""){ 
-         print "<table width=100% class=advertencia><tr><td>No puede dejar campos en blancos, vuelva a intentarlo</td></tr></table>"; 
-         $_GET['noticia'] = "nueva"; 
-     }//Si todo esta bien procesamos la noticia CARAJO 
-     else{ 
-     $categoria = $_GET['categoria']; 
-     $titulo = $_GET['titulo']; 
-     $comentario = $_GET['comentario']; 
-     $img = $_GET['img']; 
-      
-     mysql_query("insert into $tabla[2] (titulo,comentario,img,categoria,fecha) values ('$titulo','$comentario','$img','$categoria','$fecha')",$cnPortal)-  or  die(mysql_error());
 
-     print "<table width=100% class=satisfactorio><tr><td>Noticia publicada correctamente !!</td></tr></table>"; 
-     }    
-      
- } 
-   
- //Almacenando las noticias de las ya existentes del PHPBb 
- if($_GET['action']=="NoticiaPHPbb"){ 
-      
-     //Validando que no haya campos en blancos 
-     if($_GET['foroID']==""){ 
-         print "<table width=100% class=advertencia><tr><td>No puede dejar campos en blancos, vuelva a intentarlo</td></tr></table>"; 
-         $_GET['noticia'] = "nueva"; 
-     }//Si todo esta bien procesamos la noticia CARAJO 
-     else{ 
-     $categoria = $_GET['categoria']; 
-     $foroID = $_GET['foroID']; 
-     $img = $_GET['img']; 
-      
-     $extraer = mysql_query("select topic_first_poster_name,topic_title,post_text from $tabla[1] inner join phpbb_posts on phpbb_topics.topic_id = phpbb_posts.topic_id where topic_id='$foroID'",$link)-  or  die(mysql_error());
 
-      
-     //Almacenando los datos del FORO 
-     $titulo = $topic['topic_title']; 
-     $autor = $topic['topic_first_poster_name']; 
-     $comentario = $topic['post_text']; 
-      
-     print $titulo." ".$autor." ".$comentario; 
-      
-         mysql_query("insert into $tabla[2] (titulo,comentario,img,categoria,fecha) values ('$titulo','$comentario','$img','$categoria','$fecha')",$cnPortal)-  or  die(mysql_error());
 
-      
-     print "<table width=100% class=satisfactorio><tr><td>Noticia substraida correctamente !!</td></tr></table>"; 
-     }    
-      
- } 
- ?>