home *** CD-ROM | disk | FTP | other *** search
/ PC World 2001 March / PCWorld_2001-03_cd.bin / KOMUNIK / progweb / progweb.exe / phpnuke / html / admin / mainblock.php < prev    next >
PHP Script  |  2000-12-05  |  2KB  |  75 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/mainblock.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. /* MAIN Block Functions                                  */
  25. /*********************************************************/
  26.  
  27. function mblock() {
  28.     global $hlpfile, $admin;
  29.     include("header.php");
  30.     GraphicAdmin($hlpfile);
  31.     $result = mysql_query("select title, content from mainblock");
  32.     if (mysql_num_rows($result) > 0) {
  33.         while(list($title, $content) = mysql_fetch_array($result)) {
  34.             OpenTable();
  35.             ?>
  36.             <font size=4><center><b><?php echo "".translate("Edit Main Block").""; ?></center></b></font><br><br>
  37.             <form action="admin.php" method="post">
  38.             <?php echo translate("Title:"); ?>
  39.             <input class=textbox type="text" name="title" size="30" maxlength="60" value="<?php echo $title; ?>"><br>
  40.             <?php echo translate("Content:"); ?>
  41.             <br><textarea class=textbox cols="50" rows="10" name="content"><?php echo $content; ?></textarea><br>
  42.             <input type="hidden" name="op" value="changemblock">
  43.             <input type="submit" VALUE="<?php echo translate("Go!"); ?>">
  44.             </form></td></tr></table></td></tr></table>
  45.             <br><br>
  46. <?php
  47.         }
  48.     } ?>
  49.     <?php
  50.     include("footer.php");
  51. }
  52.  
  53. function changemblock($title, $content) {
  54.     $title = stripslashes(FixQuotes($title));
  55.     $content = stripslashes(FixQuotes($content));
  56.     mysql_query("update mainblock set title='$title', content='$content'");
  57.     Header("Location: admin.php?op=adminMain");
  58. }
  59.  
  60. switch ($op){
  61.  
  62.         case "mblock":
  63.             mblock();
  64.             break;
  65.  
  66.         case "changemblock":
  67.             changemblock($title, $content);
  68.             break;
  69.  
  70. }
  71.  
  72. } else {
  73.     echo "Access Denied";
  74. }
  75. ?>