📄 most played.txt
字号:
<?php global $user; ?>
<?php if ($user->uid) : ?>
Welcome: <?php print l($user->name,'user/'.$user->uid); ?>|
<?php print l("logout","logout"); ?>
<?php else : ?>
<?php print l("Login","user/login"); ?>|
<?php endif; ?>
<?php
global $user;
function strGameType($type)
{
switch($type)
{
case 'P':return "play";
break;
case 'R': return "join";
break;
case 'C' :return "closed";
break;
default: return "error";
}
}
function strLink($type)
{
switch($type)
{
case 'P':
if($user->uid)
return "<a href='http://localhost/drupal-5.x/?q=eTreasureHunt/play''>" ;
else return "<a href='http://127.0.0.1/drupal-5.x/?q=user/login' >" ;
break;
case 'R': if($user->uid)
{return "<a href='http://localhost/drupal-5.x/?q=eTreasureHunt/play&game_id=$curID' ' method='get'>";
// mysql_query("insert into sms_hunt_mobiles values(select game_id,user_phone from sms_user where user_id=$curID' )");
}
else return "<a href='http://127.0.0.1/drupal-5.x/?q=user/login' >" ;
break;
case 'C' :return "";
break;
default: return "error";
}
}
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db( 'etreasure1' );
$result = mysql_query("SELECT count( sms_user.game_id ) AS c, sms_user.game_id, sms_game.game_name,sms_game.game_password,sms_game.game_type FROM sms_user, sms_game WHERE sms_user.game_id = sms_game.game_id AND sms_user.game_id IN (SELECT DISTINCT game_id FROM sms_game) GROUP BY (sms_user.game_id) ORDER BY c DESC LIMIT 0 , 10 ");
echo "<table border='1'>
<tr>
<th>No. of Plaly</th>
<th>name</th>
<th>SMS_String</th>
<th>Action</th>
</tr>";
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['c'] . "</td>";
$curID = $row['game_id'];
echo "<td>" . "<a href='http://localhost/drupal-5.x/?q=eTreasureHunt/description/&game_id=$curID' method='get'>" . $row['game_name'] . "</a>" . "</td>";
if($user->uid&&$row['game_type']!='C'||$row['game_type']=='P' )
{echo "<td >" . $row['game_password'] . "</td>"; }
else
{echo "<td> //////</td>"; }
echo "<td>" .strLink($row['game_type']) . strGameType($row['game_type'])."</a>" . "</td>";
echo "</tr>";
}
echo "</table>";
mysql_close($con);
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -