Permalink
Browse files

move misc functions to class file

  • Loading branch information...
1 parent 20ec8de commit 9c3ab95f265939792b2f4edecf3c46a11ed04ad5 @rwchhs rwchhs committed Aug 9, 2014
View
@@ -9,7 +9,7 @@
require_once('./includes/header.php');
if (isset($_COOKIE["user_env"]) && isset($_COOKIE["uniquekey_env"]) && isset($_COOKIE["power_env"]) && isset($_COOKIE["id_env"])) {
if ($tdb->is_logged_in() && $_COOKIE["power_env"] >= 3) {
- echoTableHeading(str_replace($_CONFIG["where_sep"], $_CONFIG["table_sep"], $where), $_CONFIG);
+ MiscFunctions::echoTableHeading(str_replace($_CONFIG["where_sep"], $_CONFIG["table_sep"], $where), $_CONFIG);
echo "
<tr>
<th>Admin Options</th>
@@ -18,7 +18,7 @@
<td class='area_2' style='padding:20px;' valign='top'>";
require_once("admin_navigation.php");
echo "</td></tr>";
- echoTableFooter(SKIN_DIR);
+ MiscFunctions::echoTableFooter(SKIN_DIR);
}
else echo "<div class='alert'><div class='alert_text'>
<strong>Access Denied!!</strong></div><div style='padding:4px;'>You are not authorized to be here.</div></div>";
View
@@ -12,9 +12,9 @@
echo "
<div class='alert'><div class='alert_text'>
<strong>Access Denied!</strong></div><div style='padding:4px;'>you are not logged in!</div></div>";
- redirect("login.php?ref=admin_badwords.php", 2);
+ MiscFunctions::redirect("login.php?ref=admin_badwords.php", 2);
}
-if (!$tdb->is_logged_in() || $_COOKIE["power_env"] < 3) exitPage("
+if (!$tdb->is_logged_in() || $_COOKIE["power_env"] < 3) MiscFunctions::exitPage("
<div class='alert'><div class='alert_text'>
<strong>Access Denied!</strong></div><div style='padding:4px;'>you are not authorized to be here.</div></div>");
if ($_GET["action"] == "delete" && $_GET["word"] != "") {
@@ -32,10 +32,10 @@
$config_tdb->editVars('config', array('banned_words' => $words));
echo "Done!</div>
</div>";
- redirect("admin_badwords.php", 1);
+ MiscFunctions::redirect("admin_badwords.php", 1);
} else print 'Could not delete "'.$_GET['word'].'"</div></div>';
- } elseif($_POST["verify"] == "Cancel") redirect("admin_badwords.php", 1);
- else ok_cancel("admin_badwords.php?action=delete&word=".$_GET["word"], "Are you sure you want to remove the <b>".$_GET["word"]."</b> from the filter list?");
+ } elseif($_POST["verify"] == "Cancel") MiscFunctions::redirect("admin_badwords.php", 1);
+ else MiscFunctions::ok_cancel("admin_badwords.php?action=delete&word=".$_GET["word"], "Are you sure you want to remove the <b>".$_GET["word"]."</b> from the filter list?");
} elseif($_GET["action"] == "addnew") {
if ($_POST["newword"] != "") {
echo "
@@ -47,10 +47,10 @@
$config_tdb->editVars('config', array('banned_words' => $words));
echo "Done!</div>
</div>";
- redirect("admin_badwords.php", 1);
+ MiscFunctions::redirect("admin_badwords.php", 1);
} else {
echo "<form action='admin_badwords.php?action=addnew' method=POST>";
- echoTableHeading("Adding a filtered word", $_CONFIG);
+ MiscFunctions::echoTableHeading("Adding a filtered word", $_CONFIG);
echo "
<tr>
<th colspan='2'>Add the word you wish to be censored below</th>
@@ -65,13 +65,13 @@
<tr>
<td class='footer_3a' colspan='2' style='text-align:center;'><input type='submit' value='Add'></td>
</tr>";
- echoTableFooter(SKIN_DIR);
+ MiscFunctions::echoTableFooter(SKIN_DIR);
echo "</form>";
}
} else {
$words = explode(",", $_CONFIG['banned_words']);
- echoTableHeading(str_replace($_CONFIG["where_sep"], $_CONFIG["table_sep"], $where), $_CONFIG);
+ MiscFunctions::echoTableHeading(str_replace($_CONFIG["where_sep"], $_CONFIG["table_sep"], $where), $_CONFIG);
echo "
<tr>
<th>Admin Panel Navigation</th>
@@ -82,15 +82,15 @@
require_once("admin_navigation.php");
echo "</td>
</tr>";
- echoTableFooter(SKIN_DIR);
+ MiscFunctions::echoTableFooter(SKIN_DIR);
echo "
<div id='tabstyle_2'>
<ul>
<li><a href='admin_badwords.php?action=addnew' title='Add a new word?'><span>Add a new word?</span></a></li>
</ul>
</div>
<div style='clear:both;'></div>";
- echoTableHeading("Filtered Words", $_CONFIG);
+ MiscFunctions::echoTableHeading("Filtered Words", $_CONFIG);
echo "
<tr>
<th style='width:65%;'>Word</th>
@@ -110,7 +110,7 @@
</tr>";
}
}
- echoTableFooter(SKIN_DIR);
+ MiscFunctions::echoTableFooter(SKIN_DIR);
}
require_once("./includes/footer.php");
?>
View
@@ -27,10 +27,10 @@
echo "Done!</div>
</div>";
- redirect("admin_banuser.php", 1);
+ MiscFunctions::redirect("admin_banuser.php", 1);
} else {
- echoTableHeading(str_replace($_CONFIG["where_sep"], $_CONFIG["table_sep"], $where), $_CONFIG);
+ MiscFunctions::echoTableHeading(str_replace($_CONFIG["where_sep"], $_CONFIG["table_sep"], $where), $_CONFIG);
echo "
<tr>
@@ -43,11 +43,11 @@
require_once("admin_navigation.php");
echo "</td>
</tr>";
- echoTableFooter(SKIN_DIR);
+ MiscFunctions::echoTableFooter(SKIN_DIR);
echo "<form action='admin_banuser.php?action=edit&word=".((isset($_POST["word"])) ? $_POST['word'] : $_GET['word'])."' method=POST>";
- echoTableHeading("Changing banned username", $_CONFIG);
+ MiscFunctions::echoTableHeading("Changing banned username", $_CONFIG);
echo "
<tr>
@@ -63,7 +63,7 @@
<tr>
<td class='footer_3a' colspan='2' style='text-align:center;'><input type=submit value='Edit'></td>
</tr>";
- echoTableFooter(SKIN_DIR);
+ MiscFunctions::echoTableFooter(SKIN_DIR);
echo "</form>";
}
} else {
@@ -84,13 +84,13 @@
fclose($f);
echo "Done!</div>
</div>";
- if($_POST["ref"] != "") redirect($_POST["ref"], 1);
- else redirect("admin_banuser.php", 1);
+ if($_POST["ref"] != "") MiscFunctions::redirect($_POST["ref"], 1);
+ else MiscFunctions::redirect("admin_banuser.php", 1);
} elseif($verify == "Cancel") {
- if($_POST["ref"] != "") redirect($_POST["ref"], 1);
- else redirect("admin_banuser.php", 1);
+ if($_POST["ref"] != "") MiscFunctions::redirect($_POST["ref"], 1);
+ else MiscFunctions::redirect("admin_banuser.php", 1);
} else {
- ok_cancel("admin_banuser.php?action=delete&word=".$_GET["word"], "Are you sure you want to delete <b>".$_GET["word"]."</b> from the banned users list?<input type='hidden' name='ref' value='".$_GET["ref"]."'>");
+ MiscFunctions::ok_cancel("admin_banuser.php?action=delete&word=".$_GET["word"], "Are you sure you want to delete <b>".$_GET["word"]."</b> from the banned users list?<input type='hidden' name='ref' value='".$_GET["ref"]."'>");
}
} elseif($_GET["action"] == "addnew") {
//add new user
@@ -113,11 +113,11 @@
fclose($f);
echo "Done!</div>
</div>";
- if($_POST["ref"] != "") redirect($_POST["ref"], 1);
- else redirect("admin_banuser.php", 1);
+ if($_POST["ref"] != "") MiscFunctions::redirect($_POST["ref"], 1);
+ else MiscFunctions::redirect("admin_banuser.php", 1);
} else {
- echoTableHeading(str_replace($_CONFIG["where_sep"], $_CONFIG["table_sep"], $where), $_CONFIG);
+ MiscFunctions::echoTableHeading(str_replace($_CONFIG["where_sep"], $_CONFIG["table_sep"], $where), $_CONFIG);
echo "
<tr>
@@ -130,11 +130,11 @@
require_once("admin_navigation.php");
echo "</td>
</tr>";
- echoTableFooter(SKIN_DIR);
+ MiscFunctions::echoTableFooter(SKIN_DIR);
echo "<form action='admin_banuser.php?action=addnew' method=POST><input type='hidden' name='ref' value='".$_GET["ref"]."'>";
- echoTableHeading("Banning a member", $_CONFIG);
+ MiscFunctions::echoTableHeading("Banning a member", $_CONFIG);
echo "
<tr>
@@ -150,14 +150,14 @@
<tr>
<td class='footer_3a' colspan='2' style='text-align:center;'><input type=submit value='Add to ban list'></td>
</tr>";
- echoTableFooter(SKIN_DIR);
+ MiscFunctions::echoTableFooter(SKIN_DIR);
echo "</form>";
}
}
} else {
$list = explode("\n", file_get_contents(DB_DIR."/banneduser.dat"));
- echoTableHeading(str_replace($_CONFIG["where_sep"], $_CONFIG["table_sep"], $where), $_CONFIG);
+ MiscFunctions::echoTableHeading(str_replace($_CONFIG["where_sep"], $_CONFIG["table_sep"], $where), $_CONFIG);
echo "
<tr>
@@ -170,7 +170,7 @@
require_once("admin_navigation.php");
echo "</td>
</tr>";
- echoTableFooter(SKIN_DIR);
+ MiscFunctions::echoTableFooter(SKIN_DIR);
echo "
<div id='tabstyle_2'>
@@ -180,7 +180,7 @@
</div>
<div style='clear:both;'></div>";
- echoTableHeading("Manage banned users", $_CONFIG);
+ MiscFunctions::echoTableHeading("Manage banned users", $_CONFIG);
echo "
<tr>
@@ -200,7 +200,7 @@
</tr>";
}
}
- echoTableFooter(SKIN_DIR);
+ MiscFunctions::echoTableFooter(SKIN_DIR);
}
} else {
echo "
@@ -211,7 +211,7 @@
echo "
<div class='alert'><div class='alert_text'>
<strong>Caution!</strong></div><div style='padding:4px;'>You are not logged in!.</div></div>";
- redirect("login.php?ref=admin_basuser.php", 2);
+ MiscFunctions::redirect("login.php?ref=admin_basuser.php", 2);
}
require_once("./includes/footer.php");
@@ -8,7 +8,7 @@
$where = "<a href='admin.php'>Admin</a> ".$_CONFIG["where_sep"]." Checking for updates";
require_once('./includes/header.php');
if ($tdb->is_logged_in() && $_COOKIE["power_env"] >= 3) {
- echoTableHeading(str_replace($_CONFIG["where_sep"], $_CONFIG["table_sep"], $where), $_CONFIG);
+ MiscFunctions::echoTableHeading(str_replace($_CONFIG["where_sep"], $_CONFIG["table_sep"], $where), $_CONFIG);
echo "
<tr>
<th>Admin Panel Navigation</th>
@@ -19,13 +19,13 @@
require_once("admin_navigation.php");
echo "</td>
</tr>";
- echoTableFooter(SKIN_DIR);
- echoTableHeading("Checking for myUPB updates", $_CONFIG);
+ MiscFunctions::echoTableFooter(SKIN_DIR);
+ MiscFunctions::echoTableHeading("Checking for myUPB updates", $_CONFIG);
echo "
<tr>
<td class='review_container'><div class='review_sub'><iframe src='http://www.myupb.com/upbcheckupdate.php?ver=".UPB_VERSION."' class='review_frame' scrolling='auto' frameborder='0'></iframe></div></td>
</tr>";
- echoTableFooter(SKIN_DIR);
+ MiscFunctions::echoTableFooter(SKIN_DIR);
} else {
echo "
<div class='alert'><div class='alert_text'>
View
@@ -30,11 +30,11 @@
<div class='alert'><div class='alert_text'>
<strong>Error!</strong></div><div style='padding:4px;'>Edit Failed.</div></div>";
require_once("./includes/footer.php");
- redirect($PHP_SELF."?action=".$_POST["action"], 2);
+ MiscFunctions::redirect($PHP_SELF."?action=".$_POST["action"], 2);
die();
}
- echoTableHeading(str_replace($_CONFIG["where_sep"], $_CONFIG["table_sep"], $where), $_CONFIG);
+ MiscFunctions::echoTableHeading(str_replace($_CONFIG["where_sep"], $_CONFIG["table_sep"], $where), $_CONFIG);
echo "
<tr>
@@ -47,7 +47,7 @@
require_once("admin_navigation.php");
echo "</td>
</tr>";
- echoTableFooter(SKIN_DIR);
+ MiscFunctions::echoTableFooter(SKIN_DIR);
echo "<a name='skip_nav'>&nbsp;</a>
<div id='tabstyle_2'>
@@ -64,10 +64,10 @@
$minicats = $config_tdb->fetchMiniCategories($_GET['action']);
$configVars = $config_tdb->getVars($_GET["action"], true);
- //dump($configVars);
+ //MiscFunctions::dump($configVars);
echo "<form action=\"admin_config.php?action=".$_GET["action"]."\" method='POST' name='form'><input type='hidden' name='action' value='".$_GET["action"]."'>";
- echoTableHeading("&nbsp;", $_CONFIG);
+ MiscFunctions::echoTableHeading("&nbsp;", $_CONFIG);
while(list($minicat_id, $minicat_title) = each($minicats)) {
echo "
<tr>
@@ -163,7 +163,7 @@
echo "<input type=submit value='Submit'>";
echo "</td>
</tr>";
- echoTableFooter(SKIN_DIR);
+ MiscFunctions::echoTableFooter(SKIN_DIR);
echo "</form>";
/*
Oops, something went wrong.

0 comments on commit 9c3ab95

Please sign in to comment.