home *** CD-ROM | disk | FTP | other *** search
/ PC World 2001 March / PCWorld_2001-03_cd.bin / KOMUNIK / progweb / progweb.exe / phpnuke / html / admin / adminblock.php next >
PHP Script  |  2000-12-05  |  2KB  |  77 lines

  1. <?PHP
  2.  
  3. ######################################################################
  4. # PHP-NUKE: Web Portal System
  5. # ===========================
  6. #
  7. # Copyright (c) 2000 by Francisco Burzi (fburzi@ncc.org.ve)
  8. # http://phpnuke.org
  9. #
  10. # This modules is the main administration part
  11. #
  12. # This program is free software. You can redistribute it and/or modify
  13. # it under the terms of the GNU General Public License as published by
  14. # the Free Software Foundation; either version 2 of the License.
  15. ######################################################################
  16.  
  17. if (!eregi("admin.php", $PHP_SELF)) { die ("Access Denied"); }
  18. $hlpfile = "manual/adminblock.html";
  19. $result = mysql_query("select radminsuper from authors where aid='$aid'");
  20. list($radminsuper) = mysql_fetch_row($result);
  21. if ($radminsuper==1) {
  22.  
  23. /*********************************************************/
  24. /* ADMIN Block Functions                                 */
  25. /*********************************************************/
  26.  
  27. function ablock() {
  28.     global $hlpfile, $admin;
  29.     include("header.php");
  30.     GraphicAdmin($hlpfile);
  31.     OpenTable();
  32.     echo "
  33.     <font size=4><b><center>".translate("Edit Admin Block")."</b></center></font><br><br>
  34.     ";
  35.     $result = mysql_query("select title, content from adminblock");
  36.     if (mysql_num_rows($result) > 0) {
  37.         while(list($title, $content) = mysql_fetch_array($result)) {
  38. ?>
  39.             <form action="admin.php" method="post">
  40.             <?php echo translate("Title:"); ?>
  41.             <input class=textbox type="text" name="title" size="30" maxlength="60" value="<?php echo $title; ?>"><br>
  42.             <?php echo translate("Content:"); ?>
  43.             <br><textarea class=textbox cols="50" rows="10" name="content"><?php echo $content; ?></textarea><br>
  44.             <input type="hidden" name="op" value="changeablock">
  45.             <input type="submit" VALUE="<?php echo translate("Go!"); ?>">
  46.             </form></td></tr></table></td></tr></table>
  47.             <br><br>
  48. <?php
  49.         }
  50.     } ?>
  51.     <?php
  52.     include("footer.php");
  53. }
  54.  
  55. function changeablock($title, $content) {
  56.     $title = stripslashes(FixQuotes($title));
  57.     $content = stripslashes(FixQuotes($content));
  58.     mysql_query("update adminblock set title='$title', content='$content'");
  59.     Header("Location: admin.php?op=adminMain");
  60. }
  61.  
  62. switch($op) {
  63.  
  64.         case "ablock":
  65.             ablock();
  66.             break;
  67.  
  68.         case "changeablock":
  69.             changeablock($title, $content);
  70.             break;
  71.  
  72. }
  73.  
  74. } else {
  75.     echo "Access Denied";
  76. }
  77. ?>