<?php
include_once("../../../include/function.php");
include_once("../../../include/options.inc.php");
include("../include/para.inc");
//include("../../../include/sec_master.php");
include("../../../include/db.php");
include("../../../include/htmlencode.php");
include("../../../include/Member.php");
include("../include/Blog.php");
$data = open_data("../../../_admin/para/caching/30.txt");
$Member = new Member();
$arr = split(",",$data);
echo "<table cellspacing=0 cellpadding=3 width=100%>";
for($i=0;$i<2;$i++){
	$ddd = trim($arr[$i]);
	if($ddd){
		echo "<tr><td>";
		$Member->setID($ddd);
		$sex = $Member->row["sex"];				
		$photo_small = $Member->row["photo_small"];
		$face = $Member->row["face"];
		$username = $Member->row["nickname"]==""?$Member->row["user"]:$Member->row["nickname"];
		$blog_url = "$site/blog/".urlencode($Member->row["user"])."";
		$space_url = "$site/space/".urlencode($Member->row["user"])."";	
		$blogStr = "<br><a class=link target=_blank href='$space_url'>".$username."</a> ";		
		if($photo_small)
			$face = "<a target=_blank href='$space_url'><img width=48 height=48 src='/chat/userphotos/".$ddd."_small.".$photo_small."' style='border:#FFFFFF 2px solid' align=absmiddle></a> $blogStr";
		else if($face)
			$face = "<a target=_blank href='$space_url'><img width=48 height=48 src='/bbs/userface/".$face.".gif' style='border:#FFFFFF 2px solid' align=absmiddle></a> $blogStr";
		else if($sex=="0"){
			$face = "<a target=_blank href='$space_url'><img src='/images/cool/face_boy_mid.gif' border=0 align=absmiddle></a> $blogStr";	
		}
		else if($sex=="1"){
			$face = "<a target=_blank href='$space_url'><img src='/images/cool/face_girl_mid.gif' border=0 align=absmiddle></a> $blogStr";
		}
		$f_blog = "";
		$Blog = new Blog();
		$t = mysql_query("select * from $Blog->table where parentID=0 and userID=$ddd order by rand() limit 0,1");
		if($row = mysql_fetch_array($t)){
			$f_blog = _substr(htmlencode($row["content"]),171)." <a target='_blank' href='/dating/blog/".$row["ID"]."'>[more]</a>";
		}
		echo "<table cellspacing=0 cellpadding=2 width=100%>
		<tr><td align=center>$face</td><td>
		<a class=link target=_blank href='$blog_url'>[Blog]</a><br><input size=40 onclick='this.select()' type=text style='border:#cccccc 1px dotted;font-size:10px' value='$blog_url'><br>
		<a class=link target=_blank href='$space_url'>[Space]</a><br><input size=40 onclick='this.select()' type=text style='border:#cccccc 1px dotted;font-size:10px' value='$space_url'>
		</td></tr>
		<tr><td colspan=2>$f_blog</td></tr>
		</table>";
		echo "</td></tr>";		
	}
}
echo "</table>";
?>