home *** CD-ROM | disk | FTP | other *** search
/ Internet Magazine 2003 May / INTERNET103.ISO / pc / software / windows / building / php_nuke / html / admin / modules / blocks.php < prev    next >
Encoding:
PHP Script  |  2002-09-16  |  36.2 KB  |  925 lines

  1. <?php
  2.  
  3. /************************************************************************/
  4. /* PHP-NUKE: Web Portal System                                          */
  5. /* ===========================                                          */
  6. /*                                                                      */
  7. /* Copyright (c) 2002 by Francisco Burzi                                */
  8. /* http://phpnuke.org                                                   */
  9. /*                                                                      */
  10. /* This program is free software. You can redistribute it and/or modify */
  11. /* it under the terms of the GNU General Public License as published by */
  12. /* the Free Software Foundation; either version 2 of the License.       */
  13. /************************************************************************/
  14.  
  15. if (!eregi("admin.php", $PHP_SELF)) { die ("Access Denied"); }
  16. $result = sql_query("select radminsuper from ".$prefix."_authors where aid='$aid'", $dbi);
  17. list($radminsuper) = sql_fetch_row($result, $dbi);
  18. if ($radminsuper==1) {
  19.  
  20. /*********************************************************/
  21. /* Blocks Functions                                      */
  22. /*********************************************************/
  23.  
  24. function BlocksAdmin() {
  25.     global $bgcolor2, $bgcolor4, $prefix, $dbi, $currentlang, $multilingual;
  26.     include("header.php");
  27.     GraphicAdmin();
  28.     OpenTable();
  29.     echo "<center><font class=\"title\"><b>"._BLOCKSADMIN."</b></font></center>";
  30.     CloseTable();
  31.     echo "<br>";
  32.     OpenTable();
  33.     echo "<br><table border=\"1\" width=\"100%\"><tr>"
  34.         ."<td align=\"center\" bgcolor=\"$bgcolor2\"><b>"._TITLE."</b></td>"
  35.         ."<td align=\"center\" bgcolor=\"$bgcolor2\"><b>"._POSITION."</b></td>"
  36.         ."<td align=\"center\" bgcolor=\"$bgcolor2\" colspan=\"2\"><b>"._WEIGHT."</b></td>"
  37.         ."<td align=\"center\" bgcolor=\"$bgcolor2\"><b>"._TYPE."</b></td>"
  38.         ."<td align=\"center\" bgcolor=\"$bgcolor2\"><b>"._STATUS."</b></td>"
  39.         ."<td align=\"center\" bgcolor=\"$bgcolor2\"><b>"._VIEW."</b></td>";
  40.     if ($multilingual == 1) {
  41.         echo "<td align=\"center\" bgcolor=\"$bgcolor2\"><b>"._LANGUAGE."</b></td>";
  42.     }
  43.     echo "<td align=\"center\" bgcolor=\"$bgcolor2\"><b>"._FUNCTIONS."</b></tr>";
  44.     $result = sql_query("select bid, bkey, title, url, position, weight, active, blanguage, blockfile, view from ".$prefix."_blocks order by position, weight", $dbi);
  45.     while(list($bid, $bkey, $title, $url, $position, $weight, $active, $blanguage, $blockfile, $view) = sql_fetch_row($result, $dbi)) {
  46.         $weight1 = $weight - 1;
  47.         $weight3 = $weight + 1;
  48.         $res = sql_query("select bid from ".$prefix."_blocks where weight='$weight1' AND position='$position'", $dbi);
  49.         list ($bid1) = sql_fetch_array($res, $dbi);
  50.         $con1 = "$bid1";
  51.         $res2 = sql_query("select bid from ".$prefix."_blocks where weight='$weight3' AND position='$position'", $dbi);
  52.         list ($bid2) = sql_fetch_array($res2, $dbi);
  53.         $con2 = "$bid2";
  54.         echo "<tr>"
  55.         ."<td align=\"center\">$title</td>";
  56.         if ($position == "l") {
  57.         $position = "<img src=\"images/center_r.gif\" border=\"0\" alt=\""._LEFTBLOCK."\" title=\""._LEFTBLOCK."\" hspace=\"5\"> "._LEFT."";
  58.         } elseif ($position == "r") {
  59.         $position = ""._RIGHT." <img src=\"images/center_l.gif\" border=\"0\" alt=\""._RIGHTBLOCK."\" title=\""._RIGHTBLOCK."\" hspace=\"5\">";
  60.         } elseif ($position == "c") {
  61.         $position = "<img src=\"images/center_l.gif\" border=\"0\" alt=\""._CENTERBLOCK."\" title=\""._CENTERBLOCK."\"> "._CENTERUP." <img src=\"images/center_r.gif\" border=\"0\" alt=\""._CENTERBLOCK."\" title=\""._CENTERBLOCK."\">";
  62.         } elseif ($position == "d") {
  63.         $position = "<img src=\"images/center_l.gif\" border=\"0\" alt=\""._CENTERBLOCK."\" title=\""._CENTERBLOCK."\"> "._CENTERDOWN." <img src=\"images/center_r.gif\" border=\"0\" alt=\""._CENTERBLOCK."\" title=\""._CENTERBLOCK."\">";
  64.         }
  65.         echo "<td align=\"center\">$position</td>"
  66.         ."<td align=\"center\">"
  67.         ." $weight </td><td align=\"center\">";
  68.         if ($con1) {
  69.         echo"<a href=\"admin.php?op=BlockOrder&weight=$weight&bidori=$bid&weightrep=$weight1&bidrep=$con1\"><img src=\"images/up.gif\" alt=\""._BLOCKUP."\" title=\""._BLOCKUP."\" border=\"0\" hspace=\"3\"></a>";
  70.         }
  71.         if ($con2) {
  72.         echo "<a href=\"admin.php?op=BlockOrder&weight=$weight&bidori=$bid&weightrep=$weight&bidrep=$con2\"><img src=\"images/down.gif\" alt=\""._BLOCKDOWN."\" title=\""._BLOCKDOWN."\" border=\"0\" hspace=\"3\"></a>";
  73.         }
  74.         echo"</td>";
  75.         if ($bkey == "") {
  76.         if ($url == "") {
  77.             $type = "HTML";
  78.         } elseif ($url != "") {
  79.             $type = "RSS/RDF";
  80.         }
  81.         if ($blockfile != "") {
  82.             $type = _BLOCKFILE2;
  83.         }
  84.         } elseif ($bkey != "") {
  85.         $type = _BLOCKSYSTEM;
  86.         }
  87.         echo "<td align=\"center\">$type</td>";
  88.         $block_act = $active;
  89.         if ($active == 1) {
  90.         $active = _ACTIVE;
  91.         $change = _DEACTIVATE;
  92.         } elseif ($active == 0) {
  93.         $active = "<i>"._INACTIVE."</i>";
  94.         $change = _ACTIVATE;
  95.         }
  96.         echo "<td align=\"center\">$active</td>";
  97.         if ($view == 0) {
  98.         $who_view = _MVALL;
  99.         } elseif ($view == 1) {
  100.         $who_view = _MVUSERS;
  101.         } elseif ($view == 2) {
  102.         $who_view = _MVADMIN;
  103.         } elseif ($view == 3) {
  104.         $who_view = _MVANON;
  105.         }
  106.         echo "<td align=\"center\">$who_view</td>";
  107.         if ($multilingual == 1) {
  108.         if ($blanguage == "") {
  109.             $blanguage = _ALL;
  110.         } else {
  111.             $blanguage = ucfirst($blanguage);
  112.         }
  113.         echo "<td align=\"center\">$blanguage</td>";
  114.         }
  115.         echo "<td align=\"center\"><font class=\"content\">[ <a href=\"admin.php?op=BlocksEdit&bid=$bid\">"._EDIT."</a> | <a href=\"admin.php?op=ChangeStatus&bid=$bid\">$change</a> | ";
  116.         if ($bkey == "") {
  117.         echo "<a href=\"admin.php?op=BlocksDelete&bid=$bid\">"._DELETE."</a> | ";
  118.         } elseif ($bkey != "") {
  119.         echo ""._DELETE." | ";
  120.         }
  121.         if ($block_act == 0) {
  122.         echo "<a href=\"admin.php?op=block_show&bid=$bid\">"._SHOW."</a> ]</font></td></tr>";
  123.         } else {
  124.         echo ""._SHOW." ]</font></td></tr>";
  125.         }
  126.     }
  127.     echo "</table>"
  128.         ."<br><br>"
  129.         ."<center>[ <a href=\"admin.php?op=fixweight\">"._FIXBLOCKS."</a> ]</center><br>";
  130.     CloseTable();
  131.     echo "<br>";
  132.     OpenTable();
  133.     echo "<center><font class=\"option\"><b>"._ADDNEWBLOCK."</b></font></center><br><br>"
  134.         ."<form action=\"admin.php\" method=\"post\">"
  135.         ."<table border=\"0\" width=\"100%\">"
  136.         ."<tr><td>"._TITLE.":</td><td><input type=\"text\" name=\"title\" size=\"30\" maxlength=\"60\"></td></tr>"
  137.         ."<tr><td>"._RSSFILE.":</td><td><input type=\"text\" name=\"url\" size=\"30\" maxlength=\"200\">  "
  138.         ."<select name=\"headline\">"
  139.         ."<option name=\"headline\" value=\"0\" selected>"._CUSTOM."</option>";
  140.     $res = sql_query("select hid, sitename from ".$prefix."_headlines", $dbi);
  141.     while(list($hid, $htitle) = sql_fetch_row($res, $dbi)) {
  142.         echo "<option name=\"headline\" value=\"$hid\">$htitle</option>";
  143.     }
  144.     echo "</select> [ <a href=\"admin.php?op=HeadlinesAdmin\">Setup</a> ]<br><font class=\"tiny\">";
  145.     echo ""._SETUPHEADLINES."</font></td></tr>"
  146.         ."<tr><td>"._FILENAME.":</td><td>"
  147.         ."<select name=\"blockfile\">"
  148.         ."<option name=\"blockfile\" value=\"\" selected>"._NONE."</option>";
  149.     $blocksdir = dir("blocks");
  150.     while($func=$blocksdir->read()) {
  151.         if(substr($func, 0, 6) == "block-") {
  152.             $blockslist .= "$func ";
  153.         }
  154.     }
  155.     closedir($blocksdir->handle);
  156.     $blockslist = explode(" ", $blockslist);
  157.     sort($blockslist);
  158.     for ($i=0; $i < sizeof($blockslist); $i++) {
  159.         if($blockslist[$i]!="") {
  160.         $bl = ereg_replace("block-","",$blockslist[$i]);
  161.         $bl = ereg_replace(".php","",$bl);
  162.         $bl = ereg_replace("_"," ",$bl);
  163.         $result = sql_query("select * from ".$prefix."_blocks where blockfile='$blockslist[$i]'", $dbi);
  164.         if (sql_num_rows($result, $dbi) == 0) {
  165.             echo "<option value=\"$blockslist[$i]\">$bl</option>\n";
  166.         }
  167.         }
  168.     }
  169.     echo "</select>  <font class=\"tiny\">"._FILEINCLUDE."</font></td></tr>"
  170.         ."<tr><td>"._CONTENT.":</td><td><textarea name=\"content\" cols=\"50\" rows=\"10\"></textarea><br><font class=\"tiny\">"._IFRSSWARNING."</font></td></tr>"
  171.         ."<tr><td>"._POSITION.":</td><td><select name=\"position\"><option name=\"position\" value=\"l\">"._LEFT."</option>"
  172.         ."<option name=\"position\" value=\"c\">"._CENTERUP."</option>"
  173.         ."<option name=\"position\" value=\"c\">"._CENTERDOWN."</option>"
  174.         ."<option name=\"position\" value=\"r\">"._RIGHT."</option></select></td></tr>";
  175.     if ($multilingual == 1) {
  176.     echo "<tr><td>"._LANGUAGE.":</td><td>"
  177.         ."<select name=\"blanguage\">";
  178.     $handle=opendir('language');
  179.     while ($file = readdir($handle)) {
  180.         if (preg_match("/^lang\-(.+)\.php/", $file, $matches)) {
  181.             $langFound = $matches[1];
  182.             $languageslist .= "$langFound ";
  183.         }
  184.     }
  185.     closedir($handle);
  186.     $languageslist = explode(" ", $languageslist);
  187.     sort($languageslist);
  188.     for ($i=0; $i < sizeof($languageslist); $i++) {
  189.         if($languageslist[$i]!="") {
  190.             echo "<option value=\"$languageslist[$i]\" ";
  191.         if($languageslist[$i]==$currentlang) echo "selected";
  192.         echo ">".ucfirst($languageslist[$i])."</option>\n";
  193.         }
  194.     }
  195.     echo "<option value=\"\">"._ALL."</option></select></td></tr>";
  196.     } else {
  197.     echo "<input type=\"hidden\" name=\"blanguage\" value=\"\">";
  198.     }
  199.     echo "<tr><td>"._ACTIVATE2."</td><td><input type=\"radio\" name=\"active\" value=\"1\" checked>"._YES."   "
  200.         ."<input type=\"radio\" name=\"active\" value=\"0\">"._NO."</td></tr>"
  201.         ."<tr><td>"._REFRESHTIME.":</td><td><select name=\"refresh\">"
  202.         ."<option name=\"refresh\" value=\"1800\">1/2 "._HOUR."</option>"
  203.         ."<option name=\"refresh\" value=\"3600\" selected>1 "._HOUR."</option>"
  204.         ."<option name=\"refresh\" value=\"18000\">5 "._HOURS."</option>"
  205.         ."<option name=\"refresh\" value=\"36000\">10 "._HOURS."</option>"
  206.         ."<option name=\"refresh\" value=\"86400\">24 "._HOURS."</option></select> <font class=\"tiny\">"._ONLYHEADLINES."</font></td></tr>"
  207.         ."<tr><td>"._VIEWPRIV."</td><td><select name=\"view\">"
  208.         ."<option value=\"0\" >"._MVALL."</option>"
  209.         ."<option value=\"1\" >"._MVUSERS."</option>"
  210.         ."<option value=\"2\" >"._MVADMIN."</option>"
  211.         ."<option value=\"3\" >"._MVANON."</option>"
  212.         ."</select>"
  213.         ."</td></tr></table><br><br>"
  214.         ."<input type=\"hidden\" name=\"op\" value=\"BlocksAdd\">"
  215.         ."<input type=\"submit\" value=\""._CREATEBLOCK."\"></form>";
  216.     CloseTable();
  217.     include("footer.php");
  218. }
  219.  
  220. function block_show($bid) {
  221.     global $prefix, $dbi;
  222.     include("header.php");
  223.     GraphicAdmin();
  224.     title(""._BLOCKSADMIN."");
  225.     OpenTable2();
  226.     $result = sql_query("select bid, bkey, title, content, url, position, blockfile from ".$prefix."_blocks where bid='$bid'", $dbi);
  227.     list($bid, $bkey, $title, $content, $url, $position, $blockfile) = sql_fetch_row($result, $dbi);
  228.     if ($bkey == main) {
  229.         mainblock();
  230.     } elseif ($bkey == admin) {
  231.         adminblock();
  232.     } elseif ($bkey == modules) {
  233.         modules_block();
  234.     } elseif ($bkey == category) {
  235.         category();
  236.     } elseif ($bkey == userbox) {
  237.         userblock();
  238.     } elseif ($bkey == "") {
  239.         if ($url == "") {
  240.             if ($blockfile == "") {
  241.         if ($position == "c") {
  242.             themecenterbox($title, $content);
  243.         } else {
  244.                 themesidebox($title, $content);
  245.         }
  246.         } else {
  247.         if ($position == "c") {
  248.             blockfileinc($title, $blockfile, 1);
  249.         } else {
  250.                 blockfileinc($title, $blockfile);
  251.         }
  252.         }
  253.     } else {
  254.         headlines($bid);
  255.     }
  256.     }
  257.     CloseTable2();
  258.     echo "<br>";
  259.     OpenTable();
  260.     echo "<center><font class=\"option\"><b>"._BLOCKSADMIN.": "._FUNCTIONS."</b></font><br><br>"
  261.     ."[ <a href=\"admin.php?op=ChangeStatus&bid=$bid\">"._ACTIVATE."</a> | <a href=\"admin.php?op=BlocksEdit&bid=$bid\">"._EDIT."</a> | ";
  262.     if ($bkey == "") {
  263.     echo "<a href=\"admin.php?op=BlocksDelete&bid=$bid\">"._DELETE."</a> | ";
  264.     } else {
  265.     echo ""._DELETE." | ";
  266.     }
  267.     echo "<a href=\"admin.php?op=BlocksAdmin\">"._BLOCKSADMIN."</a> ]</center>";
  268.     CloseTable();
  269.     include("footer.php");
  270. }
  271.  
  272. function fixweight() {
  273.     global $prefix, $dbi;
  274.     $leftpos = "l";
  275.     $rightpos = "r";
  276.     $centerpos = "c";
  277.     $result = sql_query("select bid from ".$prefix."_blocks where position='$leftpos' order by weight ASC", $dbi);
  278.     $weight = 0;
  279.     while(list($bid) = sql_fetch_row($result, $dbi)) {
  280.     $weight++;
  281.     sql_query("update ".$prefix."_blocks set weight='$weight' where bid='$bid'", $dbi);
  282.     }
  283.     $result = sql_query("select bid from ".$prefix."_blocks where position='$rightpos' order by weight ASC", $dbi);
  284.     $weight = 0;
  285.     while(list($bid) = sql_fetch_row($result, $dbi)) {
  286.     $weight++;
  287.     sql_query("update ".$prefix."_blocks set weight='$weight' where bid='$bid'", $dbi);
  288.     }
  289.     $result = sql_query("select bid from ".$prefix."_blocks where position='$centerpos' order by weight ASC", $dbi);
  290.     $weight = 0;
  291.     while(list($bid) = sql_fetch_row($result, $dbi)) {
  292.     $weight++;
  293.     sql_query("update ".$prefix."_blocks set weight='$weight' where bid='$bid'", $dbi);
  294.     }
  295.     Header("Location: admin.php?op=BlocksAdmin");
  296. }
  297.  
  298. function BlockOrder ($weightrep,$weight,$bidrep,$bidori) {
  299.     global $prefix, $dbi;
  300.     $result = sql_query("update ".$prefix."_blocks set weight='$weight' where bid='$bidrep'", $dbi);
  301.     $result2 = sql_query("update ".$prefix."_blocks set weight='$weightrep' where bid='$bidori'", $dbi);
  302.     Header("Location: admin.php?op=BlocksAdmin");
  303. }
  304.  
  305. function rssfail() {
  306.     include("header.php");
  307.     GraphicAdmin();
  308.     OpenTable();
  309.     echo "<center><font class=\"title\"><b>"._BLOCKSADMIN."</b></font></center>";
  310.     CloseTable();
  311.     echo "<br>";
  312.     OpenTable();
  313.     echo "<center><b>"._RSSFAIL."</b><br><br>"
  314.     .""._RSSTRYAGAIN."<br><br>"
  315.     .""._GOBACK."</center>";
  316.     CloseTable();
  317.     include("footer.php");
  318.     die;
  319. }
  320.  
  321. function BlocksAdd($title, $content, $url, $position, $active, $refresh, $headline, $blanguage, $blockfile, $view) {
  322.     global $prefix, $dbi;
  323.     if ($headline != 0) {
  324.     $result = sql_query("select sitename, headlinesurl from ".$prefix."_headlines where hid='$headline'", $dbi);
  325.     list ($title, $url) = sql_fetch_row($result, $dbi);
  326.     }
  327.     $result = sql_query("SELECT weight FROM ".$prefix."_blocks WHERE position='$position' ORDER BY weight DESC", $dbi);
  328.     list ($weight) = sql_fetch_array($result, $dbi);
  329.     $weight++;
  330.     $title = stripslashes(FixQuotes($title));
  331.     $content = stripslashes(FixQuotes($content));
  332.     $bkey = "";
  333.     $btime = "";
  334.     if ($blockfile != "") {
  335.     $url = "";
  336.     if ($title == "") {
  337.         $title = ereg_replace("block-","",$blockfile);
  338.         $title = ereg_replace(".php","",$title);
  339.         $title = ereg_replace("_"," ",$title);
  340.     }
  341.     }
  342.     if ($url != "") {
  343.     $btime = time();
  344.     if (!ereg("http://",$url)) {
  345.         $url = "http://$url";
  346.     }
  347.     $rdf = parse_url($url);
  348.     $fp = fsockopen($rdf['host'], 80, $errno, $errstr, 15);
  349.     if (!$fp) {
  350.         rssfail();
  351.         exit;
  352.     }
  353.     if ($fp) {
  354.         fputs($fp, "GET " . $rdf['path'] . "?" . $rdf['query'] . " HTTP/1.0\r\n");
  355.         fputs($fp, "HOST: " . $rdf['host'] . "\r\n\r\n");
  356.         $string = "";
  357.         while(!feof($fp)) {
  358.             $pagetext = fgets($fp,228);
  359.             $string .= chop($pagetext);
  360.         }
  361.         fputs($fp,"Connection: close\r\n\r\n");
  362.         fclose($fp);
  363.         $items = explode("</item>",$string);
  364.         $content = "<font class=\"content\">";
  365.         for ($i=0;$i<10;$i++) {
  366.         $link = ereg_replace(".*<link>","",$items[$i]);
  367.         $link = ereg_replace("</link>.*","",$link);
  368.         $title2 = ereg_replace(".*<title>","",$items[$i]);
  369.         $title2 = ereg_replace("</title>.*","",$title2);
  370.         if ($items[$i] == "" AND $cont != 1) {
  371.             $content = "";
  372.         } else {
  373.             if (strcmp($link,$title2) AND $items[$i] != "") {
  374.             $cont = 1;
  375.             $content .= "<strong><big>·</big></strong> <a href=\"$link\" target=\"new\">$title2</a><br>\n";
  376.             }
  377.         }
  378.         }
  379.     }
  380.     }
  381.     $content = FixQuotes($content);
  382.     if (($content == "") AND ($blockfile == "")) {
  383.     rssfail();
  384.     } else {
  385.     sql_query("insert into ".$prefix."_blocks values (NULL, '$bkey', '$title', '$content', '$url', '$position', '$weight', '$active', '$refresh', '$btime', '$blanguage', '$blockfile', '$view')", $dbi);
  386.     Header("Location: admin.php?op=BlocksAdmin");
  387.     }
  388. }
  389.  
  390. function BlocksEdit($bid) {
  391.     global $bgcolor2, $bgcolor4, $prefix, $dbi, $multilingual;
  392.     include("header.php");
  393.     GraphicAdmin();
  394.     OpenTable();
  395.     echo "<center><font class=\"title\"><b>"._EDITBLOCK."</b></font></center>";
  396.     CloseTable();
  397.     echo "<br>";
  398.     $result = sql_query("select bkey, title, content, url, position, weight, active, refresh, blanguage, blockfile, view from ".$prefix."_blocks where bid='$bid'", $dbi);
  399.     list($bkey, $title, $content, $url, $position, $weight, $active, $refresh, $blanguage, $blockfile, $view) = sql_fetch_row($result, $dbi);
  400.     if ($url != "") {
  401.     $type = _RSSCONTENT;
  402.     } elseif ($blockfile != "") {
  403.     $type = _BLOCKFILE;
  404.     }
  405.     OpenTable();
  406.     echo "<center><font class=\"option\"><b>"._BLOCK.": $title $type</b></font></center><br><br>"
  407.         ."<form action=\"admin.php\" method=\"post\">"
  408.         ."<table border=\"0\" width=\"100%\">"
  409.         ."<tr><td>"._TITLE.":</td><td><input type=\"text\" name=\"title\" size=\"30\" maxlength=\"60\" value=\"$title\"></td></tr>";
  410.     if ($blockfile != "") {
  411.     echo "<tr><td>"._FILENAME.":</td><td>"
  412.         ."<select name=\"blockfile\">";
  413.     $blocksdir = dir("blocks");
  414.     while($func=$blocksdir->read()) {
  415.         if(substr($func, 0, 6) == "block-") {
  416.             $blockslist .= "$func ";
  417.         }
  418.     }
  419.     closedir($blocksdir->handle);
  420.     $blockslist = explode(" ", $blockslist);
  421.     sort($blockslist);
  422.     for ($i=0; $i < sizeof($blockslist); $i++) {
  423.         if($blockslist[$i]!="") {
  424.         $bl = ereg_replace("block-","",$blockslist[$i]);
  425.         $bl = ereg_replace(".php","",$bl);
  426.         $bl = ereg_replace("_"," ",$bl);
  427.         echo "<option value=\"$blockslist[$i]\" ";
  428.         if ($blockfile == $blockslist[$i]) { echo "selected"; }
  429.         echo ">$bl</option>\n";
  430.         }
  431.     }
  432.     echo "</select>  <font class=\"tiny\">"._FILEINCLUDE."</font></td></tr>";
  433.     } else {
  434.     if ($url != "") {
  435.         echo "<tr><td>"._RSSFILE.":</td><td><input type=\"text\" name=\"url\" size=\"30\" maxlength=\"200\" value=\"$url\">  <font class=\"tiny\">"._ONLYHEADLINES."</font></td></tr>";
  436.     } else {
  437.         echo "<tr><td>"._CONTENT.":</td><td><textarea name=\"content\" cols=\"50\" rows=\"10\">$content</textarea></td></tr>";
  438.     }
  439.     }
  440.     $oldposition = $position;
  441.     echo "<input type=\"hidden\" name=\"oldposition\" value=\"$oldposition\">";
  442.     if ($position == "l") {
  443.     $sel1 = "selected";
  444.     $sel2 = "";
  445.     $sel3 = "";
  446.     $sel4 = "";
  447.     } elseif ($position == "c") {
  448.     $sel1 = "";
  449.     $sel2 = "selected";
  450.     $sel3 = "";
  451.     $sel4 = "";
  452.     } elseif ($position == "r") {
  453.     $sel1 = "";
  454.     $sel2 = "";
  455.     $sel3 = "selected";
  456.     $sel4 = "";
  457.     } elseif ($position == "d") {
  458.     $sel1 = "";
  459.     $sel2 = "";
  460.     $sel3 = "";
  461.     $sel4 = "selected";
  462.     }
  463.     echo "<tr><td>"._POSITION.":</td><td><select name=\"position\">"
  464.     ."<option name=\"position\" value=\"l\" $sel1>"._LEFT."</option>"
  465.     ."<option name=\"position\" value=\"c\" $sel2>"._CENTERUP."</option>"
  466.     ."<option name=\"position\" value=\"d\" $sel4>"._CENTERDOWN."</option>"
  467.     ."<option name=\"position\" value=\"r\" $sel3>"._RIGHT."</option></select></td></tr>";
  468.     if ($multilingual == 1) {
  469.     echo "<tr><td>"._LANGUAGE.":</td><td>"
  470.         ."<select name=\"blanguage\">";
  471.     $handle=opendir('language');
  472.     while ($file = readdir($handle)) {
  473.         if (preg_match("/^lang\-(.+)\.php/", $file, $matches)) {
  474.             $langFound = $matches[1];
  475.             $languageslist .= "$langFound ";
  476.         }
  477.     }
  478.     closedir($handle);
  479.     $languageslist = explode(" ", $languageslist);
  480.     sort($languageslist);
  481.     for ($i=0; $i < sizeof($languageslist); $i++) {
  482.         if($languageslist[$i]!="") {
  483.         echo "<option value=\"$languageslist[$i]\" ";
  484.         if($languageslist[$i]==$blanguage) echo "selected";
  485.         echo ">".ucfirst($languageslist[$i])."</option>\n";
  486.         }
  487.     }
  488.     if ($blanguage != "") {
  489.         $sel3 = "";
  490.     } else {
  491.         $sel3 = "selected";
  492.     }
  493.     echo "<option value=\"\" $sel3>"._ALL."</option></select></td></tr>";
  494.     } else {
  495.     echo "<input type=\"hidden\" name=\"blanguage\" value=\"\">";
  496.     }
  497.     if ($active == 1) {
  498.     $sel1 = "checked";
  499.     $sel2 = "";
  500.     } elseif ($active == 0) {
  501.     $sel1 = "";
  502.     $sel2 = "checked";
  503.     }
  504.     echo "<tr><td>"._ACTIVATE2."</td><td><input type=\"radio\" name=\"active\" value=\"1\" $sel1>"._YES."   "
  505.         ."<input type=\"radio\" name=\"active\" value=\"0\" $sel2>"._NO."</td></tr>";
  506.     if ($url != "") {
  507.     if ($refresh == 1800) {
  508.     $sel1 = "selected";
  509.     $sel2 = "";
  510.     $sel3 = "";
  511.     $sel4 = "";
  512.     $sel5 = "";
  513.     } elseif ($refresh == 3600) {
  514.     $sel1 = "";
  515.     $sel2 = "selected";
  516.     $sel3 = "";
  517.     $sel4 = "";
  518.     $sel5 = "";
  519.     } elseif ($refresh == 18000) {
  520.     $sel1 = "";
  521.     $sel2 = "";
  522.     $sel3 = "selected";
  523.     $sel4 = "";
  524.     $sel5 = "";
  525.     } elseif ($refresh == 36000) {
  526.     $sel1 = "";
  527.     $sel2 = "";
  528.     $sel3 = "";
  529.     $sel4 = "selected";
  530.     $sel5 = "";
  531.     } elseif ($refresh == 86400) {
  532.     $sel1 = "";
  533.     $sel2 = "";
  534.     $sel3 = "";
  535.     $sel4 = "";
  536.     $sel5 = "selected";
  537.     }
  538.     echo "<tr><td>"._REFRESHTIME.":</td><td><select name=\"refresh\"><option name=\"refresh\" value=\"1800\" $sel1>1/2 "._HOUR."</option>"
  539.         ."<option name=\"refresh\" value=\"3600\" $sel2>1 "._HOUR."</option>"
  540.         ."<option name=\"refresh\" value=\"18000\" $sel3>5 "._HOURS."</option>"
  541.         ."<option name=\"refresh\" value=\"36000\" $sel4>10 "._HOURS."</option>"
  542.         ."<option name=\"refresh\" value=\"86400\" $sel5>24 "._HOURS."</option></select> <font class=\"tiny\">"._ONLYHEADLINES."</font>";
  543.     }
  544.     if ($view == 0) {
  545.     $sel1 = "selected";
  546.     $sel2 = "";
  547.     $sel3 = "";
  548.     $sel4 = "";
  549.     } elseif ($view == 1) {
  550.     $sel1 = "";
  551.     $sel2 = "selected";
  552.     $sel3 = "";
  553.     $sel4 = "";
  554.     } elseif ($view == 2) {
  555.     $sel1 = "";
  556.     $sel2 = "";
  557.     $sel3 = "selected";
  558.     $sel4 = "";    
  559.     } elseif ($view == 3) {
  560.     $sel1 = "";
  561.     $sel2 = "";
  562.     $sel3 = "";
  563.     $sel4 = "selected";    
  564.     }
  565.     echo "</td></tr><tr><td>"._VIEWPRIV."</td><td><select name=\"view\">"
  566.         ."<option value=\"0\" $sel1>"._MVALL."</option>"
  567.         ."<option value=\"1\" $sel2>"._MVUSERS."</option>"
  568.         ."<option value=\"2\" $sel3>"._MVADMIN."</option>"
  569.         ."<option value=\"3\" $sel4>"._MVANON."</option>"
  570.         ."</select>"
  571.     ."</td></tr></table><br><br>"
  572.     ."<input type=\"hidden\" name=\"bid\" value=\"$bid\">"
  573.     ."<input type=\"hidden\" name=\"bkey\" value=\"$bkey\">"
  574.     ."<input type=\"hidden\" name=\"weight\" value=\"$weight\">"
  575.         ."<input type=\"hidden\" name=\"op\" value=\"BlocksEditSave\">"
  576.         ."<input type=\"submit\" value=\""._SAVEBLOCK."\"></form>";
  577.     CloseTable();
  578.     include("footer.php");
  579. }
  580.  
  581. function SortWeight($position) {
  582.     global $prefix, $dbi;
  583.     $numbers = 1;
  584.     $number_two = 1;
  585.     $result = sql_query("SELECT bid,weight FROM ".$prefix."_blocks WHERE position='$position' ORDER BY weight", $dbi);
  586.     while (list ($bid,$weight) = sql_fetch_row($result, $dbi)) {
  587.     $result2 = sql_query("update ".$prefix."_blocks set weight='$numbers' where bid='$bid'", $dbi);
  588.     $numbers++;
  589.     }
  590.     if ($position == l) {
  591.     $position_two = "r";
  592.     } else {
  593.     $position_two = "l";
  594.     }
  595.     $result_two = sql_query("SELECT bid,weight FROM ".$prefix."_blocks WHERE position='$position_two' ORDER BY weight", $dbi);
  596.     while (list ($bid2,$weight) = sql_fetch_row($result_two, $dbi)) {
  597.     $result_two2 = sql_query("update ".$prefix."_blocks set weight='$number_two' where bid='$bid2'", $dbi);
  598.     $number_two++;
  599.     }
  600.     return $numbers;
  601. }
  602.  
  603. function BlocksEditSave($bid, $bkey, $title, $content, $url, $oldposition, $position, $active, $refresh, $weight, $blanguage, $blockfile, $view) { 
  604.     global $prefix, $dbi;
  605.     if ($url != "") {
  606.     $bkey = "";
  607.     $btime = time();
  608.     if (!ereg("http://",$url)) {
  609.         $url = "http://$url";
  610.     }
  611.     $rdf = parse_url($url);
  612.     $fp = fsockopen($rdf['host'], 80, $errno, $errstr, 15);
  613.     if (!$fp) {
  614.             rssfail();
  615.             exit;
  616.     }
  617.     if ($fp) {
  618.             fputs($fp, "GET " . $rdf['path'] . "?" . $rdf['query'] . " HTML/1.0\r\n");
  619.             fputs($fp, "HOST: " . $rdf['host'] . "\r\n\r\n");
  620.             $string    = "";
  621.             while(!feof($fp)) {
  622.             $pagetext = fgets($fp,300);
  623.         $string .= chop($pagetext);
  624.         }
  625.         fputs($fp,"Connection: close\r\n\r\n");
  626.         fclose($fp);
  627.         $items = explode("</item>",$string);
  628.         $content = "<font class=\"content\">";
  629.         for ($i=0;$i<10;$i++) {
  630.         $link = ereg_replace(".*<link>","",$items[$i]);
  631.         $link = ereg_replace("</link>.*","",$link);
  632.         $title2 = ereg_replace(".*<title>","",$items[$i]);
  633.         $title2 = ereg_replace("</title>.*","",$title2);
  634.         if ($items[$i] == "" AND $cont != 1) {
  635.             $content = "";
  636.         } else {
  637.             if (strcmp($link,$title2) AND $items[$i] != "") {
  638.             $cont = 1;
  639.             $content .= "<strong><big>·</big></strong> <a href=\"$link\" target=\"new\">$title2</a><br>\n";
  640.             }
  641.         }
  642.         }
  643.     }
  644.     if ($oldposition != $position) {
  645.         $result = sql_query("select bid from ".$prefix."_blocks where weight>='$weight' AND position='$position'", $dbi);
  646.         $fweight = $weight;
  647.         $oweight = $weight;
  648.         while (list($nbid) = sql_fetch_row($result, $dbi)) {
  649.         $weight++;
  650.         sql_query("update ".$prefix."_blocks set weight='$weight' where bid='$nbid'", $dbi);
  651.         }
  652.         $result = sql_query("select bid from ".$prefix."_blocks where weight>'$oweight' AND position='$oldposition'", $dbi);
  653.         while (list($obid) = sql_fetch_row($result, $dbi)) {
  654.         sql_query("update ".$prefix."_blocks set weight='$oweight' where bid='$obid'", $dbi);
  655.         $oweight++;
  656.         }
  657.         $result = sql_query("select weight from ".$prefix."_blocks where position='$position' order by weight DESC limit 0,1", $dbi);
  658.         list($lastw) = sql_fetch_row($result, $dbi);
  659.         if ($lastw <= $fweight) {
  660.         $lastw++;
  661.         sql_query("update ".$prefix."_blocks set title='$title', content='$content', position='$position', weight='$lastw', active='$active', refresh='$refresh', blanguage='$blanguage', view='$view' where bid='$bid'", $dbi);
  662.         } else {
  663.         sql_query("update ".$prefix."_blocks set title='$title', content='$content', position='$position', weight='$fweight', active='$active', refresh='$refresh', blanguage='$blanguage', view='$view' where bid='$bid'", $dbi);
  664.         }
  665.     } else {
  666.         $result = sql_query("update ".$prefix."_blocks set bkey='$bkey', title='$title', content='$content', url='$url', position='$position', weight='$weight', active='$active', refresh='$refresh', blanguage='$blanguage', view='$view' where bid='$bid'", $dbi);
  667.     }
  668.     Header("Location: admin.php?op=BlocksAdmin");
  669.     } else {
  670.     $title = stripslashes(FixQuotes($title));
  671.     $content = stripslashes(FixQuotes($content));
  672.     if ($oldposition != $position) {
  673.         $result = sql_query("select bid from ".$prefix."_blocks where weight>='$weight' AND position='$position'", $dbi);
  674.         $fweight = $weight;
  675.         $oweight = $weight;
  676.         while (list($nbid) = sql_fetch_row($result, $dbi)) {
  677.         $weight++;
  678.         sql_query("update ".$prefix."_blocks set weight='$weight' where bid='$nbid'", $dbi);
  679.         }
  680.         $result = sql_query("select bid from ".$prefix."_blocks where weight>'$oweight' AND position='$oldposition'", $dbi);
  681.         while (list($obid) = sql_fetch_row($result, $dbi)) {
  682.         sql_query("update ".$prefix."_blocks set weight='$oweight' where bid='$obid'", $dbi);
  683.         $oweight++;
  684.         }
  685.         $result = sql_query("select weight from ".$prefix."_blocks where position='$position' order by weight DESC limit 0,1", $dbi);
  686.         list($lastw) = sql_fetch_row($result, $dbi);
  687.         if ($lastw <= $fweight) {
  688.         $lastw++;
  689.         sql_query("update ".$prefix."_blocks set title='$title', content='$content', position='$position', weight='$lastw', active='$active', refresh='$refresh', blanguage='$blanguage', view='$view' where bid='$bid'", $dbi);
  690.         } else {
  691.         sql_query("update ".$prefix."_blocks set title='$title', content='$content', position='$position', weight='$fweight', active='$active', refresh='$refresh', blanguage='$blanguage', view='$view' where bid='$bid'", $dbi);
  692.         }
  693.     } else {
  694.         $result = sql_query("update ".$prefix."_blocks set bkey='$bkey', title='$title', content='$content', url='$url', position='$position', weight='$weight', active='$active', refresh='$refresh', blanguage='$blanguage', view='$view' where bid='$bid'", $dbi);
  695.     }
  696.     Header("Location: admin.php?op=BlocksAdmin");
  697.     }
  698. }
  699.  
  700. function ChangeStatus($bid, $ok=0) {
  701.     global $prefix, $dbi;
  702.     $result = sql_query("select active from ".$prefix."_blocks where bid='$bid'", $dbi);
  703.     list($active) = sql_fetch_row($result, $dbi);
  704.     if (($ok) OR ($active == 1)) {
  705.     if ($active == 0) {
  706.         $active = 1;
  707.     } elseif ($active == 1) {
  708.         $active = 0;
  709.     }
  710.     $result = sql_query("update ".$prefix."_blocks set active='$active' where bid='$bid'", $dbi);
  711.     Header("Location: admin.php?op=BlocksAdmin");
  712.     } else {
  713.     $result = sql_query("select title, content from ".$prefix."_blocks where bid='$bid'", $dbi);
  714.     list($title, $content) = sql_fetch_row($result, $dbi);
  715.     include("header.php");
  716.     GraphicAdmin();
  717.     echo "<br>";
  718.     OpenTable();
  719.     echo "<center><font class=\"option\"><b>"._BLOCKACTIVATION."</b></font></center>";
  720.     CloseTable();
  721.     echo "<br>";
  722.     OpenTable();
  723.     if ($content != "") {
  724.         echo "<center>"._BLOCKPREVIEW." <i>$title</i><br><br>";
  725.         themesidebox($title, $content);
  726.     } else {
  727.         echo "<center><i>$title</i><br><br>";
  728.     }
  729.     echo "<br>"._WANT2ACTIVATE."<br><br>"
  730.         ."[ <a href=\"admin.php?op=BlocksAdmin\">"._NO."</a> | <a href=\"admin.php?op=ChangeStatus&bid=$bid&ok=1\">"._YES."</a> ]"
  731.         ."</center>";
  732.     CloseTable();
  733.     include("footer.php");
  734.     }
  735. }
  736.  
  737. function BlocksDelete($bid, $ok=0) {
  738.     global $prefix, $dbi;
  739.     if ($ok) {
  740.     $result = sql_query("select position, weight from ".$prefix."_blocks where bid='$bid'", $dbi);
  741.     list($position, $weight) = sql_fetch_row($result, $dbi);
  742.     $result = sql_query("select bid from ".$prefix."_blocks where weight>'$weight' AND position='$position'", $dbi);
  743.     while (list($nbid) = sql_fetch_row($result, $dbi)) {
  744.         sql_query("update ".$prefix."_blocks set weight='$weight' where bid='$nbid'", $dbi);
  745.         $weight++;
  746.     }
  747.     sql_query("delete from ".$prefix."_blocks where bid='$bid'", $dbi);
  748.     Header("Location: admin.php?op=BlocksAdmin");
  749.     } else {
  750.         $result = sql_query("select title from ".$prefix."_blocks where bid='$bid'", $dbi);
  751.     list($title) = sql_fetch_row($result, $dbi);
  752.     include("header.php");
  753.     GraphicAdmin();
  754.     OpenTable();
  755.     echo "<center><font class=\"title\"><b>"._BLOCKSADMIN."</b></font></center>";
  756.     CloseTable();
  757.     echo "<br>";
  758.     OpenTable();
  759.     echo "<center>"._ARESUREDELBLOCK." <i>$title</i>?";
  760.     echo "<br><br>[ <a href=\"admin.php?op=BlocksAdmin\">"._NO."</a> | <a href=\"admin.php?op=BlocksDelete&bid=$bid&ok=1\">"._YES."</a> ]</center>";
  761.     CloseTable();
  762.     include("footer.php");
  763.     }
  764. }
  765.  
  766. function HeadlinesAdmin() {
  767.     global $bgcolor1, $bgcolor2, $prefix, $dbi;
  768.     include ("header.php");
  769.     GraphicAdmin();
  770.     OpenTable();
  771.     echo "<center><font class=\"title\"><b>"._HEADLINESADMIN."</b></font></center>";
  772.     CloseTable();
  773.     echo "<br>";
  774.     OpenTable();
  775.     echo "<form action=\"admin.php\" method=\"post\">"
  776.     ."<table border=\"1\" width=\"100%\" align=\"center\"><tr>"
  777.     ."<td bgcolor=\"$bgcolor2\" align=\"center\"><b>"._SITENAME."</b></td>"
  778.     ."<td bgcolor=\"$bgcolor2\" align=\"center\"><b>"._URL."</b></td>"
  779.     ."<td bgcolor=\"$bgcolor2\" align=\"center\"><b>"._FUNCTIONS."</b></td><tr>";
  780.     $result = sql_query("select hid, sitename, headlinesurl from ".$prefix."_headlines order by hid", $dbi);
  781.     while(list($hid, $sitename, $headlinesurl) = sql_fetch_row($result, $dbi)) {
  782.     echo "<td bgcolor=\"$bgcolor1\" align=\"center\">$sitename</td>"
  783.         ."<td bgcolor=\"$bgcolor1\" align=\"center\"><a href=\"$headlinesurl\" target=\"new\">$headlinesurl</a></td>"
  784.         ."<td bgcolor=\"$bgcolor1\" align=\"center\">[ <a href=\"admin.php?op=HeadlinesEdit&hid=$hid\">"._EDIT."</a> | <a href=\"admin.php?op=HeadlinesDel&hid=$hid&ok=0\">"._DELETE."</a> ]</td><tr>";
  785.     }
  786.     echo "</form></td></tr></table>";
  787.     CloseTable();
  788.     echo "<br>";
  789.     OpenTable();
  790.     echo "<font class=\"option\"><b>"._ADDHEADLINE."</b></font><br><br>"
  791.     ."<font class=\"content\">"
  792.     ."<form action=\"admin.php\" method=\"post\">"
  793.     ."<table border=\"0\" width=\"100%\"><tr><td>"
  794.     .""._SITENAME.":</td><td><input type=\"text\" name=\"xsitename\" size=\"31\" maxlength=\"30\"></td></tr><tr><td>"
  795.     .""._RSSFILE.":</td><td><input type=\"text\" name=\"headlinesurl\" size=\"50\" maxlength=\"200\"></td></tr><tr><td>"
  796.     ."</td></tr></table>"
  797.     ."<input type=\"hidden\" name=\"op\" value=\"HeadlinesAdd\">"
  798.     ."<input type=\"submit\" value=\""._ADD."\">"
  799.     ."</form>";
  800.     CloseTable();
  801.     include("footer.php");
  802. }
  803.  
  804. function HeadlinesEdit($hid) {
  805.     global $prefix, $dbi;
  806.     include ("header.php");
  807.     GraphicAdmin();
  808.     OpenTable();
  809.     echo "<center><font class=\"title\"><b>"._HEADLINESADMIN."</b></font></center>";
  810.     CloseTable();
  811.     echo "<br>";
  812.     $result = sql_query("select sitename, headlinesurl from ".$prefix."_headlines where hid='$hid'", $dbi);
  813.     list($xsitename, $headlinesurl) = sql_fetch_row($result, $dbi);
  814.     OpenTable();
  815.     echo "<center><font class=\"option\"><b>"._EDITHEADLINE."</b></font></center>
  816.     <form action=\"admin.php\" method=\"post\">
  817.     <input type=\"hidden\" name=\"hid\" value=\"$hid\">
  818.     <table border=\"0\" width=\"100%\"><tr><td>
  819.     "._SITENAME.":</td><td><input type=\"text\" name=\"xsitename\" size=\"31\" maxlength=\"30\" value=\"$xsitename\"></td></tr><tr><td>
  820.     "._RSSFILE.":</td><td><input type=\"text\" name=\"headlinesurl\" size=\"50\" maxlength=\"200\" value=\"$headlinesurl\"></td></tr><tr><td>
  821.     </select></td></tr></table>
  822.     <input type=\"hidden\" name=\"op\" value=\"HeadlinesSave\">
  823.     <input type=\"submit\" value=\""._SAVECHANGES."\">
  824.     </form>";
  825.     CloseTable();
  826.     include("footer.php");
  827. }
  828.  
  829. function HeadlinesSave($hid, $xsitename, $headlinesurl) {
  830.     global $prefix, $dbi;
  831.     $xsitename = ereg_replace(" ", "", $xsitename);
  832.     sql_query("update ".$prefix."_headlines set sitename='$xsitename', headlinesurl='$headlinesurl' where hid='$hid'", $dbi);
  833.     Header("Location: admin.php?op=HeadlinesAdmin");
  834. }
  835.  
  836. function HeadlinesAdd($xsitename, $headlinesurl) {
  837.     global $prefix, $dbi;
  838.     $xsitename = ereg_replace(" ", "", $xsitename);
  839.     sql_query("insert into ".$prefix."_headlines values (NULL, '$xsitename', '$headlinesurl')", $dbi);
  840.     Header("Location: admin.php?op=HeadlinesAdmin");
  841. }
  842.  
  843. function HeadlinesDel($hid, $ok=0) {
  844.     global $prefix, $dbi;
  845.     if($ok==1) {
  846.     sql_query("delete from ".$prefix."_headlines where hid='$hid'", $dbi);
  847.     Header("Location: admin.php?op=HeadlinesAdmin");
  848.     } else {
  849.     include("header.php");
  850.     GraphicAdmin();
  851.     OpenTable();
  852.     echo "<center><br>";
  853.     echo "<font class=\"option\">";
  854.     echo "<b>"._SURE2DELHEADLINE."</b></font><br><br>";
  855.     }
  856.     echo "[ <a href=\"admin.php?op=HeadlinesDel&hid=$hid&ok=1\">"._YES."</a> | <a href=\"admin.php?op=HeadlinesAdmin\">"._NO."</a> ]<br><br>";
  857.     CloseTable();
  858.     include("footer.php");
  859. }
  860.  
  861. switch($op) {
  862.  
  863.     case "BlocksAdmin":
  864.     BlocksAdmin();
  865.     break;
  866.  
  867.     case "BlocksAdd":
  868.     BlocksAdd($title, $content, $url, $position, $active, $refresh, $headline, $blanguage, $blockfile, $view);
  869.     break;
  870.  
  871.     case "BlocksEdit":
  872.     BlocksEdit($bid);
  873.     break;
  874.  
  875.     case "BlocksEditSave":
  876.     BlocksEditSave($bid, $bkey, $title, $content, $url, $oldposition, $position, $active, $refresh, $weight, $blanguage, $blockfile, $view);
  877.     break;
  878.  
  879.     case "ChangeStatus":
  880.     ChangeStatus($bid, $ok, $de);
  881.     break;
  882.  
  883.     case "BlocksDelete":
  884.     BlocksDelete($bid, $ok);
  885.     break;
  886.  
  887.     case "BlockOrder":
  888.     BlockOrder ($weightrep,$weight,$bidrep,$bidori);
  889.     break;
  890.  
  891.     case "HeadlinesDel":
  892.     HeadlinesDel($hid, $ok);
  893.     break;
  894.  
  895.     case "HeadlinesAdd":
  896.     HeadlinesAdd($xsitename, $headlinesurl);
  897.     break;
  898.  
  899.     case "HeadlinesSave":
  900.     HeadlinesSave($hid, $xsitename, $headlinesurl);
  901.     break;
  902.  
  903.     case "HeadlinesAdmin":
  904.     HeadlinesAdmin();
  905.     break;
  906.  
  907.     case "HeadlinesEdit":
  908.     HeadlinesEdit($hid);
  909.     break;
  910.  
  911.     case "fixweight":
  912.     fixweight();
  913.     break;
  914.  
  915.     case "block_show":
  916.     block_show($bid);
  917.     break;
  918.  
  919. }
  920.  
  921. } else {
  922.     echo "Access Denied";
  923. }
  924.  
  925. ?>