This commit has been accessed 605 times via Git panel.
commit 69a222cff7c947f620be1ec678a3d93289e4968a
tree 374279ce3628560a66b96cdae81279df296f050f
parent b9867231504b82f7d91324af2abdd7aee131e041
author Magie Antonio <magie@majcms.org> 1321880935 +0800
committer Magie Antonio <magie@majcms.org> 1321880935 +0800
Aggregate panel display into maj_panels()
diff --git a/core.php b/core.php
index e505c22..cc86ff8 100644
--- a/core.php
+++ b/core.php
@@ -666,4 +666,139 @@ function maj_download_file($file_name,$file_dir,$count_dir) {
}
}
+function maj_panels($panel_array) {
+
+ global $maj_data_directory;
+ global $maj_admin_username;
+ global $maj_logged_in_username;
+ global $maj_wspace;
+
+ if (count($panel_array) > 0) {
+
+ foreach ($panel_array as $panel) {
+
+ if (!file_exists("$maj_data_directory/panels/$panel/free.txt")) {
+
+ if (file_exists("$maj_data_directory/panels/$panel/border.txt")) {
+ $panel_border = file_get_contents("$maj_data_directory/panels/$panel/border.txt");
+ }
+ else {
+ if (isset($panel_border)) {
+ unset($panel_border);
+ }
+ }
+
+ if (file_exists("$maj_data_directory/panels/$panel/bgcolor-t.txt")) {
+ $panel_bgcolor_t = file_get_contents("$maj_data_directory/panels/$panel/bgcolor-t.txt");
+ }
+ else {
+ if (isset($panel_bgcolor_t)) {
+ unset($panel_bgcolor_t);
+ }
+ }
+
+ if (file_exists("$maj_data_directory/panels/$panel/bgcolor-c.txt")) {
+ $panel_bgcolor_c = file_get_contents("$maj_data_directory/panels/$panel/bgcolor-c.txt");
+ }
+ else {
+ if (isset($panel_bgcolor_c)) {
+ unset($panel_bgcolor_c);
+ }
+ }
+
+ if (file_exists("$maj_data_directory/panels/$panel/text-t.txt")) {
+ $panel_text_t = file_get_contents("$maj_data_directory/panels/$panel/text-t.txt");
+ }
+ else {
+ if (isset($panel_text_t)) {
+ unset($panel_text_t);
+ }
+ }
+
+ if (file_exists("$maj_data_directory/panels/$panel/text-c.txt")) {
+ $panel_text_c = file_get_contents("$maj_data_directory/panels/$panel/text-c.txt");
+ }
+ else {
+ if (isset($panel_text_c)) {
+ unset($panel_text_c);
+ }
+ }
+
+ echo "\r\n<div class=\"panel_wrapper\">\r\n\r\n\t<div class=\"panel_title\"";
+
+ if (isset($panel_border) or isset($panel_bgcolor_t) or isset($panel_text_t)) {
+ echo ' style="';
+ }
+
+ if (isset($panel_bgcolor_t)) {
+ echo "background-color: $panel_bgcolor_t;";
+ }
+
+ if (isset($panel_text_t)) {
+ echo "color: $panel_text_t;";
+ }
+
+ if (isset($panel_border)) {
+ echo "border-color: $panel_border;";
+ }
+
+ if (isset($panel_border) or isset($panel_bgcolor_t) or isset($panel_text_t)) {
+ echo '"';
+ }
+
+ echo ">";
+
+ readfile("$maj_data_directory/panels/$panel/title.txt");
+
+ if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
+ echo "<a href=\"panels.php#{$panel}\">";
+ echo '<img src="images/widget.edit.png" border="0" width="11" height="11" align="right"></a>';
+ }
+
+ if (file_exists("$maj_data_directory/panels/$panel/private.txt")) {
+ echo '<img src="images/widget.private.png" border="0" width="11" height="11" align="right">';
+ }
+
+ echo "</div>";
+
+ echo "\r\n\r\n\t<div class=\"panel_body\"";
+
+ if (isset($panel_border) or isset($panel_bgcolor_c) or isset($panel_text_c)) {
+ echo ' style="';
+ }
+
+ if (isset($panel_bgcolor_c)) {
+ echo "background-color: $panel_bgcolor_c;";
+ }
+
+ if (isset($panel_text_c)) {
+ echo "color: $panel_text_c;";
+ }
+
+ if (isset($panel_border)) {
+ echo "border-color: $panel_border;";
+ }
+
+ if (isset($panel_border) or isset($panel_bgcolor_c) or isset($panel_text_c)) {
+ echo '"';
+ }
+
+ echo ">\r\n\t\t";
+ }
+
+ if (file_exists("$maj_data_directory/panels/$panel/free.txt")) {
+ echo '<div class=panel_free>';
+ }
+
+ include("$maj_data_directory/panels/$panel/panel.php");
+
+ echo "\r\n\t</div>\r\n</div>\r\n";
+
+ if (file_exists("$maj_data_directory/panels/$panel/free.txt") and !file_exists("$maj_data_directory/panels/$panel/nomargin.txt")) {
+ echo "<div style=\"height: {$maj_wspace}px;\"></div>";
+ }
+ }
+ }
+}
+
?>
diff --git a/index.php b/index.php
index 16d48fd..24e410b 100644
--- a/index.php
+++ b/index.php
@@ -882,291 +882,29 @@ if (file_exists("$maj_data_directory/panels")) {
sort($maj_left_panels);
reset($maj_left_panels);
- $maj_count_left_panels = count($maj_left_panels);
-
sort($maj_right_panels);
reset($maj_right_panels);
- $maj_count_right_panels = count($maj_right_panels);
-
sort($maj_top_panels);
reset($maj_top_panels);
- $maj_count_top_panels = count($maj_top_panels);
-
sort($maj_bottom_panels);
reset($maj_bottom_panels);
- $maj_count_bottom_panels = count($maj_bottom_panels);
-
sort($maj_center_panels);
reset($maj_center_panels);
- $maj_count_center_panels = count($maj_center_panels);
-
sort($maj_entry_panels);
reset($maj_entry_panels);
- $maj_count_entry_panels = count($maj_entry_panels);
-
- if ($maj_count_left_panels > 0) {
-
- foreach ($maj_left_panels as $maj_left_panel) {
-
- if (!file_exists("$maj_data_directory/panels/$maj_left_panel/free.txt")) {
-
- if (file_exists("$maj_data_directory/panels/$maj_left_panel/border.txt")) {
- $maj_left_panel_border = file_get_contents("$maj_data_directory/panels/$maj_left_panel/border.txt");
- }
- else {
- if (isset($maj_left_panel_border)) {
- unset($maj_left_panel_border);
- }
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_left_panel/bgcolor-t.txt")) {
- $maj_left_panel_bgcolor_t = file_get_contents("$maj_data_directory/panels/$maj_left_panel/bgcolor-t.txt");
- }
- else {
- if (isset($maj_left_panel_bgcolor_t)) {
- unset($maj_left_panel_bgcolor_t);
- }
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_left_panel/bgcolor-c.txt")) {
- $maj_left_panel_bgcolor_c = file_get_contents("$maj_data_directory/panels/$maj_left_panel/bgcolor-c.txt");
- }
- else {
- if (isset($maj_left_panel_bgcolor_c)) {
- unset($maj_left_panel_bgcolor_c);
- }
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_left_panel/text-t.txt")) {
- $maj_left_panel_text_t = file_get_contents("$maj_data_directory/panels/$maj_left_panel/text-t.txt");
- }
- else {
- if (isset($maj_left_panel_text_t)) {
- unset($maj_left_panel_text_t);
- }
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_left_panel/text-c.txt")) {
- $maj_left_panel_text_c = file_get_contents("$maj_data_directory/panels/$maj_left_panel/text-c.txt");
- }
- else {
- if (isset($maj_left_panel_text_c)) {
- unset($maj_left_panel_text_c);
- }
- }
-
- echo "\r\n<div class=\"panel_wrapper\">\r\n\r\n\t<div class=\"panel_title\"";
-
- if (isset($maj_left_panel_border) or isset($maj_left_panel_bgcolor_t) or isset($maj_left_panel_text_t)) {
- echo ' style="';
- }
-
- if (isset($maj_left_panel_bgcolor_t)) {
- echo "background-color: $maj_left_panel_bgcolor_t;";
- }
-
- if (isset($maj_left_panel_text_t)) {
- echo "color: $maj_left_panel_text_t;";
- }
-
- if (isset($maj_left_panel_border)) {
- echo "border-color: $maj_left_panel_border;";
- }
-
- if (isset($maj_left_panel_border) or isset($maj_left_panel_bgcolor_t) or isset($maj_left_panel_text_t)) {
- echo '"';
- }
-
- echo ">";
-
- readfile("$maj_data_directory/panels/$maj_left_panel/title.txt");
-
- if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
- echo "<a href=\"panels.php#{$maj_left_panel}\">";
- echo '<img src="images/widget.edit.png" border="0" width="11" height="11" align="right"></a>';
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_left_panel/private.txt")) {
- echo '<img src="images/widget.private.png" border="0" width="11" height="11" align="right">';
- }
-
- echo "</div>";
-
- echo "\r\n\r\n\t<div class=\"panel_body\"";
-
- if (isset($maj_left_panel_border) or isset($maj_left_panel_bgcolor_c) or isset($maj_left_panel_text_c)) {
- echo ' style="';
- }
-
- if (isset($maj_left_panel_bgcolor_c)) {
- echo "background-color: $maj_left_panel_bgcolor_c;";
- }
-
- if (isset($maj_left_panel_text_c)) {
- echo "color: $maj_left_panel_text_c;";
- }
-
- if (isset($maj_left_panel_border)) {
- echo "border-color: $maj_left_panel_border;";
- }
-
- if (isset($maj_left_panel_border) or isset($maj_left_panel_bgcolor_c) or isset($maj_left_panel_text_c)) {
- echo '"';
- }
-
- echo ">\r\n\t\t";
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_left_panel/free.txt")) {
- echo '<div class=panel_free>';
- }
-
- include("$maj_data_directory/panels/$maj_left_panel/panel.php");
-
- echo "\r\n\t</div>\r\n</div>\r\n";
-
- if (file_exists("$maj_data_directory/panels/$maj_left_panel/free.txt") and !file_exists("$maj_data_directory/panels/$maj_left_panel/nomargin.txt")) {
- echo "<div style=\"height: {$maj_wspace}px;\"></div>";
- }
- }
- }
+ maj_panels($maj_left_panels);
}
// main
echo "\r\n\r\n<td valign=\"top\" width=\"$maj_wmain\">\r\n\r\n";
-if ($maj_count_top_panels > 0) {
-
- foreach ($maj_top_panels as $maj_top_panel) {
-
- if (!file_exists("$maj_data_directory/panels/$maj_top_panel/free.txt")) {
-
- if (file_exists("$maj_data_directory/panels/$maj_top_panel/border.txt")) {
- $maj_top_panel_border = file_get_contents("$maj_data_directory/panels/$maj_top_panel/border.txt");
- }
- else {
- if (isset($maj_top_panel_border)) {
- unset($maj_top_panel_border);
- }
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_top_panel/bgcolor-t.txt")) {
- $maj_top_panel_bgcolor_t = file_get_contents("$maj_data_directory/panels/$maj_top_panel/bgcolor-t.txt");
- }
- else {
- if (isset($maj_top_panel_bgcolor_t)) {
- unset($maj_top_panel_bgcolor_t);
- }
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_top_panel/bgcolor-c.txt")) {
- $maj_top_panel_bgcolor_c = file_get_contents("$maj_data_directory/panels/$maj_top_panel/bgcolor-c.txt");
- }
- else {
- if (isset($maj_top_panel_bgcolor_c)) {
- unset($maj_top_panel_bgcolor_c);
- }
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_top_panel/text-t.txt")) {
- $maj_top_panel_text_t = file_get_contents("$maj_data_directory/panels/$maj_top_panel/text-t.txt");
- }
- else {
- if (isset($maj_top_panel_text_t)) {
- unset($maj_top_panel_text_t);
- }
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_top_panel/text-c.txt")) {
- $maj_top_panel_text_c = file_get_contents("$maj_data_directory/panels/$maj_top_panel/text-c.txt");
- }
- else {
- if (isset($maj_top_panel_text_c)) {
- unset($maj_top_panel_text_c);
- }
- }
-
- echo "\t<div class=\"panel_wrapper\">\r\n\r\n\t\t<div class=\"panel_title\"";
-
- if (isset($maj_top_panel_border) or isset($maj_top_panel_bgcolor_t) or isset($maj_top_panel_text_t)) {
- echo ' style="';
- }
-
- if (isset($maj_top_panel_bgcolor_t)) {
- echo "background-color: $maj_top_panel_bgcolor_t;";
- }
-
- if (isset($maj_top_panel_text_t)) {
- echo "color: $maj_top_panel_text_t;";
- }
-
- if (isset($maj_top_panel_border)) {
- echo "border-color: $maj_top_panel_border;";
- }
-
- if (isset($maj_top_panel_border) or isset($maj_top_panel_bgcolor_t) or isset($maj_top_panel_text_t)) {
- echo '"';
- }
-
- echo '>';
-
- readfile("$maj_data_directory/panels/$maj_top_panel/title.txt");
-
- if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
- echo "<a href=\"panels.php#{$maj_top_panel}\">";
- echo '<img src="images/widget.edit.png" border="0" width="11" height="11" align="right"></a>';
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_top_panel/private.txt")) {
- echo '<img src="images/widget.private.png" border="0" width="11" height="11" align="right">';
- }
-
- echo "</div>\r\n\r\n\t\t";
-
- echo '<div class="panel_body"';
-
- if (isset($maj_top_panel_border) or isset($maj_top_panel_bgcolor_c) or isset($maj_top_panel_text_c)) {
- echo ' style="';
- }
-
- if (isset($maj_top_panel_bgcolor_c)) {
- echo "background-color: $maj_top_panel_bgcolor_c;";
- }
-
- if (isset($maj_top_panel_text_c)) {
- echo "color: $maj_top_panel_text_c;";
- }
-
- if (isset($maj_top_panel_border)) {
- echo "border-color: $maj_top_panel_border;";
- }
-
- if (isset($maj_top_panel_border) or isset($maj_top_panel_bgcolor_c) or isset($maj_top_panel_text_c)) {
- echo '"';
- }
-
- echo ">\r\n\t\t\t";
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_top_panel/free.txt")) {
- echo '<div class=panel_free>';
- }
-
- include("$maj_data_directory/panels/$maj_top_panel/panel.php");
-
- echo "\r\n\t\t</div>\r\n\t</div>\r\n\r\n";
-
- if (file_exists("$maj_data_directory/panels/$maj_top_panel/free.txt") and !file_exists("$maj_data_directory/panels/$maj_top_panel/nomargin.txt")) {
- echo "<div style=\"height: {$maj_wspace}px;\"></div>";
- }
- }
-}
+maj_panels($maj_top_panels);
// clean-up (start)
@@ -1577,132 +1315,7 @@ if (file_exists("$maj_data_directory/bb.txt") and file_exists("$maj_data_directo
}
-if ($maj_count_center_panels > 0) {
-
- foreach ($maj_center_panels as $maj_center_panel) {
-
- if (!file_exists("$maj_data_directory/panels/$maj_center_panel/free.txt")) {
-
- if (file_exists("$maj_data_directory/panels/$maj_center_panel/border.txt")) {
- $maj_center_panel_border = file_get_contents("$maj_data_directory/panels/$maj_center_panel/border.txt");
- }
- else {
- if (isset($maj_center_panel_border)) {
- unset($maj_center_panel_border);
- }
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_center_panel/bgcolor-t.txt")) {
- $maj_center_panel_bgcolor_t = file_get_contents("$maj_data_directory/panels/$maj_center_panel/bgcolor-t.txt");
- }
- else {
- if (isset($maj_center_panel_bgcolor_t)) {
- unset($maj_center_panel_bgcolor_t);
- }
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_center_panel/bgcolor-c.txt")) {
- $maj_center_panel_bgcolor_c = file_get_contents("$maj_data_directory/panels/$maj_center_panel/bgcolor-c.txt");
- }
- else {
- if (isset($maj_center_panel_bgcolor_c)) {
- unset($maj_center_panel_bgcolor_c);
- }
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_center_panel/text-t.txt")) {
- $maj_center_panel_text_t = file_get_contents("$maj_data_directory/panels/$maj_center_panel/text-t.txt");
- }
- else {
- if (isset($maj_center_panel_text_t)) {
- unset($maj_center_panel_text_t);
- }
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_center_panel/text-c.txt")) {
- $maj_center_panel_text_c = file_get_contents("$maj_data_directory/panels/$maj_center_panel/text-c.txt");
- }
- else {
- if (isset($maj_center_panel_text_c)) {
- unset($maj_center_panel_text_c);
- }
- }
-
- echo '<div class="panel_wrapper"><div class="panel_title"';
-
- if (isset($maj_center_panel_border) or isset($maj_center_panel_bgcolor_t) or isset($maj_center_panel_text_t)) {
- echo ' style="';
- }
-
- if (isset($maj_center_panel_bgcolor_t)) {
- echo "background-color: $maj_center_panel_bgcolor_t;";
- }
-
- if (isset($maj_center_panel_text_t)) {
- echo "color: $maj_center_panel_text_t;";
- }
-
- if (isset($maj_center_panel_border)) {
- echo "border-color: $maj_center_panel_border;";
- }
-
- if (isset($maj_center_panel_border) or isset($maj_center_panel_bgcolor_t) or isset($maj_center_panel_text_t)) {
- echo '"';
- }
-
- echo '>';
-
- readfile("$maj_data_directory/panels/$maj_center_panel/title.txt");
-
- if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
- echo "<a href=\"panels.php#{$maj_center_panel}\">";
- echo '<img src="images/widget.edit.png" border="0" width="11" height="11" align="right"></a>';
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_center_panel/private.txt")) {
- echo '<img src="images/widget.private.png" border="0" width="11" height="11" align="right">';
- }
-
- echo '</div>';
-
- echo '<div class="panel_body"';
-
- if (isset($maj_center_panel_border) or isset($maj_center_panel_bgcolor_c) or isset($maj_center_panel_text_c)) {
- echo ' style="';
- }
-
- if (isset($maj_center_panel_bgcolor_c)) {
- echo "background-color: $maj_center_panel_bgcolor_c;";
- }
-
- if (isset($maj_center_panel_text_c)) {
- echo "color: $maj_center_panel_text_c;";
- }
-
- if (isset($maj_center_panel_border)) {
- echo "border-color: $maj_center_panel_border;";
- }
-
- if (isset($maj_center_panel_border) or isset($maj_center_panel_bgcolor_c) or isset($maj_center_panel_text_c)) {
- echo '"';
- }
-
- echo '>';
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_center_panel/free.txt")) {
- echo '<div class=panel_free>';
- }
-
- include("$maj_data_directory/panels/$maj_center_panel/panel.php");
-
- echo '</div></div>';
-
- if (file_exists("$maj_data_directory/panels/$maj_center_panel/free.txt") and !file_exists("$maj_data_directory/panels/$maj_center_panel/nomargin.txt")) {
- echo "<div style=\"height: {$maj_wspace}px;\"></div>";
- }
- }
-}
+maj_panels($maj_center_panels);
if (isset($maj_req_category) and !empty($maj_req_category)) {
@@ -2556,133 +2169,8 @@ foreach ($maj_disp as $maj_d) {
echo "\r\n\t\t\t</div>\r\n\t\t</div>\r\n\r\n";
echo "\t</td></tr></table>\r\n\r\n";
-
- if ($maj_count_entry_panels > 0) {
-
- foreach ($maj_entry_panels as $maj_entry_panel) {
-
- if (!file_exists("$maj_data_directory/panels/$maj_entry_panel/free.txt")) {
-
- if (file_exists("$maj_data_directory/panels/$maj_entry_panel/border.txt")) {
- $maj_entry_panel_border = file_get_contents("$maj_data_directory/panels/$maj_entry_panel/border.txt");
- }
- else {
- if (isset($maj_entry_panel_border)) {
- unset($maj_entry_panel_border);
- }
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_entry_panel/bgcolor-t.txt")) {
- $maj_entry_panel_bgcolor_t = file_get_contents("$maj_data_directory/panels/$maj_entry_panel/bgcolor-t.txt");
- }
- else {
- if (isset($maj_entry_panel_bgcolor_t)) {
- unset($maj_entry_panel_bgcolor_t);
- }
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_entry_panel/bgcolor-c.txt")) {
- $maj_entry_panel_bgcolor_c = file_get_contents("$maj_data_directory/panels/$maj_entry_panel/bgcolor-c.txt");
- }
- else {
- if (isset($maj_entry_panel_bgcolor_c)) {
- unset($maj_entry_panel_bgcolor_c);
- }
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_entry_panel/text-t.txt")) {
- $maj_entry_panel_text_t = file_get_contents("$maj_data_directory/panels/$maj_entry_panel/text-t.txt");
- }
- else {
- if (isset($maj_entry_panel_text_t)) {
- unset($maj_entry_panel_text_t);
- }
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_entry_panel/text-c.txt")) {
- $maj_entry_panel_text_c = file_get_contents("$maj_data_directory/panels/$maj_entry_panel/text-c.txt");
- }
- else {
- if (isset($maj_entry_panel_text_c)) {
- unset($maj_entry_panel_text_c);
- }
- }
-
- echo '<div class="panel_wrapper"><div class="panel_title"';
-
- if (isset($maj_entry_panel_border) or isset($maj_entry_panel_bgcolor_t) or isset($maj_entry_panel_text_t)) {
- echo ' style="';
- }
-
- if (isset($maj_entry_panel_bgcolor_t)) {
- echo "background-color: $maj_entry_panel_bgcolor_t;";
- }
-
- if (isset($maj_entry_panel_text_t)) {
- echo "color: $maj_entry_panel_text_t;";
- }
-
- if (isset($maj_entry_panel_border)) {
- echo "border-color: $maj_entry_panel_border;";
- }
-
- if (isset($maj_entry_panel_border) or isset($maj_entry_panel_bgcolor_t) or isset($maj_entry_panel_text_t)) {
- echo '"';
- }
-
- echo '>';
-
- readfile("$maj_data_directory/panels/$maj_entry_panel/title.txt");
-
- if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
- echo "<a href=\"panels.php#{$maj_entry_panel}\">";
- echo '<img src="images/widget.edit.png" border="0" width="11" height="11" align="right"></a>';
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_entry_panel/private.txt")) {
- echo '<img src="images/widget.private.png" border="0" width="11" height="11" align="right">';
- }
-
- echo '</div>';
-
- echo '<div class="panel_body"';
-
- if (isset($maj_entry_panel_border) or isset($maj_entry_panel_bgcolor_c) or isset($maj_entry_panel_text_c)) {
- echo ' style="';
- }
-
- if (isset($maj_entry_panel_bgcolor_c)) {
- echo "background-color: $maj_entry_panel_bgcolor_c;";
- }
-
- if (isset($maj_entry_panel_text_c)) {
- echo "color: $maj_entry_panel_text_c;";
- }
-
- if (isset($maj_entry_panel_border)) {
- echo "border-color: $maj_entry_panel_border;";
- }
-
- if (isset($maj_entry_panel_border) or isset($maj_entry_panel_bgcolor_c) or isset($maj_entry_panel_text_c)) {
- echo '"';
- }
-
- echo '>';
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_entry_panel/free.txt")) {
- echo '<div class=panel_free>';
- }
-
- include("$maj_data_directory/panels/$maj_entry_panel/panel.php");
-
- echo '</div></div>';
-
- if (file_exists("$maj_data_directory/panels/$maj_entry_panel/free.txt") and !file_exists("$maj_data_directory/panels/$maj_entry_panel/nomargin.txt")) {
- echo "<div style=\"height: {$maj_wspace}px;\"></div>";
- }
- }
- }
+
+ maj_panels($maj_entry_panels);
if (file_exists("images/$maj_d/album") and (file_exists("$maj_data_directory/items/$maj_d/auto-album.txt") or (isset($maj_req_entry) and !empty($maj_req_entry) and isset($maj_req_show) and !empty($maj_req_show) and ($maj_req_show == album)))) {
@@ -3487,132 +2975,7 @@ foreach ($maj_disp as $maj_d) {
}
}
-if ($maj_count_bottom_panels > 0) {
-
- foreach ($maj_bottom_panels as $maj_bottom_panel) {
-
- if (!file_exists("$maj_data_directory/panels/$maj_bottom_panel/free.txt")) {
-
- if (file_exists("$maj_data_directory/panels/$maj_bottom_panel/border.txt")) {
- $maj_bottom_panel_border = file_get_contents("$maj_data_directory/panels/$maj_bottom_panel/border.txt");
- }
- else {
- if (isset($maj_bottom_panel_border)) {
- unset($maj_bottom_panel_border);
- }
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_bottom_panel/bgcolor-t.txt")) {
- $maj_bottom_panel_bgcolor_t = file_get_contents("$maj_data_directory/panels/$maj_bottom_panel/bgcolor-t.txt");
- }
- else {
- if (isset($maj_bottom_panel_bgcolor_t)) {
- unset($maj_bottom_panel_bgcolor_t);
- }
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_bottom_panel/bgcolor-c.txt")) {
- $maj_bottom_panel_bgcolor_c = file_get_contents("$maj_data_directory/panels/$maj_bottom_panel/bgcolor-c.txt");
- }
- else {
- if (isset($maj_bottom_panel_bgcolor_c)) {
- unset($maj_bottom_panel_bgcolor_c);
- }
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_bottom_panel/text-t.txt")) {
- $maj_bottom_panel_text_t = file_get_contents("$maj_data_directory/panels/$maj_bottom_panel/text-t.txt");
- }
- else {
- if (isset($maj_bottom_panel_text_t)) {
- unset($maj_bottom_panel_text_t);
- }
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_bottom_panel/text-c.txt")) {
- $maj_bottom_panel_text_c = file_get_contents("$maj_data_directory/panels/$maj_bottom_panel/text-c.txt");
- }
- else {
- if (isset($maj_bottom_panel_text_c)) {
- unset($maj_bottom_panel_text_c);
- }
- }
-
- echo '<div class="panel_wrapper"><div class="panel_title"';
-
- if (isset($maj_bottom_panel_border) or isset($maj_bottom_panel_bgcolor_t) or isset($maj_bottom_panel_text_t)) {
- echo ' style="';
- }
-
- if (isset($maj_bottom_panel_bgcolor_t)) {
- echo "background-color: $maj_bottom_panel_bgcolor_t;";
- }
-
- if (isset($maj_bottom_panel_text_t)) {
- echo "color: $maj_bottom_panel_text_t;";
- }
-
- if (isset($maj_bottom_panel_border)) {
- echo "border-color: $maj_bottom_panel_border;";
- }
-
- if (isset($maj_bottom_panel_border) or isset($maj_bottom_panel_bgcolor_t) or isset($maj_bottom_panel_text_t)) {
- echo '"';
- }
-
- echo '>';
-
- readfile("$maj_data_directory/panels/$maj_bottom_panel/title.txt");
-
- if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
- echo "<a href=\"panels.php#{$maj_bottom_panel}\">";
- echo '<img src="images/widget.edit.png" border="0" width="11" height="11" align="right"></a>';
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_bottom_panel/private.txt")) {
- echo '<img src="images/widget.private.png" border="0" width="11" height="11" align="right">';
- }
-
- echo '</div>';
-
- echo '<div class="panel_body"';
-
- if (isset($maj_bottom_panel_border) or isset($maj_bottom_panel_bgcolor_c) or isset($maj_bottom_panel_text_c)) {
- echo ' style="';
- }
-
- if (isset($maj_bottom_panel_bgcolor_c)) {
- echo "background-color: $maj_bottom_panel_bgcolor_c;";
- }
-
- if (isset($maj_bottom_panel_text_c)) {
- echo "color: $maj_bottom_panel_text_c;";
- }
-
- if (isset($maj_bottom_panel_border)) {
- echo "border-color: $maj_bottom_panel_border;";
- }
-
- if (isset($maj_bottom_panel_border) or isset($maj_bottom_panel_bgcolor_c) or isset($maj_bottom_panel_text_c)) {
- echo '"';
- }
-
- echo '>';
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_bottom_panel/free.txt")) {
- echo '<div class=panel_free>';
- }
-
- include("$maj_data_directory/panels/$maj_bottom_panel/panel.php");
-
- echo '</div></div>';
-
- if (file_exists("$maj_data_directory/panels/$maj_bottom_panel/free.txt") and !file_exists("$maj_data_directory/panels/$maj_bottom_panel/nomargin.txt")) {
- echo "<div style=\"height: {$maj_wspace}px;\"></div>";
- }
- }
-}
+maj_panels($maj_bottom_panels);
?>
@@ -4210,132 +3573,7 @@ if (($maj_count_archives > 0) and ($maj_count_latest > $maj_increase) and ($maj_
echo "</table></div></div>";
}
-if ($maj_count_right_panels > 0) {
-
- foreach ($maj_right_panels as $maj_right_panel) {
-
- if (!file_exists("$maj_data_directory/panels/$maj_right_panel/free.txt")) {
-
- if (file_exists("$maj_data_directory/panels/$maj_right_panel/border.txt")) {
- $maj_right_panel_border = file_get_contents("$maj_data_directory/panels/$maj_right_panel/border.txt");
- }
- else {
- if (isset($maj_right_panel_border)) {
- unset($maj_right_panel_border);
- }
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_right_panel/bgcolor-t.txt")) {
- $maj_right_panel_bgcolor_t = file_get_contents("$maj_data_directory/panels/$maj_right_panel/bgcolor-t.txt");
- }
- else {
- if (isset($maj_right_panel_bgcolor_t)) {
- unset($maj_right_panel_bgcolor_t);
- }
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_right_panel/bgcolor-c.txt")) {
- $maj_right_panel_bgcolor_c = file_get_contents("$maj_data_directory/panels/$maj_right_panel/bgcolor-c.txt");
- }
- else {
- if (isset($maj_right_panel_bgcolor_c)) {
- unset($maj_right_panel_bgcolor_c);
- }
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_right_panel/text-t.txt")) {
- $maj_right_panel_text_t = file_get_contents("$maj_data_directory/panels/$maj_right_panel/text-t.txt");
- }
- else {
- if (isset($maj_right_panel_text_t)) {
- unset($maj_right_panel_text_t);
- }
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_right_panel/text-c.txt")) {
- $maj_right_panel_text_c = file_get_contents("$maj_data_directory/panels/$maj_right_panel/text-c.txt");
- }
- else {
- if (isset($maj_right_panel_text_c)) {
- unset($maj_right_panel_text_c);
- }
- }
-
- echo '<div class="panel_wrapper"><div class="panel_title"';
-
- if (isset($maj_right_panel_border) or isset($maj_right_panel_bgcolor_t) or isset($maj_right_panel_text_t)) {
- echo ' style="';
- }
-
- if (isset($maj_right_panel_bgcolor_t)) {
- echo "background-color: $maj_right_panel_bgcolor_t;";
- }
-
- if (isset($maj_right_panel_text_t)) {
- echo "color: $maj_right_panel_text_t;";
- }
-
- if (isset($maj_right_panel_border)) {
- echo "border-color: $maj_right_panel_border;";
- }
-
- if (isset($maj_right_panel_border) or isset($maj_right_panel_bgcolor_t) or isset($maj_right_panel_text_t)) {
- echo '"';
- }
-
- echo '>';
-
- readfile("$maj_data_directory/panels/$maj_right_panel/title.txt");
-
- if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
- echo "<a href=\"panels.php#{$maj_right_panel}\">";
- echo '<img src="images/widget.edit.png" border="0" width="11" height="11" align="right"></a>';
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_right_panel/private.txt")) {
- echo '<img src="images/widget.private.png" border="0" width="11" height="11" align="right">';
- }
-
- echo '</div>';
-
- echo '<div class="panel_body"';
-
- if (isset($maj_right_panel_border) or isset($maj_right_panel_bgcolor_c) or isset($maj_right_panel_text_c)) {
- echo ' style="';
- }
-
- if (isset($maj_right_panel_bgcolor_c)) {
- echo "background-color: $maj_right_panel_bgcolor_c;";
- }
-
- if (isset($maj_right_panel_text_c)) {
- echo "color: $maj_right_panel_text_c;";
- }
-
- if (isset($maj_right_panel_border)) {
- echo "border-color: $maj_right_panel_border;";
- }
-
- if (isset($maj_right_panel_border) or isset($maj_right_panel_bgcolor_c) or isset($maj_right_panel_text_c)) {
- echo '"';
- }
-
- echo '>';
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_right_panel/free.txt")) {
- echo '<div class=panel_free>';
- }
-
- include("$maj_data_directory/panels/$maj_right_panel/panel.php");
-
- echo '</div></div>';
-
- if (file_exists("$maj_data_directory/panels/$maj_right_panel/free.txt") and !file_exists("$maj_data_directory/panels/$maj_right_panel/nomargin.txt")) {
- echo "<div style=\"height: {$maj_wspace}px;\"></div>";
- }
- }
-}
+maj_panels($maj_right_panels);
if ($maj_count_latest > 0) {
tree 374279ce3628560a66b96cdae81279df296f050f
parent b9867231504b82f7d91324af2abdd7aee131e041
author Magie Antonio <magie@majcms.org> 1321880935 +0800
committer Magie Antonio <magie@majcms.org> 1321880935 +0800
Aggregate panel display into maj_panels()
diff --git a/core.php b/core.php
index e505c22..cc86ff8 100644
--- a/core.php
+++ b/core.php
@@ -666,4 +666,139 @@ function maj_download_file($file_name,$file_dir,$count_dir) {
}
}
+function maj_panels($panel_array) {
+
+ global $maj_data_directory;
+ global $maj_admin_username;
+ global $maj_logged_in_username;
+ global $maj_wspace;
+
+ if (count($panel_array) > 0) {
+
+ foreach ($panel_array as $panel) {
+
+ if (!file_exists("$maj_data_directory/panels/$panel/free.txt")) {
+
+ if (file_exists("$maj_data_directory/panels/$panel/border.txt")) {
+ $panel_border = file_get_contents("$maj_data_directory/panels/$panel/border.txt");
+ }
+ else {
+ if (isset($panel_border)) {
+ unset($panel_border);
+ }
+ }
+
+ if (file_exists("$maj_data_directory/panels/$panel/bgcolor-t.txt")) {
+ $panel_bgcolor_t = file_get_contents("$maj_data_directory/panels/$panel/bgcolor-t.txt");
+ }
+ else {
+ if (isset($panel_bgcolor_t)) {
+ unset($panel_bgcolor_t);
+ }
+ }
+
+ if (file_exists("$maj_data_directory/panels/$panel/bgcolor-c.txt")) {
+ $panel_bgcolor_c = file_get_contents("$maj_data_directory/panels/$panel/bgcolor-c.txt");
+ }
+ else {
+ if (isset($panel_bgcolor_c)) {
+ unset($panel_bgcolor_c);
+ }
+ }
+
+ if (file_exists("$maj_data_directory/panels/$panel/text-t.txt")) {
+ $panel_text_t = file_get_contents("$maj_data_directory/panels/$panel/text-t.txt");
+ }
+ else {
+ if (isset($panel_text_t)) {
+ unset($panel_text_t);
+ }
+ }
+
+ if (file_exists("$maj_data_directory/panels/$panel/text-c.txt")) {
+ $panel_text_c = file_get_contents("$maj_data_directory/panels/$panel/text-c.txt");
+ }
+ else {
+ if (isset($panel_text_c)) {
+ unset($panel_text_c);
+ }
+ }
+
+ echo "\r\n<div class=\"panel_wrapper\">\r\n\r\n\t<div class=\"panel_title\"";
+
+ if (isset($panel_border) or isset($panel_bgcolor_t) or isset($panel_text_t)) {
+ echo ' style="';
+ }
+
+ if (isset($panel_bgcolor_t)) {
+ echo "background-color: $panel_bgcolor_t;";
+ }
+
+ if (isset($panel_text_t)) {
+ echo "color: $panel_text_t;";
+ }
+
+ if (isset($panel_border)) {
+ echo "border-color: $panel_border;";
+ }
+
+ if (isset($panel_border) or isset($panel_bgcolor_t) or isset($panel_text_t)) {
+ echo '"';
+ }
+
+ echo ">";
+
+ readfile("$maj_data_directory/panels/$panel/title.txt");
+
+ if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
+ echo "<a href=\"panels.php#{$panel}\">";
+ echo '<img src="images/widget.edit.png" border="0" width="11" height="11" align="right"></a>';
+ }
+
+ if (file_exists("$maj_data_directory/panels/$panel/private.txt")) {
+ echo '<img src="images/widget.private.png" border="0" width="11" height="11" align="right">';
+ }
+
+ echo "</div>";
+
+ echo "\r\n\r\n\t<div class=\"panel_body\"";
+
+ if (isset($panel_border) or isset($panel_bgcolor_c) or isset($panel_text_c)) {
+ echo ' style="';
+ }
+
+ if (isset($panel_bgcolor_c)) {
+ echo "background-color: $panel_bgcolor_c;";
+ }
+
+ if (isset($panel_text_c)) {
+ echo "color: $panel_text_c;";
+ }
+
+ if (isset($panel_border)) {
+ echo "border-color: $panel_border;";
+ }
+
+ if (isset($panel_border) or isset($panel_bgcolor_c) or isset($panel_text_c)) {
+ echo '"';
+ }
+
+ echo ">\r\n\t\t";
+ }
+
+ if (file_exists("$maj_data_directory/panels/$panel/free.txt")) {
+ echo '<div class=panel_free>';
+ }
+
+ include("$maj_data_directory/panels/$panel/panel.php");
+
+ echo "\r\n\t</div>\r\n</div>\r\n";
+
+ if (file_exists("$maj_data_directory/panels/$panel/free.txt") and !file_exists("$maj_data_directory/panels/$panel/nomargin.txt")) {
+ echo "<div style=\"height: {$maj_wspace}px;\"></div>";
+ }
+ }
+ }
+}
+
?>
diff --git a/index.php b/index.php
index 16d48fd..24e410b 100644
--- a/index.php
+++ b/index.php
@@ -882,291 +882,29 @@ if (file_exists("$maj_data_directory/panels")) {
sort($maj_left_panels);
reset($maj_left_panels);
- $maj_count_left_panels = count($maj_left_panels);
-
sort($maj_right_panels);
reset($maj_right_panels);
- $maj_count_right_panels = count($maj_right_panels);
-
sort($maj_top_panels);
reset($maj_top_panels);
- $maj_count_top_panels = count($maj_top_panels);
-
sort($maj_bottom_panels);
reset($maj_bottom_panels);
- $maj_count_bottom_panels = count($maj_bottom_panels);
-
sort($maj_center_panels);
reset($maj_center_panels);
- $maj_count_center_panels = count($maj_center_panels);
-
sort($maj_entry_panels);
reset($maj_entry_panels);
- $maj_count_entry_panels = count($maj_entry_panels);
-
- if ($maj_count_left_panels > 0) {
-
- foreach ($maj_left_panels as $maj_left_panel) {
-
- if (!file_exists("$maj_data_directory/panels/$maj_left_panel/free.txt")) {
-
- if (file_exists("$maj_data_directory/panels/$maj_left_panel/border.txt")) {
- $maj_left_panel_border = file_get_contents("$maj_data_directory/panels/$maj_left_panel/border.txt");
- }
- else {
- if (isset($maj_left_panel_border)) {
- unset($maj_left_panel_border);
- }
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_left_panel/bgcolor-t.txt")) {
- $maj_left_panel_bgcolor_t = file_get_contents("$maj_data_directory/panels/$maj_left_panel/bgcolor-t.txt");
- }
- else {
- if (isset($maj_left_panel_bgcolor_t)) {
- unset($maj_left_panel_bgcolor_t);
- }
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_left_panel/bgcolor-c.txt")) {
- $maj_left_panel_bgcolor_c = file_get_contents("$maj_data_directory/panels/$maj_left_panel/bgcolor-c.txt");
- }
- else {
- if (isset($maj_left_panel_bgcolor_c)) {
- unset($maj_left_panel_bgcolor_c);
- }
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_left_panel/text-t.txt")) {
- $maj_left_panel_text_t = file_get_contents("$maj_data_directory/panels/$maj_left_panel/text-t.txt");
- }
- else {
- if (isset($maj_left_panel_text_t)) {
- unset($maj_left_panel_text_t);
- }
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_left_panel/text-c.txt")) {
- $maj_left_panel_text_c = file_get_contents("$maj_data_directory/panels/$maj_left_panel/text-c.txt");
- }
- else {
- if (isset($maj_left_panel_text_c)) {
- unset($maj_left_panel_text_c);
- }
- }
-
- echo "\r\n<div class=\"panel_wrapper\">\r\n\r\n\t<div class=\"panel_title\"";
-
- if (isset($maj_left_panel_border) or isset($maj_left_panel_bgcolor_t) or isset($maj_left_panel_text_t)) {
- echo ' style="';
- }
-
- if (isset($maj_left_panel_bgcolor_t)) {
- echo "background-color: $maj_left_panel_bgcolor_t;";
- }
-
- if (isset($maj_left_panel_text_t)) {
- echo "color: $maj_left_panel_text_t;";
- }
-
- if (isset($maj_left_panel_border)) {
- echo "border-color: $maj_left_panel_border;";
- }
-
- if (isset($maj_left_panel_border) or isset($maj_left_panel_bgcolor_t) or isset($maj_left_panel_text_t)) {
- echo '"';
- }
-
- echo ">";
-
- readfile("$maj_data_directory/panels/$maj_left_panel/title.txt");
-
- if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
- echo "<a href=\"panels.php#{$maj_left_panel}\">";
- echo '<img src="images/widget.edit.png" border="0" width="11" height="11" align="right"></a>';
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_left_panel/private.txt")) {
- echo '<img src="images/widget.private.png" border="0" width="11" height="11" align="right">';
- }
-
- echo "</div>";
-
- echo "\r\n\r\n\t<div class=\"panel_body\"";
-
- if (isset($maj_left_panel_border) or isset($maj_left_panel_bgcolor_c) or isset($maj_left_panel_text_c)) {
- echo ' style="';
- }
-
- if (isset($maj_left_panel_bgcolor_c)) {
- echo "background-color: $maj_left_panel_bgcolor_c;";
- }
-
- if (isset($maj_left_panel_text_c)) {
- echo "color: $maj_left_panel_text_c;";
- }
-
- if (isset($maj_left_panel_border)) {
- echo "border-color: $maj_left_panel_border;";
- }
-
- if (isset($maj_left_panel_border) or isset($maj_left_panel_bgcolor_c) or isset($maj_left_panel_text_c)) {
- echo '"';
- }
-
- echo ">\r\n\t\t";
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_left_panel/free.txt")) {
- echo '<div class=panel_free>';
- }
-
- include("$maj_data_directory/panels/$maj_left_panel/panel.php");
-
- echo "\r\n\t</div>\r\n</div>\r\n";
-
- if (file_exists("$maj_data_directory/panels/$maj_left_panel/free.txt") and !file_exists("$maj_data_directory/panels/$maj_left_panel/nomargin.txt")) {
- echo "<div style=\"height: {$maj_wspace}px;\"></div>";
- }
- }
- }
+ maj_panels($maj_left_panels);
}
// main
echo "\r\n\r\n<td valign=\"top\" width=\"$maj_wmain\">\r\n\r\n";
-if ($maj_count_top_panels > 0) {
-
- foreach ($maj_top_panels as $maj_top_panel) {
-
- if (!file_exists("$maj_data_directory/panels/$maj_top_panel/free.txt")) {
-
- if (file_exists("$maj_data_directory/panels/$maj_top_panel/border.txt")) {
- $maj_top_panel_border = file_get_contents("$maj_data_directory/panels/$maj_top_panel/border.txt");
- }
- else {
- if (isset($maj_top_panel_border)) {
- unset($maj_top_panel_border);
- }
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_top_panel/bgcolor-t.txt")) {
- $maj_top_panel_bgcolor_t = file_get_contents("$maj_data_directory/panels/$maj_top_panel/bgcolor-t.txt");
- }
- else {
- if (isset($maj_top_panel_bgcolor_t)) {
- unset($maj_top_panel_bgcolor_t);
- }
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_top_panel/bgcolor-c.txt")) {
- $maj_top_panel_bgcolor_c = file_get_contents("$maj_data_directory/panels/$maj_top_panel/bgcolor-c.txt");
- }
- else {
- if (isset($maj_top_panel_bgcolor_c)) {
- unset($maj_top_panel_bgcolor_c);
- }
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_top_panel/text-t.txt")) {
- $maj_top_panel_text_t = file_get_contents("$maj_data_directory/panels/$maj_top_panel/text-t.txt");
- }
- else {
- if (isset($maj_top_panel_text_t)) {
- unset($maj_top_panel_text_t);
- }
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_top_panel/text-c.txt")) {
- $maj_top_panel_text_c = file_get_contents("$maj_data_directory/panels/$maj_top_panel/text-c.txt");
- }
- else {
- if (isset($maj_top_panel_text_c)) {
- unset($maj_top_panel_text_c);
- }
- }
-
- echo "\t<div class=\"panel_wrapper\">\r\n\r\n\t\t<div class=\"panel_title\"";
-
- if (isset($maj_top_panel_border) or isset($maj_top_panel_bgcolor_t) or isset($maj_top_panel_text_t)) {
- echo ' style="';
- }
-
- if (isset($maj_top_panel_bgcolor_t)) {
- echo "background-color: $maj_top_panel_bgcolor_t;";
- }
-
- if (isset($maj_top_panel_text_t)) {
- echo "color: $maj_top_panel_text_t;";
- }
-
- if (isset($maj_top_panel_border)) {
- echo "border-color: $maj_top_panel_border;";
- }
-
- if (isset($maj_top_panel_border) or isset($maj_top_panel_bgcolor_t) or isset($maj_top_panel_text_t)) {
- echo '"';
- }
-
- echo '>';
-
- readfile("$maj_data_directory/panels/$maj_top_panel/title.txt");
-
- if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
- echo "<a href=\"panels.php#{$maj_top_panel}\">";
- echo '<img src="images/widget.edit.png" border="0" width="11" height="11" align="right"></a>';
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_top_panel/private.txt")) {
- echo '<img src="images/widget.private.png" border="0" width="11" height="11" align="right">';
- }
-
- echo "</div>\r\n\r\n\t\t";
-
- echo '<div class="panel_body"';
-
- if (isset($maj_top_panel_border) or isset($maj_top_panel_bgcolor_c) or isset($maj_top_panel_text_c)) {
- echo ' style="';
- }
-
- if (isset($maj_top_panel_bgcolor_c)) {
- echo "background-color: $maj_top_panel_bgcolor_c;";
- }
-
- if (isset($maj_top_panel_text_c)) {
- echo "color: $maj_top_panel_text_c;";
- }
-
- if (isset($maj_top_panel_border)) {
- echo "border-color: $maj_top_panel_border;";
- }
-
- if (isset($maj_top_panel_border) or isset($maj_top_panel_bgcolor_c) or isset($maj_top_panel_text_c)) {
- echo '"';
- }
-
- echo ">\r\n\t\t\t";
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_top_panel/free.txt")) {
- echo '<div class=panel_free>';
- }
-
- include("$maj_data_directory/panels/$maj_top_panel/panel.php");
-
- echo "\r\n\t\t</div>\r\n\t</div>\r\n\r\n";
-
- if (file_exists("$maj_data_directory/panels/$maj_top_panel/free.txt") and !file_exists("$maj_data_directory/panels/$maj_top_panel/nomargin.txt")) {
- echo "<div style=\"height: {$maj_wspace}px;\"></div>";
- }
- }
-}
+maj_panels($maj_top_panels);
// clean-up (start)
@@ -1577,132 +1315,7 @@ if (file_exists("$maj_data_directory/bb.txt") and file_exists("$maj_data_directo
}
-if ($maj_count_center_panels > 0) {
-
- foreach ($maj_center_panels as $maj_center_panel) {
-
- if (!file_exists("$maj_data_directory/panels/$maj_center_panel/free.txt")) {
-
- if (file_exists("$maj_data_directory/panels/$maj_center_panel/border.txt")) {
- $maj_center_panel_border = file_get_contents("$maj_data_directory/panels/$maj_center_panel/border.txt");
- }
- else {
- if (isset($maj_center_panel_border)) {
- unset($maj_center_panel_border);
- }
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_center_panel/bgcolor-t.txt")) {
- $maj_center_panel_bgcolor_t = file_get_contents("$maj_data_directory/panels/$maj_center_panel/bgcolor-t.txt");
- }
- else {
- if (isset($maj_center_panel_bgcolor_t)) {
- unset($maj_center_panel_bgcolor_t);
- }
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_center_panel/bgcolor-c.txt")) {
- $maj_center_panel_bgcolor_c = file_get_contents("$maj_data_directory/panels/$maj_center_panel/bgcolor-c.txt");
- }
- else {
- if (isset($maj_center_panel_bgcolor_c)) {
- unset($maj_center_panel_bgcolor_c);
- }
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_center_panel/text-t.txt")) {
- $maj_center_panel_text_t = file_get_contents("$maj_data_directory/panels/$maj_center_panel/text-t.txt");
- }
- else {
- if (isset($maj_center_panel_text_t)) {
- unset($maj_center_panel_text_t);
- }
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_center_panel/text-c.txt")) {
- $maj_center_panel_text_c = file_get_contents("$maj_data_directory/panels/$maj_center_panel/text-c.txt");
- }
- else {
- if (isset($maj_center_panel_text_c)) {
- unset($maj_center_panel_text_c);
- }
- }
-
- echo '<div class="panel_wrapper"><div class="panel_title"';
-
- if (isset($maj_center_panel_border) or isset($maj_center_panel_bgcolor_t) or isset($maj_center_panel_text_t)) {
- echo ' style="';
- }
-
- if (isset($maj_center_panel_bgcolor_t)) {
- echo "background-color: $maj_center_panel_bgcolor_t;";
- }
-
- if (isset($maj_center_panel_text_t)) {
- echo "color: $maj_center_panel_text_t;";
- }
-
- if (isset($maj_center_panel_border)) {
- echo "border-color: $maj_center_panel_border;";
- }
-
- if (isset($maj_center_panel_border) or isset($maj_center_panel_bgcolor_t) or isset($maj_center_panel_text_t)) {
- echo '"';
- }
-
- echo '>';
-
- readfile("$maj_data_directory/panels/$maj_center_panel/title.txt");
-
- if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
- echo "<a href=\"panels.php#{$maj_center_panel}\">";
- echo '<img src="images/widget.edit.png" border="0" width="11" height="11" align="right"></a>';
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_center_panel/private.txt")) {
- echo '<img src="images/widget.private.png" border="0" width="11" height="11" align="right">';
- }
-
- echo '</div>';
-
- echo '<div class="panel_body"';
-
- if (isset($maj_center_panel_border) or isset($maj_center_panel_bgcolor_c) or isset($maj_center_panel_text_c)) {
- echo ' style="';
- }
-
- if (isset($maj_center_panel_bgcolor_c)) {
- echo "background-color: $maj_center_panel_bgcolor_c;";
- }
-
- if (isset($maj_center_panel_text_c)) {
- echo "color: $maj_center_panel_text_c;";
- }
-
- if (isset($maj_center_panel_border)) {
- echo "border-color: $maj_center_panel_border;";
- }
-
- if (isset($maj_center_panel_border) or isset($maj_center_panel_bgcolor_c) or isset($maj_center_panel_text_c)) {
- echo '"';
- }
-
- echo '>';
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_center_panel/free.txt")) {
- echo '<div class=panel_free>';
- }
-
- include("$maj_data_directory/panels/$maj_center_panel/panel.php");
-
- echo '</div></div>';
-
- if (file_exists("$maj_data_directory/panels/$maj_center_panel/free.txt") and !file_exists("$maj_data_directory/panels/$maj_center_panel/nomargin.txt")) {
- echo "<div style=\"height: {$maj_wspace}px;\"></div>";
- }
- }
-}
+maj_panels($maj_center_panels);
if (isset($maj_req_category) and !empty($maj_req_category)) {
@@ -2556,133 +2169,8 @@ foreach ($maj_disp as $maj_d) {
echo "\r\n\t\t\t</div>\r\n\t\t</div>\r\n\r\n";
echo "\t</td></tr></table>\r\n\r\n";
-
- if ($maj_count_entry_panels > 0) {
-
- foreach ($maj_entry_panels as $maj_entry_panel) {
-
- if (!file_exists("$maj_data_directory/panels/$maj_entry_panel/free.txt")) {
-
- if (file_exists("$maj_data_directory/panels/$maj_entry_panel/border.txt")) {
- $maj_entry_panel_border = file_get_contents("$maj_data_directory/panels/$maj_entry_panel/border.txt");
- }
- else {
- if (isset($maj_entry_panel_border)) {
- unset($maj_entry_panel_border);
- }
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_entry_panel/bgcolor-t.txt")) {
- $maj_entry_panel_bgcolor_t = file_get_contents("$maj_data_directory/panels/$maj_entry_panel/bgcolor-t.txt");
- }
- else {
- if (isset($maj_entry_panel_bgcolor_t)) {
- unset($maj_entry_panel_bgcolor_t);
- }
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_entry_panel/bgcolor-c.txt")) {
- $maj_entry_panel_bgcolor_c = file_get_contents("$maj_data_directory/panels/$maj_entry_panel/bgcolor-c.txt");
- }
- else {
- if (isset($maj_entry_panel_bgcolor_c)) {
- unset($maj_entry_panel_bgcolor_c);
- }
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_entry_panel/text-t.txt")) {
- $maj_entry_panel_text_t = file_get_contents("$maj_data_directory/panels/$maj_entry_panel/text-t.txt");
- }
- else {
- if (isset($maj_entry_panel_text_t)) {
- unset($maj_entry_panel_text_t);
- }
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_entry_panel/text-c.txt")) {
- $maj_entry_panel_text_c = file_get_contents("$maj_data_directory/panels/$maj_entry_panel/text-c.txt");
- }
- else {
- if (isset($maj_entry_panel_text_c)) {
- unset($maj_entry_panel_text_c);
- }
- }
-
- echo '<div class="panel_wrapper"><div class="panel_title"';
-
- if (isset($maj_entry_panel_border) or isset($maj_entry_panel_bgcolor_t) or isset($maj_entry_panel_text_t)) {
- echo ' style="';
- }
-
- if (isset($maj_entry_panel_bgcolor_t)) {
- echo "background-color: $maj_entry_panel_bgcolor_t;";
- }
-
- if (isset($maj_entry_panel_text_t)) {
- echo "color: $maj_entry_panel_text_t;";
- }
-
- if (isset($maj_entry_panel_border)) {
- echo "border-color: $maj_entry_panel_border;";
- }
-
- if (isset($maj_entry_panel_border) or isset($maj_entry_panel_bgcolor_t) or isset($maj_entry_panel_text_t)) {
- echo '"';
- }
-
- echo '>';
-
- readfile("$maj_data_directory/panels/$maj_entry_panel/title.txt");
-
- if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
- echo "<a href=\"panels.php#{$maj_entry_panel}\">";
- echo '<img src="images/widget.edit.png" border="0" width="11" height="11" align="right"></a>';
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_entry_panel/private.txt")) {
- echo '<img src="images/widget.private.png" border="0" width="11" height="11" align="right">';
- }
-
- echo '</div>';
-
- echo '<div class="panel_body"';
-
- if (isset($maj_entry_panel_border) or isset($maj_entry_panel_bgcolor_c) or isset($maj_entry_panel_text_c)) {
- echo ' style="';
- }
-
- if (isset($maj_entry_panel_bgcolor_c)) {
- echo "background-color: $maj_entry_panel_bgcolor_c;";
- }
-
- if (isset($maj_entry_panel_text_c)) {
- echo "color: $maj_entry_panel_text_c;";
- }
-
- if (isset($maj_entry_panel_border)) {
- echo "border-color: $maj_entry_panel_border;";
- }
-
- if (isset($maj_entry_panel_border) or isset($maj_entry_panel_bgcolor_c) or isset($maj_entry_panel_text_c)) {
- echo '"';
- }
-
- echo '>';
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_entry_panel/free.txt")) {
- echo '<div class=panel_free>';
- }
-
- include("$maj_data_directory/panels/$maj_entry_panel/panel.php");
-
- echo '</div></div>';
-
- if (file_exists("$maj_data_directory/panels/$maj_entry_panel/free.txt") and !file_exists("$maj_data_directory/panels/$maj_entry_panel/nomargin.txt")) {
- echo "<div style=\"height: {$maj_wspace}px;\"></div>";
- }
- }
- }
+
+ maj_panels($maj_entry_panels);
if (file_exists("images/$maj_d/album") and (file_exists("$maj_data_directory/items/$maj_d/auto-album.txt") or (isset($maj_req_entry) and !empty($maj_req_entry) and isset($maj_req_show) and !empty($maj_req_show) and ($maj_req_show == album)))) {
@@ -3487,132 +2975,7 @@ foreach ($maj_disp as $maj_d) {
}
}
-if ($maj_count_bottom_panels > 0) {
-
- foreach ($maj_bottom_panels as $maj_bottom_panel) {
-
- if (!file_exists("$maj_data_directory/panels/$maj_bottom_panel/free.txt")) {
-
- if (file_exists("$maj_data_directory/panels/$maj_bottom_panel/border.txt")) {
- $maj_bottom_panel_border = file_get_contents("$maj_data_directory/panels/$maj_bottom_panel/border.txt");
- }
- else {
- if (isset($maj_bottom_panel_border)) {
- unset($maj_bottom_panel_border);
- }
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_bottom_panel/bgcolor-t.txt")) {
- $maj_bottom_panel_bgcolor_t = file_get_contents("$maj_data_directory/panels/$maj_bottom_panel/bgcolor-t.txt");
- }
- else {
- if (isset($maj_bottom_panel_bgcolor_t)) {
- unset($maj_bottom_panel_bgcolor_t);
- }
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_bottom_panel/bgcolor-c.txt")) {
- $maj_bottom_panel_bgcolor_c = file_get_contents("$maj_data_directory/panels/$maj_bottom_panel/bgcolor-c.txt");
- }
- else {
- if (isset($maj_bottom_panel_bgcolor_c)) {
- unset($maj_bottom_panel_bgcolor_c);
- }
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_bottom_panel/text-t.txt")) {
- $maj_bottom_panel_text_t = file_get_contents("$maj_data_directory/panels/$maj_bottom_panel/text-t.txt");
- }
- else {
- if (isset($maj_bottom_panel_text_t)) {
- unset($maj_bottom_panel_text_t);
- }
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_bottom_panel/text-c.txt")) {
- $maj_bottom_panel_text_c = file_get_contents("$maj_data_directory/panels/$maj_bottom_panel/text-c.txt");
- }
- else {
- if (isset($maj_bottom_panel_text_c)) {
- unset($maj_bottom_panel_text_c);
- }
- }
-
- echo '<div class="panel_wrapper"><div class="panel_title"';
-
- if (isset($maj_bottom_panel_border) or isset($maj_bottom_panel_bgcolor_t) or isset($maj_bottom_panel_text_t)) {
- echo ' style="';
- }
-
- if (isset($maj_bottom_panel_bgcolor_t)) {
- echo "background-color: $maj_bottom_panel_bgcolor_t;";
- }
-
- if (isset($maj_bottom_panel_text_t)) {
- echo "color: $maj_bottom_panel_text_t;";
- }
-
- if (isset($maj_bottom_panel_border)) {
- echo "border-color: $maj_bottom_panel_border;";
- }
-
- if (isset($maj_bottom_panel_border) or isset($maj_bottom_panel_bgcolor_t) or isset($maj_bottom_panel_text_t)) {
- echo '"';
- }
-
- echo '>';
-
- readfile("$maj_data_directory/panels/$maj_bottom_panel/title.txt");
-
- if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
- echo "<a href=\"panels.php#{$maj_bottom_panel}\">";
- echo '<img src="images/widget.edit.png" border="0" width="11" height="11" align="right"></a>';
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_bottom_panel/private.txt")) {
- echo '<img src="images/widget.private.png" border="0" width="11" height="11" align="right">';
- }
-
- echo '</div>';
-
- echo '<div class="panel_body"';
-
- if (isset($maj_bottom_panel_border) or isset($maj_bottom_panel_bgcolor_c) or isset($maj_bottom_panel_text_c)) {
- echo ' style="';
- }
-
- if (isset($maj_bottom_panel_bgcolor_c)) {
- echo "background-color: $maj_bottom_panel_bgcolor_c;";
- }
-
- if (isset($maj_bottom_panel_text_c)) {
- echo "color: $maj_bottom_panel_text_c;";
- }
-
- if (isset($maj_bottom_panel_border)) {
- echo "border-color: $maj_bottom_panel_border;";
- }
-
- if (isset($maj_bottom_panel_border) or isset($maj_bottom_panel_bgcolor_c) or isset($maj_bottom_panel_text_c)) {
- echo '"';
- }
-
- echo '>';
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_bottom_panel/free.txt")) {
- echo '<div class=panel_free>';
- }
-
- include("$maj_data_directory/panels/$maj_bottom_panel/panel.php");
-
- echo '</div></div>';
-
- if (file_exists("$maj_data_directory/panels/$maj_bottom_panel/free.txt") and !file_exists("$maj_data_directory/panels/$maj_bottom_panel/nomargin.txt")) {
- echo "<div style=\"height: {$maj_wspace}px;\"></div>";
- }
- }
-}
+maj_panels($maj_bottom_panels);
?>
@@ -4210,132 +3573,7 @@ if (($maj_count_archives > 0) and ($maj_count_latest > $maj_increase) and ($maj_
echo "</table></div></div>";
}
-if ($maj_count_right_panels > 0) {
-
- foreach ($maj_right_panels as $maj_right_panel) {
-
- if (!file_exists("$maj_data_directory/panels/$maj_right_panel/free.txt")) {
-
- if (file_exists("$maj_data_directory/panels/$maj_right_panel/border.txt")) {
- $maj_right_panel_border = file_get_contents("$maj_data_directory/panels/$maj_right_panel/border.txt");
- }
- else {
- if (isset($maj_right_panel_border)) {
- unset($maj_right_panel_border);
- }
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_right_panel/bgcolor-t.txt")) {
- $maj_right_panel_bgcolor_t = file_get_contents("$maj_data_directory/panels/$maj_right_panel/bgcolor-t.txt");
- }
- else {
- if (isset($maj_right_panel_bgcolor_t)) {
- unset($maj_right_panel_bgcolor_t);
- }
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_right_panel/bgcolor-c.txt")) {
- $maj_right_panel_bgcolor_c = file_get_contents("$maj_data_directory/panels/$maj_right_panel/bgcolor-c.txt");
- }
- else {
- if (isset($maj_right_panel_bgcolor_c)) {
- unset($maj_right_panel_bgcolor_c);
- }
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_right_panel/text-t.txt")) {
- $maj_right_panel_text_t = file_get_contents("$maj_data_directory/panels/$maj_right_panel/text-t.txt");
- }
- else {
- if (isset($maj_right_panel_text_t)) {
- unset($maj_right_panel_text_t);
- }
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_right_panel/text-c.txt")) {
- $maj_right_panel_text_c = file_get_contents("$maj_data_directory/panels/$maj_right_panel/text-c.txt");
- }
- else {
- if (isset($maj_right_panel_text_c)) {
- unset($maj_right_panel_text_c);
- }
- }
-
- echo '<div class="panel_wrapper"><div class="panel_title"';
-
- if (isset($maj_right_panel_border) or isset($maj_right_panel_bgcolor_t) or isset($maj_right_panel_text_t)) {
- echo ' style="';
- }
-
- if (isset($maj_right_panel_bgcolor_t)) {
- echo "background-color: $maj_right_panel_bgcolor_t;";
- }
-
- if (isset($maj_right_panel_text_t)) {
- echo "color: $maj_right_panel_text_t;";
- }
-
- if (isset($maj_right_panel_border)) {
- echo "border-color: $maj_right_panel_border;";
- }
-
- if (isset($maj_right_panel_border) or isset($maj_right_panel_bgcolor_t) or isset($maj_right_panel_text_t)) {
- echo '"';
- }
-
- echo '>';
-
- readfile("$maj_data_directory/panels/$maj_right_panel/title.txt");
-
- if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
- echo "<a href=\"panels.php#{$maj_right_panel}\">";
- echo '<img src="images/widget.edit.png" border="0" width="11" height="11" align="right"></a>';
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_right_panel/private.txt")) {
- echo '<img src="images/widget.private.png" border="0" width="11" height="11" align="right">';
- }
-
- echo '</div>';
-
- echo '<div class="panel_body"';
-
- if (isset($maj_right_panel_border) or isset($maj_right_panel_bgcolor_c) or isset($maj_right_panel_text_c)) {
- echo ' style="';
- }
-
- if (isset($maj_right_panel_bgcolor_c)) {
- echo "background-color: $maj_right_panel_bgcolor_c;";
- }
-
- if (isset($maj_right_panel_text_c)) {
- echo "color: $maj_right_panel_text_c;";
- }
-
- if (isset($maj_right_panel_border)) {
- echo "border-color: $maj_right_panel_border;";
- }
-
- if (isset($maj_right_panel_border) or isset($maj_right_panel_bgcolor_c) or isset($maj_right_panel_text_c)) {
- echo '"';
- }
-
- echo '>';
- }
-
- if (file_exists("$maj_data_directory/panels/$maj_right_panel/free.txt")) {
- echo '<div class=panel_free>';
- }
-
- include("$maj_data_directory/panels/$maj_right_panel/panel.php");
-
- echo '</div></div>';
-
- if (file_exists("$maj_data_directory/panels/$maj_right_panel/free.txt") and !file_exists("$maj_data_directory/panels/$maj_right_panel/nomargin.txt")) {
- echo "<div style=\"height: {$maj_wspace}px;\"></div>";
- }
- }
-}
+maj_panels($maj_right_panels);
if ($maj_count_latest > 0) {