A tumblelog CMS built on AJAX, PHP and MySQL.

index.php 6.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <?
  2. /* ===========================
  3. gelato CMS development version
  4. http://www.gelatocms.com/
  5. gelato CMS is a free software licensed under GPL (General public license)
  6. =========================== */
  7. ?>
  8. <?
  9. require_once('../config.php');
  10. include("../classes/user.class.php");
  11. $user = new user();
  12. $conf = new configuration();
  13. if ($user->isAdmin()) {
  14. ?>
  15. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
  16. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  17. <head>
  18. <title>gelato :: Control panel</title>
  19. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  20. <link rel="shortcut icon" href="<?=$conf->urlGelato;?>/images/favicon.ico" />
  21. <script language="javascript" type="text/javascript" src="<?=$conf->urlGelato;?>/admin/scripts/mootools.js"></script>
  22. <script type="text/javascript">
  23. <!--
  24. function exit(el, path) {
  25. el = $(el);
  26. el.style.display="block";
  27. el.setHTML('Processing request...');
  28. new Ajax(path, {
  29. onComplete:function(e) {
  30. el.setHTML(e).effect('opacity').custom(0,1);
  31. window.location='../login.php';
  32. }
  33. }).request();
  34. return false;
  35. }
  36. window.onload = function() {
  37. contenedor = new Fx.Style('divMessages', 'opacity', {duration: 5000, onComplete:
  38. function() {
  39. document.getElementById('divMessages').style.display="none";
  40. }
  41. });
  42. contenedor.custom(1,0);
  43. }
  44. -->
  45. </script>
  46. <style type="text/css" media="screen">
  47. @import "<?=$conf->urlGelato;?>/admin/css/style-codice.css";
  48. </style>
  49. </head>
  50. <body>
  51. <div id="div-process" style="display:none;"></div>
  52. <div id="titulo">
  53. <img src="<?=$conf->urlGelato;?>/images/logo.jpg" alt="gelato CMS" title="gelato CMS" />
  54. </div>
  55. <div id="menuContenedor">
  56. <ul>
  57. <li id="active"><a href="#" id="current">Posts</a></li>
  58. <ul>
  59. <li id="subactive"><a href="#" id="subcurrent">Manage</a></li>
  60. </ul>
  61. </li>
  62. <li><a href="<?=$conf->urlGelato;?>/admin/admin.php">Manage users</a></li>
  63. <li><a href="<?=$conf->urlGelato;?>/">Take me to the tumblelog</a></li>
  64. <li><a href="close.php" onclick="return exit('div-process','<?=$conf->urlGelato;?>/admin/ajax.php?action=close');">Logoff</a></li>
  65. </ul>
  66. </div>
  67. <div id="contenido">
  68. <div class="center">
  69. <div class="ventana">
  70. <p class="titulo"><span class="handle">Manage the posts</span></p>
  71. <div id="formulario">
  72. <?
  73. if (isset($_GET["deleted"])) {
  74. if ($_GET["deleted"]=="true") {
  75. echo "<div class=\"exito\" id=\"divMessages\">The article has been eliminated successfully.</div>";
  76. }
  77. }
  78. if (isset($_GET["modified"])) {
  79. if ($_GET["modified"]=="true") {
  80. echo "<div class=\"exito\" id=\"divMessages\">The article has been modified successfully.</div>";
  81. }
  82. }
  83. if (isset($_GET["added"])) {
  84. if ($_GET["added"]=="true") {
  85. echo "<div class=\"exito\" id=\"divMessages\">The article has been added successfully.</div>";
  86. }
  87. }
  88. if (isset($_GET["error"])) {
  89. if ($_GET["error"]==2) {
  90. echo "<div class=\"error\"><strong>Error on the database server: </strong>".$_GET["des"]."</div>";
  91. }
  92. }
  93. if (isset($_GET["mp3"])) {
  94. if ($_GET["mp3"]=="false") {
  95. echo "<div class=\"error\" id=\"divMessages\">Not an MP3 file or an upload problem.</div>";
  96. }
  97. }
  98. if (isset($_GET["photo"])) {
  99. if ($_GET["photo"]=="false") {
  100. echo "<div class=\"error\" id=\"divMessages\">Not a photo file or an upload problem.</div>";
  101. }
  102. }
  103. ?>
  104. <h2>Add a new...</h2>
  105. <table class="imgmenu" width="550px" border="0" align="center" cellpadding="5" cellspacing="5">
  106. <tr>
  107. <td><div align="center"><a href="<?=$conf->urlGelato;?>/admin/add.php?new=post"><img alt="New regular post" src="../images/post.gif" /></a></div></td>
  108. <td><div align="center"><a href="<?=$conf->urlGelato;?>/admin/add.php?new=photo"><img alt="New photo" src="../images/foto.gif" /></a></div></td>
  109. <td><div align="center"><a href="<?=$conf->urlGelato;?>/admin/add.php?new=quote"><img alt="New quote" src="../images/cita.gif" /></a></div></td>
  110. </tr>
  111. <tr>
  112. <td><div align="center"><a href="<?=$conf->urlGelato;?>/admin/add.php?new=url"><img alt="New link" src="../images/enlace.gif" /></a></div></td>
  113. <td><div align="center"><a href="<?=$conf->urlGelato;?>/admin/add.php?new=conversation"><img alt="New conversation" src="../images/conversacion.gif" /></a></div></td>
  114. <td><div align="center"><a href="<?=$conf->urlGelato;?>/admin/add.php?new=video"><img alt="New video" src="../images/video.gif" /></a></div></td>
  115. </tr>
  116. <tr>
  117. <td colspan="3"><div align="center"><a href="<?=$conf->urlGelato;?>/admin/add.php?new=mp3"><img alt="New MP3" src="../images/mp3.gif" /></a></div></td>
  118. </tr>
  119. </table>
  120. <p>&nbsp;</p>
  121. <h2>Title 1</h2>
  122. <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas facilisis scelerisque ligula. Aliquam accumsan. In hac habitasse platea dictumst. Nulla ut urna eget felis tempor pellentesque. Fusce sollicitudin ultricies lacus. Duis felis. Mauris posuere enim ac tortor scelerisque tempus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. Fusce porta. Integer odio purus, semper malesuada, eleifend in, volutpat non, quam. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. Aliquam pellentesque aliquet turpis. Quisque non enim sed enim ullamcorper aliquet. Integer sit amet arcu.</p>
  123. <p>&nbsp;</p>
  124. </div>
  125. </div>
  126. </div>
  127. <div id="pie">
  128. <p>
  129. <a href="http://www.gelatocms.com/" title="gelato CMS" target="_blank">gelato CMS</a> :: PHP/MySQL Tumblelog Content Management System.
  130. </p>
  131. </div>
  132. </div>
  133. </body>
  134. </html>
  135. <?
  136. } else {
  137. header("Location: ".$conf->urlGelato."/login.php");
  138. }
  139. ?>