• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP get_alt_col函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中get_alt_col函数的典型用法代码示例。如果您正苦于以下问题:PHP get_alt_col函数的具体用法?PHP get_alt_col怎么用?PHP get_alt_col使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: starHireHistory

 public static function starHireHistory($obj, $obj_id, $node, $node_id, $star_id = false, $opts = array())
 {
     global $lng;
     /* 
         If $star_id is false, then the HH from all stars of $obj = $obj_id will be displayed, instead of only the HH of star = $star_id 
     */
     if (!array_key_exists('GET_SS', $opts)) {
         $opts['GET_SS'] = '';
     } else {
         $extra['GETsuffix'] = $opts['GET_SS'];
     }
     # GET Sorting Suffix
     $extra['doNr'] = false;
     $extra['noHelp'] = true;
     if ($ANC = array_key_exists('anchor', $opts)) {
         $extra['anchor'] = $opts['anchor'];
     }
     $mdat = array();
     foreach ($star_id ? array(new Star($star_id)) : Star::getStars($obj, $obj_id, $node, $node_id) as $s) {
         foreach ($s->getHireHistory($obj, $obj_id, $node, $node_id) as $m) {
             $o = (object) array();
             foreach (array('match_id', 'date_played', 'hiredBy', 'hiredAgainst', 'hiredByName', 'hiredAgainstName') as $k) {
                 $o->{$k} = $m->{$k};
             }
             foreach ($s->getStats(T_NODE_MATCH, $m->match_id) as $k => $v) {
                 $o->{$k} = $v;
             }
             $o->match = $lng->getTrn('common/view');
             $o->tour = get_alt_col('tours', 'tour_id', $m->f_tour_id, 'name');
             $o->score = "{$m->team1_score} - {$m->team2_score}";
             $o->result = matchresult_icon($m->team1_id == $m->hiredBy && $m->team1_score > $m->team2_score || $m->team2_id == $m->hiredBy && $m->team1_score < $m->team2_score ? 'W' : ($m->team1_score == $m->team2_score ? 'D' : 'L'));
             $o->star_id = $s->star_id;
             $o->name = $s->name;
             array_push($mdat, $o);
         }
     }
     $fields = array('date_played' => array('desc' => $lng->getTrn('common/dateplayed')), 'name' => array('desc' => $lng->getTrn('common/star'), 'href' => array('link' => urlcompile(T_URL_PROFILE, T_OBJ_STAR, false, false, false), 'field' => 'obj_id', 'value' => 'star_id')), 'tour' => array('desc' => $lng->getTrn('common/tournament')), 'hiredByName' => array('desc' => $lng->getTrn('profile/star/hiredby'), 'href' => array('link' => urlcompile(T_URL_PROFILE, T_OBJ_TEAM, false, false, false), 'field' => 'obj_id', 'value' => 'hiredBy')), 'hiredAgainstName' => array('desc' => $lng->getTrn('common/opponent'), 'href' => array('link' => urlcompile(T_URL_PROFILE, T_OBJ_TEAM, false, false, false), 'field' => 'obj_id', 'value' => 'hiredAgainst')), 'cp' => array('desc' => 'Cp'), 'td' => array('desc' => 'Td'), 'intcpt' => array('desc' => 'Int'), 'cas' => array('desc' => 'Cas'), 'bh' => array('desc' => 'BH'), 'si' => array('desc' => 'Si'), 'ki' => array('desc' => 'Ki'), 'mvp' => array('desc' => 'MVP'), 'score' => array('desc' => $lng->getTrn('common/score'), 'nosort' => true), 'result' => array('desc' => $lng->getTrn('common/result'), 'nosort' => true), 'match' => array('desc' => $lng->getTrn('common/match'), 'href' => array('link' => 'index.php?section=matches&amp;type=report', 'field' => 'mid', 'value' => 'match_id'), 'nosort' => true));
     if ($star_id) {
         unset($fields['name']);
     }
     if ($obj && $obj_id) {
         unset($fields['hiredByName']);
     }
     $title = $lng->getTrn('common/starhh');
     if ($ANC) {
         $title = "<a name='{$opts['anchor']}'>" . $title . '<a>';
     }
     HTMLOUT::sort_table($title, $opts['url'], $mdat, $fields, sort_rule('star_HH'), isset($_GET["sort{$opts['GET_SS']}"]) ? array(($_GET["dir{$opts['GET_SS']}"] == 'a' ? '+' : '-') . $_GET["sort{$opts['GET_SS']}"]) : array(), $extra);
 }
开发者ID:nicholasmr,项目名称:obblm,代码行数:49,代码来源:class_starmerc_htmlout.php


