示例#1
0
 public function save()
 {
     global $IP_ADDRESS;
     $returnVal = false;
     if ($this->objSignUpForm->validate()) {
         $newPassword = encryptPassword($_POST['password']);
         $arrColumns = array("username", "password", "password2", "email", "applydate", "ipaddress");
         $arrValues = array($_POST['username'], $newPassword['password'], $newPassword['salt'], $_POST['email'], time(), $IP_ADDRESS);
         if ($this->addNew($arrColumns, $arrValues)) {
             $result = $this->MySQL->query("SELECT appcomponent_id FROM " . $this->MySQL->get_tablePrefix() . "app_components ORDER BY ordernum DESC");
             while ($row = $result->fetch_assoc()) {
                 $this->objAppComponent->select($row['appcomponent_id']);
                 $this->objAppComponent->saveAppValue($this->intTableKeyValue);
             }
             $returnVal = true;
             $this->notifyManagers();
         }
     } else {
         $_POST = filterArray($_POST);
         if ($this->objSignUpForm->prefillValues) {
             $this->objSignUpForm->prefillPostedValues();
         }
         $_POST['submit'] = false;
     }
     return $returnVal;
 }
示例#2
0
文件: get.php 项目: pi-hole/AdminLTE
function filterArray(&$a)
{
    $sanArray = array();
    foreach ($a as $k => $v) {
        if (is_array($v)) {
            $sanArray[htmlspecialchars($k)] = filterArray($v);
        } else {
            $sanArray[htmlspecialchars($k)] = htmlspecialchars($v);
        }
    }
    return $sanArray;
}
示例#3
0
 public function dispPollMenu($memberObj)
 {
     global $MAIN_ROOT, $member;
     if ($this->intTableKeyValue != "" && $this->hasAccess($memberObj)) {
         $pollInfo = $this->get_info_filtered();
         $hideResultLink = $pollInfo['resultvisibility'] == "votedonly" && !$this->hasVoted($memberObj->get_info("member_id")) ? " style='display: none'" : "";
         $dispResultLink = "";
         if ($pollInfo['resultvisibility'] == "open" || $pollInfo['resultvisibility'] == "votedonly" || $pollInfo['resultvisibility'] == "pollend" && $pollInfo['pollend'] != 0 && $pollInfo['pollend'] < time()) {
             $dispResultLink = "<br><p class='main' id='pollResultsLink_" . $pollInfo['poll_id'] . "' align='center'" . $hideResultLink . "><a href='" . $MAIN_ROOT . "polls/view.php?pID=" . $pollInfo['poll_id'] . "'>View Results</a></p>";
         }
         echo "\n\t\t\t\t\t<div class='pollMenuDiv'>\n\t\t\t\t\t\t" . $pollInfo['question'] . "\n\t\t\t\t\t\t\n\t\t\t\t\t\t<div class='pollMenuOptionsDiv'>\n\t\t\t\t\t\t\t<form action=''>\n\t\t\t\t\t\t\t";
         $result = $this->MySQL->query("SELECT * FROM " . $this->MySQL->get_tablePrefix() . "poll_options WHERE poll_id = '" . $this->intTableKeyValue . "' ORDER BY sortnum");
         while ($row = $result->fetch_assoc()) {
             $row = filterArray($row);
             $inputType = $pollInfo['multivote'] == 1 ? "checkbox" : "radio";
             echo "\n\t\t\t\t\t\t<div class='pollMenuOption'><input type='" . $inputType . "' id='poll_" . $row['polloption_id'] . "' name='poll_" . $row['poll_id'] . "' value='" . $row['polloption_id'] . "'> <label for='poll_" . $row['polloption_id'] . "'>" . $row['optionvalue'] . "</label></div>\n\t\t\t\t\t\t<br>\n\t\t\t\t\t";
         }
         echo "\n\t\t\t\t\n\t\t\t\t\t\t\t<p align='center'>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t<input type='button' id='btnPollVote_" . $pollInfo['poll_id'] . "' class='submitButton' value='Vote'>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\n\t\t\t\t\t\t\t" . $dispResultLink . "\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t</form>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div id='pollDialog_" . $pollInfo['poll_id'] . "' style='display: none'></div>\n\t\t\t\t\t</div>\n\t\t\t\t\t\n\t\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\t\t\$('#document').ready(function() {\n\t\t\t\t\t\t\t\$('#btnPollVote_" . $pollInfo['poll_id'] . "').click(function() {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tvar objVotes = {};\n\t\t\t\t\t\t\t\t\$(\"input[name='poll_" . $pollInfo['poll_id'] . "']\").each(function(index) {\n\t\t\t\t\t\t\t\t\tif(\$(this).is(':checked')) {\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tobjVotes[\$(this).attr('id')] = \$(this).val();\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\$(\"input[name='poll_" . $pollInfo['poll_id'] . "']\").attr('checked', false);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tvar jsonVotes = JSON.stringify(objVotes);\n\t\t\t\t\t\t\t\tvar dialogHTML = \"\";\n\t\t\t\t\t\t\t\t\$.post('" . $MAIN_ROOT . "polls/vote.php', { pollID: '" . $pollInfo['poll_id'] . "', pollOptionID: jsonVotes }, function(data) {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\tpostData = JSON.parse(data);\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tif(postData['result'] == \"success\") {\n\t\t\t\t\t\t\t\t\t\t\tdialogHTML = \"Thank you for voting!\";\n\t\t\t\t\t\t\t\t\t\t";
         if ($pollInfo['resultvisibility'] == "votedonly") {
             echo "\n\t\t\t\t\t\t\t\t\t\t\t\tdialogHTML += \"<br><br>You may now view the <a href='" . $MAIN_ROOT . "polls/view.php?pID=" . $pollInfo['poll_id'] . "'><b>poll results</b></a>.\";\n\t\t\t\t\t\t\t\t\t\t\t\t\$('#pollResultsLink_" . $pollInfo['poll_id'] . "').show();\n\t\t\t\t\t\t\t\t\t\t\t";
         }
         echo "\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\tdialogHTML = \"Unable to vote due to the following reason:<br><br>\"+postData['errors'];\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcatch(err) {\n\t\t\t\t\t\t\t\t\t\tdialogHTML = \"You do not have permission to vote on this poll.\";\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\$('#pollDialog_" . $pollInfo['poll_id'] . "').html(\"<p align='center' class='main'>\"+dialogHTML+\"</p>\");\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\$('#pollDialog_" . $pollInfo['poll_id'] . "').dialog({\n\t\t\t\t\t\t\t\t\t\ttitle: 'Poll',\n\t\t\t\t\t\t\t\t\t\tzIndex: 999999,\n\t\t\t\t\t\t\t\t\t\tmodal: true,\n\t\t\t\t\t\t\t\t\t\tshow: 'scale',\n\t\t\t\t\t\t\t\t\t\twidth: 400,\n\t\t\t\t\t\t\t\t\t\tresizable: false,\n\t\t\t\t\t\t\t\t\t\tbuttons: {\n\t\t\t\t\t\t\t\t\t\t\t'Ok': function() {\n\t\t\t\t\t\t\t\t\t\t\t\t\$(this).dialog('close');\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t});\n\t\t\t\t\t</script>\n\t\t\t\t\t\n\t\t\t\t";
     } else {
         echo "\n\t\t\t\t\t<p class='main' align='center'>\n\t\t\t\t\t\tYou do not have permission to view this poll.<br><br>\n\t\t\t\t\t</p>\n\t\t\t\t";
     }
 }
示例#4
0
        $arrValues = array($_POST['playertwo'], $_POST['team1score'], $_POST['team2score'], $_POST['outcome'], $matchReplayURL);
        $tournamentObj->objMatch->select($matchInfo['tournamentmatch_id']);
        if ($tournamentObj->objMatch->update($arrColumns, $arrValues)) {
            if ($_POST['outcome'] != 0 && $matchInfo['nextmatch_id'] != 0) {
                $nextMatchSpot = $tournamentObj->getNextMatchTeamSpot($matchWinner);
                $tournamentObj->objMatch->select($matchInfo['nextmatch_id']);
                $tournamentObj->objMatch->update(array($nextMatchSpot), array($matchWinner));
            }
            echo "\n\t\t\t\n\t\t\t<div style='display: none' id='successBox'>\n\t\t\t<p align='center'>\n\t\t\tSuccessfully Updated Match</b>!\n\t\t\t</p>\n\t\t\t</div>\n\t\t\t\n\t\t\t<script type='text/javascript'>\n\t\t\tpopupDialog('Update Match', '" . $MAIN_ROOT . "members/tournaments/managetournament.php?tID=" . $tID . "&pID=ManageMatches', 'successBox');\n\t\t\t</script>\n\t\t\t\n\t\t\t";
        } else {
            $countErrors++;
            $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> Unable to save information to the database.  Please contact the website administrator.<br>";
        }
    }
    if ($countErrors > 0) {
        $_POST = filterArray($_POST);
        $_POST['submit'] = false;
    }
}
if (!$_POST['submit']) {
    if ($tournamentInfo['playersperteam'] == 1) {
        $strPlayerTeam = "Player";
        if ($tournamentObj->objTeam->select($matchInfo['team1_id'])) {
            $teamInfo = $tournamentObj->objTeam->get_info_filtered();
            $arrPlayers = $tournamentObj->getTeamPlayers($teamInfo['tournamentteam_id'], true);
            $dispPlayer1 = "Empty Spot";
            if ($tournamentObj->objPlayer->select($arrPlayers[0])) {
                $playerInfo = $tournamentObj->objPlayer->get_info_filtered();
                if ($member->select($playerInfo['member_id'])) {
                    $dispPlayer1 = $member->getMemberLink();
                } else {
示例#5
0
    } else {
        exit;
    }
} else {
    $memberInfo = $member->get_info();
    $consoleObj->select($consoleObj->findConsoleIDByName("View Event Invitations"));
    if (!$member->hasAccess($consoleObj)) {
        exit;
    }
}
$result = $mysqli->query("SELECT em.* FROM " . $dbprefix . "events_members em, " . $dbprefix . "events e WHERE em.event_id = e.event_id AND em.hide = '0' AND em.member_id = '" . $memberInfo['member_id'] . "'");
if ($result->num_rows > 0) {
    echo "<table class='formTable' style='margin-top: 0px; border-spacing: 0px'>";
    $counter = 0;
    while ($row = $result->fetch_assoc()) {
        $row = filterArray($row);
        $eventObj->select($row['event_id']);
        $eventInfo = $eventObj->get_info_filtered();
        if ($member->select($row['invitedbymember_id'])) {
            $dispInvitedByLink = $member->getMemberLink();
        } elseif ($member->select($eventInfo['member_id'])) {
            $dispInvitedByLink = $member->getMemberLink();
        } else {
            $dispInvitedByLink = "<i>Unknown</i>";
        }
        if ($counter == 1) {
            $addCSS = " alternateBGColor";
            $counter = 0;
        } else {
            $addCSS = "";
            $counter = 1;
示例#6
0
文件: index.php 项目: jevkid/OnTarget
            $rid = $rounds[0]['id'];
        }
        // Get tables from database
        $timeline = getTable("SELECT id, userid AS `uid`, roundid AS `rid`, score, angle, x FROM timeline WHERE roundid\r\n\t\t\t\tIN (\t\t\t\r\n\t\t\t\t\tSELECT roundid\r\n\t\t\t\t\tFROM timeline\r\n\t\t\t\t\tWHERE roundid=" . $rid . "\r\n\t\t\t\t)");
        $users = getTable("SELECT id, clubid AS `cid`, fname, sname, dob, email, class, auth, datejoined, active FROM users WHERE id IN (SELECT userid FROM timeline WHERE `roundid`='" . $rid . "')");
        for ($i = 0; $i < count($users); $i++) {
            if ($users[$i]['id'] == $uid) {
                $userinfo = $users[$i];
            }
        }
        for ($i = 0; $i < count($rounds); $i++) {
            $roundstats[] = getStats($timeline, $rounds[$i]['id'], $uid);
        }
        $stats = combineStats($roundstats);
        // Remove timeline rows that aren't relevant
        $timeline = filterArray($timeline, "rid", $rid);
        //$userstats = getStats($timeline, -1, $uid);
    }
    ?>
  
	<br>
	<div id="scores">
  
  
  
  
  
  
  
  
  
示例#7
0
        }
    }
    if ($countErrors == 0) {
        echo "\n\t\t\t\n\t\t\t<div style='display: none' id='successBox'>\n\t\t\t\t<p align='center'>\n\t\t\t\t\tSuccessfully sent event invitations!\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t\t\n\t\t\t<script type='text/javascript'>\n\t\t\t\tpopupDialog('Invite Members', '" . $MAIN_ROOT . "members/console.php?cID=" . $cID . "&select=" . $eventInfo['event_id'] . "', 'successBox');\n\t\t\t</script>\n\t\t\n\t\t";
    }
    if ($countErrors > 0) {
        $_POST = filterArray($_POST);
        $_POST['submit'] = false;
    }
}
if (!$_POST['submit']) {
    $_SESSION['btEventID'] = $eventInfo['event_id'];
    if ($countErrors == 0) {
        $_SESSION['btInviteList'] = array();
    } else {
        $_SESSION['btInviteList'] = filterArray($_SESSION['btInviteList']);
    }
    $arrInvitedMembers = $eventObj->getInvitedMembers(true);
    $arrInvitedMembers = array_merge($arrInvitedMembers, $_SESSION['btInviteList']);
    $sqlInvitedMembers = "('" . implode("','", $arrInvitedMembers) . "')";
    $memberoptions = "<option value=''>Select</option>";
    $result = $mysqli->query("SELECT m.username,m.member_id,r.ordernum,r.name FROM " . $dbprefix . "members m, " . $dbprefix . "ranks r WHERE m.rank_id = r.rank_id AND m.member_id NOT IN " . $sqlInvitedMembers . " AND m.disabled = '0' AND m.rank_id != '1' ORDER BY r.ordernum DESC");
    while ($row = $result->fetch_assoc()) {
        $memberoptions .= "<option value='" . $row['member_id'] . "'>" . filterText($row['name']) . " " . filterText($row['username']) . "</option>";
    }
    $showInviteList = "<p align='center'><i>- Empty -</i></p>";
    if (count($_SESSION['btInviteList']) > 0) {
        $showInviteList = "";
        foreach ($_SESSION['btInviteList'] as $key => $value) {
            if ($objInviteMember->select($value)) {
                $showInviteList .= "<div class='mttPlayerSlot' style='width: 95%'>" . $objInviteMember->get_info_filtered("username") . "<div class='mttDeletePlayer'><a href='javascript:void(0)' onclick=\"removeMember('" . $key . "')\">X</a></div></div>";
示例#8
0
 public function populateDonationInfo($total = false, $currentPeriod = 0, $nextPeriod = 0)
 {
     $donationInfo = array();
     if ($this->intTableKeyValue != "") {
         $arrPeriod = $this->getCurrentPeriodRange(true);
         $sqlCurrentPeriod = $currentPeriod == 0 ? $arrPeriod['current'] : $currentPeriod;
         $sqlNextPeriod = $nextPeriod == 0 ? $arrPeriod['next'] : $nextPeriod;
         $addSQL = count($arrPeriod) == 0 || $total ? "" : " AND datesent >= '" . $sqlCurrentPeriod . "' AND datesent < '" . $sqlNextPeriod . "'";
         $result = $this->MySQL->query("SELECT * FROM " . $this->MySQL->get_tablePrefix() . "donations WHERE donationcampaign_id = '" . $this->intTableKeyValue . "' " . $addSQL . "ORDER BY datesent DESC");
         while ($row = $result->fetch_assoc()) {
             $donationInfo[] = filterArray($row);
             $totalDonationAmount += $row['amount'];
         }
         $this->donationAmounts = $totalDonationAmount;
     }
     $this->donationInfo = $donationInfo;
 }
示例#9
0
$manageCID = $consoleObj->findConsoleIDByName("Manage Games Played");
$consoleObj->select($manageCID);
$checkAccess1 = $member->hasAccess($consoleObj);
$addCID = $consoleObj->findConsoleIDByName("Add Games Played");
$consoleObj->select($addCID);
$checkAccess2 = $member->hasAccess($consoleObj);
$checkAccess = $checkAccess1 || $checkAccess2;
if ($member->authorizeLogin($_SESSION['btPassword'])) {
    $memberInfo = $member->get_info_filtered();
    if ($checkAccess) {
        if (is_array($_SESSION['btStatCache']) and count($_SESSION['btStatCache']) > 0) {
            echo "\n\t\t\t\n\t\t\t\t<table align='left' border='0' cellspacing='2' cellpadding='2' width=\"90%\">\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class='formTitle'>Stat Name:</td>\n\t\t\t\t\t\t<td class='formTitle'>Stat Type:</td>\n\t\t\t\t\t\t<td class='formTitle'>Formula:</td>\n\t\t\t\t\t\t<td class='formTitle'>Actions:</td>\n\t\t\t\t\t</tr>\n\t\t\t\t";
            $counter = 0;
            $totalStats = count($_SESSION['btStatCache']);
            foreach ($_SESSION['btStatCache'] as $key => $statInfo) {
                $statInfo = filterArray($statInfo);
                $counter++;
                $statType = "Input";
                $dispFormula = "<i>none</i>";
                if ($statInfo['statType'] == "calculate") {
                    $statType = "Auto-Calculated";
                    $dispFirstStat = filterText($_SESSION['btStatCache'][$statInfo['firstStat']]['statName']);
                    $dispSecondStat = filterText($_SESSION['btStatCache'][$statInfo['secondStat']]['statName']);
                    $dispOp = "";
                    switch ($statInfo['calcOperation']) {
                        case "add":
                            $dispOp = " + ";
                            break;
                        case "sub":
                            $dispOp = " - ";
                            break;
示例#10
0
     }
     if ($countErrors > 0) {
         $_POST = filterArray($_POST);
         $_POST['editComponent'] = false;
         echo "\n\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\t\$(document).ready(function() {\n\t\t\t\t\n\t\t\t\t\t\t\$(\".add-component-dialog .ui-button-text:contains('Please Wait...')\").text('Edit Component');\n\t\t\t\t\n\t\t\t\t\t});\n\t\t\t\t</script>\n\t\t\t";
         $arrComponentInfo['type'] = $_POST['componentType'];
         $arrComponentInfo['name'] = $_POST['componentName'];
         $arrComponentInfo['required'] = $_POST['componentRequired'];
         $arrComponentInfo['tooltip'] = $_POST['componentToolTip'];
     }
 }
 if (!$_POST['editComponent']) {
     if ($dispError != "") {
     } else {
         $_SESSION['btFormComponentTempSelectValues'] = $_SESSION['btFormComponent'][$componentIndex]['cOptions'];
         $arrComponentInfo = filterArray($_SESSION['btFormComponent'][$componentIndex]);
     }
     $arrSelectedType = array();
     $checkRequired = "";
     switch ($arrComponentInfo['type']) {
         case "largeinput":
             $arrSelectedType['largeinput'] = " selected";
             break;
         case "select":
             $arrSelectedType['select'] = " selected";
             break;
         case "multiselect":
             $arrSelectedType['multiselect'] = " selected";
             break;
         case "separator":
             $arrSelectedType['separator'] = " selected";
示例#11
0
        if (!isset($checkHTMLAccess)) {
            $checkHTMLAccess = $member->hasAccess($checkHTMLConsoleObj);
        }
        $dispNews = $checkHTMLAccess ? parseBBCode($newsObj->get_info("newspost")) : nl2br(parseBBCode(filterText($newsInfo['newspost'])));
        $dispAnnouncements .= "\n\t\t\t<div class='newsDiv' id='newsDiv_" . $newsInfo['news_id'] . "'>\n\t\t\t\t<div class='postInfo'>\n\t\t\t\t\t<div id='newsPostAvatar' style='float: left'><img src='" . $posterInfo['avatar'] . "' class='avatarImg'></div>\n\t\t\t\t\t<div id='newsPostInfo' style='float: left; margin-left: 15px'>posted by " . $member->getMemberLink() . " - " . getPreciseTime($newsInfo['dateposted']) . $dispNewsType . "<br>\n\t\t\t\t\t<span class='subjectText'>" . $newsInfo['postsubject'] . "</span></div>\n\t\t\t\t</div>\n\t\t\t\t<br>\n\t\t\t\t<div class='dottedLine' style='margin-top: 5px'></div>\n\t\t\t\t<div class='postMessage'>\n\t\t\t\t\t" . $dispNews . "\n\t\t\t\t</div>\n\t\t\t\t<div class='dottedLine' style='margin-top: 5px; margin-bottom: 5px'></div>\n\t\t\t\t<div class='main' style='margin-top: 0px; margin-bottom: 10px; padding-left: 5px'>" . $dispLastEdit . "</div>\n\t\t\t\t<p style='padding: 0px; margin: 0px' align='right'><b><a href='" . $MAIN_ROOT . "news/viewpost.php?nID=" . $newsInfo['news_id'] . "#comments'>Comments (" . $newsObj->countComments() . ")</a></b></p>\n\t\t\t</div>\n\t\t\n\t\t\n\t\t";
    }
}
// Get Most Recent News Post
$numOfNewsPosts = $websiteInfo['hpnews'] == -1 ? "" : " LIMIT " . $websiteInfo['hpnews'];
$result = $mysqli->query("SELECT * FROM " . $dbprefix . "news WHERE newstype = '1' AND hpsticky = '0' ORDER BY dateposted DESC" . $numOfNewsPosts);
$checkHTMLAccess = "";
if ($result->num_rows > 0) {
    while ($row = $result->fetch_assoc()) {
        unset($checkHTMLAccess);
        $newsObj = new News($mysqli);
        $newsInfo = filterArray($row);
        $newsObj->select($newsInfo['news_id']);
        $member->select($newsInfo['member_id']);
        $posterInfo = $member->get_info_filtered();
        if ($posterInfo['avatar'] == "") {
            $posterInfo['avatar'] = $MAIN_ROOT . "themes/" . $THEME . "/images/defaultavatar.png";
        }
        $dispNewsType = " - <span class='publicNewsColor' style='font-style: italic'>public</span>";
        $dispLastEdit = "";
        if ($member->select($newsInfo['lasteditmember_id'])) {
            $dispLastEditTime = getPreciseTime($newsInfo['lasteditdate']);
            $dispLastEdit = "<span style='font-style: italic'>last edited by " . $member->getMemberLink() . " - " . $dispLastEditTime . "</span>";
        }
        $member->select($newsInfo['member_id']);
        if (!isset($checkHTMLAccess)) {
            $checkHTMLAccess = $member->hasAccess($checkHTMLConsoleObj);
/**
 * filter PAGES using a callback filter function on each page
 * remove page if callback returns true
 * helper for getPages
 *
 * @since  3.4
 * @param  array $pages PAGES collection
 * @param  callable $func  functionname to use as callback filter
 * @param  args $arg  args to pass on to func
 * @return array        new pagesarray
 */
function filterPageFunc($pages, $func, $arg)
{
    return filterArray($pages, $func, $arg);
}
示例#13
0
<?php

if (!defined("MAIN_ROOT")) {
    exit;
}
$signUpForm = $memberAppObj->objSignUpForm;
$appComponentObj->defaultCounter = 0;
$arrComponents = $appComponentObj->getDefaultInputCode();
$i = $appComponentObj->defaultCounter;
$result = $mysqli->query("SELECT * FROM " . $dbprefix . "app_components ORDER BY ordernum DESC");
if ($result->num_rows > 0) {
    $arrComponents['applicationquestions'] = array("type" => "section", "options" => array("section_title" => "Application Questions"), "sortorder" => $i++);
    while ($row = $result->fetch_assoc()) {
        $appComponentObj->select($row['appcomponent_id']);
        $arrAppCompInfo = filterArray($row);
        $formInputName = "appcomponent_" . $arrAppCompInfo['appcomponent_id'];
        $arrComponents[$formInputName] = array("sortorder" => $i++, "attributes" => array("class" => "formInput textBox"), "display_name" => $arrAppCompInfo['name'], "tooltip" => $arrAppCompInfo['tooltip'], "type" => "text");
        $arrComponents[$formInputName] = array_merge($arrComponents[$formInputName], $appComponentObj->getComponentInputCode());
    }
}
$arrComponents['submit'] = array("type" => "submit", "sortorder" => $i++, "attributes" => array("class" => "submitButton formSubmitButton"), "value" => "Sign Up");
$extraDesc = $websiteInfo['memberapproval'] == 1 ? " After signing up, you must be approved by a member before becoming a full member on the website." : "";
$setupSignupForm = array("name" => "signup-form", "components" => $arrComponents, "description" => "Use the form below to sign up to join " . $websiteInfo['clanname'] . "." . $extraDesc, "attributes" => array("action" => $MAIN_ROOT . "signup.php", "method" => "post"), "saveLink" => MAIN_ROOT, "saveMessage" => "You have successfully signed up to join " . $websiteInfo['clanname'] . "!", "saveMessageTitle" => "Sign Up - Confirmation");
$signUpForm->buildForm($setupSignupForm);
示例#14
0
$member->select($_SESSION['btUsername']);
$pollObj = new Poll($mysqli);
// Check Login
$LOGIN_FAIL = true;
if ($member->authorizeLogin($_SESSION['btPassword']) && $member->hasAccess($consoleObj)) {
    $pollObj->cacheID = $_POST['cacheID'];
    if (isset($_POST['action']) && $_POST['action'] == "move") {
        $pollObj->moveCache($_POST['direction'], $_POST['optionOrder']);
    } elseif (isset($_POST['action']) && $_POST['action'] == "delete") {
        unset($_SESSION['btPollOptionCache'][$pollObj->cacheID][$_POST['pollOption']]);
        $pollObj->resortCacheOrder();
    }
    $optionCount = count($_SESSION['btPollOptionCache'][$pollObj->cacheID]);
    echo "<table class='formTable' style='width: 75%; margin-top: 0px'>";
    foreach ($_SESSION['btPollOptionCache'][$pollObj->cacheID] as $key => $pollOptionInfo) {
        $pollOptionInfo = filterArray($pollOptionInfo);
        $dispDownArrow = "<a href='javascript:void(0)' title='Move Down'><img src='" . $MAIN_ROOT . "themes/" . $THEME . "/images/buttons/downarrow.png' data-pollcache='" . $key . "' data-polldirection='down' class='manageListActionButton'></a>";
        $dispUpArrow = "<a href='javascript:void(0)' title='Move Up'><img src='" . $MAIN_ROOT . "themes/" . $THEME . "/images/buttons/uparrow.png' data-pollcache='" . $key . "' data-polldirection='up' class='manageListActionButton'></a>";
        if ($key == $optionCount - 1) {
            $dispDownArrow = "<img src='" . $MAIN_ROOT . "themes/" . $THEME . "/images/transparent.png' class='manageListActionButton'>";
        }
        if ($key == 0) {
            $dispUpArrow = "<img src='" . $MAIN_ROOT . "themes/" . $THEME . "/images/transparent.png' class='manageListActionButton'>";
        }
        echo "\n\t\t\t<tr>\n\t\t\t\t<td class='main' align='center' style='width: 50%'>" . $pollOptionInfo['value'] . "</td>\n\t\t\t\t<td class='main' align='center' style='width: 14%'><div class='solidBox' style='background-color: " . $pollOptionInfo['color'] . "; padding: 0px; height: 20px; width: 40%; display: inline-block'></div></td>\n\t\t\t\t<td class='main' align='center' style='width: 9%'>" . $dispUpArrow . "</td>\n\t\t\t\t<td class='main' align='center' style='width: 9%'>" . $dispDownArrow . "</td>\n\t\t\t\t<td class='main' align='center' style='width: 9%'><a href='javascript:void(0)' title='Edit Option'><img src='" . $MAIN_ROOT . "themes/" . $THEME . "/images/buttons/edit.png' class='manageListActionButton' data-polledit='" . $key . "'></a></td>\n\t\t\t\t<td class='main' align='center' style='width: 9%'><a href='javascript:void(0)' title='Delete Option'><img src='" . $MAIN_ROOT . "themes/" . $THEME . "/images/buttons/delete.png' class='manageListActionButton' data-polldelete='" . $key . "'></a></td>\n\t\t\t</tr>\n\t\t\n\t\t";
    }
    echo "</table>\n\t\n\t\n\t\n\t\t<script type='text/javascript'>\n\t\n\t\t\t\$(document).ready(function() {\n\t\t\t\n\t\t\t\t\$('img[data-pollcache]').click(function() {\n\t\t\t\t\t\n\t\t\t\t\t\$('#loadingSpiral').show();\n\t\t\t\t\t\$('#pollOptions').hide();\n\t\t\t\t\t\$.post('" . $MAIN_ROOT . "members/include/polls/include/optioncache.php', { cacheID: '" . $pollObj->cacheID . "', action: 'move', direction: \$(this).attr('data-polldirection'), optionOrder: \$(this).attr('data-pollcache') }, function(data) {\n\t\t\t\t\t\t\$('#loadingSpiral').hide();\n\t\t\t\t\t\t\$('#pollOptions').html(data);\n\t\t\t\t\t\t\$('#pollOptions').fadeIn(250);\n\t\t\t\t\t});\n\t\t\t\t\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t\$('img[data-polldelete]').click(function() {\n\t\t\t\t\t\$('#loadingSpiral').show();\n\t\t\t\t\t\$('#pollOptions').hide();\n\t\t\t\t\t\$.post('" . $MAIN_ROOT . "members/include/polls/include/optioncache.php', { cacheID: '" . $pollObj->cacheID . "', action: 'delete', pollOption: \$(this).attr('data-polldelete') }, function(data) {\n\t\t\t\t\t\t\$('#loadingSpiral').hide();\n\t\t\t\t\t\t\$('#pollOptions').html(data);\n\t\t\t\t\t\t\$('#pollOptions').fadeIn(250);\n\t\t\t\t\t});\n\t\t\t\t\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\$('img[data-polledit]').click(function() {\n\t\t\t\t\n\t\t\t\t\t\$.post('" . $MAIN_ROOT . "members/include/polls/include/editoption.php', { cacheID: '" . $pollObj->cacheID . "', pollOption: \$(this).attr('data-polledit') }, function(data) {\n\t\t\t\t\t\t\$('#addModifyOptionDiv').html(data);\n\t\n\t\t\t\t\t\t\$('#addModifyOptionDiv').dialog({\n\t\t\t\t\t\t\ttitle: 'Edit Poll Option',\n\t\t\t\t\t\t\twidth: 350,\n\t\t\t\t\t\t\tshow: 'scale',\n\t\t\t\t\t\t\tmodal: true,\n\t\t\t\t\t\t\tzIndex: 99999,\n\t\t\t\t\t\t\tresizable: false,\n\t\t\t\t\t\t\tbuttons: {\n\t\t\t\t\t\t\t\t'Save': function() {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\$.post('" . $MAIN_ROOT . "members/include/polls/include/editoption.php', { cacheID: '" . $pollObj->cacheID . "', submit: 'add', optionValue: \$('#optionValue').val(), optionColor: \$('#optionColor').val(), optionOrder: \$('#optionOrder').val(), optionOrderBeforeAfter: \$('#optionOrderBeforeAfter').val(), pollOption: \$('#pollOption').val() }, function(data) {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tpostData = JSON.parse(data);\n\n\t\t\t\t\t\t\t\t\t\tif(postData['result'] == \"success\") {\n\t\t\t\t\t\t\t\t\t\t\treloadOptionCache();\n\t\t\t\t\t\t\t\t\t\t\t\$('#addModifyOptionDiv').dialog('close');\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tvar errorHTML = \"<strong>Unable to edit poll option due to the following errors:</strong><ul>\";\n\t\t\t\t\t\t\t\t\t\t\tfor(var i in postData['errors']) {\n\t\t\t\t\t\t\t\t\t\t\t\terrorHTML += \"<li>\"+postData['errors'][i]+\"</li>\";\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\terrorHTML += \"</ul>\";\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\$('#dialogErrors').html(errorHTML);\n\t\t\t\t\t\t\t\t\t\t\t\$('#dialogErrors').show();\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t'Cancel': function() {\n\t\t\t\t\t\t\t\t\t\$(this).dialog('close');\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t});\n\t\t\t\t\n\t\t\t\t\t});\n\t\t\t\t\n\t\t\t\t});\n\t\t\t\n\t\t\t\t\n\t\t\t\tfunction reloadOptionCache() {\n\t\t\t\t\n\t\t\t\t\t\$('#loadingSpiral').show();\n\t\t\t\t\t\$('#pollOptions').hide();\n\t\t\t\t\t\$.post('" . $MAIN_ROOT . "members/include/polls/include/optioncache.php', { cacheID: '" . $pollObj->cacheID . "' }, function(data) {\n\t\t\t\t\t\t\$('#loadingSpiral').hide();\n\t\t\t\t\t\t\$('#pollOptions').html(data);\n\t\t\t\t\t\t\n\t\t\t\t\t\t\$('#pollOptions').fadeIn(250);\n\t\t\t\t\t\n\t\t\t\t\t});\n\t\t\t\t\n\t\t\t\t}\n\t\t\t});\n\t\t\n\t\t</script>\n\t";
    if (count($_SESSION['btPollOptionCache'][$pollObj->cacheID]) == 0) {
        echo "\n\t\t\t<p class='main' align='center'>\n\t\t\t\t<i>No options added yet!</i>\n\t\t\t</p>\n\t\t";
    }
}
示例#15
0
         if ($_POST['statType'] == "inputtext") {
             $intInputText = 1;
             $_POST['statType'] = "input";
         } elseif ($_POST['statType'] == "inputnum") {
             $_POST['statType'] = "input";
         }
         $_POST = filterArray($_POST);
         $savedGameStatsID = $_SESSION['btStatCache'][$_POST['sID']]['gamestatsID'];
         $_SESSION['btStatCache'][$_POST['sID']] = array('statName' => $_POST['statName'], 'statType' => $_POST['statType'], 'calcOperation' => $_POST['calcOperation'], 'firstStat' => $_POST['firstStat'], 'secondStat' => $_POST['secondStat'], 'rounding' => $_POST['rounding'], 'hideStat' => $_POST['hideStat'], 'textInput' => $intInputText, 'gamestatsID' => $savedGameStatsID);
         echo "\n\t\t\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\t\t\t\$(document).ready(function() {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\$('#loadingSpiral').show();\n\t\t\t\t\t\t\t\t\$('#statList').hide();\n\t\t\t\t\t\t\t\t\$.post('" . $MAIN_ROOT . "members/include/admin/statcache/view.php', { }, function(data) {\n\t\t\t\t\t\t\t\t\t\$('#statList').html(data);\n\t\t\t\t\t\t\t\t\t\$('#statList').fadeOut(400);\n\t\t\t\t\t\t\t\t\t\$('#loadingSpiral').hide();\n\t\t\t\t\t\t\t\t\t\$('#statList').fadeIn(400);\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\$('#addNewStatForm').dialog('close');\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t</script>\n\t\t\t\t\t";
     } else {
         $_POST['submit'] = false;
     }
 }
 if (!$_POST['submit']) {
     $statInfo = filterArray($_SESSION['btStatCache'][$_POST['sID']]);
     $selectTextInput = "";
     if ($statInfo['textInput'] == 1) {
         $selectTextInput = "selected";
     }
     $statOptions = "<option value='inputnum'>Input (Number)</option><option value='inputtext' " . $selectTextInput . ">Input (Text)</option>";
     $onChange = "";
     if (is_array($_SESSION['btStatCache'])) {
         if (count($_SESSION['btStatCache']) > 1) {
             if ($statInfo['statType'] == "calculate") {
                 $statOptions .= "<option value='calculate' selected>Auto-Calculate</option>";
             } else {
                 $statOptions .= "<option value='calculate'>Auto-Calculate</option>";
             }
             $onChange = "onchange='changeStatsForm()'";
         }