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


PHP Player::fromid方法代码示例

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


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

示例1: apiapp

include 'php/checklogged.php';
include 'php/opendatabase.php';
include 'php/club.php';
include 'php/rank.php';
include 'php/player.php';
include 'php/team.php';
include 'php/teammemb.php';
// This is the module called when all goes OK with the initial transaction, we need to get details of the
// transaction from Paypal and set up to call the final confirmation.
function apiapp(&$arr, $k, $v)
{
    array_push($arr, "{$k}={$v}");
}
try {
    $player = new Player();
    $player->fromid($userid);
} catch (PlayerException $e) {
    $mess = $e->getMessage();
    include 'php/wrongentry.php';
    exit(0);
}
$ind = $_GET["ind"];
$tok = $_GET["token"];
if (strlen($ind) == 0 || strlen($tok) == 0) {
    $mess = "No indicator given ind={$ind} tok={$tok}???";
    include 'php/wrongentry.php';
    exit(0);
}
$ret = mysql_query("select league,descr1,descr2,token,amount from pendpay where ind={$ind}");
if (!$ret) {
    $mess = mysql_error();
开发者ID:Britgo,项目名称:Online-League,代码行数:31,代码来源:payver.php

示例2: htmlspecialchars

$gid = $row["gameind"];
$subj = $row["subject"];
$hsubj = htmlspecialchars($subj);
$hasr = $row["hasread"];
$cont = $row["contents"];
try {
    $fp = new Player();
    $fp->fromid($fu);
} catch (PlayerException $e) {
    $mess = "Unknown sender id {$fu}";
    include 'php/wrongentry.php';
    exit(0);
}
try {
    $tp = new Player();
    $tp->fromid($tu);
} catch (PlayerException $e) {
    $mess = "Unknown recipient id {$tu}";
    include 'php/wrongentry.php';
    exit(0);
}
if (!$hasr && !$sent) {
    mysql_query("update message set hasread=1 where ind={$messid}");
}
if (preg_match("/(\\d+)-(\\d+)-(\\d+)\\s+(\\d+):(\\d+):(\\d+)/", $cr, $matches)) {
    $dat = $matches[3] . '/' . $matches[2] . '/' . $matches[1];
    $tim = $matches[4] . ':' . $matches[5] . ':' . $matches[6];
} else {
    $dat = $tim = $cr;
}
if ($mid != 0) {
开发者ID:Britgo,项目名称:Online-League,代码行数:31,代码来源:dispmessage.php

示例3: listmessages

function listmessages($userid, $sent)
{
    if ($sent) {
        $searchid = 'touser';
        $fetchid = 'fromuser';
        $msgt = "Sent";
        $fl = "&sent=y";
        $th = "To";
    } else {
        $searchid = 'fromuser';
        $fetchid = 'touser';
        $msgt = "Received";
        $fl = "";
        $th = "From";
    }
    print "<h1>{$msgt} messages</h1>";
    $Sun = mysql_real_escape_string($userid);
    $ret = mysql_query("select {$searchid},created,matchind,gameind,subject,hasread,ind from message where {$fetchid}='{$Sun}' order by created,subject");
    if (!$ret || mysql_num_rows($ret) == 0) {
        print "<p>No messages found.</p>\n";
    } else {
        print <<<EOT
<table class="resultsb">
<tr>
\t<th>{$th}</th>
\t<th>Date</th>
\t<th>Time</th>
\t<th>Match</th>
\t<th>Game</th>
\t<th>Subject</th>
EOT;
        while ($row = mysql_fetch_assoc($ret)) {
            $fu = $row[$searchid];
            $cr = $row["created"];
            $mid = $row["matchind"];
            $gid = $row["gameind"];
            $subj = $row["subject"];
            $qsubj = htmlspecialchars($subj);
            $hasr = $row["hasread"];
            $ind = $row["ind"];
            $fp = new Player();
            $fp->fromid($fu);
            $pre = $post = "";
            if (!$hasr) {
                $pre = "<strong>";
                $post = "</strong>";
            }
            if (preg_match("/(\\d+)-(\\d+)-(\\d+)\\s+(\\d+):(\\d+):(\\d+)/", $cr, $matches)) {
                $dat = $matches[3] . '/' . $matches[2] . '/' . $matches[1];
                $tim = $matches[4] . ':' . $matches[5] . ':' . $matches[6];
            } else {
                $dat = $tim = $cr;
            }
            $am = $mid == 0 ? "-" : "About match";
            $ag = $gid == 0 ? "-" : "About game";
            print <<<EOT
<tr>
\t<td>{$pre}{$fp->display_name()}{$post}</td>
\t<td>{$pre}{$dat}{$post}</td>
\t<td>{$pre}{$tim}{$post}</td>
\t<td>{$pre}{$am}{$post}</td>
\t<td>{$pre}{$ag}{$post}</td>
\t<td><a href="dispmessage.php?msgi={$ind}{$fl}">{$pre}{$qsubj}{$post}</a></td>
</tr>

EOT;
        }
        print "</table>\n";
    }
}
开发者ID:Britgo,项目名称:Online-League,代码行数:70,代码来源:messages.php

示例4: exit

}
$messid = $_POST["msgi"];
$mid = $_POST["mi"];
$gid = $_POST["gn"];
$subj = $_POST["subject"];
$msgt = $_POST["mcont"];
$ret = mysql_query("select fromuser from message where ind={$messid}");
if (!$ret || mysql_num_rows($ret) == 0) {
    $mess = "Cannot find mess id {$messid}";
    include 'php/wrongentry.php';
    exit(0);
}
$row = mysql_fetch_array($ret);
$recipid = $row[0];
$recip = new Player();
$recip->fromid($recipid);
$qfrom = mysql_real_escape_string($player->Userid);
$qto = mysql_real_escape_string($recipid);
$qsubj = mysql_real_escape_string($subj);
$qmsgt = mysql_real_escape_string($msgt);
mysql_query("insert into message (fromuser,touser,created,gameind,matchind,subject,contents) values ('{$qfrom}','{$qto}',now(),{$gid},{$mid},'{$qsubj}','{$qmsgt}')");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<?php 
$Qun = htmlspecialchars($username);
$Sun = mysql_real_escape_string($userid);
$Title = "Reply Sent";
include 'php/head.php';
?>
<body>
开发者ID:Britgo,项目名称:Online-League,代码行数:31,代码来源:sendreply.php

示例5: Params

include 'php/team.php';
include 'php/match.php';
include 'php/matchdate.php';
include 'php/game.php';
include 'php/params.php';
include 'php/hcp_message.php';
$asuser = $userid;
if ($admin && strlen($_GET["asuser"]) != 0) {
    $asuser = $_GET["asuser"];
}
// Get parameters to include handicap info
$pars = new Params();
$pars->fetchvalues();
$player = new Player();
try {
    $player->fromid($asuser);
} catch (PlayerException $e) {
    $mess = $e->getMessage();
    include 'php/wrongentry.php';
    exit(0);
}
// Get the teams this player is captain of
try {
    $captain_of = list_teams_captof($player);
} catch (TeamException $e) {
    $mess = $e->getMessage();
    include 'php/wrongentry.php';
    exit(0);
}
$unalloc_matches = array();
$oppunalloc_matches = array();
开发者ID:Britgo,项目名称:Online-League,代码行数:31,代码来源:osmatches.php

示例6: Player

//   (at your option) any later version.
//   This program is distributed in the hope that it will be useful,
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//   GNU General Public License for more details.
//   You should have received a copy of the GNU General Public License
//   along with this program.  If not, see <http://www.gnu.org/licenses/>.
// This is invoked from a subwindow so we don't do the frame emulation stuff.
include 'php/session.php';
include 'php/opendatabase.php';
include 'php/rank.php';
include 'php/player.php';
include 'php/club.php';
try {
    $player = new Player();
    $player->fromid($_GET['uid']);
} catch (PlayerException $e) {
    $mess = $e->getMessage();
    include 'php/wrongentry.php';
    exit(0);
}
$em = $player->Email;
$pw = $player->get_passwd();
if (strlen($em) == 0) {
    $Title = "No email address";
    $Mess = "Player {$player->display_name(false)} has no email address set up.";
} elseif (strlen($pw) == 0) {
    $Title = "No password";
    $Mess = "Player {$player->display_name(false)} has no password set.";
} else {
    $Title = "Reminder sent";
开发者ID:Britgo,项目名称:Online-League,代码行数:31,代码来源:rempwbyuid.php


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