示例2: getPath

 public function getPath($rid = false)
 {
     foreach (self::$supportedExtensions as $exts) {
         foreach ($exts as $ext) {
             if (file_exists($filePath = self::$typeToPathMappings[$this->obj] . '/' . $this->obj_id . '.' . $ext)) {
                 return $filePath;
             }
         }
     }
     // Else return default image.
     if ($this->obj == IMGTYPE_TEAMLOGO) {
         global $DEA, $raceididx;
         $race = $raceididx[$rid ? $rid : get_alt_col('teams', 'team_id', $this->obj_id, 'f_race_id')];
         return file_exists($path = RACE_ICONS . '/' . $DEA[$race]['other']['icon']) ? $path : NO_PIC;
     } else {
         return NO_PIC;
     }
 }
开发者ID:nicholasmr,项目名称:obblm,代码行数:18,代码来源:class_image.php


示例3: foreach

        <select name="ring">
            <?php 
foreach ($T_GLOBAL_RINGS as $r => $desc) {
    if ($r <= $coach->ring) {
        echo "<option value='{$r}' " . ($r == Coach::T_RING_GLOBAL_NONE ? 'SELECTED' : '') . ">{$desc}</option>\n";
    }
}
?>
        </select>
        <br><br>
        Local (league) access<br>
        <SELECT NAME="def_leagues[]" MULTIPLE>
        <?php 
foreach ($settings['default_leagues'] as $lid) {
    if (get_alt_col('leagues', 'lid', $lid, 'lid')) {
        echo "<OPTION DISABLED VALUE='{$lid}'>" . get_alt_col('leagues', 'lid', $lid, 'name') . " (added to automatically)</OPTION>\n";
    }
}
foreach ($leagues as $lid => $desc) {
    if ($desc['ring'] == Coach::T_RING_LOCAL_ADMIN && !in_array($lid, $settings['default_leagues'])) {
        echo "<OPTION VALUE='{$lid}'>{$desc['lname']}</OPTION>\n";
    }
}
?>
        </SELECT>
        <br><br>
        <input type="hidden" name="type" value="mk_coach">
        <input type="submit" name="button" value="Create coach">
        </form>
    </div>
</div>
开发者ID:nicholasmr,项目名称:obblm,代码行数:31,代码来源:admin_usr_man.php


