bestbuildpc: Forums
 

 Forum FAQForum FAQ   SearchSearch   UsergroupsUsergroups   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Converting Old Addon Block Manager
 
 
Post new topic   Reply to topic    bestbuildpc Forum Index -> RavenNuke -> Addons
View previous topic :: View next topic  
Author Message
bestbuildpc
Site Admin
Site Admin


Joined: Jun 30, 2012
Posts: 169
Location: NL

PostPosted: Sun Oct 27, 2013 18:35    Post subject: Converting Old Addon Block Manager Reply with quote

VERY OLD ADDON

Code:
<?php

/************************************************************************/
/* WB_BlocksManager v0.2                                                */
/* Module for phpnuke 6.x by Paulo FERREIRA                             */
/* Copyright (C) 2003 Paulo Ferreira                                    */
/* Web:   http://www.phpnuke-belgique.org/                              */
/* Email: webmaster@phpnuke-belgique.org                                */
/*                                                                      */
/* Modifications by James Johnston, 02/07/2004                          */
/* Email: jjohnston@techknowpro.com                                     */
/* Mods: Easy Position Change, Block Position by Module,                */
/*       Multi Add/Remove of Selected Blocks                            */
/*                                                                      */
/* =====================================================================*/
/* PHP-NUKE: Web Portal System                                          */
/* =====================================================================*/
/*                                                                      */
/* Copyright (c) 2002 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 (!eregi("admin.php", $PHP_SELF)) { Header("Location: index.php"); die(); }
$result = sql_query("select radminsuper from ".$prefix."_authors where aid='$aid'", $dbi);
list($radminsuper) = sql_fetch_row($result, $dbi);
if ($radminsuper==1) {

/*********************************************************/
/* Blocks_Manager Functions                              */
/*********************************************************/

