<?php
$where = $_SERVER['REQUEST_URI'];
include("../common.php");
include("common.php");
include("../include/class/Image.php");
//============
$menu_blog = "<img src='/images/menu_this.jpg' border='0'>";
$titleHeader = $this_section;
//============
//=====================
$list_blog = 8;
$list_forum = 8;
$list_order = 8;
//=====================
$blog = new Blog();
$user = substr($where,(strrpos($where,"/")+1));
$user = urldecode($user);
$member = new Member();
$member->setUser($user);
$user = $member->row["user"];
if(!$user){
	header("location:../register?msg=This member does not exist.");
}
$titleHeader = $this_section;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Pragma" content="no-cache" />
<META name="description" content="<?=$_meta_des?>">
<META name="keywords" content="<?=$_meta_keyword?>">
<meta name="robots" content="follow,index">
<title><?=$titleHeader?></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="<?=BLOG_PATH?>include/style.css" type="text/css">
<? include($tps."elements/meta.inc")?>
<script type="text/javascript" src="http://download.skype.com/share/skypebuttons/js/skypeCheck.js"></script>
<script language="javascript">
var max_len = 300;
function resize(elem) {
  if (elem == undefined || elem == null) return false;
  if (elem.width > max_len) elem.width = max_len;  
}
</script>
</HEAD>
<BODY>
	<div id="wrapper"> 
    <? include($tps."elements/header.php")?>		
	 <div id="main_body2">       
     		<div id="col_l">
         	<? include("panel_more.htm")?>
	  		</div>		  
            <div id="col_r">
        <div class="title" style="padding-bottom:15px"><img src="../images/photo/blog_title.jpg" width="160" height="76" /></div>
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr> 
            <td height="33" valign="top" style="padding-left:0px"> <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                <tr> 
                  <td height="10" valign="top"></td>
                </tr>
                <tr> 
                  <td height="56" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                      <tr> 
                        <td width="24%" valign="top"> 
<?
$photoext = $member->row["photoext"];
if($photoext){
	$path = path($member->row["pDate"]);
	$face = "<table cellpadding='2'cellspacing='0' style='border:#666666 1px solid'><tr><td><img style='border:#FFFFFF 2px solid;' onload='resize(this)' width='300' src='/chat/userphotos/$path/".$member->row["memberID"].".".$photoext."' border=0></td></tr></table>";
}		
echo $face;					  
?>
                        </td>
                        <td width="76%" valign="top"><table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
                            <tr> 
                              <td align="center"> 
                                <?=$msg1?>
                              </td>
                            </tr>
                            <tr> 
                              <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                                  <tr> 
                                    <td> 
                                      <!------- search result start ------>
                                      <table width="100%" height="50"  border="0" cellpadding= "cellspacing=0">
                                        <tr> 
                                          <td height="30" align="middle" valign="middle"> 
                                            <?
$condStr = " where (parentID='0' or series_parentID<>'0' ) and userID='".$member->row["memberID"]."' ";
$sortStr = "";
If($sortBy) $sortStr = " order by $sortBy"; else  $sortStr = " order by ID desc"; 	
$sql="SELECT * FROM $table_details $condStr $sortStr limit 0,100";
$tsql = "SELECT count(ID) as total from $table_details $condStr ";
$result = mysql_query($sql) or die(mysql_error());
$tquery = mysql_query($tsql) or die(mysql_error());
$trows = mysql_fetch_array($tquery);
$count = $trows['total'];
if($count == "0") echo "Your search yielded no result.<br>";
?>
                                            <div class="head"><?php echo $msg?> 
                                            </div>
                                            <? 
$caching_date = "";
echo "<table width=100% cellpadding=0 cellspacing=6>";
while($row=mysql_fetch_array($result)){
		$ID = $row["ID"];
		$subject = $row["subject"];
		$hotnet = BLOG_PATH.hotnet_url($ID,$subject);
		//---------------------------------------
	$postDate = substr($row["postDate"],0,10);
	$postDate = date("l M d, Y",strtotime($postDate));
	if($caching_date!=$postDate){
		$caching_date = $postDate;
		$dis_date = "<div class='title_orange_large'>".$caching_date."</div>";
	}
	else{
		$dis_date = "";
	}
	//---------------------------------------
	echo "<tr><td>$dis_date<div style='padding-top:10px;padding-bottom:10px;'><a class=link href='$hotnet'>$subject</a> <font class=small>(".$row["postDate"].")</font></div>
	</td></tr><tr><td class='listing_div'>&nbsp;</td></tr>";
}
echo "</table>";       
if($count>100)
	echo "<div style='text-align:center'><a href='".BLOG_PATH."search?userID=".$member->row["memberID"]."'>[More]</a></div>";
	
?>
                                          </td>
                                        </tr>
                                      </table>
                                      <!------- search result end ------>
                                    </td>
                                  </tr>
                                </table></td>
                            </tr>
                          </table></td>
                      </tr>
                    </table></td>
                </tr>
              </table></td>
          </tr>
        </table>
      </div>		
      <!--col_r end-->
	  <div style="clear: both;">&nbsp;</div>	
    </div>
	</div>
	<? include($tps."elements/footer.php")?>
</body>
</html>