<?php // configuration require_once "../includes/config.php"; $utrend = get_active_trend(); $atrend = get_active_admin_trend(); $rtrend = get_new_regs_trend(); render_mult(["admin_common.php", "admin_dash_trends.php"], ["title" => $title . " - Dashboard", "utrend" => $utrend, "atrend" => $atrend, "rtrend" => $rtrend]);
<?php // configuration require_once "../includes/config.php"; if (isset($_POST["user_to_ban"])) { if (!isset($_POST["ban_reason"])) { apologize("Must provide a reason for the ban."); } if (ban_from_soc($_POST["user_to_ban"], $soc, $_POST["ban_reason"]) === false) { apologize("Something went wrong."); } } elseif (isset($_POST["user_to_unban"])) { if (!isset($_POST["unban_reason"])) { apologize("Must provide a reason for the ban."); } if (unban_from_soc($_POST["user_to_unban"], $soc, $_POST["unban_reason"]) === false) { apologize("Something went wrong."); } } // assoc array $bans = get_soc_bans($soc); render_mult(["soc_common.php", "mod_common.php", "soc_bans.php"], ["title" => $title . " - Banned users", "bans" => $bans, "soc" => $soc, "status" => $status]);
<?php // configuration require_once "../includes/config.php"; if (isset($_POST["user_to_mod"])) { if (!isset($_POST["mod_reason"])) { apologize("Must provide a reason for the promotion."); } if (make_mod($_POST["user_to_mod"], $soc, $_POST["mod_reason"]) === false) { apologize("Something went wrong."); } } elseif (isset($_POST["user_to_demod"])) { if (!isset($_POST["demod_reason"])) { apologize("Must provide a reason for the demotion."); } if (del_mod($_POST["user_to_demod"], $soc, $_POST["demod_reason"]) === false) { apologize("Something went wrong."); } } // assoc array $mods = get_mod_list($soc); render_mult(["soc_common.php", "mod_common.php", "soc_mods.php"], ["title" => $title . " - View Moderators", "mods" => $mods, "soc" => $soc, "status" => $status]);
<?php // configuration require_once "../includes/config.php"; $log = get_mod_log($soc); render_mult(["soc_common.php", "mod_common.php", "mod_log.php"], ["title" => $title . " - Mod Log", "log" => $log, "soc" => $soc, "status" => $status]);
<?php // configuration require_once "../includes/config.php"; $regs = get_new_registrations(30); // $regs = ($regs); render_mult(["jq.php"], ["title" => "jq", "regs" => $regs]);
<?php require_once "../includes/config.php"; if ($_SERVER["REQUEST_METHOD"] == "POST") { session_start(); if (edit_soc_info($_POST["soc_id"], $_POST["info"]) === false) { apologize("Failed to make edit."); } redirect("soc.php?soc=" . $_POST["soc_name"]); } else { $hist = get_soc_edit_history($soc["soc_id"]); render_mult(["soc_common.php", "soc_info.php"], ["title" => "About " . $soc["soc_name"], "soc" => $soc, "status" => $status, "hist" => $hist]); }
<?php // configuration require_once "../includes/config.php"; // assoc array $reps = get_user_reports(); render_mult(["admin_common.php", "user_reps.php"], ["title" => $title . " - Reported users", "reps" => $reps]);
<?php $subs = get_subbed_socs(); $msubs = get_modded_socs(); render_mult(["user_common.php", "usocs.php"], ["title" => $u["username"] . "'s Profile", "subs" => $subs, "msubs" => $msubs, "pg" => "user.php?u=" . $u["username"], "self" => $self]);
<?php // configuration require_once "../includes/config.php"; // assoc array $reps = get_post_reports($soc["soc_id"]); render_mult(["soc_common.php", "mod_common.php", "post_reps.php"], ["title" => $title . " - Reported Posts", "reps" => $reps, "soc" => $soc, "status" => $status]);
<?php // configuration require_once "../includes/config.php"; // assoc array $reps = get_soc_reports(); render_mult(["admin_common.php", "soc_reps.php"], ["title" => $title . " - Reported societies", "reps" => $reps]);
<?php // require("../includes/config.php"); $pms = get_inbox(); render_mult(["user_common.php", "inbox.php"], ["title" => $u["username"] . "'s Inbox", "pg" => "user.php?u=" . $u["username"], "self" => $self, "u" => $u, "pms" => $pms]);
<?php if (isset($_POST["soc_to_lock"])) { if (!isset($_POST["lock_reason"])) { apologize("Must provide a reason for the lock."); } if (lock_soc($_POST["soc_to_lock"], $_POST["lock_reason"]) === false) { apologize("Something went wrong."); } } elseif (isset($_POST["soc_to_unlock"])) { if (!isset($_POST["unlock_reason"])) { apologize("Must provide a reason for the lock."); } if (unlock_soc($_POST["soc_to_unlock"], $_POST["unlock_reason"]) === false) { apologize("Something went wrong."); } } // configuration require_once "../includes/config.php"; $locks = get_locked_socs(); render_mult(["admin_common.php", "soc_locks.php"], ["title" => $title . " - Admin Log", "locks" => $locks]);
<?php if (isset($_POST["user_to_ban"])) { if (!isset($_POST["ban_reason"])) { apologize("Must provide a reason for the ban."); } if (ban_user($_POST["user_to_ban"], $_POST["ban_reason"]) === false) { apologize("Something went wrong."); } } elseif (isset($_POST["user_to_unban"])) { if (!isset($_POST["unban_reason"])) { apologize("Must provide a reason for the ban."); } if (unban_user($_POST["user_to_unban"], $_POST["unban_reason"]) === false) { apologize("Something went wrong."); } } // assoc array $bans = get_site_bans(); render_mult(["admin_common.php", "user_bans.php"], ["title" => $title . " - Banned users", "bans" => $bans]);
<?php // configuration require_once "../includes/config.php"; $atrend = get_active_trend_soc($soc["soc_id"]); $strend = get_subs_trend($soc["soc_id"]); $ctrend = get_comms_trend($soc["soc_id"]); $ptrend = get_posts_trend($soc["soc_id"]); render_mult(["soc_common.php", "mod_common.php", "mod_dash_trends.php"], ["title" => $title . " - Dashboard", "soc" => $soc, "status" => $status, "atrend" => $atrend, "strend" => $strend, "ctrend" => $ctrend, "ptrend" => $ptrend]);
<?php // configuration require_once "../includes/config.php"; $active = get_active_users_soc($soc["soc_id"]); $atrend = get_active_trend_soc($soc["soc_id"]); // $mods = get_active_mods($soc["soc_id"]); $subs = get_new_subs_today($soc["soc_id"]); $comms = get_comms_today($soc["soc_id"]); $posts = get_posts_today($soc["soc_id"]); render_mult(["soc_common.php", "mod_common.php", "mod_dash.php"], ["title" => $title . " - Dashboard", "soc" => $soc, "status" => $status, "active" => $active, "atrend" => $atrend, "subs" => $subs, "comms" => $comms, "posts" => $posts]);
<?php // configuration require_once "../includes/config.php"; if (isset($_POST["user_to_admin"])) { if (!isset($_POST["admin_reason"])) { apologize("Must provide a reason for the promotion."); } if (make_admin($_POST["user_to_admin"], $_POST["admin_reason"]) === false) { apologize("Something went wrong."); } } elseif (isset($_POST["user_to_deadmin"])) { if (!isset($_POST["deadmin_reason"])) { apologize("Must provide a reason for the demotion."); } if (del_admin($_POST["user_to_deadmin"], $_POST["deadmin_reason"]) === false) { apologize("Something went wrong."); } } // assoc array $admins = get_admin_list(); render_mult(["admin_common.php", "admins.php"], ["title" => $title . " - View Admins", "admins" => $admins]);
<?php // configuration require_once "../includes/config.php"; $posts = get_del_posts($soc); render_mult(["soc_common.php", "mod_common.php", "del_posts.php"], ["title" => $title . " - Mod Log", "posts" => $posts, "soc" => $soc, "status" => $status]);
<?php require "soc_common.php"; if (isset($_GET["pid"])) { // fetch post $post = get_post($_GET["pid"]); if (!$post || $post["status"] == "DELETED") { apologize("Nothing here!"); } if ($post["soc_id"] != $soc["soc_id"]) { redirect("post.php?pid=" . $_GET["pid"] . "&soc=" . get_society_by_id($post["soc_id"])["soc_name"]); } // register post view register_post_view($post["post_id"]); if (isset($_GET["paction"])) { if (strcasecmp($_GET["paction"], "sub")) { post_sub($post["post_id"]); } elseif (strcasecmp($_GET["paction"], "unsub")) { post_unsub($post["post_id"]); } } // fetch comments $comms = get_comments($post); render_mult(["soc_common.php", "post.php"], ["title" => $post["title"] . " - " . $soc["soc_name"], "post" => $post, "soc" => $soc, "status" => soc_rel($soc), "psub" => post_rel($post["post_id"]), "comms" => $comms]); } else { redirect("soc.php?soc=" . $soc["soc_name"]); }
<?php require "soc_common.php"; if (isset($_GET["view"]) && strcasecmp($_GET["view"], "info") == 0) { require "soc_info.php"; exit; } // fetch posts $posts = get_posts($soc, isset($_GET["page"]) ? $_GET["page"] : 0, 10); render_mult(["soc_common.php", "soc_front.php"], ["title" => $soc["soc_name"], "posts" => $posts, "soc" => $soc, "status" => $status]);
<?php // configuration require_once "../includes/config.php"; $log = get_admin_log(); render_mult(["admin_common.php", "admin_log.php"], ["title" => $title . " - Admin Log", "log" => $log]);
<?php $posts = get_post_hist($u); render_mult(["user_common.php", "uphist.php"], ["title" => $u["username"] . "'s Profile", "posts" => $posts, "pg" => "user.php?u=" . $u["username"], "self" => $self, "u" => $u]);
<?php $score = get_user_score($u["user_id"]); render_mult(["user_common.php", "profile.php"], ["title" => $u["username"] . "'s Profile", "u" => $u, "pg" => "user.php?u=" . $u["username"], "self" => $self, "u" => $u, "pscore" => $score["pscore"], "cscore" => $score["cscore"]]);
<?php // configuration require "../includes/config.php"; verify_access(); if (empty($_POST)) { render_mult(["change_passfm.php"], ["title" => "Change Password"]); } else { if ($_SERVER["REQUEST_METHOD"] != "POST") { redirect("index.php"); } // if form was submitted... // validate submission if (empty($_POST["old_pass"])) { apologize("You must provide your current password."); } if (empty($_POST["new_pass"])) { apologize("You must provide a new password."); } if (empty($_POST["confirmation"])) { apologize("You must confirm your new password."); } if ($_POST["new_pass"] != $_POST["confirmation"]) { apologize("Password and confirmation do not match."); } // compare hash of user's input against the old hash if (!password_verify($_POST["old_pass"], $_SESSION["user"]["password"])) { apologize("Invalid username and/or password."); } if (tquery(" \tUPDATE users\n\t\t\t\t\t\tSET password = ?\n\t\t\t\t\t\tWHERE user_id = ?", [password_hash($_POST["new_pass"], PASSWORD_DEFAULT), $_SESSION["user"]["user_id"]]) === false) { apologize("Failed to change password.");
<?php // configuration require_once "../includes/config.php"; $active = get_active_users(); $admins = get_active_admins(); $regs = get_new_regs_today(); $asocs = get_most_active_socs(); $gsocs = get_fastest_growing_socs(); render_mult(["admin_common.php", "admin_dash.php"], ["title" => $title . " - Dashboard", "active" => $active, "regs" => $regs, "admins" => $admins, "asocs" => $asocs, "gsocs" => $gsocs]);