Permalink
Browse files

Update MyUpb with DrKitarisu's Repo

Download DrKitarisu's Repo as zip and update this now
with the last Troubleshooting  DrKitarisu'S timezone settings, my
Errorreporting and ConfigSettings update,
because Doc' can't push his update , get well soon !!
Best Regards
Blacky
  • Loading branch information...
1 parent 789a65b commit 3f4519da36a1e9d57f7cd9aebdd9025f71f985ee @blackcrack blackcrack committed Sep 6, 2014
Showing 887 changed files with 35,223 additions and 7,455 deletions.
View
@@ -1,29 +1,15 @@
<?php
-// Ultimate PHP Board
-// Author: Tim Hoeppner aka RR_Pilot, FixITguy
-// Website: http://www.myupb.com
-// Version: 2.0
-// Using textdb Version: 4.3.2
-require_once("./includes/upb.initialize.php");
-$where = "Admin Panel";
+/**
+ * This file sets the main administration view up and displays it.
+ *
+ * @author Tim Hoeppner
+ * @author FixITguy
+ * @author Rouven Wachhaus <rouven@wachhaus.xyz>
+ * @license https://creativecommons.org/licenses/by-nc-sa/3.0/
+ * @version 2.2.7
+ */
+require_once('./includes/upb.initialize.php');
+$where = 'Admin Panel';
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) {
- MiscFunctions::echoTableHeading(str_replace($_CONFIG["where_sep"], $_CONFIG["table_sep"], $where), $_CONFIG);
- echo "
- <tr>
- <th>Admin Options</th>
- </tr>
- <tr>
- <td class='area_2' style='padding:20px;' valign='top'>";
- require_once("admin_navigation.php");
- echo "</td></tr>";
- 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>";
-}
-else echo "<div class='alert'><div class='alert_text'>
-<strong>Step Five Failed!</strong></div><div style='padding:4px;'>You are not logged in or not authorized to be here.<meta http-equiv='refresh' content='2;URL=login.php?ref=admin.php'></div></div>";
-require_once("./includes/footer.php");
-?>
+
+echo $twig->render('admin/_main.twig', array('_COOKIE' => $_COOKIE, 'tdb' => $tdb, 'SKIN_DIR' => SKIN_DIR, 'UPB_VERSION' => UPB_VERSION));
View
@@ -1,116 +1,45 @@
<?php
-// Ultimate PHP Board
-// Author: Tim Hoeppner aka RR_Pilot, FixITguy
-// Website: http://www.myupb.com
-// Version: 2.0
-// Using textdb Version: 4.3.2
-require_once("./includes/upb.initialize.php");
-$words = array();
-$where = "<a href='admin.php'>Admin</a> ".$_CONFIG["where_sep"]." <a href='admin_badwords.php'>Manage Filtered Language</a>";
+/**
+ * This file sets the administrative bad word filter up and displays its view.
+ *
+ * @author Tim Hoeppner
+ * @author FixITguy
+ * @author Rouven Wachhaus <rouven@wachhaus.xyz>
+ * @license https://creativecommons.org/licenses/by-nc-sa/3.0/
+ * @version 2.2.7
+ */
+require_once('./includes/upb.initialize.php');
+$where = '<a href="admin.php">Admin</a> ' . $_CONFIG['where_sep'] . ' <a href="admin_badwords.php">Manage Filtered Language</a>';
require_once('./includes/header.php');
-if (!(isset($_COOKIE["user_env"]) && isset($_COOKIE["uniquekey_env"]) && isset($_COOKIE["power_env"]) && isset($_COOKIE["id_env"]))) {
- echo "
- <div class='alert'><div class='alert_text'>
- <strong>Access Denied!</strong></div><div style='padding:4px;'>you are not logged in!</div></div>";
- MiscFunctions::redirect("login.php?ref=admin_badwords.php", 2);
-}
-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"] != "") {
- if ($_POST["verify"] == "Ok") {
- echo "
- <div class='alert_confirm'>
- <div class='alert_confirm_text'>
- <strong>Redirecting:</div><div style='padding:4px;'>
- deleting bad word...
- ";
- $words = explode(",", $_CONFIG['banned_words']);
- if (($index = array_search($_GET["word"], $words)) !== FALSE) {
- unset($words[$index]);
- $words = implode(',', $words);
- $config_tdb->editVars('config', array('banned_words' => $words));
- echo "Done!</div>
- </div>";
- MiscFunctions::redirect("admin_badwords.php", 1);
- } else print 'Could not delete "'.$_GET['word'].'"</div></div>';
- } 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 "
- <div class='alert_confirm'>
- <div class='alert_confirm_text'>
- <strong>Redirecting:</div><div style='padding:4px;'>
- adding new word...";
- $words = $_CONFIG['banned_words'] . ((strlen($_CONFIG['banned_words']) == 0) ? '' : ',') . htmlentities(stripslashes(trim($_POST['newword'])));
- $config_tdb->editVars('config', array('banned_words' => $words));
- echo "Done!</div>
- </div>";
- MiscFunctions::redirect("admin_badwords.php", 1);
- } else {
- echo "<form action='admin_badwords.php?action=addnew' method=POST>";
- MiscFunctions::echoTableHeading("Adding a filtered word", $_CONFIG);
- echo "
- <tr>
- <th colspan='2'>Add the word you wish to be censored below</th>
- </tr>
- <tr>
- <td class='area_1' style='width:35%;padding:12px;'><strong>New filtered word</strong></td>
- <td class='area_2'><input type='text' name='newword' size='20'></td>
- </tr>
- <tr>
- <td class='footer_3' colspan='2'><img src='./skins/default/images/spacer.gif' alt='' title='' /></td>
- </tr>
- <tr>
- <td class='footer_3a' colspan='2' style='text-align:center;'><input type='submit' value='Add'></td>
- </tr>";
- MiscFunctions::echoTableFooter(SKIN_DIR);
- echo "</form>";
- }
+
+if ($_GET['action'] == 'delete' && $_GET['word'] != '') {
+ $words = array();
+
+ if ($_POST['verify'] == 'Ok') {
+ $words = explode(',', $_CONFIG['banned_words']);
+
+ if (($index = array_search($_GET['word'], $words)) !== false) {
+ unset($words[$index]);
+ $words = implode(',', $words);
+ $config_tdb->editVars('config', array('banned_words' => $words));
+ }
+ }
+
+ echo $twig->render('admin/badwords_delete.twig', array('words' => $words, '_COOKIE' => $_COOKIE, 'tdb' => $tdb,
+ '_POST' => $_POST, '_GET' => $_GET, 'SKIN_DIR' => SKIN_DIR, 'UPB_VERSION' => UPB_VERSION));
+} elseif($_GET['action'] == 'addnew') {
+ $words = array();
+
+ if ($_POST['newword'] != '') {
+ $words = $_CONFIG['banned_words'] . ((strlen($_CONFIG['banned_words']) == 0) ? '' : ',') . htmlentities(stripslashes(trim($_POST['newword'])));
+ $config_tdb->editVars('config', array('banned_words' => $words));
+ }
+
+ echo $twig->render('admin/badwords_add.twig', array('words' => $words, '_COOKIE' => $_COOKIE, 'tdb' => $tdb,
+ '_POST' => $_POST, '_GET' => $_GET, 'SKIN_DIR' => SKIN_DIR, 'UPB_VERSION' => UPB_VERSION));
} else {
+ $words = explode(',', $_CONFIG['banned_words']);
- $words = explode(",", $_CONFIG['banned_words']);
- MiscFunctions::echoTableHeading(str_replace($_CONFIG["where_sep"], $_CONFIG["table_sep"], $where), $_CONFIG);
- echo "
- <tr>
- <th>Admin Panel Navigation</th>
- </tr>";
- echo "
- <tr>
- <td class='area_2' style='padding:20px;' valign='top'>";
- require_once("admin_navigation.php");
- echo "</td>
- </tr>";
- 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>";
- MiscFunctions::echoTableHeading("Filtered Words", $_CONFIG);
- echo "
- <tr>
- <th style='width:65%;'>Word</th>
- <th>Option</th>
- </tr>";
- if (count($words) == 0) {
- echo "
- <tr>
- <td class='area_2' style='text-align:center;font-weight:bold;padding:12px;line-height:20px;' colspan='2'>No words found</td>
- </tr>";
- } else {
- for($i = 0; $i < count($words); $i++) {
- echo "
- <tr>
- <td class='area_1' style='padding:8px;'><strong>$words[$i]</strong></td>
- <td class='area_2' style='padding:8px;'><a href='admin_badwords.php?action=delete&word=$words[$i]'>Delete</a></td>
- </tr>";
- }
- }
- MiscFunctions::echoTableFooter(SKIN_DIR);
-}
-require_once("./includes/footer.php");
-?>
+ echo $twig->render('admin/badwords.twig', array('words' => $words, '_COOKIE' => $_COOKIE, 'tdb' => $tdb,
+ 'SKIN_DIR' => SKIN_DIR, 'UPB_VERSION' => UPB_VERSION));
+}
Oops, something went wrong.

0 comments on commit 3f4519d

Please sign in to comment.