示例4: _CCprofile

    private function _CCprofile($ALLOW_EDIT)
    {
        global $lng, $coach, $leagues;
        // Was new password/email request made?
        if (isset($_POST['type']) && $ALLOW_EDIT) {
            if (get_magic_quotes_gpc()) {
                $_POST['new_passwd'] = isset($_POST['new_passwd']) ? stripslashes($_POST['new_passwd']) : '';
                $_POST['new_phone'] = isset($_POST['new_phone']) ? stripslashes($_POST['new_phone']) : '';
                $_POST['new_email'] = isset($_POST['new_email']) ? stripslashes($_POST['new_email']) : '';
                $_POST['new_name'] = isset($_POST['new_name']) ? stripslashes($_POST['new_name']) : '';
                $_POST['new_realname'] = isset($_POST['new_realname']) ? stripslashes($_POST['new_realname']) : '';
            }
            switch ($_POST['type']) {
                case 'chpasswd':
                    status(Coach::checkPasswd($this->coach_id, $_POST['old_passwd']) && $this->setPasswd($_POST['new_passwd']));
                    break;
                case 'chphone':
                    status($this->setPhone($_POST['new_phone']));
                    break;
                case 'chmail':
                    status($this->setMail($_POST['new_email']));
                    break;
                case 'chlogin':
                    status($this->setName($_POST['new_name']));
                    break;
                case 'chname':
                    status($this->setRealName($_POST['new_realname']));
                    break;
                case 'chlang':
                    status($this->setSetting('lang', $_POST['new_lang']));
                    break;
                case 'chhomelid':
                    status(isset($_POST['new_homelid']) && get_alt_col('leagues', 'lid', (int) $_POST['new_homelid'], 'lid') && $this->setSetting('home_lid', $_POST['new_homelid']));
                    break;
                case 'pic':
                    status($_POST['add_del'] == 'add' ? $this->savePic(false) : $this->deletePic());
                    break;
                case 'coachtext':
                    if (get_magic_quotes_gpc()) {
                        $_POST['coachtext'] = stripslashes($_POST['coachtext']);
                    }
                    status($this->saveText($_POST['coachtext']));
                    break;
            }
        }
        // New team and change coach settings.
        echo "<br><br>";
        ?>
    <table class="common"><tr class="commonhead"><td><b><?php 
        echo $lng->getTrn('cc/coach_info');
        ?>
</b></td></tr></table>
    <br>
    <?php 
        echo $lng->getTrn('cc/note_persinfo');
        echo "<br><br>";
        if (is_object($coach) && !$ALLOW_EDIT) {
            # Logged in but not viewing own coach page.
            ?>
        <table>
            <tr>
                <td>ID:</td>
                <td><?php 
            echo $this->coach_id;
            ?>
</td>
            </tr>
            <tr>
                <td>Name (login):</td>
                <td><?php 
            echo $this->name;
            ?>
</td>
            </tr>
            <tr>
                <td>Full name:</td>
                <td><?php 
            echo empty($this->realname) ? '<i>' . $lng->getTrn('common/none') . '</i>' : $this->realname;
            ?>
</td>
            </tr>
            <tr>
                <td>Phone:</td>
                <td><?php 
            echo empty($this->phone) ? '<i>' . $lng->getTrn('common/none') . '</i>' : $this->phone;
            ?>
</td>
            </tr>
            <tr>
                <td>Mail:</td>
                <td><?php 
            echo empty($this->mail) ? '<i>' . $lng->getTrn('common/none') . '</i>' : $this->mail;
            ?>
</td>
            </tr>
        </table>
        <br>
        <?php 
        }
        if ($ALLOW_EDIT) {
//.........这里部分代码省略.........
开发者ID:TheNAF,项目名称:naflm,代码行数:101,代码来源:class_coach_htmlout.php


示例5: makeList

    public static function makeList($ALLOW_EDIT)
    {
        global $lng, $coach, $settings;
        HTMLOUT::frame_begin(is_object($coach) ? $coach->settings['theme'] : $settings['stylesheet']);
        # Make page frame, banner and menu.
        /* A new entry was sent. Add it to system */
        if (isset($_POST['tid']) && $ALLOW_EDIT) {
            if (get_magic_quotes_gpc()) {
                $_POST['title'] = stripslashes($_POST['title']);
                $_POST['about'] = stripslashes($_POST['about']);
            }
            switch ($_GET['action']) {
                case 'edit':
                    $e = new self($_GET['ft_id']);
                    status($e->edit($_POST['title'], $_POST['about']));
                    break;
                case 'new':
                    status(self::create($_POST['tid'], $_POST['title'], $_POST['about']));
                    break;
            }
        }
        title($lng->getTrn('name', __CLASS__));
        /* Was a request for a new entry made? */
        if (isset($_GET['action']) && $ALLOW_EDIT) {
            // Default schema values. These are empty unless "edit" is chosen.
            $tid = false;
            $title = '';
            $about = '';
            switch ($_GET['action']) {
                case 'delete':
                    if (isset($_GET['ft_id']) && is_numeric($_GET['ft_id'])) {
                        $e = new self($_GET['ft_id']);
                        status($e->delete());
                        unset($e);
                    } else {
                        fatal('Sorry. You did not specify which FT-id you wish to delete.');
                    }
                    break;
                case 'edit':
                    if (isset($_GET['ft_id']) && is_numeric($_GET['ft_id'])) {
                        $e = new self($_GET['ft_id']);
                        $tid = $e->tid;
                        $title = $e->title;
                        $about = $e->about;
                        $_POST['lid'] = get_alt_col('mv_teams', 'f_tid', $tid, 'f_lid');
                    } else {
                        fatal('Sorry. You did not specify which FT-id you wish to edit.');
                    }
                    // Fall-through to "new" !!!
                // Fall-through to "new" !!!
                case 'new':
                    echo "<a href='handler.php?type=famousteams'><-- " . $lng->getTrn('common/back') . "</a><br><br>";
                    $_DISABLED = !isset($_POST['lid']) ? 'DISABLED' : '';
                    $node_id = isset($_POST['lid']) ? $_POST['lid'] : null;
                    ?>
                <form name="STS" method="POST" enctype="multipart/form-data">
                <b><?php 
                    echo $lng->getTrn('common/league');
                    ?>
</b><br>
                <?php 
                    echo HTMLOUT::nodeList(T_NODE_LEAGUE, 'lid', array(), array(), array('sel_id' => $node_id));
                    ?>
                <input type='submit' value='<?php 
                    echo $lng->getTrn('common/select');
                    ?>
'>
                </form>
                <br>
                <form method="POST">
                <b><?php 
                    echo $lng->getTrn('team', __CLASS__) . '</b>';
                    ?>
<br>
                <?php 
                    $query = "SELECT team_id, name FROM teams WHERE f_lid = {$node_id} ORDER by name ASC";
                    $result = mysql_query($query);
                    if ($result && mysql_num_rows($result) == 0) {
                        $_DISABLED = 'DISABLED';
                    }
                    ?>
                <select name="tid" id="teams" <?php 
                    echo $_DISABLED;
                    ?>
>
                    <?php 
                    while ($row = mysql_fetch_assoc($result)) {
                        echo "<option value='{$row['team_id']}' " . ($tid == $row['team_id'] ? 'SELECTED' : '') . ">{$row['name']}</option>\n";
                    }
                    ?>
                </select>
                <br><br>
                <b><?php 
                    echo $lng->getTrn('g_title', __CLASS__) . '</b>&nbsp;&mdash;&nbsp;' . $lng->getTrn('title', __CLASS__);
                    ?>
<br>
                <input type="text" name="title" size="60" maxlength="100" value="<?php 
                    echo $title;
                    ?>
" <?php 
//.........这里部分代码省略.........
开发者ID:nicholasmr,项目名称:obblm,代码行数:101,代码来源:class_famousteams.php


示例6: form

 private static function form()
 {
     /**
      * Creates an upload form.
      *
      * 
      **/
     global $coach;
     if (is_object($coach)) {
         # Tours the logged in coach can "see".
         list(, , $tours) = Coach::allowedNodeAccess(Coach::NODE_STRUCT__FLAT, $coach->coach_id, array(T_NODE_TOURNAMENT => array('type' => 'type', 'locked' => 'locked', 'f_did' => 'f_did')));
         $tourlist = "";
         $coach_lid = isset($_SESSION['NS_node_id']) && $_SESSION['NS_node_id'] > 0 ? $_SESSION['NS_node_id'] : 1;
         foreach ($tours as $trid => $t) {
             $lid = get_alt_col('divisions', 'did', $t['f_did'], 'f_lid');
             if ($t['type'] == TT_FFA && !$t['locked'] && $coach_lid == $lid && $t['tname'] != "Pandora's Box") {
                 $tourlist .= "<option value='{$trid}'>{$t['tname']}</option>\n";
             }
         }
         #            $tourlist = HTMLOUT::nodeList(T_NODE_TOURNAMENT, 'ffatours', array(T_NODE_TOURNAMENT => array('type' => TT_FFA, 'locked' => 0)), array(), array('hide_empty'=>array(T_NODE_DIVISION,T_NODE_LEAGUE)));
         global $settings;
         $cy_reroll = "";
         if ($settings['leegmgr_cyanide']) {
             $cy_reroll = "\r\n                    Reroll winnings if roll is less than: \r\n                    <select name='reroll'>\r\n                        <option value='2'>2</option>\r\n                        <option value='3'>3</option>\r\n                        <option value='4'>4</option>\r\n                        <option value='5'>5</option>\r\n                        <option value='6'>6</option>\r\n                    </select><br>";
         }
         $form = "\r\n                <!-- The data encoding type, enctype, MUST be specified as below -->\r\n                <form enctype='multipart/form-data' action='handler.php?type=leegmgr' method='POST'>\r\n                    <!-- MAX_FILE_SIZE must precede the file input field -->\r\n                    <input type='hidden' name='MAX_FILE_SIZE' value='256000' />\r\n                    <!-- Name of input element determines name in {$_FILES} array -->\r\n                    Send this file <input name='userfile' type='file' /><br>\r\n                    Save in tournament\r\n                    <select name='ffatours'>\r\n                        <optgroup label='Existing FFA'>\r\n\r\n                            {$tourlist}\r\n\r\n                        </optgroup>\r\n                    </select>\r\n\r\n                    <br>{$cy_reroll}<br>\r\n                    <input type='submit' value='Send File' />\r\n                </form>\r\n            ";
         return "\r\n            <div class='boxCommon'>\r\n            <h3 class='boxTitle" . T_HTMLBOX_MATCH . "'>Upload match</h3>\r\n            <div class='boxBody'>\r\n            " . $form . "\r\n            </div>\r\n            </div>\r\n            ";
     } else {
         return 'You must login in order to upload a match report.';
     }
 }
开发者ID:TheNAF,项目名称:naflm,代码行数:31,代码来源:class_upload_botocs.php


示例7: activateUser

 function activateUser()
 {
     $coach_id = get_alt_col(USERTABLE, USERNAME, $this->username, USERID);
     $c = new Coach($coach_id);
     if ($c->retired == 2) {
         mysql_query("UPDATE coaches SET retired = 0 WHERE coach_id = {$coach_id}");
     } else {
         $this->error = ACTIVATION_NOT_NEEDED;
         return false;
     }
     return true;
 }
开发者ID:TheNAF,项目名称:naflm,代码行数:12,代码来源:class_registration.php


示例8: _matchBest

    private function _matchBest()
    {
        global $lng;
        $p = $this;
        // Copy. Used instead of $this for readability.
        ?>
   
    <div class="row">
        <div class="boxWide">
            <div class="boxTitle<?php 
        echo T_HTMLBOX_STATS;
        ?>
"><a href='javascript:void(0);' onClick="slideToggleFast('mbest');"><b>[+/-]</b></a> &nbsp;<?php 
        echo $lng->getTrn('profile/player/best');
        ?>
</div>
            <div class="boxBody" id="mbest">
                <table class="common">
                    <tr>
                        <td><b><?php 
        echo $lng->getTrn('common/type');
        ?>
</b></td>
                        <td><b><?php 
        echo $lng->getTrn('common/tournament');
        ?>
</b></td>
                        <td><b><?php 
        echo $lng->getTrn('common/opponent');
        ?>
</b></td>
                        <td><b>Td</b></td>
                        <td><b>Ki</b></td>
                        <td><b><?php 
        echo $lng->getTrn('common/score');
        ?>
</b></td>
                        <td><b><?php 
        echo $lng->getTrn('common/result');
        ?>
</b></td>
                        <td><b><?php 
        echo $lng->getTrn('common/match');
        ?>
</b></td>
                    </tr>
                    <?php 
        foreach (array('td' => 'scorer', 'ki' => 'killer') as $s => $desc) {
            $been_there = false;
            $matches = $p->getMatchMost($s);
            foreach ($matches as $entry) {
                if (!$been_there) {
                    echo "<tr><td colspan='8'><hr></td></tr>";
                }
                ?>
                            <tr>
                                <?php 
                $m = $entry['match_obj'];
                if ($been_there) {
                    echo '<td></td>';
                } else {
                    echo "<td><i>Top {$desc}: " . count($matches) . " times</i></td>";
                    $been_there = true;
                }
                ?>
                                <td><?php 
                echo get_alt_col('tours', 'tour_id', $m->f_tour_id, 'name');
                ?>
</td>
                                <td><?php 
                echo $p->owned_by_team_id == $m->team1_id ? $m->team2_name : $m->team1_name;
                ?>
</td>
                                <td><?php 
                echo $entry['td'];
                ?>
</td>
                                <td><?php 
                echo $entry['ki'];
                ?>
</td>
                                <td><?php 
                echo $m->team1_score . ' - ' . $m->team2_score;
                ?>
</td>
                                <td><?php 
                echo matchresult_icon($m->is_draw ? 'D' : ($m->winner == $p->owned_by_team_id ? 'W' : 'L'));
                ?>
</td>
                                <td><a href='javascript:void(0)' onClick="window.open('index.php?section=matches&amp;type=report&amp;mid=<?php 
                echo $m->match_id;
                ?>
');"><?php 
                echo $lng->getTrn('common/view');
                ?>
</a></td>
                            </tr>
                            <?php 
            }
        }
//.........这里部分代码省略.........
开发者ID:rythos42,项目名称:naflm,代码行数:101,代码来源:class_player_htmlout.php


示例9: get_parent_name

function get_parent_name($type, $id, $parent_type)
{
    global $relations_node, $relations_obj;
    $relations = in_array($type, array_keys($relations_node)) ? $relations_node : $relations_obj;
    return get_alt_col($relations[$parent_type]['tbl'], $relations[$parent_type]['id'], get_parent_id($type, $id, $parent_type), 'name');
}
开发者ID:rythos42,项目名称:naflm,代码行数:6,代码来源:mysql.php


示例10: main

    public static function main($argv)
    {
        // Check if teamid is provided, else show error mess
        $team_id = $_GET['team_id'];
        if (!get_alt_col('teams', 'team_id', $team_id, 'team_id')) {
            fatal("Invalid team ID.");
        }
        global $stars, $DEA, $rules, $skillarray, $inducements, $racesNoApothecary;
        // Move these constants to header.php?
        define('MAX_STARS', 2);
        define('MERC_EXTRA_COST', 30000);
        define('MERC_EXTRA_SKILL_COST', 50000);
        $ind_cost = 0;
        $redirectlink = 'handler.php?type=roster&detailed=0&team_id=' . $team_id;
        $t = new Team($team_id);
        $star_list[0] = '      <option value="0">-No Induced Stars-</option>' . "\n";
        foreach ($stars as $s => $d) {
            $star_list[0] .= "      <option " . (in_array($t->f_race_id, $d['races']) ? 'style="background-color: ' . COLOR_HTML_READY . ';" ' : '') . "value=\"{$d['id']}\">{$s}</option>\n";
        }
        ?>
<!--
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<link type="text/css" href="css/stylesheet1.css" rel="stylesheet">
-->
<style type="text/css">
td { background-color: #EEEEEE; color: #000000; font: 13px Tahoma; }
td.indtitle { background-color: #EEEEEE; color: #000000; font: bold 12px Tahoma; }
td.boxie { background-color: #EEEEEE; color: #000000; }
td.cent { text-align: center; }
td.cent2 { text-align: center; background-color: #EEEEEE; color: #000000; }
td.right { text-align: right; background-color: #EEEEEE; color: #000000; }
</style>
<script language="javascript">
<!--
function SendToPDF()
{
    document.InduceForm.action = "<?php 
        print $redirectlink;
        ?>
"    // Redirect to pdf_roster
    document.InduceForm.submit();        // Submit the page
    return true;
}
-->
</script>
<!--
</head>
<body>
<div class="everything">
<div class="section">
-->
<?php 
        title('Inducements try-out');
        ?>
<form action="" method="post" name="InduceForm">

<table>
    <tr>
        <td class="indtitle">Star Name</td>
        <td class="indtitle">Cost</td>
        <td class="indtitle">MA</td>
        <td class="indtitle">ST</td>
        <td class="indtitle">AG</td>
        <td class="indtitle">AV</td>
        <td class="indtitle">Skills</td> <!-- <td>Cp</td><td>Td</td><td>Int</td><td>Cas</td><td>BH</td><td>Si</td><td>Ki</td><td>MVP</td><td>SPP</td> -->
    </tr>
<?php 
        $brick_n_grotty = false;
        $i = 1;
        while ($i <= MAX_STARS) {
            print "  <tr>\n";
            if (array_key_exists("Star{$i}", $_POST)) {
                $sid = $_POST["Star{$i}"];
                if ($sid != 0) {
                    $s = new Star($sid);
                    #      $s->setStats(false, false, false, false);
                    $star_list[$i] = $star_list[0];
                    if ($sid == "-6" || $sid == "-7") {
                        // Select Brick as selected and add row for Grotty later
                        $brick_n_grotty = true;
                        $star_list[$i] = str_replace('option value="-6"', 'option selected value="-6"', $star_list[$i]);
                        // Hardcoded Brick
                        $star_list[$i] = str_replace('option style="background-color: ' . COLOR_HTML_READY . ';" value="-6"', 'option selected style="background-color: ' . COLOR_HTML_READY . ';" value="-6"', $star_list[$i]);
                        $sid = -6;
                        $s = new Star($sid);
                        // Making sure to switch from Grotty to Brick
                        #        $s->setStats(false, false, false, false);
                        $star_list[0] = str_replace('      <option value="-6">Brick Far\'th (+ Grotty)</option>' . "\n", '', $star_list[0]);
                        // Removing Brick from second row
                        $star_list[0] = str_replace('      <option style="background-color: ' . COLOR_HTML_READY . ';" value="-6">Brick Far\'th (+ Grotty)</option>' . "\n", '', $star_list[0]);
                        $star_list[0] = str_replace('      <option value="-7">Grotty (included in Brick Far\'th)</option>' . "\n", '', $star_list[0]);
                        // Removing Grotty from second row
                        $star_list[0] = str_replace('      <option style="background-color: ' . COLOR_HTML_READY . ';" value="-7">Grotty (included in Brick Far\'th)</option>' . "\n", '', $star_list[0]);
                    } else {
                        $star_list[$i] = str_replace('option value="' . $sid . '"', 'option selected value="' . $sid . '"', $star_list[$i]);
                        $star_list[$i] = str_replace('option style="background-color: ' . COLOR_HTML_READY . ';" value="' . $sid . '"', 'option selected style="background-color: ' . COLOR_HTML_READY . ';" value="' . $sid . '"', $star_list[$i]);
                        $star_list[0] = str_replace('<option value="' . $sid . '">' . $s->name . "</option>\n", '', $star_list[0]);
                        $star_list[0] = str_replace('option style="background-color: ' . COLOR_HTML_READY . ';" value="' . $sid . '">' . $s->name . "</option>\n", '', $star_list[0]);
//.........这里部分代码省略.........
开发者ID:nicholasmr,项目名称:obblm,代码行数:101,代码来源:class_inducements.php


示例11: foreach

 foreach ($team_ids as $tid) {
     $query = "SELECT (t.f_did = {$did}) AS 'in_did', (t.f_lid = {$lid}) AS 'in_lid' FROM teams AS t WHERE t.team_id = {$tid}";
     $result = mysql_query($query);
     if ($result) {
         $state = mysql_fetch_assoc($result);
         if (!$state['in_lid']) {
             $teams_OK['l'] = false;
             break;
         }
         if ($TIE_TEAMS && !$state['in_did']) {
             $teams_OK['d'] = false;
             break;
         }
     }
 }
 $errors = array(array(!$nameSet && !$addMatchToFFA, "Please fill out the tournament name."), array($nameSet && get_alt_col('tours', 'name', $_POST['name'], 'tour_id'), "Tournament name already in use."), array(!$teams_OK['d'], 'You may not schedule matches between teams from different divisions in the selected league.'), array(!$teams_OK['l'], 'You may not schedule matches between teams from different leagues OR one or more of the selected teams are not from the chosen league.'), array($leagues[$lid]['ring'] != Coach::T_RING_LOCAL_ADMIN, 'You do not have the rights to schedule matches in the selected league.'), array($_POST['type'] == 'RR_TOUR' && $teamsCount < 3, 'Please select at least 3 teams'), array($_POST['type'] == 'FFA_TOUR' && $teamsCount % 2 != 0, 'Please select an even number of teams'));
 // Print errors.
 $STATUS = true;
 foreach ($errors as $e) {
     if ($e[0]) {
         status(false, $e[1] . "<br>\n");
         $STATUS = false;
     }
 }
 /*
     Input modification.
 */
 if ($nameSet && get_magic_quotes_gpc()) {
     $_POST['name'] = stripslashes($_POST['name']);
 }
 // Shuffle team list if multiple teams are scheduled to play a FFA.
开发者ID:nicholasmr,项目名称:obblm,代码行数:31,代码来源:admin_schedule.php


示例12: __construct

 public function __construct($mid)
 {
     parent::__construct($mid);
     $this->hash_botocs = get_alt_col('leegmgr_matches', 'mid', $mid, 'hash');
 }
开发者ID:nicholasmr,项目名称:obblm,代码行数:5,代码来源:class_match_botocs.php


示例13: sec_main


//.........这里部分代码省略.........
                } else {
                    $box['dispType'] = 'latestgames';
                }
            }
        }
        switch ($box['type']) {
            case 'league':
                $_type = T_NODE_LEAGUE;
                break;
            case 'division':
                $_type = T_NODE_DIVISION;
                break;
            case 'tournament':
                $_type = T_NODE_TOURNAMENT;
                break;
            default:
                $_type = T_NODE_LEAGUE;
        }
        $box['type'] = $_type;
        $boxes[] = $box;
    }
    // Used in the below standings dispType boxes.
    global $core_tables, $ES_fields;
    $_MV_COLS = array_merge(array_keys($core_tables['mv_teams']), array_keys($ES_fields));
    $_MV_RG_INTERSECT = array_intersect(array_keys($core_tables['teams']), array_keys($core_tables['mv_teams']));
    // Let's print those boxes!
    foreach ($boxes as $box) {
        switch ($box['dispType']) {
            case 'standings':
                $_BAD_COLS = array();
                # Halt on these columns/fields.
                switch ($box['type']) {
                    case T_NODE_TOURNAMENT:
                        if (!get_alt_col('tours', 'tour_id', $box['id'], 'tour_id')) {
                            break 2;
                        }
                        $tour = new Tour($box['id']);
                        $SR = array_map(create_function('$val', 'return $val[0]."mv_".substr($val,1);'), $tour->getRSSortRule());
                        break;
                    case T_NODE_DIVISION:
                        $_BAD_COLS = array('elo', 'swon', 'slost', 'sdraw', 'win_pct');
                        # Divisions do not have pre-calculated, MV, values of these fields.
                        // Fall through!
                    # Divisions do not have pre-calculated, MV, values of these fields.
                    // Fall through!
                    case T_NODE_LEAGUE:
                    default:
                        global $hrs;
                        $SR = $hrs[$box['HRS']]['rule'];
                        foreach ($SR as &$f) {
                            $field = substr($f, 1);
                            if (in_array($field, $_MV_RG_INTERSECT)) {
                                if (in_array($field, $_BAD_COLS)) {
                                    # E.g. divisions have no win_pct record for teams like the mv_teams table (for tours) has.
                                    fatal("Sorry, the element '{$field}' in your specified house sortrule #{$box['HRS']} is not supported for your chosen type (ie. tournament/division/league).");
                                }
                                $f = $f[0] . "rg_" . substr($f, 1);
                            } else {
                                $f = $f[0] . "mv_" . substr($f, 1);
                            }
                        }
                        break;
                }
                list($teams, ) = Stats::getRaw(T_OBJ_TEAM, array($box['type'] => $box['id']), array(1, $box['length']), $SR, false);
                ?>
            <div class='boxWide'>
开发者ID:rythos42,项目名称:naflm,代码行数:67,代码来源:sections.php


示例14: _teamsSelect

    protected static function _teamsSelect()
    {
        global $lng;
        $_SUBMITTED = isset($_POST['team1_as']) && isset($_POST['team2_as']) && $_POST['team1_as'] && $_POST['team2_as'];
        $t1 = $t2 = '';
        if ($_SUBMITTED) {
            $t1 = $_POST['team1_as'];
            $t2 = $_POST['team2_as'];
        }
        ?>
    <br>
    <center>
    <form method='POST'>
    <input type="text" id='team1_as' name="team1_as" size="30" maxlength="50" value="<?php 
        echo $t1;
        ?>
">
    <script>
        $(document).ready(function(){
            var options, a;

            options = {
                minChars:3,
                    serviceUrl:'handler.php?type=autocomplete&obj=<?php 
        echo T_OBJ_TEAM;
        ?>
',
            };
            a = $('#team1_as').autocomplete(options);
        });
    </script>
        VS.
    <input type="text" id='team2_as' name="team2_as" size="30" maxlength="50" value="<?php 
        echo $t2;
        ?>
">
    <script>
        $(document).ready(function(){
            var options, b;

            options = {
                minChars:3,
                    serviceUrl:'handler.php?type=autocomplete&obj=<?php 
        echo T_OBJ_TEAM;
        ?>
',
            };
            b = $('#team2_as').autocomplete(options);
        });
    </script>
    <br><br>
    <input type="submit" name="compare" value="<?php 
        echo $lng->getTrn('cmp', __CLASS__);
        ?>
!">
    </form>
    </center>
    <br>
    <?php 
        return $_SUBMITTED ? array(get_alt_col('teams', 'name', $t1, 'team_id'), get_alt_col('teams', 'name', $t2, 'team_id')) : null;
    }
开发者ID:nicholasmr,项目名称:obblm,代码行数:61,代码来源:class_teamcompare.php


示例15: getMainBoardMessages

 public static function getMainBoardMessages($n, $lid = false, $get_tnews = true, $get_summaries = true)
 {
     global $settings;
     $board = array();
     // First we add all commissioner messages to the board structure.
     foreach (Message::getMessages($n, $lid) as $m) {
         $o = (object) array();
         // Specific fields:
         $o->msg_id = $m->msg_id;
         $o->author_id = $m->f_coach_id;
         // General fields:
         $o->cssidx = T_HTMLBOX_ADMIN;
         // CSS box index
         $o->type = T_TEXT_MSG;
         $o->author = get_alt_col('coaches', 'coach_id', $m->f_coach_id, 'name');
         $o->title = $m->title;
         $o->message = $m->message;
         $o->date = $m->date_posted;
         $o->pinned = $m->pinned;
         array_push($board, $o);
     }
     // Now we add all game summaries.
     if ($get_summaries) {
         foreach (MatchSummary::getSummaries($n, $lid) as $r) {
             $o = (object) array();
             $m = new Match($r->match_id);
             // Specific fields:
             $o->date_mod = $m->date_modified;
             $o->match_id = $m->match_id;
             // General fields:
             $o->cssidx = T_HTMLBOX_MATCH;
             // CSS box index
             $o->type = T_TEXT_MATCH_SUMMARY;
             $o->author = get_alt_col('coaches', 'coach_id', $m->submitter_id, 'name');
             $o->title = "Match: {$m->team1_name} {$m->team1_score}&mdash;{$m->team2_score} {$m->team2_name}";
             $o->message = $m->getText();
             $o->date = $m->date_played;
             $o->pinned = 0;
             // Not allowed for other types than board messages
             array_push($board, $o);
         }
     }
     // And finally team news.
     if ($get_tnews) {
         foreach (TeamNews::getNews(false, $n, $lid) as $t) {
             $o = (object) array();
             // Specific fields:
             # none
             // General fields:
             $o->cssidx = T_HTMLBOX_INFO;
             // CSS box index
             $o->type = T_TEXT_TNEWS;
             $o->author = get_alt_col('teams', 'team_id', $t->f_id, 'name');
             $o->title = "Team news: {$o->author}";
             $o->message = $t->txt;
             $o->date = $t->date;
             $o->pinned = 0;
             // Not allowed for other types than board messages
             array_push($board, $o);
         }
     }
     // Last touch on the board.
     if (!empty($board)) {
         objsort($board, array('-pinned', '-date'));
         if ($n) {
             $board = array_slice($board, 0, $n);
         }
     }
     return $board;
 }
开发者ID:nicholasmr,项目名称:obblm,代码行数:70,代码来源:class_text.php


示例16: edit

 public static function edit($pid, $title, $about)
 {
     $ENTRY_EXISTS = get_alt_col('cemetery', 'pid', $pid, 'date');
     if ($ENTRY_EXISTS) {
         $query = "UPDATE cemetery SET \n            title = '" . mysql_real_escape_string($title) . "', \n            about = '" . mysql_real_escape_string($about) . "' \n            WHERE pid = {$pid}";
         return mysql_query($query);
     } else {
         $query = "INSERT INTO cemetery \n            (pid, title, about, date) \n            VALUES \n            ({$pid}, '" . mysql_real_escape_string($title) . "', '" . mysql_real_escape_string($about) . "', NOW())";
         return mysql_query($query);
     }
 }
开发者ID:nicholasmr,项目名称:obblm,代码行数:11,代码来源:class_cemetery.php


示例17: getLeagueUrl

 public static function getLeagueUrl($lid, $l_name = null)
 {
     if (!isset($l_name)) {
         $l_name = get_alt_col('leagues', 'lid', $lid, 'name');
     }
     return "<a href=\"" . urlcompile(T_URL_STANDINGS, T_OBJ_TEAM, false, T_NODE_LEAGUE, $lid) . "\">" . $l_name . "</a>";
 }
开发者ID:nicholasmr,项目名称:obblm,代码行数:7,代码来源:class_league.php


示例18: create

该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_ancestors函数代码示例发布时间:2022-05-15
下一篇:
PHP get_also_bought函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap