» Log in
User Name:

Password:

Not a member yet?
Register Now!
» Online Users: 55
3 members and 52 guests
berkutar, daypear, thitahomo
Most users ever online was 611, 03-21-2008 at 10:10 PM.
» .::.
Web Hosting - web hosting, dedicated servers and web design services
Online Degree - search for 1000+ online degrees, online colleges & online universities.
Tattoo - we are a group of tattoo enthusiasts
Gexa Energy - your absolute best choice in electric service
Texas electricity - save on electric rates
Football Betting - best nfl betting promotions at sportsbook.com.
Oral Chelation - initial cleansing of your veins & arteries
Portatiles - Ofertas en Ordenadores y Portatiles. Increibles Ofertas DELL.

Register Now! Contact Us

About this Page
This is a discussion on Cannot create newe blocks in 7.3 within the Nuke 7.x - General forums, part of the PHP-Nuke 7.x category; I just cannot create new blocks via block administration in PHPNuke v7.3 What do I do? And how do ...



Go Back   Nukemods Forum » PHP-Nuke 7.x » Nuke 7.x - General

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-27-2004, 11:24 AM
Junior Member
 
Join Date: Jul 2004
Posts: 22
Cannot create newe blocks in 7.3
I just cannot create new blocks via block administration in PHPNuke v7.3 What do I do? And how do I add the information manually in the db via PHPMyAdmin?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 07-27-2004, 11:26 AM
Moderator
 
Join Date: Nov 2002
Location: Belgium
Posts: 957
does it give any errors?? post admin/modules/blocks.php (in txt format) so we can check
__________________
Yannick R. aka Mighty_Y
http://support.code-area51.com
http://www.code-area51.com

Search before asking makes my life easier!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 07-27-2004, 01:21 PM
Junior Member
 
Join Date: Jul 2004
Posts: 22
Same as above
Nah I dont receive any error message. After clicking Add Block, the page refreshes back to Block Administration, but the new blocks aere not added to the list nor to the database.

My blocks file: http://66.36.242.216/~potter/blocks.txt

Also here is my table from db

Quote:
# Table structure for table 'nuke_blocks'
#

CREATE TABLE nuke_blocks (
bid int(10) NOT NULL auto_increment,
bkey varchar(15) NOT NULL,
title varchar(60) NOT NULL,
content text NOT NULL,
url varchar(200) NOT NULL,
bposition char(1) NOT NULL,
weight int(10) DEFAULT '1' NOT NULL,
active int(1) DEFAULT '1' NOT NULL,
refresh int(10) DEFAULT '0' NOT NULL,
time varchar(14) DEFAULT '0' NOT NULL,
blanguage varchar(30) NOT NULL,
blockfile varchar(255) NOT NULL,
view int(1) DEFAULT '0' NOT NULL,
expire varchar(14) DEFAULT '0' NOT NULL,
action char(1) NOT NULL,
subscription int(1) DEFAULT '0' NOT NULL,
PRIMARY KEY (bid),
KEY bid (bid),
KEY title (title)
);
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 07-27-2004, 01:43 PM
Junior Member
 
Join Date: Jul 2004
Posts: 22
Due to slow Internet connection, I cannot upload the blocks.php file, so the link in the last post will not work. But I have used FolderMatch to verify and it is exactly the same as that whcih comes with PHPNuke 7.3 from PHPNuke.org
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 07-27-2004, 06:02 PM
Moderator
 
Join Date: Jan 2003
Posts: 338
Is the block you are trying to add a file block or one made up of basic html? if the last one is the case you could turn it into a file block:
Code:
<?php

if (eregi("block-Desired_Block_Name_Here.php", $_SERVER['PHP_SELF'])) {
    Header("Location: index.php");
    die();
}

$content .= "Your html here, just escape any double quotes with a backslash,
only those in your code, not the ones at the start & end of this line";

?>
__________________
NukeResources | ScriptHeaven
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 07-27-2004, 09:10 PM
Junior Member
 
Join Date: Jul 2004
Posts: 22
I am trying to add the Advanced Download block, which scrollas the downloads etc. and even the Google Adsense Block and the Latest Updates block for Gallery.

How do I manually enter the data in the tables?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 07-28-2004, 01:01 PM
Senior Member
 
Join Date: Sep 2002
Posts: 2,905
Quote:
How do I manually enter the data in the tables?
Not sure what you mean, but all you do with MOST blocks is upload them to your blocks directory on your server, then go to your Admin menu to blocks and add it in the form below.

As far as data in the tables. Once you add Downloads to your Downloads section, they will automatically show up in the Downloads block. You should not have to "manually" add any data to any tables. There has to ba another reason these blocks aren't getting added once you submit them in your Admin/BLocks area.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 07-28-2004, 08:59 PM
Junior Member
 
Join Date: Jul 2004
Posts: 22
PROBLEM SAOLVED
I have solved this problem on my own. PHPNuke 7.3 has a dfferent method of querying the databse tables. And since i had my site already created, I had just uploaded the files and then uploaded the database backup.

To solve this problem, I overwrote the admin/blocks.php of 7.3 with the admin/blocks.php of 7.2 and now everything is working fine. You could add this to bug fixes, I think.

Guess I am a noob no more!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 08-01-2006, 02:48 PM
Junior Member
 
Join Date: Sep 2005
Posts: 1
OK I am having the same issue
I add my block after uploading it to the blocks directory ( mind you I have been doing this a long time ) and this particular site will not add anymore blocks to the DB. I went in through PhpMyadmin and took a look at the blocks and the ones I add are not there. Now it may be a mod or something added prior but not sure

Now old blocks work and can be activated and de-activated just fine just nothing new is being inserted into the DB