function BlocksManager($wb_name) {
    global $bgcolor2, $bgcolor4, $prefix, $dbi, $currentlang, $multilingual;
    include("header.php");
    GraphicAdmin();
    OpenTable();
    echo "<center><font class=\"title\"><b>"._BLOCKMGR_BLOCKSADMIN_MANAGER."</b></font></center>";
    CloseTable();
    echo "<br>";
    OpenTable();
    $wb_url="admin.php?op=BlocksManager&amp;wb_name=";
    echo "<div align=\"center\">\n"
        ."<form action=\"admin.php\" method=\"post\">\n"
        .""._BLOCKMGR_MODULEDROP."&nbsp;<select name=\"wb_name\" size=\"1\" onChange=\"top.location.href=this.options[this.selectedIndex].value\">\n";
    $result = sql_query("SELECT mid, title, custom_title, active, view, inmenu FROM ".$prefix."_modules WHERE active=1 ORDER BY title ASC", $dbi);
    while(list($mid, $title, $custom_title, $active, $view, $inmenu) = sql_fetch_row($result, $dbi)) {
        echo "<option value=\"".$wb_url.$title."\""; if ($wb_name==$title) { echo " selected"; } echo ">$title</option>\n";
        if (!isset($wb_name)) { $wb_name = $title; }
    }
    echo "</select> \n"
        ."</form></div>\n";
    echo "<table border=\"1\" width=\"100%\"><tr>"
        ."<td align=\"center\" bgcolor=\"$bgcolor2\"><b>"._TITLE."</b></td>"
        ."<td align=\"center\" bgcolor=\"$bgcolor2\" colspan=\"2\"><b>"._POSITION."</b></td>"
        ."<td align=\"center\" bgcolor=\"$bgcolor2\" colspan=\"2\"><b>"._WEIGHT."</b></td>"
        ."<td align=\"center\" bgcolor=\"$bgcolor2\"><b>"._TYPE."</b></td>"
        ."<td align=\"center\" bgcolor=\"$bgcolor2\"><b>"._STATUS."</b></td>"
        ."<td align=\"center\" bgcolor=\"$bgcolor2\"><b>"._VIEW."</b></td>";
    if ($multilingual == 1) {
        echo "<td align=\"center\" bgcolor=\"$bgcolor2\"><b>"._LANGUAGE."</b></td>";
    }
//    echo "<td align=\"center\" bgcolor=\"$bgcolor2\"><b>"._FUNCTIONS."</b></tr>";

    $i=0;
    $sql = "SELECT b.bid, b.bkey, b.title, b.url, m.bposition, m.weight, b.active, b.blanguage, b.blockfile, b.view FROM ".$prefix."_blocks b, ".$prefix."_blocks_manager m WHERE b.bid=m.bid AND m.title='$wb_name' ORDER BY bposition, weight";
    $result1 = sql_query($sql, $dbi);
   while(list($bid, $bkey, $title, $url, $bposition, $weight, $active, $blanguage, $blockfile, $view) = sql_fetch_row($result1, $dbi)) {
      $weight1 = $weight - 1;
       $weight3 = $weight + 1;
       $res = sql_query("select bid from ".$prefix."_blocks_manager where title='$wb_name' AND weight='$weight1' AND bposition='$bposition'", $dbi);
       list ($bid1) = sql_fetch_array($res, $dbi);
       $con1 = "$bid1";
       $res2 = sql_query("select bid from ".$prefix."_blocks_manager where title='$wb_name' AND weight='$weight3' AND bposition='$bposition'", $dbi);
       list ($bid2) = sql_fetch_array($res2, $dbi);
       $con2 = "$bid2";      
        echo "<tr>"
            ."<td align=\"center\">$title</td>";
        if ($bposition == "l") {
           $bposition = ""._LEFT."</td><td align=\"center\"><a href=\"admin.php?op=BlocksManager_BlockPosition&amp;bid=$bid&amp;title=$wb_name&amp;position=r\">"
                  ."<img src=\"images/center_l.gif\" border=\"0\" alt=\""._MOVERIGHT."\" title=\""._MOVERIGHT."\">"
                  ."</a>"
                  ."<a href=\"admin.php?op=BlocksManager_BlockPosition&amp;bid=$bid&amp;title=$wb_name&amp;position=c\">"
                  ."<img src=\"images/up.gif\" alt=\""._MOVECENTERUP."\" title=\""._MOVECENTERUP."\" border=\"0\">"
                  ."</a>"
                  ."<a href=\"admin.php?op=BlocksManager_BlockPosition&amp;bid=$bid&amp;title=$wb_name&amp;position=d\">"
                  ."<img src=\"images/down.gif\" alt=\""._MOVECENTERDOWN."\" title=\""._MOVECENTERDOWN."\" border=\"0\">"
                  ."</a>";
        } elseif ($bposition == "r") {
           $bposition = ""._RIGHT."</td><td align=\"center\"><a href=\"admin.php?op=BlocksManager_BlockPosition&amp;bid=$bid&amp;title=$wb_name&amp;position=l\">"
                  ."<img src=\"images/center_r.gif\" border=\"0\" alt=\""._MOVELEFT."\" title=\""._MOVELEFT."\">"
                  ."</a>"
                  ."<a href=\"admin.php?op=BlocksManager_BlockPosition&amp;bid=$bid&amp;title=$wb_name&amp;position=c\">"
                  ."<img src=\"images/up.gif\" alt=\""._MOVECENTERUP."\" title=\""._MOVECENTERUP."\" border=\"0\">"
                  ."</a>"
                  ."<a href=\"admin.php?op=BlocksManager_BlockPosition&amp;bid=$bid&amp;title=$wb_name&amp;position=d\">"
                  ."<img src=\"images/down.gif\" alt=\""._MOVECENTERDOWN."\" title=\""._MOVECENTERDOWN."\" border=\"0\">"
                  ."</a>";
        } elseif ($bposition == "c") {
           $bposition = ""._CENTERUP."</td><td align=\"center\"><a href=\"admin.php?op=BlocksManager_BlockPosition&amp;bid=$bid&amp;title=$wb_name&amp;position=l\">"
                  ."<img src=\"images/center_r.gif\" border=\"0\" alt=\""._MOVELEFT."\" title=\""._MOVELEFT."\">"
                  ."</a>"
                  ."<a href=\"admin.php?op=BlocksManager_BlockPosition&amp;bid=$bid&amp;title=$wb_name&amp;position=r\">"
                  ."<img src=\"images/center_l.gif\" border=\"0\" alt=\""._MOVERIGHT."\" title=\""._MOVERIGHT."\">"
                  ."</a>"
                  ."<a href=\"admin.php?op=BlocksManager_BlockPosition&amp;bid=$bid&amp;title=$wb_name&amp;position=d\">"
                  ."<img src=\"images/down.gif\" alt=\""._MOVECENTERDOWN."\" title=\""._MOVECENTERDOWN."\" border=\"0\">"
                  ."</a>";         
        } elseif ($bposition == "d") {
           $bposition = ""._CENTERDOWN."</td><td align=\"center\"><a href=\"admin.php?op=BlocksManager_BlockPosition&amp;bid=$bid&amp;title=$wb_name&amp;position=l\">"
                  ."<img src=\"images/center_r.gif\" border=\"0\" alt=\""._MOVELEFT."\" title=\""._MOVELEFT."\">"
                  ."</a>"
                  ."<a href=\"admin.php?op=BlocksManager_BlockPosition&amp;bid=$bid&amp;title=$wb_name&amp;position=r\">"
                  ."<img src=\"images/center_l.gif\" border=\"0\" alt=\""._MOVERIGHT."\" title=\""._MOVERIGHT."\">"
                  ."</a>"                  
                  ."<a href=\"admin.php?op=BlocksManager_BlockPosition&amp;bid=$bid&amp;title=$wb_name&amp;position=c\">"
                  ."<img src=\"images/up.gif\" alt=\""._MOVECENTERUP."\" title=\""._MOVECENTERUP."\" border=\"0\">"
                  ."</a>";
        }
        echo "<td align=\"center\">$bposition</td>"
            ."<td align=\"center\">";
//            ."&nbsp;".$row1[weight]."&nbsp;</td>";
         
      echo "$weight</td><td align=\"center\">";
       if ($con1) {
         echo"<a href=\"admin.php?op=BlocksManager_BlockOrder&amp;weight=$weight&amp;bidori=$bid&amp;weightrep=$weight1&amp;bidrep=$con1\"><img src=\"images/up.gif\" alt=\""._BLOCKUP."\" title=\""._BLOCKUP."\" border=\"0\" hspace=\"3\"></a>";
       }
       if ($con2) {
         echo "<a href=\"admin.php?op=BlocksManager_BlockOrder&amp;weight=$weight&amp;bidori=$bid&amp;weightrep=$weight3&amp;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 = _ACTIVE;
         $change = _DEACTIVATE;
        } elseif ($active == 0) {
         $active = "<i>"._INACTIVE."</i>";
         $change = _ACTIVATE;
        }
        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\">";
        if ($bkey == "") {
            echo "<a href=\"admin.php?op=BlocksManager_Delete&amp;bid=$bid&amp;title=$wb_name\">"._BLOCKMGR_WB_DELETE."</a>";
        } elseif ($bkey != "") {
            echo ""._BLOCKMGR_WB_DELETE."";
        }
        echo "</td>";
*/      
      echo "</tr>";
        $wb_tabblocks[$i] = $bid;
        $i++;
    }
    echo "</table><br>"
      ."<center>[ <a href=\"admin.php?op=BlocksManager_FixWeight&amp;wb_name=$wb_name\">"._FIXBLOCKS."</a> ]</center><br>"
        ."<br><br>";
    CloseTable();
    echo "<br>";
    OpenTable();
    echo "<center><font class=\"option\"><b>"._BLOCKMGR_ADDNEWBLOCK_MANAGER."</b></font></center><br><br>"
        ."<form name=\"BM_EDIT\" action=\"admin.php\" method=\"post\">"
        ."<table border=\"0\" width=\"80%\" align=\"center\">"
      ."<tr>";
      
   //List all inactive Blocks for selected module
    echo "<td align=\"center\" valign=\"top\">"
        ._BLOCKMGR_ACTIVE_BLOCKS."<br><select name=\"bida[]\" size=\"10\" multiple>";
    $sql = "SELECT bid, title FROM ".$prefix."_blocks ORDER BY title ASC";
    $result = sql_query($sql, $dbi);
    while(list($bid, $title) = sql_fetch_row($result, $dbi)) {
        $ii=0; $wb_affiche=1;
        while ($ii<$i) {
            if ($wb_tabblocks[$ii]==$bid) { $wb_affiche=0; }
            $ii++;
        }
        if ($wb_affiche==1) { echo "<option value=\"".$bid."\">$title</option>\n"; }
    }
    echo "</select><br>"
      ."<input type=\"submit\" value=\""._BLOCKMGR_ADD_BLOCK."\" onclick=\"document.BM_EDIT.op.value='BlocksManager_Add';\">"
      ."</td>";
      
   //List all active Modules
   echo "<td align=\"center\" valign=\"top\">"
         .""._BLOCKMGR_MODULES."<br><select name=\"title[]\" size=\"10\" multiple>\n";
    $result = sql_query("SELECT mid, title, custom_title, active, view, inmenu FROM ".$prefix."_modules WHERE active=1 ORDER BY title ASC", $dbi);
    while(list($mid, $title, $custom_title, $active, $view, $inmenu) = sql_fetch_row($result, $dbi)) {
        echo "<option value=\"$title\"";
      if ($wb_name==$title) { echo " selected"; } echo ">$title</option>\n";
        if (!isset($wb_name)) { $wb_name = $title; }
    }
    echo "</select><br>"
      ."</td>\n";
   
   //List all active Blocks for selected module
    echo "<td align=\"center\" valign=\"top\">"
        ._BLOCKMGR_INACTIVE_BLOCKS."<br><select name=\"bidr[]\" size=\"10\" multiple>";
   $sql = "SELECT b.bid, b.title FROM ".$prefix."_blocks b, ".$prefix."_blocks_manager m WHERE b.bid=m.bid AND m.title='$wb_name' ORDER BY title ASC";
    $result = sql_query($sql, $dbi);
    while(list($bid, $title) = sql_fetch_row($result, $dbi)) {
        echo "<option value=\"$bid\">$title</option>\n";
    }
    echo "</select><br>"
      ."<input type=\"submit\" value=\""._BLOCKMGR_REMOVE_BLOCK."\" onclick=\"document.BM_EDIT.op.value='BlocksManager_Remove';\"></td>";

    echo "</tr><tr><td align=\"center\" colspan=\"2\"><br>"
        ."</td>"
        ."</tr>"
        ."</table>"
      ."<input type=\"hidden\" name=\"wb_name\" value=\"$wb_name\">"
        ."<input type=\"hidden\" name=\"op\" value=\"BlocksManager_Add\">"
        ."</form>";

    CloseTable();
    include("footer.php");
}


function BlocksManager_Add($bid, $title, $wb_name) {
   global $prefix, $dbi;
   
   foreach($title as $tKey => $tValue) {
      foreach($bid as $bKey => $bValue) {
         $sql = "SELECT bposition, weight FROM ".$prefix."_blocks WHERE bid='$bValue'";
         echo "$sql<br>";
         $result = sql_query($sql, $dbi);
         list($bposition, $weight) = sql_fetch_row($result, $dbi);
         sql_query("INSERT INTO ".$prefix."_blocks_manager VALUES ('$bValue', '$tValue', '$bposition', '$weight')", $dbi);
//         echo "INSERT INTO ".$prefix."_blocks_manager VALUES ('$bValue', '$tValue', '$bposition', '$weight')<br>";
      }
   }
   Header("Location: admin.php?op=BlocksManager&wb_name=$wb_name");
}

function BlocksManager_Remove($bid, $title, $wb_name) {
   global $prefix, $dbi;
   
   foreach($title as $tKey => $tValue) {
      foreach($bid as $bKey => $bValue) {
           sql_query("DELETE FROM ".$prefix."_blocks_manager WHERE bid='$bValue' AND title='$tValue'", $dbi);
//         echo "DELETE FROM ".$prefix."_blocks_manager WHERE bid='$bValue' AND title='$tValue'<br>";
      }
   }
   Header("Location: admin.php?op=BlocksManager&wb_name=$wb_name");
}

function BlocksManager_FixWeight($wb_name) {
    global $prefix, $dbi;
    $leftpos = "l";
    $rightpos = "r";
    $centeruppos = "c";
    $centerdnpos = "d";
   
   //Fix Left Block Weights
    $result = sql_query("select bid, title from ".$prefix."_blocks_manager where title='$wb_name' AND bposition='$leftpos' order by weight ASC", $dbi);
    $weight = 0;
    while(list($bid, $title) = sql_fetch_row($result, $dbi)) {
      $weight++;
      sql_query("update ".$prefix."_blocks_manager set weight='$weight' where title='$wb_name' AND bid='$bid'", $dbi);
      echo "$bid, $title, $weight<br>\n";
    }

   //Fix Right Block Weights   
    $result = sql_query("select bid from ".$prefix."_blocks_manager where title='$wb_name' bposition='$rightpos' order by weight ASC", $dbi);
    $weight = 0;
    while(list($bid) = sql_fetch_row($result, $dbi)) {
      $weight++;
      sql_query("update ".$prefix."_blocks_manager set weight='$weight' where title='$wb_name' AND bid='$bid'", $dbi);
    }

   //Fix Center Up Block Weights   
    $result = sql_query("select bid from ".$prefix."_blocks_manager where title='$wb_name' bposition='$centeruppos' order by weight ASC", $dbi);
    $weight = 0;
    while(list($bid) = sql_fetch_row($result, $dbi)) {
      $weight++;
      sql_query("update ".$prefix."_blocks_manager set weight='$weight' where title='$wb_name' AND bid='$bid'", $dbi);
    }

   //Fix Center Down Block Weights   
    $result = sql_query("select bid from ".$prefix."_blocks_manager where title='$wb_name' bposition='$centerdnpos' order by weight ASC", $dbi);
    $weight = 0;
    while(list($bid) = sql_fetch_row($result, $dbi)) {
      $weight++;
      sql_query("update ".$prefix."_blocks_manager set weight='$weight' where title='$wb_name' AND bid='$bid'", $dbi);
    }   
    Header("Location: admin.php?op=BlocksManager&wb_name=$wb_name");
}

function BlocksManager_BlockPosition($bid, $title, $position) {
   global $prefix, $dbi;
   sql_query("UPDATE ".$prefix."_blocks_manager SET bposition='$position' WHERE bid='$bid' AND title='$title'", $dbi);
//   echo "UPDATE ".$prefix."_blocks_manager SET bposition='$position' WHERE bid='$bid' AND title='$title'";
   Header("Location: admin.php?op=BlocksManager&wb_name=$title");
}

function BlocksManager_BlockOrder($weightrep,$weight,$bidrep,$bidori) {
    global $prefix, $dbi;
    $result = sql_query("update ".$prefix."_blocks_manager set weight='$weight' where bid='$bidrep'", $dbi);
    $result2 = sql_query("update ".$prefix."_blocks_manager set weight='$weightrep' where bid='$bidori'", $dbi);
    Header("Location: admin.php?op=BlocksManager");
}


switch($op) {

    case "BlocksManager":
    BlocksManager($wb_name);
    break;

    case "BlocksManager_Add":
   BlocksManager_Add($bida, $title, $wb_name);
    break;

    case "BlocksManager_Remove":
   BlocksManager_Remove($bidr, $title, $wb_name);
    break;

   case "BlocksManager_BlockPosition":
   BlocksManager_BlockPosition($bid, $title, $position);
   break;

    case "BlocksManager_FixWeight":
    BlocksManager_FixWeight($wb_name);
    break;
   
    case "BlocksManager_BlockOrder":
    BlocksManager_BlockOrder ($weightrep,$weight,$bidrep,$bidori);
    break;   
}

} else {
    Header("Location: index.php");
    die();
}

?>


New Convertion from neralex

Code:
<?php

/**
 * @package: RN Admin Module - WB_BlocksManager
 * @version: 1.0
 * @file: blocks_manager.php
 * @copyright: WB_BlocksManager v0.2 (c) 2003 Paulo Ferreira http://www.phpnuke-belgique.org
 * @modifications: Easy Position Change, Block Position by Module,  Multi Add/Remove of Selected Blocks
 * @modifications: (c) 2004 James Johnston http://www.phpnuke-belgique.org
 * @Updated for PHPNuke 7.4: (c) 2004 spcdata  http://www.nextnet.se
 * @Updated for RavenNuke(tm) v25x: (c) 2013 by neralex - http://www.media.soefm.de
 * @license: http://opensource.org/licenses/gpl-license.php GNU Public License
 */

if (!defined('ADMIN_FILE')) {die('Illegal File Access');}
if (!defined('PHP_EOL')) define('PHP_EOL', strtoupper(substr(PHP_OS,0,3) == 'WIN') ? "\r\n" : "\n");

if (is_mod_admin('admin')) {

   if (!isset($op)) $op = '';
   if (!isset($wb_name)) $wb_name = '';
   if (!isset($bidrep)) $bidrep = '';

   switch($op) {
   
      case 'BlocksManager':
      BlocksManager($wb_name);
      break;
   
      case 'BlocksManager_Add':
      csrf_check();
      BlocksManager_Add($bida, $title, $wb_name);
      break;
   
      case 'BlocksManager_Remove':
      csrf_check();
      BlocksManager_Remove($bidr, $title, $wb_name);
      break;
   
      case 'BlocksManager_BlockPosition':
      csrf_check();
      BlocksManager_BlockPosition($bid, $title, $position);
      break;
   
      case 'BlocksManager_FixWeight':
      csrf_check();
      BlocksManager_FixWeight($wb_name);
      break;
   
      case 'BlocksManager_BlockOrder':
      csrf_check();
      BlocksManager_BlockOrder($weightrep, $weight, $bidrep, $bidori, $title);
      break;

   }

} else {
   echo 'Access Denied';
}
die();

/*********************************************************/
/* Blocks_Manager Functions                              */
/*********************************************************/

function BlocksManager($wb_name) {
    global $admin_file, $prefix, $db, $currentlang, $multilingual;
   $table = $db->sql_fetchrow($db->sql_query('SHOW TABLES LIKE \'' . $prefix . '_blocks_manager\''));
   if (isset($table['0'])) {
      $blma_css = '<style type="text/css">' . PHP_EOL
              . '.noborder {border:none;}' . PHP_EOL
              . '.valign_top {vertical-align:top;}' . PHP_EOL
              . '.valign_bottom {vertical-align:bottom;}' . PHP_EOL
              . '.valign_middle {vertical-align:middle;}' . PHP_EOL
              . '.blma_maintable {border-top:1px solid; border-bottom:1px solid; width:100%; border-spacing:0px;}' . PHP_EOL
              . '.blma_maintable td:first-child {border-left:1px solid;}' . PHP_EOL
              . '.blma_maintable td {padding:0; border-top:1px solid; border-top:1px solid; border-right:1px solid; display:table-cell; vertical-align:middle; text-align:center; padding:2px 0 2px 0;}' . PHP_EOL
              . '.blma_maintable img {border:none;}' . PHP_EOL
              . '.blma_maintable tr:first-child {font-weight:bold;border-bottom:1px solid;}' . PHP_EOL
              . '.blma_maintable tr:first-child td {border-top:none;}' . PHP_EOL
              . '.blma_addnewtable {border:none; border-spacing:0px; width:80%;}' . PHP_EOL
              . '.blma_addnewtable td {display:table-cell; text-align:center;}' . PHP_EOL
              . '</style>' . PHP_EOL;
      addCSSToHead($blma_css, 'inline');
   
      include_once 'header.php';
      GraphicAdmin();
      OpenTable();
      echo '<div class="text-center thick">' , _BLOCKMGR_BLOCKSADMIN_MANAGER , '</div>' , PHP_EOL;
      CloseTable();
      echo '<br />' , PHP_EOL;
      OpenTable();
      $wb_url = $admin_file . '.php?op=BlocksManager&amp;wb_name=';
      $result = $db->sql_query('SELECT `mid`, `title`, `custom_title`, `active`, `view`, `inmenu` FROM `' . $prefix . '_modules` WHERE `active` = 1 ORDER BY `title` ASC');
      echo '<div class="text-center">' , PHP_EOL;
      if ($db->sql_numrows($result) > 0) {
         echo '<form action="' , $admin_file , '.php" method="post">' , PHP_EOL
            , _BLOCKMGR_MODULEDROP , '&nbsp;' , PHP_EOL
            , '<select name="wb_name" size="1" onchange="top.location.href=this.options[this.selectedIndex].value">' , PHP_EOL;
         while (list($mid, $title, $custom_title, $active, $view, $inmenu) = $db->sql_fetchrow($result)) {
            echo '<option value="' , $wb_url , $title , '"' , ($wb_name == $title ? ' selected="selected"' : '') , '>' , $title , '</option>' , PHP_EOL;
            if ($wb_name == '') {
               $wb_name = $title;
            }
         } # end of while
         echo '</select>' , PHP_EOL
            , '</form>' , PHP_EOL
            , '</div>' , PHP_EOL
            , '<br />' , PHP_EOL;
      } else {
         echo 'No active modules found!' , PHP_EOL
            , '</div>' , PHP_EOL;
         CloseTable();
         include_once 'footer.php';
         exit;   
      }   
      echo '<table class="blma_maintable">' , PHP_EOL
         , '<tr>' , PHP_EOL
         , '<td>' , _TITLE , '</td>' , PHP_EOL
         , '<td colspan="2">' , _POSITION , '</td>' , PHP_EOL
         , '<td colspan="2">' , _WEIGHT , '</td>' , PHP_EOL
         , '<td>' , _TYPE , '</td>' , PHP_EOL
         , '<td>' , _STATUS , '</td>' , PHP_EOL
         , '<td>' , _VIEW , '</td>' , PHP_EOL;
      if ($multilingual == 1) {
         echo '<td>' , _LANGUAGE , '</td>' , PHP_EOL;
      }
      #echo '<td>' , _FUNCTIONS , '</td>' , PHP_EOL;
      echo '</tr>' , PHP_EOL;   
      $i = 0;
      $sql = 'SELECT b.`bid`, b.`bkey`, b.`title`, b.`url`, m.`bposition`, m.`weight`, b.`active`, b.`blanguage`, b.`blockfile`, b.`view` FROM `' . $prefix . '_blocks` b, `' . $prefix . '_blocks_manager` m WHERE b.`bid` = m.`bid` AND m.`title` = \'' . $db->sql_escape_string($wb_name) . '\' ORDER BY m.`bposition`, m.`weight` ASC';
      $result1 = $db->sql_query($sql);
      if ($db->sql_numrows($result1) > 0) {
         while (list($bid, $bkey, $title, $url, $bposition, $weight, $active, $blanguage, $blockfile, $view) = $db->sql_fetchrow($result1)) {
            $weight1 = $weight - 1;
            $weight3 = $weight + 1;
            $res = $db->sql_query('SELECT `bid` FROM `' . $prefix . '_blocks_manager` WHERE `title` = \'' . $db->sql_escape_string($wb_name) . '\' AND `weight` = \'' . $weight1 . '\' AND `bposition` = \'' . $bposition . '\'');
            list($bid1) = $db->sql_fetchrow($res);
            $con1 = $bid1;
            $res2 = $db->sql_query('SELECT `bid` FROM `' . $prefix . '_blocks_manager` WHERE `title` = \'' . $db->sql_escape_string($wb_name) . '\' AND `weight` = \'' . $weight3 . '\' AND `bposition` = \'' . $bposition . '\'');
            list($bid2) = $db->sql_fetchrow($res2);
            $con2 = $bid2;
            # added query to catch the current main-module (HOME)
            $row2 = $db->sql_fetchrow($db->sql_query('SELECT `main_module` FROM `' . $prefix . '_main`'));
            $main_module = $row2['main_module'];

            echo '<tr>' , PHP_EOL
               , '<td>' , $title , '</td>' , PHP_EOL;
            if ($bposition == 'l') {
               $bposition = _LEFT . '</td>' . PHP_EOL
                        . '<td>' . PHP_EOL
                        . '<a class="rn_csrf" href="' . $admin_file . '.php?op=BlocksManager_BlockPosition&amp;bid=' . $bid . '&amp;title=' . $wb_name . '&amp;position=r">'
                        . '<img src="images/center_l.gif" alt="' . _RIGHTBLOCK . '" title="' . _RIGHTBLOCK . '" />'
                        . '</a>' . PHP_EOL;
               if ($wb_name == $main_module) {
                  $bposition .= '<a class="rn_csrf" href="' . $admin_file . '.php?op=BlocksManager_BlockPosition&amp;bid=' . $bid . '&amp;title=' . $wb_name . '&amp;position=c">'
                           . '<img src="images/up.gif" alt="' . _CENTERUP . '" title="' . _CENTERUP . '" />'
                           . '</a>' . PHP_EOL
                           . '<a class="rn_csrf" href="' . $admin_file . '.php?op=BlocksManager_BlockPosition&amp;bid=' . $bid . '&amp;title=' . $wb_name . '&amp;position=d">'
                           . '<img src="images/down.gif" alt="' . _CENTERDOWN . '" title="' . _CENTERDOWN . '" />'
                           . '</a>' . PHP_EOL;
               }
            } elseif ($bposition == 'r') {
               $bposition = _RIGHT . '</td>' . PHP_EOL
                        . '<td>' . PHP_EOL
                        . '<a class="rn_csrf" href="' . $admin_file . '.php?op=BlocksManager_BlockPosition&amp;bid=' . $bid . '&amp;title=' . $wb_name . '&amp;position=l">'
                        . '<img src="images/center_r.gif" alt="' . _LEFTBLOCK . '" title="' . _LEFTBLOCK . '" />'
                        . '</a>' . PHP_EOL;
               if ($wb_name == $main_module) {
                  $bposition .= '<a class="rn_csrf" href="' . $admin_file . '.php?op=BlocksManager_BlockPosition&amp;bid=' . $bid . '&amp;title=' . $wb_name . '&amp;position=c">'
                              . '<img src="images/up.gif" alt="' . _CENTERUP . '" title="' . _CENTERUP . '" />'
                              . '</a>' . PHP_EOL
                             . '<a class="rn_csrf" href="' . $admin_file . '.php?op=BlocksManager_BlockPosition&amp;bid=' . $bid . '&amp;title=' . $wb_name . '&amp;position=d">'
                             . '<img src="images/down.gif" alt="' . _CENTERDOWN . '" title="' . _CENTERDOWN . '" />'
                             . '</a>' . PHP_EOL;
               }
            } elseif ($bposition == 'c') {
               $bposition = _CENTERUP . '</td>' . PHP_EOL
                        . '<td>' . PHP_EOL
                        . '<a class="rn_csrf" href="' . $admin_file . '.php?op=BlocksManager_BlockPosition&amp;bid=' . $bid . '&amp;title=' . $wb_name . '&amp;position=l">'
                        . '<img src="images/center_r.gif" alt="' . _LEFTBLOCK . '" title="' . _LEFTBLOCK . '" />'
                        . '</a>' . PHP_EOL
                        . '<a class="rn_csrf" href="' . $admin_file . '.php?op=BlocksManager_BlockPosition&amp;bid=' . $bid . '&amp;title=' . $wb_name . '&amp;position=r">'
                        . '<img src="images/center_l.gif" alt="' . _RIGHTBLOCK . '" title="' . _RIGHTBLOCK . '" />'
                        . '</a>' . PHP_EOL;
               if ($wb_name == $main_module) {
                  $bposition .= '<a class="rn_csrf" href="' . $admin_file . '.php?op=BlocksManager_BlockPosition&amp;bid=' . $bid . '&amp;title=' . $wb_name . '&amp;position=d">'
                              . '<img src="images/down.gif" alt="' . _CENTERDOWN . '" title="' . _CENTERDOWN . '" />'
                              . '</a>' . PHP_EOL;
               }
            } elseif ($bposition == 'd') {
               $bposition = _CENTERDOWN . '</td>' . PHP_EOL
                        . '<td>' . PHP_EOL
                        . '<a class="rn_csrf" href="' . $admin_file . '.php?op=BlocksManager_BlockPosition&amp;bid=' . $bid . '&amp;title=' . $wb_name . '&amp;position=l">'
                        . '<img src="images/center_r.gif" alt="' . _LEFTBLOCK . '" title="' . _LEFTBLOCK . '" />'
                        . '</a>' . PHP_EOL
                        . '<a class="rn_csrf" href="' . $admin_file . '.php?op=BlocksManager_BlockPosition&amp;bid=' . $bid . '&amp;title=' . $wb_name . '&amp;position=r">'
                        . '<img src="images/center_l.gif" alt="' . _RIGHTBLOCK . '" title="' . _RIGHTBLOCK . '" />'
                        . '</a>' . PHP_EOL;
               if ($wb_name == $main_module) {
                  $bposition .= '<a class="rn_csrf" href="' . $admin_file . '.php?op=BlocksManager_BlockPosition&amp;bid=' . $bid . '&amp;title=' . $wb_name . '&amp;position=c">'
                              . '<img src="images/up.gif" alt="' . _CENTERUP . '" title="' . _CENTERUP . '" />'
                             . '</a>' . PHP_EOL;
               }
            }
            echo '<td>' , $bposition , '</td>' , PHP_EOL
               , '<td>' , $weight , '</td>' , PHP_EOL
               , '<td>' , PHP_EOL      
               , '<a class="rn_csrf" href="' , $admin_file , '.php?op=BlocksManager_BlockOrder&amp;weight=' , $weight , '&amp;bidori=' , $bid , '&amp;weightrep=' , $weight1 , ($con1 != '' ? '&amp;bidrep=' . $con1 : '') , '&amp;title=' , $wb_name , '"><img src="images/up.gif" alt="' , _BLOCKUP , '" title="' , _BLOCKUP , '" /></a>' , PHP_EOL
               , '<a class="rn_csrf" href="' , $admin_file , '.php?op=BlocksManager_BlockOrder&amp;weight=' , $weight , '&amp;bidori=' , $bid , '&amp;weightrep=' , $weight3 , ($con2 != '' ? '&amp;bidrep=' . $con2 : '') , '&amp;title=' , $wb_name , '"><img src="images/down.gif" alt="' , _BLOCKDOWN , '" title="' , _BLOCKDOWN , '" /></a>' , PHP_EOL
               , '</td>' , PHP_EOL;   
            if ($bkey == '') {
               if ($url == '') {
                  $type = 'HTML';
               } elseif ($url != '') {
                  $type = 'RSS/RDF';
               }
               if ($blockfile != '') {
                  $type = _BLOCKFILE2;
               }
            } elseif ($bkey != '') {
               $type = _BLOCKSYSTEM;
            }
            echo '<td>' , $type , '</td>' , PHP_EOL;
            $block_act = $active;
            if ($active == 1) {
               $active = _ACTIVE;
               $change = _DEACTIVATE;
            } elseif ($active == '0') {
               $active = '<em>' . _INACTIVE . '</em>';
               $change = _ACTIVATE;
            }
            echo '<td>' , $active , '</td>' , PHP_EOL;
            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>' , $who_view , '</td>' , PHP_EOL;
            if ($multilingual == 1) {
               if ($blanguage == '') {
                  $blanguage = _ALL;
               } else {
                  $blanguage = ucfirst($blanguage);
               }
               echo '<td>' , $blanguage , '</td>' , PHP_EOL;
            }   
            /*echo '<td>';
            if ($bkey == '') {
               echo '<a href="' , $admin_file , '.php?op=BlocksManager_Delete&amp;bid=' , $bid , '&amp;title=' , $wb_name , '">' , _DELETE , '</a>';
            } elseif ($bkey != '') {
               echo _DELETE;
            }
            echo '</td>' , PHP_EOL;   */
            echo '</tr>' , PHP_EOL;
            $wb_tabblocks[$i] = $bid;
            $i++;
         } # end of while
      } else {
         echo '<tr>' , PHP_EOL
            , '<td colspan="' , ($multilingual == 1 ? '9' : '8') , '">' , _BLOCKMGR_NOENTRIES , '</td>' , PHP_EOL
            , '</tr>' , PHP_EOL;
      }
      echo '</table>' , PHP_EOL
         , '<br />' , PHP_EOL
         , '<div class="text-center">[ <a class="rn_csrf" href="' , $admin_file , '.php?op=BlocksManager_FixWeight&amp;wb_name=' , $wb_name , '">' , _FIXBLOCKS , '</a> ]</div>' , PHP_EOL
         , '<br />' , PHP_EOL;
      CloseTable();
      echo '<br />' , PHP_EOL;
      OpenTable();
      echo '<div class="text-center thick">' , _BLOCKMGR_ADDNEWBLOCK_MANAGER , '</div>' , PHP_EOL
         , '<br />' , PHP_EOL
         , '<form name="BM_EDIT" action="' , $admin_file , '.php" method="post">' , PHP_EOL
         , '<table class="blma_addnewtable centered">' , PHP_EOL
         , '<tr>' , PHP_EOL
      # List all inactive Blocks for selected module
         , '<td class="valign_top">' , PHP_EOL
         , '<span class="thick">' , _BLOCKMGR_ACTIVE_BLOCKS , '</span><br />' , PHP_EOL;
      $result = $db->sql_query('SELECT `bid`, `title` FROM `' . $prefix . '_blocks` ORDER BY `title` ASC');
      if ($db->sql_numrows($result) > 0) {
         echo '<select name="bida[]" size="10" multiple="multiple">' , PHP_EOL;
         while (list($bid, $title) = $db->sql_fetchrow($result)) {
            $ii = 0;
            $wb_affiche = 1;
            while ($ii < $i) {
               if ($wb_tabblocks[$ii] == $bid) {
                  $wb_affiche = 0;
               }
               $ii++;
            } # end of while
            if ($wb_affiche == 1) {
               echo '<option value="' , $bid , '">' , $title , '</option>' , PHP_EOL;
            }
         }
         echo '</select>' , PHP_EOL
            , '<br /><br />' , PHP_EOL
            , '<input type="submit" value="' , _BLOCKMGR_ADD_BLOCK , '" onclick="document.BM_EDIT.op.value=\'BlocksManager_Add\';" />' , PHP_EOL;
      } else {
         echo _BLOCKMGR_NOENTRIES , PHP_EOL;
      }
      echo '</td>' , PHP_EOL
      # List all active Modules
         , '<td class="valign_top">' , PHP_EOL
         , '<span class="thick">' , _BLOCKMGR_MODULES , '</span><br />' , PHP_EOL;
      $result = $db->sql_query('SELECT `mid`, `title`, `custom_title`, `active`, `view`, `inmenu` FROM `' . $prefix . '_modules` WHERE `active` = 1 ORDER BY `title` ASC');
      if ($db->sql_numrows($result) > 0) {
         echo '<select name="title[]" size="10" multiple="multiple">' , PHP_EOL;
         while (list($mid, $title, $custom_title, $active, $view, $inmenu) = $db->sql_fetchrow($result)) {
            echo '<option value="' , $title , '"' , ($wb_name == $title ? ' selected="selected"' : '') , '>' , $title , '</option>' , PHP_EOL;
            if ($wb_name == '') {
               $wb_name = $title;
            }
         } # end of while
         echo '</select>' , PHP_EOL
            , '<br />' , PHP_EOL;
      } else {
         echo _BLOCKMGR_NOENTRIES , PHP_EOL;
      }
      echo '</td>' , PHP_EOL
      # List all active Blocks for selected module
         , '<td class="valign_top">' , PHP_EOL
         , '<span class="thick">' , _BLOCKMGR_INACTIVE_BLOCKS , '</span><br />' , PHP_EOL;
      $result = $db->sql_query('SELECT b.`bid`, b.`title` FROM `' . $prefix . '_blocks` b, `' . $prefix . '_blocks_manager` m WHERE b.`bid` = m.`bid` AND m.`title` = \'' . $db->sql_escape_string($wb_name) . '\' ORDER BY `title` ASC');
      if ($db->sql_numrows($result) > 0) {
         echo '<select name="bidr[]" size="10" multiple="multiple">' , PHP_EOL;
         while (list($bid, $title) = $db->sql_fetchrow($result)) {
            echo '<option value="' , $bid , '">' , $title , '</option>' , PHP_EOL;
         } # end of while
         echo '</select>' , PHP_EOL
            , '<br />' , PHP_EOL
            , '<input type="submit" value="' , _BLOCKMGR_REMOVE_BLOCK , '" onclick="document.BM_EDIT.op.value=\'BlocksManager_Remove\';" />' , PHP_EOL;
      } else {
         echo _BLOCKMGR_NOENTRIES , PHP_EOL;
      }
      echo '</td>' , PHP_EOL
         , '</tr>' , PHP_EOL
         , '</table>' , PHP_EOL
         , '<br />' , PHP_EOL
         , '<input type="hidden" name="wb_name" value="' , $wb_name , '" />' , PHP_EOL
         , '<input type="hidden" name="op" value="BlocksManager_Add" />' , PHP_EOL
         , '</form>' , PHP_EOL;
      CloseTable();
      include_once 'footer.php';
   } else {
      $visit_table = $db->sql_fetchrow($db->sql_query('SHOW TABLES LIKE \'' . $prefix . '_blocks_manager\''));
      if (!isset($visit_table['0'])) {      
         include_once 'header.php';
         GraphicAdmin();
         OpenTable();
         echo '<div class="text-center">' , PHP_EOL;
         $createtable = 'CREATE TABLE IF NOT EXISTS `' . $prefix . '_blocks_manager` (
         `bid` int(10) NOT NULL DEFAULT \'0\',
         `title` varchar(255) NOT NULL DEFAULT \'0\',
         `bposition` char(1) NOT NULL DEFAULT \'\',
         `weight` int(10) NOT NULL DEFAULT \'1\',
         KEY title (`title`)
         ) ENGINE=MyISAM ;';
         $qry = $db->sql_query($createtable);
         if ($qry) {
            echo 'create blocks manager db-table = done!<br />' , PHP_EOL;
         } else {
            echo 'create blocks manager db-table = failed!<br />' , PHP_EOL;
         }
         echo '<br /><a href="' , $admin_file , '.php?op=BlocksManager">Lets go!</a><br />' , PHP_EOL
            , '</div>' , PHP_EOL;
         CloseTable();
         include_once 'footer.php';
      }
   }
}

function BlocksManager_Add($bid, $title, $wb_name) {
   global $prefix, $db, $admin_file;
   if ($wb_name != '') {
      foreach ($title as $tKey => $tValue) {
         if ($tValue != '') {
            foreach ($bid as $bKey => $bValue) {
               if (is_numeric($bValue)) {
                  $result = $db->sql_query('SELECT `bid`, `bposition`, `weight` FROM `' . $prefix . '_blocks` WHERE `bid` = \'' . $bValue . '\'');
                  list($bid, $bposition, $weight) = $db->sql_fetchrow($result);
                  if ($bid != '') {
                     $tValue = $db->sql_escape_string(htmlspecialchars_decode(check_html($tValue, 'nohtml'), ENT_QUOTES));
                     $db->sql_query('INSERT INTO `' . $prefix . '_blocks_manager` VALUES (\'' . $bValue . '\', \'' . $tValue . '\', \'' . $bposition . '\', \'' . $weight . '\')');
                  }
               }
            }
         }
      }
      Header('Location: ' . $admin_file . '.php?op=BlocksManager&wb_name=' . $wb_name); exit;
   } else {
      Header('Location: ' . $admin_file . '.php'); exit;
   }
}

function BlocksManager_Remove($bid, $title, $wb_name) {
   global $prefix, $db, $admin_file;
   if ($wb_name != '') {
      foreach ($title as $tKey => $tValue) {
         if ($tValue != '') {
            foreach ($bid as $bKey => $bValue) {
               if (is_numeric($bValue)) {
                  $db->sql_query('DELETE FROM `' . $prefix . '_blocks_manager` WHERE `bid` = \'' . $bValue . '\' AND `title` = \'' . $db->sql_escape_string($tValue) . '\'');
               }
            }
         }
      }
      Header('Location: ' . $admin_file . '.php?op=BlocksManager&wb_name=' . $wb_name); exit;
   } else {
      Header('Location: ' . $admin_file . '.php'); exit;
   }
}

function BlocksManager_FixWeight($wb_name) {
    global $prefix, $db, $admin_file;
   if ($wb_name != '') {
      $leftpos = 'l';
      $rightpos = 'r';
      $centeruppos = 'c';
      $centerdnpos = 'd';
      # Fix Left Block Weights
      $result = $db->sql_query('SELECT `bid`, `title` FROM `' . $prefix . '_blocks_manager` WHERE `title` = \'' . $db->sql_escape_string($wb_name) . '\' AND `bposition` = \'' . $db->sql_escape_string($leftpos) . '\' ORDER BY `weight` ASC');   
      if ($db->sql_numrows($result) > 0) {
         $weight = 0;
         while (list($bid, $title) = $db->sql_fetchrow($result)) {
            $weight++;
            $db->sql_query('UPDATE `' . $prefix . '_blocks_manager` SET `weight` = \'' . $weight . '\' WHERE `title` = \'' . $db->sql_escape_string($wb_name) . '\' AND `bid` = \'' . $bid . '\'');
         } # end of while
      }   
      # Fix Right Block Weights
      $result = $db->sql_query('SELECT `bid` FROM `' . $prefix . '_blocks_manager` WHERE `title` = \'' . $db->sql_escape_string($wb_name) . '\' AND `bposition` = \'' . $db->sql_escape_string($rightpos) . '\' ORDER BY `weight` ASC');
      if ($db->sql_numrows($result) > 0) {
         $weight = 0;
         while (list($bid) = $db->sql_fetchrow($result)) {
            $weight++;
            $db->sql_query('UPDATE `' . $prefix . '_blocks_manager` SET `weight` = \'' . $weight . '\' WHERE `title` = \'' . $db->sql_escape_string($wb_name) . '\' AND `bid` = \'' . $bid . '\'');
         } # end of while
      }   
      # Fix Center Up Block Weights
      $result = $db->sql_query('SELECT `bid` FROM `' . $prefix . '_blocks_manager` WHERE `title` = \'' . $db->sql_escape_string($wb_name) . '\' AND `bposition` = \'' . $db->sql_escape_string($centeruppos) . '\' ORDER BY `weight` ASC');
      if ($db->sql_numrows($result) > 0) {
         $weight = 0;
         while (list($bid) = $db->sql_fetchrow($result)) {
            $weight++;
            $db->sql_query('UPDATE `' . $prefix . '_blocks_manager` SET `weight` = \'' . $weight . '\' WHERE `title` = \'' . $db->sql_escape_string($wb_name) . '\' AND `bid` = \'' . $bid . '\'');
         } # end of while
      }   
      # Fix Center Down Block Weights
      $result = $db->sql_query('SELECT `bid` FROM `' . $prefix . '_blocks_manager` WHERE `title` = \'' . $db->sql_escape_string($wb_name) . '\' AND `bposition` = \'' . $db->sql_escape_string($centerdnpos) . '\' ORDER BY `weight` ASC');
      if ($db->sql_numrows($result) > 0) {
         $weight = 0;
         while (list($bid) = $db->sql_fetchrow($result)) {
            $weight++;
            $db->sql_query('UPDATE `' . $prefix . '_blocks_manager` SET `weight` = \'' . $weight . '\' WHERE `title` = \'' . $db->sql_escape_string($wb_name) . '\' AND `bid` = \'' . $bid . '\'');
         } # end of while
      }
      Header('Location: ' . $admin_file . '.php?op=BlocksManager&wb_name=' . $wb_name); exit;
   } else {
      Header('Location: ' . $admin_file . '.php'); exit;
   }
}

function BlocksManager_BlockPosition($bid, $title, $position) {
   global $prefix, $db, $admin_file;
   if (is_numeric($bid) && ($position == 'l' || $position == 'r' || $position == 'c' || $position == 'd') && $title != '') {
      $title = $db->sql_escape_string(htmlspecialchars_decode(check_html($title, 'nohtml'), ENT_QUOTES));
      $db->sql_query('UPDATE `' . $prefix . '_blocks_manager` SET `bposition` = \'' .  $db->sql_escape_string($position) . '\' WHERE `bid` = \'' . $bid . '\' AND `title` = \'' . $title . '\'');
      Header('Location: ' . $admin_file . '.php?op=BlocksManager&wb_name=' . $title); exit;
   } else {
      Header('Location: ' . $admin_file . '.php'); exit;
   }
}

function BlocksManager_BlockOrder($weightrep, $weight, $bidrep, $bidori, $title) {
    global $prefix, $db, $admin_file;
   if (is_numeric($weightrep) && is_numeric($weight) && is_numeric($bidori) && $title != '') {
      if (is_numeric($bidrep)) {
         $result = $db->sql_query('UPDATE `' . $prefix . '_blocks_manager` SET `weight` = \'' . $weight . '\' WHERE `bid` = \'' . $bidrep . '\'');
      }
      $result2 = $db->sql_query('UPDATE `' . $prefix . '_blocks_manager` SET `weight` = \'' . $weightrep . '\' WHERE `bid` = \'' . $bidori . '\'');
        Header('Location: ' . $admin_file . '.php?op=BlocksManager&wb_name=' . $title); exit;
   } else {
      Header('Location: ' . $admin_file . '.php'); exit;
   }
}
  
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic    bestbuildpc Forum Index -> RavenNuke -> Addons All times are GMT + 2 Hours
 
 Page 1 of 1

 

Jump to:   
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Powered by phpBB © 2001-2008 phpBB Group
 
Forums ©