<?php
include_once("inc/config.php");
include_once("inc/ftbbsdbclass.php");
include_once("inc/publicfun.php");
include_once("inc/pageclass.php");
include_once("conn.php");
include_once("checkuser.php");
include_once("ftbbs_nav.php");
include_once("bbsuser.php");

$query = "SELECT * FROM {$tablepre}ftbbsmb";
$ftbbsmb=makecache('ftbbsmb.html',$query,$expire);
$pagesize=$ftbbsmb[5];
$defaulthome=$ftbbsmb[31];
include_once("homeurl.php");

$strsql="select * from {$tablepre}ftbbs_favorites,{$tablepre}bbstitle where {$tablepre}ftbbs_favorites.bbstitleid = {$tablepre}bbstitle.id and {$tablepre}ftbbs_favorites.clubuser_name='".get_cookie('username')."' order by {$tablepre}ftbbs_favorites.id desc";
$p = new ft_page;
$pagesize=$ftbbsmb[5];
$rs=mysql_query($strsql);
$myrow = mysql_fetch_array($rs);
$numrows = mysql_num_rows($rs); 

$p->pvar="page"; 
//$p->setvar(array("searchcontent" => $searchcontent, "searchkind" => $searchkind));
$p->set($pagesize,$numrows,$psize); 
$rsx=mysql_query($strsql." limit ".$p->limit());
?>
<HTML><HEAD>
<META http-equiv=Content-Type content=text/html;charset=utf-8>
<title>我的收藏夹</title>
<script language=javascript src="inc/cookies.js"></script>
<script>
var stylecook = getCookie("STYLESHOW");
var style;
var strstyle;
if(stylecook=="")
{
 stylecook=1;
}
else
{
 stylecook++;
}
style="main0"+stylecook+".css";
strstyle="<link href=\"css/"+style+"\"  rel=\"stylesheet\" type=\"text/css\"> ";
document.write(strstyle);
</script>
</HEAD>
</head>
<script language="JavaScript" src="inc/Main.js"></script>
<script src="js/publicfun.js" type="text/javascript"></script>
<body>
<?
if (get_cookie('ftbbstype')==1){
include_once("pbhead.php");
}
?>
<table width="99%" border=0 align="center" cellpadding=2 cellspacing=1 class="maintbbg">
  <tbody>
    <tr> 
      <td height="25" colspan="3" class="f12bg">&nbsp;<?=$userinfo?></td>
    </tr>
    <tr> 
      <td height="25" colspan="3" class="maintbtr3">&nbsp;<a href="<?=$homepage?>">论坛首页</a> 
        >> 贴子收藏</td>
    </tr>
  </tbody>
</table>
<table width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td height=5 bgcolor="#FFFFFF"><spacer height="5" type="block"></td>
  </tr>
</table>
<table width="99%" border=0 cellpadding=2 cellspacing=0 class="listborder" align="center">
  <tbody>
    <tr align=middle class=f12> 
      <td width="5%" height="28" class="f12bg">选择</td>
      <td width="52%" class="f12bg">论坛主题</td>
      <td width="10%" class="f12bg">回复/点击</td>
      <td width="11%" class="f12bg">作者</td>
      <td width="25%" class="f12bg">最后更新</td>
    </tr>
  <form name="selectform" method="post" action="delmyfavtories.php" style="MARGIN-TOP: 0px;margin-bottom:0px">
    <input type="hidden" name="op" value="选择删除">
    <input type="hidden" name="returnURL" value="myfavorties.php">
    <script language="JavaScript">
  <!--
  function select_pl_submit(optype){
	var f=document.forms["selectform"]
	f.op.value=optype
	f.submit()
  }
  //-->
  </script>
    <?
if ($myrow = mysql_fetch_array($rsx)){
if ($numrows>0){
    do {
    $i++;
	$indbdate=$myrow["dateh"];
	$indbdate=dateFormat($indbdate,'y-m-d H:i'); 
	$titlecolor=$myrow["titlecolor"];
	$bbstitle=$myrow["title"];
	if ($titlecolor!=""){
	$title="<font color=".$titlecolor.">".$bbstitle."</font>";
	}
	else{
	$title=$bbstitle;
	}
	$reinfo=$myrow["reinfo"];
	if (strrpos($reinfo,"||")){
	$rearr=explode("||",$reinfo);
	$arrnum=count($rearr)-1;
	$reinfo=$rearr[$arrnum];
	}
	if (reinfo!="" && strrpos($reinfo,",")){
	$reinfo=str_replace("|","",$reinfo);
	$rearr=explode(",",$reinfo);
	$replydate=$rearr[0];
	$replydate=dateFormat($indbdate,'y-m-d H:i');
	$replyuser=" <font color=red>|</font> <a class=map href=ftbbsmyinfo.php?ftbbsuser=".$rearr[1].">".$rearr[1]."</a>";
	}
	else{
	$replydate=$indbdate;
	$replyuser="";
	}
?>
    <tr align=middle> 
      <td width="5%" height="28" class="loopborder1"> <input type="checkbox" name="checkbox1[]" value="<?=$myrow["bbstitleid"]?>"> 
      </td>
      <td width="52%"  align=left valign="middle" class="loopborder2"> 
        <?if ($myrow["zhiye"]=="10"){?>
        <img src="images/rar.gif" width="16" height="16" align="absmiddle"> 
        <?}?>
        <?if ($myrow["P_display"]!="0" && $myrow["bbstop"]!=1 and $myrow["sign"]!="1" && $myrow["huati"]!="1" && $myrow["zhiye"]!="10" && $myrow["picture"]!=""){?>
        <img src="images/<?=$myrow["picture"]?>" width="19" height="19" align="absmiddle"> 
        <?}?>
        <a class=f14 href="ftbbs.php?id=<?=$myrow["ID"]?>" title="<?=$myrow["title"]?>&#xA;作者:<?=$myrow["user_id"]?>&#xA;发表于:<?=$myrow["dateh"]?>" target="_blank">
        <?=$title?>
        </a> 
        <?
			  if ($bbs_img_display==1){
			  echo "<img src=\"images/picflag.gif\" width=\"13\" height=\"13\" align=\"absmiddle\" alt=\"附带图片\">";
			  }
			  $pagenum=$ftbbsmb[6];//'贴子每页显示条数
              $k=$myrow["rep"]/$pagenum;
			  if (is_int($k)){
			  $repage=intval($k);
			  }else{
			  $repage=intval($k)+1;
			  }
			  if ($repage>1){
			    //echo "[";
				for ($i=0;$i<$repage;$i++){
				   if ($htmlsign==1){
				   $pagehtm='ftbbs-'.$myrow['ID'].'-'.($i+1).'.html';
				   }
				   else{
				   $pagehtm='ftbbs.php?page='.($i+1).'&id='.$myrow['ID'];
				   }
				   if ($i>=4 && $repage>6){
				      if ($htmlsign==1){
					  $pagehtm='ftbbs-'.$myrow['ID'].'-'.$repage.'.html';
					  }
					  else{
				      $pagehtm='ftbbs.php?page='.$repage.'&id='.$myrow["ID"];
					  }
				      echo '..<a class="mainouttd" href='.$pagehtm.' target="_blank">'.$repage.'</a>';
					  break;
				   }
				   if ($i==0){
				   echo '<a class="mainouttd" href='.$pagehtm.' target="_blank">'.($i+1).'</a>';
				   }
				   else{
				   echo '<a class="mainouttd" href='.$pagehtm.' target="_blank">'.($i+1).'</a>';
				   }
				}  
				//echo "]";
			  }
			?>
      </td>
      <td width="7%" class="loopborder1"> 
        <?=$myrow["rep"]?>
        /
        <?=$myrow["hit"]?>
      </td>
      <td width="9%" class="loopborder3"><a href="ftbbsmyinfo.php?ftbbsuser=<?=$myrow["user_id"]?>">
        <?=$myrow["user_id"]?>
        </a></td>
      <td width="16%" class="loopborder3"> <div align="left">
          <?=$replydate?>
          <?=$replyuser?>
        </div></td>
    </tr>
    <?
}
while ($myrow = mysql_fetch_array($rsx));
}
?>
    <tr valign="top"> 
      <td colspan="6" class="maintbtr1"> <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
          <tr> 
            <td align="left" class="f12"> <input type="checkbox" name="chkall" onclick="checkall(this.form)"> 
              <input name="button" type="button" onclick="select_pl_submit('选择删除')" value="将所选删除"> 
            </td>
            <td height="24" align="right" class="f12"> 
              <?
                $p->output(0);
				mysql_free_result($rs);
                $db->close(); 
                ?>
            </td>
          </tr>
        </table></td>
    </tr>
  </form>
  <?
}
else
{
?>
  <tr class="maintbtr3"> 
    <td colspan=6 align=center height=25 class="f12"> 欢迎到本论坛发表贴子！ </td>
  </tr>
  <?
}
?>
</table>
<?
include_once("inc/bbstail.php");
?>