Questo sito utilizza cookies solo per scopi di autenticazione sul sito e nient'altro. Nessuna informazione personale viene tracciata. Leggi l'informativa sui cookies.
Username: Password: oppure
NoPaste Cms - index.php

index.php

Caricato da: Cassin.simone
Scarica il programma completo

  1. <html>
  2. <head>
  3. <title>NoPasteCMS 2.0</title>
  4. <?php
  5. //Se l'utente sta visualizzando una pagina con codice allora integro l'evidenziatore della sintassi
  6. if ($_GET['view']<>""){
  7. include('./pages/config.php');
  8. mysql_connect($host, $username, $password);
  9. mysql_select_db($database);
  10. //Variabile assegnata per mantenere la compatibilità anche sui server locali
  11. $view=$_GET['view'];
  12. $select_one=mysql_query("SELECT * FROM nopaste WHERE id='$view'") or die ("Errore nella query.<br>".mysql_error());
  13. $array_one=mysql_fetch_array($select_one);
  14. }
  15. ?>
  16. <link rel="stylesheet" href="./themes/css/stile.css" type="text/css">
  17. <script type="text/javascript" src="./SyntaxHighlighter/scripts/shCore.js"></script>
  18. <script type="text/javascript" src="./SyntaxHighlighter/scripts/shBrush<?php echo $array_one['linguaggio']; ?>.js"></script>
  19.   <script type="text/javascript">
  20.     SyntaxHighlighter.config.clipboardSwf = './SyntaxHighlighter/scripts/clipboard.swf';
  21.     SyntaxHighlighter.all();
  22.   </script>
  23.   <link type="text/css" rel="stylesheet" href="./SyntaxHighlighter/styles/shThemeDefault.css" id="shTheme"/>
  24.   <link type="text/css" rel="stylesheet" href="./SyntaxHighlighter/styles/shCore.css"/>
  25. </head>
  26. <body>
  27. <center>
  28. <div id="container">
  29.  
  30. <div id="header">
  31. </div>
  32.  
  33. <div id="menu">
  34. <a href="index.php">Lista Codici</a> ~ <a href="insert.php">Inserisci Codice</a>
  35. </div>
  36. <br>
  37.  
  38. <div id="page">
  39. <?php
  40. include('./pages/config.php');
  41. mysql_connect($host, $username, $password);
  42. mysql_select_db($database);
  43. if ($_GET['view']==""){
  44. $select_all=mysql_query("SELECT * FROM nopaste") or die ("Errore nella query.<br>".mysql_error());
  45. ?>
  46. <ul>
  47. <?php
  48. $count=mysql_num_rows($select_all);
  49. while ($count<>0){
  50. $select_one=mysql_query("SELECT * FROM nopaste WHERE id='$count'") or die ("Errore nella query.<br>".mysql_error());
  51. $array_one=mysql_fetch_array($select_one);
  52. echo '<li><a href="'.$count.'.html">'.$array_one['titolo'].'</a></li>';
  53. $count=$count-1;
  54. }
  55. ?>
  56. </ul>
  57. <?php
  58. }elseif ($_GET['view']<>""){
  59. //Variabile assegnata per mantenere la compatibilità anche sui server locali
  60. $view=$_GET['view'];
  61. $select_one=mysql_query("SELECT * FROM nopaste WHERE id='$view'") or die ("Errore nella query.<br>".mysql_error());
  62. $array_one=mysql_fetch_array($select_one);
  63. ?>
  64. <b>Titolo:</b>  <?php echo $array_one['titolo'];?><br>
  65. <b>Descrizione: </b>  <?php echo $array_one['descrizione'];?><br>
  66. <b>Linguaggio: </b>  <?php echo $array_one['linguaggio'];?><br>
  67. <b>Codice:</b><br>
  68. <pre class="brush: <?php echo strtolower($array_one['linguaggio']);?>"><?php echo $array_one['codice'];?></pre>
  69. <b>Indirizzo ip:</b>   Non visibile
  70. </div><br>
  71. <?php } ?>
  72. <div id="footer">
  73. Creato da <a href="http://www.simonecassin.altervista.org"><b>Simone Cassin</b></a><br>
  74. Grafica by <a href="http://ferruccio94.altervista.org" target="_blank"><b>ferruccio94</b></a>
  75. </div>
  76.  
  77. </div>
  78. </center>
  79. </body>
  80. </html>