C:\php-fusion-7-00\files\themes\templates\panels.php
E:\v7.00-Custom-Panels-Control-v1.00-RC1\files\themes\templates\panels.php
  1|<?php
  2|/*-------------------------------------------------------+
  3|| PHP-Fusion Content Management System
  4|| Copyright (C) 2002 - 2008 Nick Jones
  5|| http://www.php-fusion.co.uk/
  6|+--------------------------------------------------------+
  7|| Filename: panels.php
  8|| Author: Nick Jones (Digitanium)
  9|+--------------------------------------------------------+
 10|| This program is released as free software under the
 11|| Affero GPL license. You can redistribute it and/or
 12|| modify it under the terms of this license which you
 13|| can read by viewing the included agpl.txt or online
 14|| at www.gnu.org/licenses/agpl.html. Removal of this
 15|| copyright header is strictly prohibited without
 16|| written permission from the original author(s).
 17|+--------------------------------------------------------*/
 18|if (!defined("IN_FUSION")) { header("Location: ../../index.php"); exit; }
 19|
 20|// Calculate current true url
 21|$script_url = explode("/", $_SERVER['PHP_SELF'].(FUSION_QUERY ? "?".FUSION_QUERY : ""));
 22|$url_count = count($script_url);
 23|$base_url_count = substr_count(BASEDIR, "/") + 1;
 24|$start_page = "";
 25|while ($base_url_count != 0) {
 26|    $current = $url_count - $base_url_count;
 27|    $start_page .= "/".$script_url[$current];
 28|    $base_url_count--;
 29|}
 30|
 31|define("START_PAGE", substr(preg_replace("#(&amp;|\?)(s_action=edit&amp;shout_id=)([0-9]+)#s", "", $start_page), 1));
 32|
 33|// Side & center panels
 34|ob_start();
 35|$plc = 0;
 36|
 37|// Render left panels
 38|if(!defined("ADMIN_PANEL")){
 39|    if (check_panel_status("left")) {
 40|        $p_res = dbquery("SELECT * FROM ".DB_PANELS." WHERE panel_side='1' AND panel_status='1' ORDER BY panel_order");
 41|        if (dbrows($p_res)) {
 42|            while ($p_data = dbarray($p_res)) {
   
 43|                if (checkgroup($p_data['panel_access'])) {
 44|                    if ($p_data['panel_type'] == "file") {
 45|                        $panel_name = $p_data['panel_filename'];
 46|                        include INFUSIONS.$panel_name."/".$panel_name.".php";
 47|                    } else {
 48|                        eval(stripslashes($p_data['panel_content']));
 49|                    }
 50|                    $plc++;
 51|                }
   
 52|            }
 53|        }
 54|    }
 55|}else{
 56|    require_once ADMIN."navigation.php";
 57|}
 58|
 59|define("LEFT", ob_get_contents());
 60|ob_end_clean();
 61|
 62|// Render right panels
 63|$prc = 0;
 64|ob_start();
 65|if(!defined("ADMIN_PANEL")){
 66|    if (check_panel_status("right")) {
 67|        $p_res = dbquery("SELECT * FROM ".DB_PANELS." WHERE panel_side='4' AND panel_status='1' ORDER BY panel_order");
 68|        if (dbrows($p_res)) {
 69|            while ($p_data = dbarray($p_res)) {
   
 70|                if (checkgroup($p_data['panel_access'])) {
 71|                    if ($p_data['panel_type'] == "file") {
 72|                        $panel_name = $p_data['panel_filename'];
 73|                        include INFUSIONS.$panel_name."/".$panel_name.".php";
 74|                    } else {
 75|                        eval(stripslashes($p_data['panel_content']));
 76|                    }
 77|                    $prc++;
 78|                }
   
 79|            }
 80|        }
 81|    }
 82|}
 83|define("RIGHT", ob_get_contents());
 84|ob_end_clean();
 85|
 86|// Set the require div-width class
 87|if(defined("ADMIN_PANEL")){
 88|    $main_style = "side-left";
 89|}elseif ($plc && $prc) {
 90|    $main_style = "side-both";
 91|} elseif ($plc && !$prc) {
 92|    $main_style = "side-left";
 93|} elseif (!$plc && $prc) {
 94|    $main_style = "side-right";
 95|} elseif (!$plc && !$prc) {
 96|    $main_style = "";
 97|}
 98|
 99|// Render upper center panels   
