⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 last added.txt

📁 drupal(内容管理系统CMS)的应用项目
💻 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
 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 * FROM sms_game order by Creationdate desc LIMIT 0 , 10 ");

//echo "<form name='play' action='' method='get'>";
echo "<table border='1'>
<tr>
<th>Date Creation</th>
<th>Name</th>

<th>SMS_String</th>

<th>Action</th>
</tr>";
while($row = mysql_fetch_array($result))
  {
  echo "<tr>";
	$curID = $row['game_id'];
  echo "<td>" . $row['CreationDate'] . "</td>";
	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 "</table>";

	//echo "</form>";
	mysql_close($con);
?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -