当前位置: 首页>>代码示例>>PHP>>正文


PHP Match::get_permissions方法代码示例

本文整理汇总了PHP中Match::get_permissions方法的典型用法代码示例。如果您正苦于以下问题:PHP Match::get_permissions方法的具体用法?PHP Match::get_permissions怎么用?PHP Match::get_permissions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Match的用法示例。


在下文中一共展示了Match::get_permissions方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: brackets


//.........这里部分代码省略.........
                                $score_1_str = ' ';
                                if ($this->getField('AllowScore') == TRUE) {
                                    if (isset($score_0)) {
                                        $score_0_str = $score_0;
                                    }
                                    if (isset($score_1)) {
                                        $score_1_str = $score_1;
                                    }
                                }
                                switch ($match_winner) {
                                    case 'top':
                                        $class_str = 'match-winner';
                                        $score_str = $score_0_str;
                                        $match_link_str = '<a href="' . e_PLUGIN . 'ebattles/matchinfo.php?matchid=' . $match_id . '"><div class="' . $class_str . '" title="' . EB_MATCH_L1 . ' ' . ($match + 1) . '">' . $score_str . '</div></a>';
                                        $tbl[$match][0] = '<td>' . $match_link_str . '</td>';
                                        $class_str = 'match-loser';
                                        $score_str = $score_1_str;
                                        $match_link_str = '<a href="' . e_PLUGIN . 'ebattles/matchinfo.php?matchid=' . $match_id . '"><div class="' . $class_str . '" title="' . EB_MATCH_L1 . ' ' . ($match + 1) . '">' . $score_str . '</div></a>';
                                        $tbl[$match][1] = '<td>' . $match_link_str . '</td>';
                                        break;
                                    case 'bottom':
                                        $class_str = 'match-loser';
                                        $score_str = $score_1_str;
                                        $match_link_str = '<a href="' . e_PLUGIN . 'ebattles/matchinfo.php?matchid=' . $match_id . '"><div class="' . $class_str . '" title="' . EB_MATCH_L1 . ' ' . ($match + 1) . '">' . $score_str . '</div></a>';
                                        $tbl[$match][0] = '<td>' . $match_link_str . '</td>';
                                        $class_str = 'match-winner';
                                        $score_str = $score_0_str;
                                        $match_link_str = '<a href="' . e_PLUGIN . 'ebattles/matchinfo.php?matchid=' . $match_id . '"><div class="' . $class_str . '" title="' . EB_MATCH_L1 . ' ' . ($match + 1) . '">' . $score_str . '</div></a>';
                                        $tbl[$match][1] = '<td>' . $match_link_str . '</td>';
                                        break;
                                    default:
                                        $class_str = 'match-not-played';
                                        $matchObj = new Match($match_id);
                                        $permissions = $matchObj->get_permissions(USERID);
                                        $userclass = $permissions['userclass'];
                                        $can_report = $permissions['can_report'];
                                        $can_approve = $permissions['can_approve'];
                                        $can_delete = $permissions['can_delete'];
                                        $can_edit = $permissions['can_edit'];
                                        $match_link_str = '';
                                        $tbl[$match][0] = '';
                                        if ($can_approve == 1) {
                                            $match_link_str = ' <a href="' . e_PLUGIN . 'ebattles/matchinfo.php?matchid=' . $match_id . '"><img class="eb_image" src="' . e_PLUGIN . 'ebattles/images/exclamation.png" alt="' . EB_MATCH_L13 . '" title="' . EB_MATCH_L13 . '"/></a>';
                                            $tbl[$match][0] .= '<td rowspan="2" class="' . $class_str . '"><div class="' . $class_str . '" title="' . EB_MATCH_L1 . ' ' . ($match + 1) . '">' . $match_link_str . '</div></td>';
                                        }
                                        /*
                                        if($can_edit == 1)
                                        {
                                        	if($matchObj->getField('Status') == 'scheduled')
                                        	{
                                        		$match_link_str = ebImageLink('matchschedulededit', EB_MATCHR_L46, '', e_PLUGIN.'ebattles/matchreport.php?eventid='.$event_id.'&amp;matchid='.$match_id.'&amp;actionid=matchschedulededit&amp;userclass='.$userclass, 'page_white_edit.png', '', 'matchreport_link', '', EB_MATCHR_L46.' '.($match+1));
                                        		$tbl[$match][0] .= '<td rowspan="2" class="'.$class_str.'"><div class="'.$class_str.'">'.$match_link_str.'</div></td>';
                                        	}
                                        	else
                                        	{
                                        		$match_link_str = ebImageLink('matchedit', EB_MATCHR_L46, '', e_PLUGIN.'ebattles/matchreport.php?eventid='.$event_id.'&amp;matchid='.$match_id.'&amp;actionid=matchedit&amp;userclass='.$userclass, 'page_white_edit.png', '', 'matchreport_link', '', EB_MATCHR_L46.' '.($match+1));
                                        		$tbl[$match][0] .= '<td rowspan="2" class="'.$class_str.'"><div class="'.$class_str.'">'.$match_link_str.'</div></td>';
                                        	}		
                                        }
                                        */
                                        if ($can_report == 1) {
                                            $match_link_str = ebImageLink('matchscheduledreport', EB_MATCHR_L32, '', e_PLUGIN . 'ebattles/matchreport.php?eventid=' . $event_id . '&amp;matchid=' . $match_id . '&amp;actionid=matchscheduledreport&amp;userclass=' . $userclass, 'report.png', '', 'matchreport_link', '', EB_MATCHR_L32 . ' ' . ($match + 1));
                                            $tbl[$match][0] .= '<td rowspan="2" class="' . $class_str . '"><div class="' . $class_str . '" title="' . EB_MATCH_L1 . ' ' . ($match + 1) . '">' . $match_link_str . '</div></td>';
                                        }
                                        $tbl[$match][1] = '';
                                        break;
开发者ID:testt98,项目名称:ebattles,代码行数:67,代码来源:event.php

示例2: displayUserInfo

/**
* displayUserInfo - Displays user information
*/
function displayUserInfo($req_user, $profile_link)
{
    global $pref;
    global $sql;
    $text = '<tr><td>';
    if ($pref['eb_links_showmatchsplayed'] == 1) {
        /* Display Active Matches */
        $q = "SELECT count(*) " . " FROM " . TBL_MATCHS . ", " . TBL_SCORES . ", " . TBL_PLAYERS . ", " . TBL_GAMERS . " WHERE (" . TBL_SCORES . ".MatchID = " . TBL_MATCHS . ".MatchID)" . " AND (" . TBL_MATCHS . ".Status = 'active')" . " AND ((" . TBL_PLAYERS . ".PlayerID = " . TBL_SCORES . ".Player)" . " OR   ((" . TBL_PLAYERS . ".Team = " . TBL_SCORES . ".Team)" . " AND   (" . TBL_PLAYERS . ".Team != 0)))" . " AND (" . TBL_PLAYERS . ".Gamer = " . TBL_GAMERS . ".GamerID)" . " AND (" . TBL_GAMERS . ".User = '{$req_user}')";
        $result = $sql->db_Query($q);
        $numMatches = mysql_result($result, 0);
        if ($numMatches > 0) {
            $text .= $numMatches . '&nbsp;' . EB_EVENT_L59;
            $text .= '<br />';
        }
    }
    if ($pref['eb_links_showmatchstoapprove'] == 1) {
        /* Display Matches which need user approval */
        $matchArray = array();
        // events owned
        $q = "SELECT DISTINCT " . TBL_MATCHS . ".*" . " FROM " . TBL_MATCHS . ", " . TBL_EVENTS . " WHERE (" . TBL_EVENTS . ".Owner = '{$req_user}')" . "   AND (" . TBL_MATCHS . ".Event = " . TBL_EVENTS . ".EventID)" . "   AND (" . TBL_MATCHS . ".Status = 'pending')";
        $result = $sql->db_Query($q);
        $numMatches = mysql_numrows($result);
        for ($match = 0; $match < $numMatches; $match++) {
            // For each match played by user
            $matchArray[] = mysql_result($result, $match, TBL_MATCHS . ".MatchID");
        }
        // events mod
        $q = "SELECT DISTINCT " . TBL_MATCHS . ".*" . " FROM " . TBL_MATCHS . ", " . TBL_EVENTMODS . " WHERE (" . TBL_EVENTMODS . ".User = '{$req_user}')" . "   AND (" . TBL_MATCHS . ".Event = " . TBL_EVENTMODS . ".Event)" . "   AND (" . TBL_MATCHS . ".Status = 'pending')";
        $result = $sql->db_Query($q);
        $numMatches = mysql_numrows($result);
        for ($match = 0; $match < $numMatches; $match++) {
            // For each match played by user
            $matchArray[] = mysql_result($result, $match, TBL_MATCHS . ".MatchID");
        }
        // opps
        // Check if you can approve the match, for each of the pending match
        $q = "SELECT DISTINCT " . TBL_MATCHS . ".*" . " FROM " . TBL_MATCHS . ", " . TBL_SCORES . ", " . TBL_PLAYERS . ", " . TBL_GAMERS . " WHERE (" . TBL_MATCHS . ".Status = 'pending')" . " AND (" . TBL_SCORES . ".MatchID = " . TBL_MATCHS . ".MatchID)" . " AND ((" . TBL_PLAYERS . ".PlayerID = " . TBL_SCORES . ".Player)" . " OR   ((" . TBL_PLAYERS . ".Team = " . TBL_SCORES . ".Team)" . " AND   (" . TBL_PLAYERS . ".Team != 0)))" . " AND (" . TBL_PLAYERS . ".Gamer = " . TBL_GAMERS . ".GamerID)" . " AND (" . TBL_GAMERS . ".User = '{$req_user}')" . " ORDER BY " . TBL_MATCHS . ".TimeReported DESC";
        $result = $sql->db_Query($q);
        $numMatches = mysql_numrows($result);
        for ($match = 0; $match < $numMatches; $match++) {
            // For each match played by user
            $match_id = mysql_result($result, $match, TBL_MATCHS . ".MatchID");
            $matchObj = new Match($match_id);
            $permissions = $matchObj->get_permissions(USERID);
            $userclass = $permissions['userclass'];
            $can_approve = $permissions['can_approve'];
            if ($can_approve == 1) {
                $matchArray[] = $match_id;
            }
        }
        $numMatches = count(array_unique($matchArray));
        if ($numMatches > 0) {
            //			$text .= '<span class="badge">'.$numMatches.'</span>&nbsp;'.EB_EVENT_L73;
            $text .= '<span style="background-color:red;	color:white;	font-family: Helvetica,Arial,sans-serif;	font-size: 9px;	line-height: 18px;	font-weight: bold;	padding:3px 6px;	margin:1px;	-moz-border-radius: 10px;	-khtml-border-radius: 10px;	-webkit-border-radius: 10px;	border-radius: 10px;">' . $numMatches . '</span>';
            $text .= '<a href="' . $profile_link . '#tabs-4">';
            $text .= '&nbsp;' . EB_EVENT_L73;
            $text .= '</a>';
            $text .= '<br />';
        }
    }
    if ($pref['eb_links_showmatchspending'] == 1) {
        /* Display Pending Matches */
        $q = "SELECT DISTINCT " . TBL_MATCHS . ".*" . " FROM " . TBL_MATCHS . ", " . TBL_SCORES . ", " . TBL_PLAYERS . ", " . TBL_GAMERS . " WHERE (" . TBL_MATCHS . ".Status = 'pending')" . " AND (" . TBL_SCORES . ".MatchID = " . TBL_MATCHS . ".MatchID)" . " AND ((" . TBL_PLAYERS . ".PlayerID = " . TBL_SCORES . ".Player)" . " OR   ((" . TBL_PLAYERS . ".Team = " . TBL_SCORES . ".Team)" . " AND   (" . TBL_PLAYERS . ".Team != 0)))" . " AND (" . TBL_PLAYERS . ".Gamer = " . TBL_GAMERS . ".GamerID)" . " AND (" . TBL_GAMERS . ".User = '{$req_user}')" . " ORDER BY " . TBL_MATCHS . ".TimeReported DESC";
        $result = $sql->db_Query($q);
        $numMatches = mysql_numrows($result);
        if ($numMatches > 0) {
            $text .= $numMatches . '&nbsp;' . EB_EVENT_L64;
            $text .= '<br />';
        }
    }
    if ($pref['eb_links_showmatchesscheduled'] == 1) {
        /* Display Scheduled Matches */
        $q = "SELECT DISTINCT " . TBL_MATCHS . ".*" . " FROM " . TBL_MATCHS . ", " . TBL_SCORES . ", " . TBL_PLAYERS . ", " . TBL_GAMERS . " WHERE (" . TBL_MATCHS . ".Status = 'scheduled')" . " AND (" . TBL_SCORES . ".MatchID = " . TBL_MATCHS . ".MatchID)" . " AND ((" . TBL_PLAYERS . ".PlayerID = " . TBL_SCORES . ".Player)" . " OR   ((" . TBL_PLAYERS . ".Team = " . TBL_SCORES . ".Team)" . " AND   (" . TBL_PLAYERS . ".Team != 0)))" . " AND (" . TBL_PLAYERS . ".Gamer = " . TBL_GAMERS . ".GamerID)" . " AND (" . TBL_GAMERS . ".User = '{$req_user}')" . " ORDER BY " . TBL_MATCHS . ".TimeReported DESC";
        $result = $sql->db_Query($q);
        $numMatches = mysql_numrows($result);
        if ($numMatches > 0) {
            //			$text .= '<span class="badge">'.$numMatches.'</span>&nbsp;'.EB_EVENT_L70;
            $text .= '<span style="background-color:red;	color:white;	font-family: Helvetica,Arial,sans-serif;	font-size: 9px;	line-height: 18px;	font-weight: bold;	padding:3px 6px;	margin:1px;	-moz-border-radius: 10px;	-khtml-border-radius: 10px;	-webkit-border-radius: 10px;	border-radius: 10px;">' . $numMatches . '</span>';
            $text .= '<a href="' . $profile_link . '#tabs-4">';
            $text .= '&nbsp;' . EB_EVENT_L70;
            $text .= '</a>';
            $text .= '<br />';
        }
    }
    if ($pref['eb_links_showchallengesrequested'] == 1) {
        /* Display Requested Challenges */
        $q = "SELECT DISTINCT " . TBL_CHALLENGES . ".*" . " FROM " . TBL_CHALLENGES . " WHERE (" . TBL_CHALLENGES . ".Status = 'requested')" . " AND (" . TBL_CHALLENGES . ".ReportedBy = '{$req_user}')" . " ORDER BY " . TBL_CHALLENGES . ".TimeReported DESC";
        $result = $sql->db_Query($q);
        $numChallenges = mysql_numrows($result);
        if ($numChallenges > 0) {
            $text .= $numChallenges . '&nbsp;' . EB_EVENT_L66;
            $text .= '<br />';
        }
    }
    if ($pref['eb_links_showchallengesunconfirmed'] == 1) {
        /* Display Unconfirmed Challenges */
        $q = "SELECT DISTINCT " . TBL_CHALLENGES . ".*" . " FROM " . TBL_CHALLENGES . ", " . TBL_PLAYERS . ", " . TBL_GAMERS . " WHERE (" . TBL_CHALLENGES . ".Status = 'requested')" . "   AND ((" . TBL_PLAYERS . ".PlayerID = " . TBL_CHALLENGES . ".ChallengedPlayer)" . "    OR  ((" . TBL_PLAYERS . ".Team = " . TBL_CHALLENGES . ".ChallengedTeam)" . "   AND   (" . TBL_PLAYERS . ".Team != 0)))" . "   AND (" . TBL_PLAYERS . ".Gamer = " . TBL_GAMERS . ".GamerID)" . "   AND (" . TBL_GAMERS . ".User = '{$req_user}')" . " ORDER BY " . TBL_CHALLENGES . ".TimeReported DESC";
//.........这里部分代码省略.........
开发者ID:testt98,项目名称:ebattles,代码行数:101,代码来源:ebattles_menu.php

示例3: Match

            if (!isset($_POST['rank1'])) {
                $_POST['rank1'] = 'Team #1';
            }
            if (!isset($_POST['rank2'])) {
                $_POST['rank2'] = 'Team #2';
            }
            if (!isset($_POST['forfeit2'])) {
                $_POST['forfeit2'] = 1;
            }
            break;
    }
}
if ($match_id) {
    $match = new Match($match_id);
    //------------ event permissions --------------
    $match_permissions = $match->get_permissions(USERID);
    $can_report_scheduled = $match_permissions['can_report'];
    $can_edit = $match_permissions['can_edit'];
    // If match_id is not null, fill up the form information from the database
    switch ($event->getMatchPlayersType()) {
        case 'Players':
            $q = "SELECT " . TBL_MATCHS . ".*, " . TBL_SCORES . ".*, " . TBL_PLAYERS . ".*, " . TBL_USERS . ".*" . " FROM " . TBL_MATCHS . ", " . TBL_SCORES . ", " . TBL_PLAYERS . ", " . TBL_GAMERS . ", " . TBL_USERS . " WHERE (" . TBL_MATCHS . ".MatchID = '{$match_id}')" . " AND (" . TBL_SCORES . ".MatchID = " . TBL_MATCHS . ".MatchID)" . " AND (" . TBL_PLAYERS . ".PlayerID = " . TBL_SCORES . ".Player)" . " AND (" . TBL_PLAYERS . ".Gamer = " . TBL_GAMERS . ".GamerID)" . " AND (" . TBL_USERS . ".user_id = " . TBL_GAMERS . ".User)" . " ORDER BY " . TBL_SCORES . ".Player_Rank, " . TBL_SCORES . ".Player_MatchTeam";
            break;
        case 'Teams':
            $q = "SELECT " . TBL_MATCHS . ".*, " . TBL_SCORES . ".*, " . TBL_CLANS . ".*, " . TBL_TEAMS . ".*, " . TBL_DIVISIONS . ".*" . " FROM " . TBL_MATCHS . ", " . TBL_SCORES . ", " . TBL_CLANS . ", " . TBL_TEAMS . ", " . TBL_DIVISIONS . " WHERE (" . TBL_MATCHS . ".MatchID = '{$match_id}')" . " AND (" . TBL_SCORES . ".MatchID = " . TBL_MATCHS . ".MatchID)" . " AND (" . TBL_TEAMS . ".TeamID = " . TBL_SCORES . ".Team)" . " AND (" . TBL_CLANS . ".ClanID = " . TBL_DIVISIONS . ".Clan)" . " AND (" . TBL_TEAMS . ".Division = " . TBL_DIVISIONS . ".DivisionID)" . " ORDER BY " . TBL_SCORES . ".Player_Rank, " . TBL_SCORES . ".Player_MatchTeam";
            break;
        default:
    }
    $result = $sql->db_Query($q);
    $numScores = mysql_numrows($result);
    if (!isset($_POST['nbr_players'])) {
开发者ID:testt98,项目名称:ebattles,代码行数:31,代码来源:matchreport.php


注:本文中的Match::get_permissions方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。