100|ob_start();
101|
102|if(!defined("ADMIN_PANEL")){
103|    echo "<a id='content' name='content'></a>\n";
104|    if (iADMIN && $settings['maintenance']) {
105|        echo "<div class='admin-message'>".$locale['global_190']."</div>";
106|    }
107|    if (iSUPERADMIN && file_exists(BASEDIR."setup.php")) {
108|        echo "<div class='admin-message'>".$locale['global_198']."</div>";
109|    }
110|    if (iADMIN && !$userdata['user_admin_password']) {
111|        echo "<div class='admin-message'>".$locale['global_199']."</div>";
112|    }
113|    if (check_panel_status("upper")) {
114|        $p_res = dbquery("SELECT * FROM ".DB_PANELS." WHERE panel_side='2' AND panel_status='1' ORDER BY panel_order");
115|        if (dbrows($p_res)) {
116|            while ($p_data = dbarray($p_res)) {
   
117|                if (checkgroup($p_data['panel_access'])) {
118|                    if ($p_data['panel_display'] == 1 || $settings['opening_page'] == START_PAGE) {
119|                        if ($p_data['panel_type'] == "file") {
120|                            $panel_name = $p_data['panel_filename'];
121|                            include INFUSIONS.$panel_name."/".$panel_name.".php";
122|                        } else {
123|                            eval(stripslashes($p_data['panel_content']));
124|                        }
125|                    }
126|                }
   
127|            }
128|        }
129|    }
130|}
131|define("U_CENTER", ob_get_contents());
132|ob_end_clean();
133|
134|// Render lower center panels
135|ob_start();
136|
137|if(!defined("ADMIN_PANEL")){
138|    if (check_panel_status("lower")) {
139|        $p_res = dbquery("SELECT * FROM ".DB_PANELS." WHERE panel_side='3' AND panel_status='1' ORDER BY panel_order");
140|        if (dbrows($p_res) != 0) {
141|            while ($p_data = dbarray($p_res)) {
   
142|                if (checkgroup($p_data['panel_access'])) {
143|                    if ($p_data['panel_display'] == 1 || $settings['opening_page'] == START_PAGE) {
144|                        if ($p_data['panel_type'] == "file") {
145|                            $panel_name = $p_data['panel_filename'];
146|                            include INFUSIONS.$panel_name."/".$panel_name.".php";
147|                        } else {
148|                            eval(stripslashes($p_data['panel_content']));
149|                        }
150|                    }
151|                }
   
152|            }
153|        }
154|    }
155|}
156|define("L_CENTER", ob_get_contents());
157|ob_end_clean();
158|?>
  1|<?php
  2|/*-------------------------------------------------------+
  3|| PHP-Fusion Content Management System
  4|| Copyright (C) 2002 - 2008 Nick Jones
  5|| http://www.php-fusion.co.uk/
  6|+--------------------------------------------------------+
  7|| Filename: panels.php
  8|| Author: Nick Jones (Digitanium), modded by WEC
  9|+--------------------------------------------------------+
 10|| This program is released as free software under the
 11|| Affero GPL license. You can redistribute it and/or
 12|| modify it under the terms of this license which you
 13|| can read by viewing the included agpl.txt or online
 14|| at www.gnu.org/licenses/agpl.html. Removal of this
 15|| copyright header is strictly prohibited without
 16|| written permission from the original author(s).
 17|+--------------------------------------------------------*/
 18|if (!defined("IN_FUSION")) { header("Location: ../../index.php"); exit; }
 19|
 20|// Calculate current true url
 21|$script_url = explode("/", $_SERVER['PHP_SELF'].(FUSION_QUERY ? "?".FUSION_QUERY : ""));
 22|$url_count = count($script_url);
 23|$base_url_count = substr_count(BASEDIR, "/") + 1;
 24|$start_page = "";
 25|while ($base_url_count != 0) {
 26|    $current = $url_count - $base_url_count;
 27|    $start_page .= "/".$script_url[$current];
 28|    $base_url_count--;
 29|}
 30|
 31|define("START_PAGE", substr(preg_replace("#(&amp;|\?)(s_action=edit&amp;shout_id=)([0-9]+)#s", "", $start_page), 1));
 32|
 33|// Side & center panels
 34|ob_start();
 35|$plc = 0;
 36|
 37|// Render left panels
 38|if(!defined("ADMIN_PANEL")){
 39|    if (check_panel_status("left")) {
 40|        $p_res = dbquery("SELECT * FROM ".DB_PANELS." WHERE panel_side='1' AND panel_status='1' ORDER BY panel_order");
 41|        if (dbrows($p_res)) {
 42|            while ($p_data = dbarray($p_res)) {
 43|                if ($p_data['panel_url_list'] == '' || (!in_array($start_page, explode("\r\n", $p_data['panel_url_list'])) && $p_data['panel_url_list_exclude'] == 1) || (in_array($start_page, explode("\r\n", $p_data['panel_url_list'])) && $p_data['panel_url_list_exclude'] == 0) ) {///
 44|                    if (checkgroup($p_data['panel_access'])) {
 45|                        if ($p_data['panel_type'] == "file") {
 46|                            $panel_name = $p_data['panel_filename'];
 47|                            include INFUSIONS.$panel_name."/".$panel_name.".php";
 48|                        } else {
 49|                            eval(stripslashes($p_data['panel_content']));
 50|                        }
 51|                        $plc++;
 52|                    }
 53|                }///
 54|            }
 55|        }
 56|    }
 57|}else{
 58|    require_once ADMIN."navigation.php";
 59|}
 60|
 61|define("LEFT", ob_get_contents());
 62|ob_end_clean();
 63|
 64|// Render right panels
 65|$prc = 0;
 66|ob_start();
 67|if(!defined("ADMIN_PANEL")){
 68|    if (check_panel_status("right")) {
 69|        $p_res = dbquery("SELECT * FROM ".DB_PANELS." WHERE panel_side='4' AND panel_status='1' ORDER BY panel_order");
 70|        if (dbrows($p_res)) {
 71|            while ($p_data = dbarray($p_res)) {
 72|                if ($p_data['panel_url_list'] == '' || (!in_array($start_page, explode("\r\n", $p_data['panel_url_list'])) && $p_data['panel_url_list_exclude'] == 1) || (in_array($start_page, explode("\r\n", $p_data['panel_url_list'])) && $p_data['panel_url_list_exclude'] == 0) ) {///
 73|                    if (checkgroup($p_data['panel_access'])) {
 74|                            if ($p_data['panel_type'] == "file") {
 75|                                $panel_name = $p_data['panel_filename'];
 76|                                include INFUSIONS.$panel_name."/".$panel_name.".php";
 77|                            } else {
 78|                                eval(stripslashes($p_data['panel_content']));
 79|                            }
 80|                            $prc++;
 81|                    }
 82|                }///
 83|            }
 84|        }
 85|    }
 86|}
 87|define("RIGHT", ob_get_contents());
 88|ob_end_clean();
 89|
 90|// Set the require div-width class
 91|if(defined("ADMIN_PANEL")){
 92|    $main_style = "side-left";
 93|}elseif ($plc && $prc) {
 94|    $main_style = "side-both";
 95|} elseif ($plc && !$prc) {
 96|    $main_style = "side-left";
 97|} elseif (!$plc && $prc) {
 98|    $main_style = "side-right";
 99|} elseif (!$plc && !$prc) {
100|    $main_style = "";
101|}
102|
103|// Render upper center panels   
104|ob_start();
105|
106|if(!defined("ADMIN_PANEL")){
107|    echo "<a id='content' name='content'></a>\n";
108|    if (iADMIN && $settings['maintenance']) {
109|        echo "<div class='admin-message'>".$locale['global_190']."</div>";
110|    }
111|    if (iSUPERADMIN && file_exists(BASEDIR."setup.php")) {
112|        echo "<div class='admin-message'>".$locale['global_198']."</div>";
113|    }
114|    if (iADMIN && !$userdata['user_admin_password']) {
115|        echo "<div class='admin-message'>".$locale['global_199']."</div>";
116|    }
117|    if (check_panel_status("upper")) {
118|        $p_res = dbquery("SELECT * FROM ".DB_PANELS." WHERE panel_side='2' AND panel_status='1' ORDER BY panel_order");
119|        if (dbrows($p_res)) {
120|            while ($p_data = dbarray($p_res)) {
121|                if ($p_data['panel_url_list'] == '' || (!in_array($start_page, explode("\r\n", $p_data['panel_url_list'])) && $p_data['panel_url_list_exclude'] == 1) || (in_array($start_page, explode("\r\n", $p_data['panel_url_list'])) && $p_data['panel_url_list_exclude'] == 0) ) {///
122|                    if (checkgroup($p_data['panel_access'])) {
123|                        if ($p_data['panel_display'] == 1 || $settings['opening_page'] == START_PAGE) {
124|                            if ($p_data['panel_type'] == "file") {
125|                                $panel_name = $p_data['panel_filename'];
126|                                include INFUSIONS.$panel_name."/".$panel_name.".php";
127|                            } else {
128|                                eval(stripslashes($p_data['panel_content']));
129|                            }
130|                        }
131|                    }
132|                }///
133|            }
134|        }
135|    }
136|}
137|define("U_CENTER", ob_get_contents());
138|ob_end_clean();
139|
140|// Render lower center panels
141|ob_start();
142|
143|if(!defined("ADMIN_PANEL")){
144|    if (check_panel_status("lower")) {
145|        $p_res = dbquery("SELECT * FROM ".DB_PANELS." WHERE panel_side='3' AND panel_status='1' ORDER BY panel_order");
146|        if (dbrows($p_res) != 0) {
147|            while ($p_data = dbarray($p_res)) {
148|                if ($p_data['panel_url_list'] == '' || (!in_array($start_page, explode("\r\n", $p_data['panel_url_list'])) && $p_data['panel_url_list_exclude'] == 1) || (in_array($start_page, explode("\r\n", $p_data['panel_url_list'])) && $p_data['panel_url_list_exclude'] == 0) ) {///
149|                    if (checkgroup($p_data['panel_access'])) {
150|                        if ($p_data['panel_display'] == 1 || $settings['opening_page'] == START_PAGE) {
151|                            if ($p_data['panel_type'] == "file") {
152|                                $panel_name = $p_data['panel_filename'];
153|                                include INFUSIONS.$panel_name."/".$panel_name.".php";
154|                            } else {
155|                                eval(stripslashes($p_data['panel_content']));
156|                            }
157|                        }
158|                    }
159|                }///
160|            }
161|        }
162|    }
163|}
164|define("L_CENTER", ob_get_contents());
165|ob_end_clean();
166|?>
Legend:
Added(8+440)
Deleted(0+0)
Changed(1)
Changed words in changed(0)