Here is my nuke_blocks sql
  • Table structure for table `nuke_blocks`
    --

    CREATE TABLE `nuke_blocks` (
    `bid` int(10) NOT NULL auto_increment,
    `bkey` varchar(15) NOT NULL default '',
    `title` varchar(60) NOT NULL default '',
    `content` text NOT NULL,
    `url` varchar(200) NOT NULL default '',
    `bposition` char(1) NOT NULL default '',
    `weight` int(10) NOT NULL default '1',
    `active` int(1) NOT NULL default '1',
    `refresh` int(10) NOT NULL default '0',
    `time` varchar(14) NOT NULL default '0',
    `blanguage` varchar(30) NOT NULL default '',
    `blockfile` varchar(255) NOT NULL default '',
    `view` int(1) NOT NULL default '0',
    `groups` text NOT NULL,
    `expire` varchar(14) NOT NULL default '0',
    `action` char(1) NOT NULL default '',
    `subscription` int(1) NOT NULL default '0',
    PRIMARY KEY (`bid`),
    KEY `bid` (`bid`),
    KEY `title` (`title`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=27 ;

here is my blocks.php info
  • <?php

    /************************************************** **********************/
    /* PHP-NUKE: Web Portal System */
    /* =========================== */
    /* */
    /* Copyright (c) 2005 by Francisco Burzi */
    /* http://phpnuke.org */
    /* */
    /* This program is free software. You can redistribute it and/or modify */
    /* it under the terms of the GNU General Public License as published by */
    /* the Free Software Foundation; either version 2 of the License. */
    /************************************************** **********************/

    if (!defined('ADMIN_FILE')) {
    die ("Access Denied");
    }

    global $prefix, $db, $admin_file;
    $aid = substr("$aid", 0,25);
    $row = $db->sql_fetchrow($db->sql_query("SELECT radminsuper FROM " . $prefix . "_authors WHERE aid='$aid'"));
    if ($row['radminsuper'] == 1) {

    /************************************************** *******/
    /* Blocks Functions */
    /************************************************** *******/

    function BlocksAdmin() {
    global $bgcolor2, $bgcolor4, $prefix, $db, $currentlang, $multilingual, $admin_file;
    include("header.php");
    GraphicAdmin();
    OpenTable();
    echo "<center><font class=\"title\">"._BLOCKSADMIN."</font></center>";
    CloseTable();
    echo "
    ";
    OpenTable();
    echo "
    <table border=\"1\" width=\"100%\"><tr>"
    ."<td align=\"center\" bgcolor=\"$bgcolor2\">"._TITLE."</td>"
    ."<td align=\"center\" bgcolor=\"$bgcolor2\">"._POSITION."</td>"
    ."<td align=\"center\" bgcolor=\"$bgcolor2\" colspan=\"2\">"._WEIGHT."</td>"
    ."<td align=\"center\" bgcolor=\"$bgcolor2\">"._TYPE."</td>"
    ."<td align=\"center\" bgcolor=\"$bgcolor2\">"._STATUS."</td>"
    ."<td align=\"center\" bgcolor=\"$bgcolor2\">"._VIEW."</td>";
    if ($multilingual == 1) {
    echo "<td align=\"center\" bgcolor=\"$bgcolor2\">"._LANGUAGE."</td>";
    }
    echo "<td align=\"center\" bgcolor=\"$bgcolor2\">"._FUNCTIONS."</tr>";
    $result = $db->sql_query("select bid, bkey, title, url, bposition, weight, active, blanguage, blockfile, view from ".$prefix."_blocks order by bposition, weight");
    while ($row = $db->sql_fetchrow($result)) {
    $bid = intval($row['bid']);
    $bkey = $row['bkey'];
    $title = $row['title'];
    $url = $row['url'];
    $bposition = $row['bposition'];
    $weight = intval($row['weight']);
    $active = intval($row['active']);
    $blanguage = $row['blanguage'];
    $blockfile = $row['blockfile'];
    $view = intval($row['view']);
    $weight1 = $weight - 1;
    $weight3 = $weight + 1;
    $row_res = $db->sql_fetchrow($db->sql_query("select bid from ".$prefix."_blocks where weight='$weight1' AND bposition='$bposition'"));
    $bid1 = intval($row_res['bid']);
    $con1 = "$bid1";
    $row_res2 = $db->sql_fetchrow($db->sql_query("select bid from ".$prefix."_blocks where weight='$weight3' AND bposition='$bposition'"));
    $bid2 = intval($row_res2['bid']);
    $con2 = "$bid2";
    echo "<tr>"
    ."<td align=\"center\">$title</td>";
    if ($bposition == "l") {
    $bposition = "<img src=\"images/center_r.gif\" border=\"0\" alt=\""._LEFTBLOCK."\" title=\""._LEFTBLOCK."\" hspace=\"5\"> "._LEFT."";
    } elseif ($bposition == "r") {
    $bposition = ""._RIGHT." <img src=\"images/center_l.gif\" border=\"0\" alt=\""._RIGHTBLOCK."\" title=\""._RIGHTBLOCK."\" hspace=\"5\">";
    } elseif ($bposition == "c") {
    $bposition = "<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."\">";
    } elseif ($bposition == "d") {
    $bposition = "<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."\">";
    }
    echo "<td align=\"center\">$bposition</td>"
    ."<td align=\"center\">"
    ."$weight</td><td align=\"center\">";
    if ($con1) {
    echo"<a href=\"".$admin_file.".php?op=BlockOrder&amp;weigh t=$weight&amp;bidori=$bid&amp;weightrep=$weight1&a mp;bidrep=$con1\"><img src=\"images/up.gif\" alt=\""._BLOCKUP."\" title=\""._BLOCKUP."\" border=\"0\" hspace=\"3\"></a>";
    }
    if ($con2) {
    echo "<a href=\"".$admin_file.".php?op=BlockOrder&amp;weigh t=$weight&amp;bidori=$bid&amp;weightrep=$weight3&a mp;bidrep=$con2\"><img src=\"images/down.gif\" alt=\""._BLOCKDOWN."\" title=\""._BLOCKDOWN."\" border=\"0\" hspace=\"3\"></a>";
    }
    echo"</td>";
    if ($bkey == "") {
    if ($url == "") {
    $type = "HTML";
    } elseif ($url != "") {
    $type = "RSS/RDF";
    }
    if ($blockfile != "") {
    $type = _BLOCKFILE2;
    }
    } elseif ($bkey != "") {
    $type = _BLOCKSYSTEM;
    }
    echo "<td align=\"center\">$type</td>";
    $block_act = $active;
    if ($active == 1) {
    $active = "<img src=\"images/active.gif\" alt=\""._ACTIVE."\" title=\""._ACTIVE."\" border=\"0\" width=\"16\" height=\"16\">";
    $change = "<img src=\"images/inactive.gif\" alt=\""._DEACTIVATE."\" title=\""._DEACTIVATE."\" border=\"0\" width=\"16\" height=\"16\">";
    } elseif ($active == 0) {
    $active = "<img src=\"images/inactive.gif\" alt=\""._INACTIVE."\" title=\""._INACTIVE."\" border=\"0\" width=\"16\" height=\"16\">";
    $change = "<img src=\"images/active.gif\" alt=\""._ACTIVATE."\" title=\""._ACTIVATE."\" border=\"0\" width=\"16\" height=\"16\">";
    }
    echo "<td align=\"center\">$active</td>";
    if ($view == 0) {
    $who_view = _MVALL;
    } elseif ($view == 1) {
    $who_view = _MVUSERS;
    } elseif ($view == 2) {
    $who_view = _MVADMIN;
    } elseif ($view == 3) {
    $who_view = _MVANON;
    }
    echo "<td align=\"center\">$who_view</td>";
    if ($multilingual == 1) {
    if ($blanguage == "") {
    $blanguage = _ALL;
    } else {
    $blanguage = ucfirst($blanguage);
    }
    echo "<td align=\"center\">$blanguage</td>";
    }
    echo "<td align=\"center\"><font class=\"content\"><a href=\"".$admin_file.".php?op=BlocksEdit&amp;bid=$ bid\"><img src=\"images/edit.gif\" alt=\""._EDIT."\" title=\""._EDIT."\" border=\"0\" width=\"17\" height=\"17\"></a> <a href=\"".$admin_file.".php?op=ChangeStatus&amp;bid =$bid\">$change</a> ";
    if ($bkey == "") {
    echo "<a href=\"".$admin_file.".php?op=BlocksDelete&amp;bid =$bid\"><img src=\"images/delete.gif\" alt=\""._DELETE."\" title=\""._DELETE."\" border=\"0\" width=\"17\" height=\"17\"></a> ";
    } elseif ($bkey != "") {
    echo "<img src=\"images/delete_x.gif\" alt=\""._DELETE."\" title=\""._DELETE."\" border=\"0\" width=\"17\" height=\"17\"> ";
    }
    echo "<a href=\"".$admin_file.".php?op=block_show&bid=$bid\ "><img src=\"images/view.gif\" alt=\""._SHOW."\" title=\""._SHOW."\" border=\"0\" width=\"17\" height=\"17\"></a></font></td></tr>";
    }
    echo "</table>"
    ."

    "
    ."<center>[ <a href=\"".$admin_file.".php?op=fixweight\">"._FIXBL OCKS."</a> ]</center>
    ";
    CloseTable();
    echo "
    ";
    OpenTable();
    echo "<center><font class=\"option\">"._ADDNEWBLOCK."</font></center>

    "
    ."<form action=\"".$admin_file.".php\" method=\"post\">"
    ."<table border=\"0\" width=\"100%\">"
    ."<tr><td>"._TITLE.":</td><td><input type=\"text\" name=\"title\" size=\"30\" maxlength=\"60\"></td></tr>"
    ."<tr><td>"._RSSFILE.":</td><td><input type=\"text\" name=\"url\" size=\"30\" maxlength=\"200\">"
    ."<select name=\"headline\">"
    ."<option name=\"headline\" value=\"0\" selected>"._CUSTOM."</option>";
    $res3 = $db->sql_query("select hid, sitename from ".$prefix."_headlines");
    while ($row_res3 = $db->sql_fetchrow($res3)) {
    $hid = intval($row_res3['hid']);
    $htitle = $row_res3['sitename'];
    echo "<option name=\"headline\" value=\"$hid\">$htitle</option>";
    }
    echo "</select>[ <a href=\"".$admin_file.".php?op=HeadlinesAdmin\">Set up</a> ]
    <font class=\"tiny\">";
    echo ""._SETUPHEADLINES."</font></td></tr>"
    ."<tr><td>"._FILENAME.":</td><td>"
    ."<select name=\"blockfile\">"
    ."<option name=\"blockfile\" value=\"\" selected>"._NONE."</option>";
    $blocksdir = dir("blocks");
    while($func=$blocksdir->read()) {
    if(substr($func, 0, 6) == "block-") {
    $blockslist .= "$func ";
    }
    }
    closedir($blocksdir->handle);
    $blockslist = explode(" ", $blockslist);
    sort($blockslist);
    for ($i=0; $i < sizeof($blockslist); $i++) {
    if($blockslist[$i]!="") {
    $bl = ereg_replace("block-","",$blockslist[$i]);
    $bl = ereg_replace(".php","",$bl);
    $bl = ereg_replace("_"," ",$bl);
    $result2 = $db->sql_query("select * from ".$prefix."_blocks where blockfile='$blockslist[$i]'");
    $numrows = $db->sql_numrows($result2);
    if ($numrows == 0) {
    echo "<option value=\"$blockslist[$i]\">$bl</option>\n";
    }
    }
    }
    echo "</select><font class=\"tiny\">"._FILEINCLUDE."</font></td></tr>"
    ."<tr><td>"._CONTENT.":</td><td><textarea name=\"content\" cols=\"70\" rows=\"15\"></textarea>
    <font class=\"tiny\">"._IFRSSWARNING."</font></td></tr>"
    ."<tr><td>"._POSITION.":</td><td><select name=\"bposition\"><option name=\"bposition\" value=\"l\">"._LEFT."</option>"
    ."<option name=\"bposition\" value=\"c\">"._CENTERUP."</option>"
    ."<option name=\"bposition\" value=\"d\">"._CENTERDOWN."</option>"
    ."<option name=\"bposition\" value=\"r\">"._RIGHT."</option></select></td></tr>";
    if ($multilingual == 1) {
    echo "<tr><td>"._LANGUAGE.":</td><td>"
    ."<select name=\"blanguage\">";
    $handle=opendir('language');
    while ($file = readdir($handle)) {
    if (preg_match("/^lang\-(.+)\.php/", $file, $matches)) {
    $langFound = $matches[1];
    $languageslist .= "$langFound ";
    }
    }
    closedir($handle);
    $languageslist = explode(" ", $languageslist);
    sort($languageslist);
    for ($i=0; $i < sizeof($languageslist); $i++) {
    if($languageslist[$i]!="") {
    echo "<option value=\"$languageslist[$i]\" ";
    if($languageslist[$i]==$currentlang) echo "selected";
    echo ">".ucfirst($languageslist[$i])."</option>\n";
    }
    }
    echo "<option value=\"\">"._ALL."</option></select></td></tr>";
    } else {
    echo "<input type=\"hidden\" name=\"blanguage\" value=\"\">";
    }
    echo "<tr><td>"._ACTIVATE2."</td><td><input type=\"radio\" name=\"active\" value=\"1\" checked>"._YES." "
    ."<input type=\"radio\" name=\"active\" value=\"0\">"._NO."</td></tr>"
    ."<tr><td>"._EXPIRATION.":</td><td><input type=\"text\" name=\"expire\" size=\"4\" maxlength=\"3\" value=\"0\"> "._DAYS."</td></tr>"
    ."<tr><td>"._AFTEREXPIRATION.":</td><td><select name=\"action\">"
    ."<option name=\"action\" value=\"d\">"._DEACTIVATE."</option>"
    ."<option name=\"action\" value=\"r\">"._DELETE."</option></select></td></tr>"
    ."<tr><td>"._REFRESHTIME.":</td><td><select name=\"refresh\">"
    ."<option name=\"refresh\" value=\"1800\">1/2 "._HOUR."</option>"
    ."<option name=\"refresh\" value=\"3600\" selected>1 "._HOUR."</option>"
    ."<option name=\"refresh\" value=\"18000\">5 "._HOURS."</option>"
    ."<option name=\"refresh\" value=\"36000\">10 "._HOURS."</option>"
    ."<option name=\"refresh\" value=\"86400\">24 "._HOURS."</option></select><font class=\"tiny\">"._ONLYHEADLINES."</font></td></tr>"
    ."<tr><td>"._VIEWPRIV."</td><td><select name=\"view\">"
    ."<option value=\"0\" >"._MVALL."</option>"
    ."<option value=\"1\" >"._MVUSERS."</option>"
    ."<option value=\"2\" >"._MVADMIN."</option>"
    ."<option value=\"3\" >"._MVANON."</option>"
    ."</select></td></tr><tr><td nowrap>"
    .""._SUBVISIBLE."</td><td><input type=\"radio\" name=\"subscription\" value=\"0\" checked>"._YES." <input type=\"radio\" name=\"subscription\" value=\"1\">"._NO.""
    ."</td></tr></table>

    "
    ."<input type=\"hidden\" name=\"op\" value=\"BlocksAdd\">"
    ."<input type=\"submit\" value=\""._CREATEBLOCK."\"></form>";
    CloseTable();
    include("footer.php");
    }

    function block_show($bid) {
    global $prefix, $db, $admin_file;
    include("header.php");
    GraphicAdmin();
    title(""._BLOCKSADMIN."");
    OpenTable();
    echo "
    <center>";
    $bid = intval($bid);
    $row = $db->sql_fetchrow($db->sql_query("select bid, bkey, title, content, url, active, bposition, blockfile from ".$prefix."_blocks where bid='$bid'"));
    $bid = intval($row['bid']);
    $bkey = $row['bkey'];
    $title = $row['title'];
    $content = $row['content'];
    $url = $row['url'];
    $active = intval($row['active']);
    $bposition = $row['bposition'];
    $blockfile = $row['blockfile'];
    if ($bkey == main) {
    mainblock();
    } elseif ($bkey == admin) {
    adminblock();
    } elseif ($bkey == modules) {
    modules_block();
    } elseif ($bkey == category) {
    category();
    } elseif ($bkey == userbox) {
    userblock();
    } elseif ($bkey == "") {
    if ($url == "") {
    if ($blockfile == "") {
    if ($bposition == "c") {
    themecenterbox($title, $content);
    } else {
    themesidebox($title, $content);
    }
    } else {
    if ($bposition == "c") {
    blockfileinc($title, $blockfile, 1);
    } else {
    blockfileinc($title, $blockfile);
    }
    }
    } else {
    headlines($bid);
    }
    }
    echo "</center>";
    CloseTable();
    echo "
    ";
    OpenTable();
    if ($active == 1) {
    $act_chg = _DEACTIVATE;
    } elseif ($active == 0) {
    $act_chg = _ACTIVATE;
    }
    echo "<center><font class=\"option\">"._BLOCKSADMIN.": "._FUNCTIONS."</font>

    "
    ."[ <a href=\"".$admin_file.".php?op=ChangeStatus&bid=$bi d\">$act_chg</a> | <a href=\"".$admin_file.".php?op=BlocksEdit&bid=$bid\ ">"._EDIT."</a> | ";
    if ($bkey == "") {
    echo "<a href=\"".$admin_file.".php?op=BlocksDelete&bid=$bi d\">"._DELETE."</a> | ";
    } else {
    echo ""._DELETE." | ";
    }
    echo "<a href=\"".$admin_file.".php?op=BlocksAdmin\">"._BLO CKSADMIN."</a> ]</center>";
    CloseTable();
    include("footer.php");
    }

    function fixweight() {
    global $prefix, $db, $admin_file;
    $leftpos = "l";
    $rightpos = "r";
    $centerpos = "c";
    $result = $db->sql_query("select bid from ".$prefix."_blocks where bposition='$leftpos' order by weight ASC");
    $weight = 0;
    while ($row = $db->sql_fetchrow($result)) {
    $bid = intval($row['bid']);
    $weight++;
    $db->sql_query("update ".$prefix."_blocks set weight='$weight' where bid='$bid'");
    }
    $result2 = $db->sql_query("select bid from ".$prefix."_blocks where bposition='$rightpos' order by weight ASC");
    $weight = 0;
    while ($row2 = $db->sql_fetchrow($result2)) {
    $bid = intval($row2['bid']);
    $weight++;
    $db->sql_query("update ".$prefix."_blocks set weight='$weight' where bid='$bid'");
    }
    $result3 = $db->sql_query("select bid from ".$prefix."_blocks where bposition='$centerpos' order by weight ASC");
    $weight = 0;
    while ($row3 = $db->sql_fetchrow($result3)) {
    $bid = intval($row3['bid']);
    $weight++;
    $db->sql_query("update ".$prefix."_blocks set weight='$weight' where bid='$bid'");
    }
    Header("Location: ".$admin_file.".php?op=BlocksAdmin");
    }

    function BlockOrder ($weightrep,$weight,$bidrep,$bidori) {
    global $prefix, $db, $admin_file;
    $bidrep = intval($bidrep);
    $bidori = intval($bidori);
    $result = $db->sql_query("update ".$prefix."_blocks set weight='$weight' where bid='$bidrep'");
    $result2 = $db->sql_query("update ".$prefix."_blocks set weight='$weightrep' where bid='$bidori'");
    Header("Location: ".$admin_file.".php?op=BlocksAdmin");
    }

    function rssfail() {
    include("header.php");
    GraphicAdmin();
    OpenTable();
    echo "<center><font class=\"title\">"._BLOCKSADMIN."</font></center>";
    CloseTable();
    echo "
    ";
    OpenTable();
    echo "<center>"._RSSFAIL."

    "
    .""._RSSTRYAGAIN."

    "
    .""._GOBACK."</center>";
    CloseTable();
    include("footer.php");
    die;
    }

    function BlocksAdd($title, $content, $url, $bposition, $active, $refresh, $headline, $blanguage, $blockfile, $view, $expire, $action, $subscription) {
    global $prefix, $db, $admin_file;
    if ($headline != 0) {
    $row = $db->sql_fetchrow($db->sql_query("select sitename, headlinesurl from ".$prefix."_headlines where hid='$headline'"));
    $title = $row['sitename'];
    $url = $row['headlinesurl'];
    }
    $row2 = $db->sql_fetchrow($db->sql_query("SELECT weight FROM ".$prefix."_blocks WHERE bposition='$bposition' ORDER BY weight DESC"));
    $weight = intval($row2['weight']);
    $weight++;
    $title = stripslashes(FixQuotes($title));
    $content = stripslashes(FixQuotes($content));
    $bkey = "";
    $btime = "";
    if ($blockfile != "") {
    $url = "";
    if ($title == "") {
    $title = ereg_replace("block-","",$blockfile);
    $title = ereg_replace(".php","",$title);
    $title = ereg_replace("_"," ",$title);
    }
    }
    if ($url != "") {
    $btime = time();
    if (!ereg("http://",$url)) {
    $url = "http://$url";
    }
    $rdf = parse_url($url);
    $fp = fsockopen($rdf['host'], 80, $errno, $errstr, 15);
    if (!$fp) {
    rssfail();
    exit;
    }
    if ($fp) {
    fputs($fp, "GET " . $rdf['path'] . "?" . $rdf['query'] . " HTTP/1.0\r\n");
    fputs($fp, "HOST: " . $rdf['host'] . "\r\n\r\n");
    $string = "";
    while(!feof($fp)) {
    $pagetext = fgets($fp,228);
    $string .= chop($pagetext);
    }
    fputs($fp,"Connection: close\r\n\r\n");
    fclose($fp);
    $items = explode("</item>",$string);
    $content = "<font class=\"content\">";
    for ($i=0;$i<10;$i++) {
    $link = ereg_replace(".*<link>","",$items[$i]);
    $link = ereg_replace("</link>.*","",$link);
    $title2 = ereg_replace(".*<title>","",$items[$i]);
    $title2 = ereg_replace("</title>.*","",$title2);
    if ($items[$i] == "" AND $cont != 1) {
    $content = "";
    } else {
    if (strcmp($link,$title2) AND $items[$i] != "") {
    $cont = 1;
    $content .= "<big>&middot;</big><a href=\"$link\" target=\"new\">$title2</a>
    \n";
    }
    }
    }
    }
    }
    $content = FixQuotes($content);
    if (($content == "") AND ($blockfile == "")) {
    rssfail();
    } else {
    if ($expire == "") {
    $expire = 0;
    }
    if ($expire != 0) {
    $expire = time() + ($expire * 86400);
    }
    $db->sql_query("insert into ".$prefix."_blocks values (NULL, '$bkey', '$title', '$content', '$url', '$bposition', '$weight', '$active', '$refresh', '$btime', '$blanguage', '$blockfile', '$view', '$expire', '$action', '$subscription')");
    Header("Location: ".$admin_file.".php?op=BlocksAdmin");
    }
    }

    function BlocksEdit($bid) {
    global $bgcolor2, $bgcolor4, $prefix, $db, $multilingual, $admin_file;
    include("header.php");
    GraphicAdmin();
    OpenTable();
    echo "<center><font class=\"title\">"._EDITBLOCK."</font></center>";
    CloseTable();
    echo "
    ";
    $bid = intval($bid);
    $row = $db->sql_fetchrow($db->sql_query("select bkey, title, content, url, bposition, weight, active, refresh, blanguage, blockfile, view, expire, action, subscription from ".$prefix."_blocks where bid='$bid'"));
    $bkey = $row['bkey'];
    $title = $row['title'];
    $content = $row['content'];
    $url = $row['url'];
    $bposition = $row['bposition'];
    $weight = intval($row['weight']);
    $active = intval($row['active']);
    $refresh = intval($row['refresh']);
    $blanguage = $row['blanguage'];
    $blockfile = $row['blockfile'];
    $view = intval($row['view']);
    $expire = intval($row['expire']);
    $action = intval($row['action']);
    $subscription = intval($row['subscription']);
    if ($url != "") {
    $type = _RSSCONTENT;
    } elseif ($blockfile != "") {
    $type = _BLOCKFILE;
    }
    OpenTable();
    echo "<center><font class=\"option\">"._BLOCK.": $title $type</font></center>

    "
    ."<form action=\"".$admin_file.".php\" method=\"post\">"
    ."<table border=\"0\" width=\"100%\">"
    ."<tr><td>"._TITLE.":</td><td><input type=\"text\" name=\"title\" size=\"30\" maxlength=\"60\" value=\"$title\"></td></tr>";
    if ($blockfile != "") {
    echo "<tr><td>"._FILENAME.":</td><td>"
    ."<select name=\"blockfile\">";
    $blocksdir = dir("blocks");
    while($func=$blocksdir->read()) {
    if(substr($func, 0, 6) == "block-") {
    $blockslist .= "$func ";
    }
    }
    closedir($blocksdir->handle);
    $blockslist = explode(" ", $blockslist);
    sort($blockslist);
    for ($i=0; $i < sizeof($blockslist); $i++) {
    if($blockslist[$i]!="") {
    $bl = ereg_replace("block-","",$blockslist[$i]);
    $bl = ereg_replace(".php","",$bl);
    $bl = ereg_replace("_"," ",$bl);
    echo "<option value=\"$blockslist[$i]\" ";
    if ($blockfile == $blockslist[$i]) { echo "selected"; }
    echo ">$bl</option>\n";
    }
    }
    echo "</select><font class=\"tiny\">"._FILEINCLUDE."</font></td></tr>";
    } else {
    if ($url != "") {
    echo "<tr><td>"._RSSFILE.":</td><td><input type=\"text\" name=\"url\" size=\"30\" maxlength=\"200\" value=\"$url\"><font class=\"tiny\">"._ONLYHEADLINES."</font></td></tr>";
    } else {
    echo "<tr><td>"._CONTENT.":</td><td><textarea name=\"content\" cols=\"70\" rows=\"15\">$content</textarea></td></tr>";
    }
    }
    $oldposition = $bposition;
    echo "<input type=\"hidden\" name=\"oldposition\" value=\"$oldposition\">";
    if ($bposition == "l") {
    $sel1 = "selected";
    $sel2 = "";
    $sel3 = "";
    $sel4 = "";
    } elseif ($bposition == "c") {
    $sel1 = "";
    $sel2 = "selected";
    $sel3 = "";
    $sel4 = "";
    } elseif ($bposition == "r") {
    $sel1 = "";
    $sel2 = "";
    $sel3 = "selected";
    $sel4 = "";
    } elseif ($bposition == "d") {
    $sel1 = "";
    $sel2 = "";
    $sel3 = "";
    $sel4 = "selected";
    }
    echo "<tr><td>"._POSITION.":</td><td><select name=\"bposition\">"
    ."<option name=\"bposition\" value=\"l\" $sel1>"._LEFT."</option>"
    ."<option name=\"bposition\" value=\"c\" $sel2>"._CENTERUP."</option>"
    ."<option name=\"bposition\" value=\"d\" $sel4>"._CENTERDOWN."</option>"
    ."<option name=\"bposition\" value=\"r\" $sel3>"._RIGHT."</option></select></td></tr>";
    if ($multilingual == 1) {
    echo "<tr><td>"._LANGUAGE.":</td><td>"
    ."<select name=\"blanguage\">";
    $handle=opendir('language');
    while ($file = readdir($handle)) {
    if (preg_match("/^lang\-(.+)\.php/", $file, $matches)) {
    $langFound = $matches[1];
    $languageslist .= "$langFound ";
    }
    }
    closedir($handle);
    $languageslist = explode(" ", $languageslist);
    sort($languageslist);
    for ($i=0; $i < sizeof($languageslist); $i++) {
    if($languageslist[$i]!="") {
    echo "<option value=\"$languageslist[$i]\" ";
    if($languageslist[$i]==$blanguage) echo "selected";
    echo ">".ucfirst($languageslist[$i])."</option>\n";
    }
    }
    if ($blanguage != "") {
    $sel3 = "";
    } else {
    $sel3 = "selected";
    }
    echo "<option value=\"\" $sel3>"._ALL."</option></select></td></tr>";
    } else {
    echo "<input type=\"hidden\" name=\"blanguage\" value=\"\">";
    }
    if ($active == 1) {
    $sel1 = "checked";
    $sel2 = "";
    } elseif ($active == 0) {
    $sel1 = "";
    $sel2 = "checked";
    }
    if ($expire != 0) {
    $oldexpire = $expire;
    $expire = intval(($expire - time()) / 3600);
    $exp_day = $expire / 24;
    $expire = "<input type=\"hidden\" name=\"expire\" value=\"$oldexpire\">$expire "._HOURS." (".substr($exp_day,0,5)." "._DAYS.") <input type='text' name='moretime' size='4'> "._MOREDAYS."";
    } else {
    $expire = "<input type=\"text\" name=\"expire\" value=\"0\" size=\"4\" maxlength=\"3\"> "._DAYS."";
    }
    if ($action == "d") {
    $selact1 = "selected";
    $selact2 = "";
    } elseif ($action == "r") {
    $selact1 = "";
    $selact2 = "selected";
    }
    echo "<tr><td>"._ACTIVATE2."</td><td><input type=\"radio\" name=\"active\" value=\"1\" $sel1>"._YES." "
    ."<input type=\"radio\" name=\"active\" value=\"0\" $sel2>"._NO."</td></tr>"
    ."<tr><td>"._EXPIRATION.":</td><td>$expire</td></tr>"
    ."<tr><td>"._AFTEREXPIRATION.":</td><td><select name=\"action\">"
    ."<option name=\"action\" value=\"d\" $selact1>"._DEACTIVATE."</option>"
    ."<option name=\"action\" value=\"r\" $selact2>"._DELETE."</option></select></td></tr>";
    if ($url != "") {
    if ($refresh == 1800) {
    $sel1 = "selected";
    $sel2 = "";
    $sel3 = "";
    $sel4 = "";
    $sel5 = "";
    } elseif ($refresh == 3600) {
    $sel1 = "";
    $sel2 = "selected";
    $sel3 = "";
    $sel4 = "";
    $sel5 = "";
    } elseif ($refresh == 18000) {
    $sel1 = "";
    $sel2 = "";
    $sel3 = "selected";
    $sel4 = "";
    $sel5 = "";
    } elseif ($refresh == 36000) {
    $sel1 = "";
    $sel2 = "";
    $sel3 = "";
    $sel4 = "selected";
    $sel5 = "";
    } elseif ($refresh == 86400) {
    $sel1 = "";
    $sel2 = "";
    $sel3 = "";
    $sel4 = "";
    $sel5 = "selected";
    }
    echo "<tr><td>"._REFRESHTIME.":</td><td><select name=\"refresh\"><option name=\"refresh\" value=\"1800\" $sel1>1/2 "._HOUR."</option>"
    ."<option name=\"refresh\" value=\"3600\" $sel2>1 "._HOUR."</option>"
    ."<option name=\"refresh\" value=\"18000\" $sel3>5 "._HOURS."</option>"
    ."<option name=\"refresh\" value=\"36000\" $sel4>10 "._HOURS."</option>"
    ."<option name=\"refresh\" value=\"86400\" $sel5>24 "._HOURS."</option></select><font class=\"tiny\">"._ONLYHEADLINES."</font>";
    }
    if ($view == 0) {
    $sel1 = "selected";
    $sel2 = "";
    $sel3 = "";
    $sel4 = "";
    } elseif ($view == 1) {
    $sel1 = "";
    $sel2 = "selected";
    $sel3 = "";
    $sel4 = "";
    } elseif ($view == 2) {
    $sel1 = "";
    $sel2 = "";
    $sel3 = "selected";
    $sel4 = "";
    } elseif ($view == 3) {
    $sel1 = "";
    $sel2 = "";
    $sel3 = "";
    $sel4 = "selected";
    }
    if ($subscription == 1) {
    $sub_c1 = "";
    $sub_c2 = "checked";
    } else {
    $sub_c1 = "checked";
    $sub_c2 = "";
    }
    echo "</td></tr><tr><td>"._VIEWPRIV."</td><td><select name=\"view\">"
    ."<option value=\"0\" $sel1>"._MVALL."</option>"
    ."<option value=\"1\" $sel2>"._MVUSERS."</option>"
    ."<option value=\"2\" $sel3>"._MVADMIN."</option>"
    ."<option value=\"3\" $sel4>"._MVANON."</option>"
    ."</select></td></tr><tr><td nowrap>"
    .""._SUBVISIBLE."</td><td><input type='radio' name='subscription' value='0' $sub_c1> "._YES."<input type='radio' name='subscription' value='1' $sub_c2> "._NO.""
    ."</td></tr></table>

    "
    ."<input type=\"hidden\" name=\"bid\" value=\"$bid\">"
    ."<input type=\"hidden\" name=\"bkey\" value=\"$bkey\">"
    ."<input type=\"hidden\" name=\"weight\" value=\"$weight\">"
    ."<input type=\"hidden\" name=\"op\" value=\"BlocksEditSave\">"
    ."<input type=\"submit\" value=\""._SAVEBLOCK."\"></form>";
    CloseTable();
    include("footer.php");
    }

    function SortWeight($bposition) {
    global $prefix, $db;
    $numbers = 1;
    $number_two = 1;
    $result = $db->sql_query("SELECT bid,weight FROM ".$prefix."_blocks WHERE bposition='$bposition' ORDER BY weight");
    while ($row = $db->sql_fetchrow($result)) {
    $bid = intval($row['bid']);
    $weight = intval($row['weight']);
    $result2 = $db->sql_query("update ".$prefix."_blocks set weight='$numbers' where bid='$bid'");
    $numbers++;
    }
    if ($bposition == l) {
    $position_two = "r";
    } else {
    $position_two = "l";
    }
    $result_two = $db->sql_query("SELECT bid,weight FROM ".$prefix."_blocks WHERE bposition='$position_two' ORDER BY weight");
    while ($row_two = $db->sql_fetchrow($result_two)) {
    $bid2 = intval($row_two['bid']);
    $weight = $row_two['weight'];
    $result_two2 = $db->sql_query("update ".$prefix."_blocks set weight='$number_two' where bid='$bid2'");
    $number_two++;
    }
    return $numbers;
    }

    function BlocksEditSave($bid, $bkey, $title, $content, $url, $oldposition, $bposition, $active, $refresh, $weight, $blanguage, $blockfile, $view, $expire, $action, $subscription, $moretime) {
    global $prefix, $db, $admin_file;
    if ($moretime != "") {
    $moretime = $moretime * 86400;
    $expire = $moretime + $expire;
    }
    if ($url != "") {
    $bkey = "";
    $btime = time();
    if (!ereg("http://",$url)) {
    $url = "http://$url";
    }
    $rdf = parse_url($url);
    $fp = fsockopen($rdf['host'], 80, $errno, $errstr, 15);
    if (!$fp) {
    rssfail();
    exit;
    }
    if ($fp) {
    fputs($fp, "GET " . $rdf['path'] . "?" . $rdf['query'] . " HTTP/1.0\r\n");
    fputs($fp, "HOST: " . $rdf['host'] . "\r\n\r\n");
    $string = "";
    while(!feof($fp)) {
    $pagetext = fgets($fp,300);
    $string .= chop($pagetext);
    }
    fputs($fp,"Connection: close\r\n\r\n");
    fclose($fp);
    $items = explode("</item>",$string);
    $content = "<font class=\"content\">";
    for ($i=0;$i<10;$i++) {
    $link = ereg_replace(".*<link>","",$items[$i]);
    $link = ereg_replace("</link>.*","",$link);
    $title2 = ereg_replace(".*<title>","",$items[$i]);
    $title2 = ereg_replace("</title>.*","",$title2);
    if ($items[$i] == "" AND $cont != 1) {
    $content = "";
    } else {
    if (strcmp($link,$title2) AND $items[$i] != "") {
    $cont = 1;
    $content .= "<big>&middot;</big><a href=\"$link\" target=\"new\">$title2</a>
    \n";
    }
    }
    }
    }
    if ($oldposition != $bposition) {
    $result = $db->sql_query("select bid from ".$prefix."_blocks where weight>='$weight' AND bposition='$bposition'");
    $fweight = $weight;
    $oweight = $weight;
    while ($row = $db->sql_fetchrow($result)) {
    $nbid = intval($row['bid']);
    $weight++;
    $db->sql_query("update ".$prefix."_blocks set weight='$weight' where bid='$nbid'");
    }
    $result2 = $db->sql_query("select bid from ".$prefix."_blocks where weight>'$oweight' AND bposition='$oldposition'");
    while ($row2 = $db->sql_fetchrow($result2)) {
    $obid = intval($row2['bid']);
    $db->sql_query("update ".$prefix."_blocks set weight='$oweight' where bid='$obid'");
    $oweight++;
    }
    $row3 = $db->sql_fetchrow($db->sql_query("select weight from ".$prefix."_blocks where bposition='$bposition' order by weight DESC limit 0,1"));
    $lastw = $row3['weight'];
    if ($lastw <= $fweight) {
    $lastw++;
    $db->sql_query("update ".$prefix."_blocks set title='$title', content='$content', bposition='$bposition', weight='$lastw', active='$active', refresh='$refresh', blanguage='$blanguage', blockfile='$blockfile', view='$view', subscription='$subscription' where bid='$bid'");
    } else {
    $db->sql_query("update ".$prefix."_blocks set title='$title', content='$content', bposition='$bposition', weight='$fweight', active='$active', refresh='$refresh', blanguage='$blanguage', blockfile='$blockfile', view='$view', subscription='$subscription' where bid='$bid'");
    }
    } else {
    $db->$result = sql_query("update ".$prefix."_blocks set bkey='$bkey', title='$title', content='$content', url='$url', bposition='$bposition', weight='$weight', active='$active', refresh='$refresh', blanguage='$blanguage', blockfile='$blockfile', view='$view', subscription='$subscription' where bid='$bid'");
    }
    Header("Location: ".$admin_file.".php?op=BlocksAdmin");
    } else {
    $title = stripslashes(FixQuotes($title));
    $content = stripslashes(FixQuotes($content));
    if ($oldposition != $bposition) {
    $result5 = $db->sql_query("select bid from ".$prefix."_blocks where weight>='$weight' AND bposition='$bposition'");
    $fweight = $weight;
    $oweight = $weight;
    while ($row5 = $db->sql_fetchrow($result5)) {
    $nbid = intval($row5['bid']);
    $weight++;
    $db->sql_query("update ".$prefix."_blocks set weight='$weight' where bid='$nbid'");
    }
    $result6 = $db->sql_query("select bid from ".$prefix."_blocks where weight>'$oweight' AND bposition='$oldposition'");
    while ($row6 = $db->sql_fetchrow($result6)) {
    $obid = intval($row6['bid']);
    $db->sql_query("update ".$prefix."_blocks set weight='$oweight' where bid='$obid'");
    $oweight++;
    }
    $row7 = $db->sql_fetchrow($db->sql_query("select weight from ".$prefix."_blocks where bposition='$bposition' order by weight DESC limit 0,1"));
    $lastw = $row7['weight'];
    if ($lastw <= $fweight) {
    $lastw++;
    $db->sql_query("update ".$prefix."_blocks set title='$title', content='$content', bposition='$bposition', weight='$lastw', active='$active', refresh='$refresh', blanguage='$blanguage', blockfile='$blockfile', view='$view', subscription='$subscription' where bid='$bid'");
    } else {
    $db->sql_query("update ".$prefix."_blocks set title='$title', content='$content', bposition='$bposition', weight='$fweight', active='$active', refresh='$refresh', blanguage='$blanguage', blockfile='$blockfile', view='$view', subscription='$subscription' where bid='$bid'");
    }
    } else {
    if ($expire == "") {
    $expire = 0;
    }
    if ($expire != 0 AND $expire <= 999) {
    $expire = time() + ($expire * 86400);
    }
    $result8 = $db->sql_query("update ".$prefix."_blocks set bkey='$bkey', title='$title', content='$content', url='$url', bposition='$bposition', weight='$weight', active='$active', refresh='$refresh', blanguage='$blanguage', blockfile='$blockfile', view='$view', expire='$expire', action='$action', subscription='$subscription' where bid='$bid'");
    }
    Header("Location: ".$admin_file.".php?op=BlocksAdmin");
    }
    }

    function ChangeStatus($bid, $ok=0) {
    global $prefix, $db, $admin_file;
    $bid = intval($bid);
    $row = $db->sql_fetchrow($db->sql_query("select active from ".$prefix."_blocks where bid='$bid'"));
    $active = intval($row['active']);
    if (($ok) OR ($active == 1)) {
    if ($active == 0) {
    $active = 1;
    } elseif ($active == 1) {
    $active = 0;
    }
    $result2 = $db->sql_query("update ".$prefix."_blocks set active='$active' where bid='$bid'");
    Header("Location: ".$admin_file.".php?op=BlocksAdmin");
    } else {
    $row3 = $db->sql_fetchrow($db->sql_query("select title, content from ".$prefix."_blocks where bid='$bid'"));
    $title = $row3['title'];
    $content = $row3['content'];
    include("header.php");
    GraphicAdmin();
    echo "
    ";
    OpenTable();
    echo "<center><font class=\"option\">"._BLOCKACTIVATION."</font></center>";
    CloseTable();
    echo "
    ";
    OpenTable();
    if ($content != "") {
    echo "<center>"._BLOCKPREVIEW." $title

    ";
    themesidebox($title, $content);
    } else {
    echo "<center>$title

    ";
    }
    echo "
    "._WANT2ACTIVATE."

    "
    ."[ <a href=\"".$admin_file.".php?op=BlocksAdmin\">"._NO. "</a> | <a href=\"".$admin_file.".php?op=ChangeStatus&amp;bid =$bid&amp;ok=1\">"._YES."</a> ]"
    ."</center>";
    CloseTable();
    include("footer.php");
    }
    }

    function BlocksDelete($bid, $ok=0) {
    global $prefix, $db, $admin_file;
    $bid = intval($bid);
    if ($ok) {
    $row = $db->sql_fetchrow($db->sql_query("select bposition, weight from ".$prefix."_blocks where bid='$bid'"));
    $bposition = $row['bposition'];
    $weight = intval($row['weight']);
    $result2 = $db->sql_query("select bid from ".$prefix."_blocks where weight>'$weight' AND bposition='$bposition'");
    while ($row2 = $db->sql_fetchrow($result2)) {
    $nbid = intval($row2['bid']);
    $db->sql_query("update ".$prefix."_blocks set weight='$weight' where bid='$nbid'");
    $weight++;
    }
    $db->sql_query("delete from ".$prefix."_blocks where bid='$bid'");
    Header("Location: ".$admin_file.".php?op=BlocksAdmin");
    } else {
    $row3 = $db->sql_fetchrow($db->sql_query("select title from ".$prefix."_blocks where bid='$bid'"));
    $title = $row3['title'];
    include("header.php");
    GraphicAdmin();
    OpenTable();
    echo "<center><font class=\"title\">"._BLOCKSADMIN."</font&