📄 viewfav.php
字号:
<?
/* BMForum Plus! Bulletin Board Systems Version : Plus! This is a freeware, but don't change the copyright information. A SourceForge Project - GNU Licence project. Web Site: http://www.bmforum.com Copyright (C) Bluview Technology*/
require("datafile/config.php");
require("getskin.php");
include("template.php");
require("lang/$language/usercp.php");
$username="{$_COOKIE['bmforumerboardidbym']}";
$navi_bar_des=$info[7];
$navi_bar_l2="<a href='forums.php?forumid=$forumid'>$forum_name</a>";
if (empty($username)) {
include("header.php");
navi_bar($navi_bar_des,$navi_bar_l2,$gl[53]);
$status=$error[3];
print_err();
include("footer.php");
exit;
}
if($action=="add"){
if(empty($username) || empty($filename) || empty($forumid)) exit;
$newstring="<?exit;?>||".safe_convert($forumid)."|".safe_convert($filename)."|\n";
$favFile ="favorites/".$fileusername;
if (file_exists($favFile)){ //检查文件是否存在
$fp = fopen($favFile,"a");
if (fwrite($fp,$newstring)) $echoInfo="$gl[6]";
else $echoInfo="$gl[7]";
fclose($fp);
}else{
$fp = fopen($favFile,"w"); //建立文件
if (fwrite($fp,$newstring)) $echoInfo="$gl[6]";
else $echoInfo="$gl[7]";
fclose($fp);
}
jump_page("viewfav.php",$echoInfo,
"$gl[3]
<ul>
<li><a href='topic.php?forumid=$forumid&filename=$filename'>$gl[8]</a></li><br><br>
<li><a href='forums.php?forumid=$forumid'>$gl[4]</a></li><br><br>
<li><a href='index.php'>$gl[5]</a></li><br>
</ul>");
}
if (empty($page)) $page=1;
require("lang/$language/usercp.php");
$forum_name=$info[9];
$add_title=" > $forum_name";
require("header.php");
$favFile ="favorites/".$fileusername;
if (file_exists($favFile)) {
$temp=file($favFile);
$amount=count($temp);
}
else $amount=0;
$des=$info[7];
navi_bar($des,$forum_name);
if(!file_exists("datafile/cache/themes/$styleidcode/usercp-$language-$openstylereplace.htm")){
$noexists=1;
newtemplate(0, "newtem/$temfilename/usercp.htm");
}else{
newtemplate(0, "datafile/cache/themes/$styleidcode/usercp-$language-$openstylereplace.htm",1);
}
if($cachedstyle==0) {
$noexists=0;
set_var($navbarshow,"",FALSE,"navbarshow");
if($openstylereplace==1) set_var(array("categorycolor"=>$categorycolor,"decorate1"=>$decorate1,"decorate2"=>$decorate2,"decorate3"=>$decorate3,"decorate4"=>$decorate4,"winimages"=>$winimages,"jiazhongcolor"=>$jiazhongcolor,"logofile"=>$logofile,"otherimages"=>$otherimages,"replyicon"=>$replyicon,"npollicon"=>$npollicon,"npost"=>$npost,"pollicon"=>$pollicon,"posticon"=>$posticon,"nonewpost"=>$nonewpost,"onlyread"=>$onlyread,"newpost"=>$newpost,"tablebg"=>$tablebg,"header_tile"=>$header_tile,"tile_back"=>$tile_back,"background_color"=>$background_color,"article_color2"=>$article_color2,"article_color1"=>$article_color1,"list_color2"=>$list_color2,"list_color1"=>$list_color1,"forumcolortwo"=>$forumcolortwo,"forumcolorone"=>$forumcolorone,"forumdescolor"=>$forumdescolor,"forumnamecolor"=>$forumnamecolor,"categoryfontcolor"=>$categoryfontcolor,"cautioncolor"=>$cautioncolor,"subcolor"=>$subcolor,"tablewidth"=>$tablewidth,"bordercolor"=>$bordercolor,"titlefontcolor"=>$titlefontcolor,"titlecolor"=>$titlecolor,"backgroundcolor"=>$backgroundcolor,));
}
if($noexists) {
set_var($navbarshow,"",FALSE,"navbarshow");
if($openstylereplace==1) set_var(array("categorycolor"=>$categorycolor,"decorate1"=>$decorate1,"decorate2"=>$decorate2,"decorate3"=>$decorate3,"decorate4"=>$decorate4,"winimages"=>$winimages,"jiazhongcolor"=>$jiazhongcolor,"logofile"=>$logofile,"otherimages"=>$otherimages,"replyicon"=>$replyicon,"npollicon"=>$npollicon,"npost"=>$npost,"pollicon"=>$pollicon,"posticon"=>$posticon,"nonewpost"=>$nonewpost,"onlyread"=>$onlyread,"newpost"=>$newpost,"tablebg"=>$tablebg,"header_tile"=>$header_tile,"tile_back"=>$tile_back,"background_color"=>$background_color,"article_color2"=>$article_color2,"article_color1"=>$article_color1,"list_color2"=>$list_color2,"list_color1"=>$list_color1,"forumcolortwo"=>$forumcolortwo,"forumcolorone"=>$forumcolorone,"forumdescolor"=>$forumdescolor,"forumnamecolor"=>$forumnamecolor,"categoryfontcolor"=>$categoryfontcolor,"cautioncolor"=>$cautioncolor,"subcolor"=>$subcolor,"tablewidth"=>$tablewidth,"bordercolor"=>$bordercolor,"titlefontcolor"=>$titlefontcolor,"titlecolor"=>$titlecolor,"backgroundcolor"=>$backgroundcolor,));
$wrtingcaches=nsubst();
writetofile("datafile/cache/themes/$styleidcode/usercp-$language-$openstylereplace.htm",$wrtingcaches);
}
psubst(0);
echo <<<EOT
<table cellspacing=0 cellpadding=0 width=$tablewidth align=center bgcolor=$bordercolor border=0><tr><td height=1></td></tr></table>
<table cellspacing=0 cellpadding=0 width=$tablewidth align=center border=1 background='$tile_back' bgcolor='$tile_back' bordercolor=$bordercolor>
<tr align=center height=26>
<td colspan=2 width=* class=title><b>$gl[280]</b></td>
<td width=120><b class=title>$gl[281]</b></td>
<td width=160><b class=title>$gl[279]</b></td>
<td width=50><a href='favcon.php?filename=all'><b class=title>$smlng[40]</b></a></td>
</tr>
</table>
EOT;
$favFile ="favorites/".$fileusername;
if (file_exists("$favFile")) {
$chkFp=fopen("$favFile","r");
flock($chkFp,LOCK_SH);
$checkStr = fread($chkFp,20);
fclose($chkFp);
}
if (file_exists("$favFile") && trim($checkStr) != "") {
$total=( max($page,10) * $perpage );
$fp=fopen($favFile,"r");
flock($fp,LOCK_SH);
$count=0;
while (!feof($fp) && $count<$total) {
$article_list[]=fgets($fp,800);
$count++;
}
fclose($fp);
if (!$article_list[$count-1]) {
unset ($article_list[$count-1]);
$count--;
}
if ($count%$perpage==0) $maxpageno=$count/$perpage;
else $maxpageno=floor($count/$perpage)+1;
if ($page>$maxpageno) $page=$maxpageno;
$pagemin=min( ($page-1)*$perpage , $count-1);
$pagemax=min( $pagemin+$perpage-1, $count-1);
for ($i=$pagemin; $i<=$pagemax; $i++) {
$a_info=$article_list[$i];
article_line();
}
} else {$maxpageno=1;}
?>
</table>
<br>
<!---Pages list begin-->
<table cellspacing=0 cellpadding=0 width=<?=$tablewidth?> align=center border=0 bgcolor=<?=$list_color1?>>
<form name=jump action=viewfav.php method=post>
<tr>
<td align=left >
<?
echo "<b>$gl[145]".$page."$gl[146] $gl[147]".$maxpageno."$gl[146]</b> ";
$nextpage=$page+1;
$previouspage=$page-1;
if ($page>=2) echo "<a href=\"viewfav.php?page=$previouspage\"><b>$gl[338]</b></a> ";
else echo "<font color=#BCC594>$gl[338]</font></b> ";
if ($page<=$maxpageno-1) echo "<a href=\"viewfav.php?page=$nextpage\"><b>$gl[339]</b></a> ";
else echo "<font color=#BCC594>$gl[339]</font> ";
echo "
$gl[149]<input type='text' name='page' size=4 maxlength=4 >$gl[146]
<input type='submit' value='$gl[137]' name='submit'> <b>[ ".$perpage."$gl[153]/$gl[146] ]</b>
";
?>
</td></tr>
</form>
</table>
<!------Pages list end--->
<?
require("footer.php");
exit;
function article_line() {
global $a_info,$list_color1,$idpath,$fileusername,$list_color2,$bordercolor,$username,$tablewidth,$read_perpage,$otherimages;
list($title,$author,$forumid,$filename)=explode("|",$a_info);
if (!file_exists("{$idpath}forum".basename($forumid)."/".basename($filename))) {
$favFile ="favorites/".$fileusername;
$oldlist=file($favFile);
$count=count($oldlist);
for ($i=0; $i<$count; $i++) {
$detail=explode("|",$oldlist[$i]);
if ($detail[3]==$filename) {
$oldlist[$i]="";
break;
}
}
$oldlist=implode("",$oldlist);
writetofile($favFile,$oldlist);
return;
}
$articlelist=file("{$idpath}forum$forumid/$filename");
list($title,$author)=explode("|",$articlelist[0]);
$viewauthor=$author;
if ($username==$author)
$stats="img src='$otherimages/system/mytopicnew.gif'";
else
$stats="img src='$otherimages/system/topicnew.gif'";
$stats="<a target=_blank href='topic.php?forumid=$forumid&filename=$filename'><$stats border=0></a>";
$title_back=$title;
if (utf8_strlen($title)>=61) $title=substr($title,0,58)."...";
$title=str_replace('%a%','<img src="$otherimages/attach/attach.gif" border=0>',$title);
$title="<acronym title=\"$title_back\"><a href='topic.php?forumid=$forumid&filename=$filename'\">$title</a></acronym>";
$forumlist=file('datafile/forumdata.php');
$count=count($forumlist);
for ($i=0; $i<$count; $i++) {
$detail=explode('|',$forumlist[$i]);
if ($detail[3]==$forumid) {$forumInfo=$detail[1]; break; }
}
$urlauthor=urlencode($author);
print ("
<table cellspacing=0 cellpadding=0 width=$tablewidth align=center border=1 bordercolor=$bordercolor>
<tr align=center height=25 bgcolor=$list_color1>
<td width=32>$stats</td>
<td width=* bgcolor=$list_color2 align=left> <acronym title=\"$des\">$title</acronym>$multipage</td>
<td width=120 ><a href=\"profile.php?job=show&target=$urlauthor\">$viewauthor</a></td>
<td width=160 bgcolor=$list_color2 ><a href=\"forums.php?forumid=$forumid\">$forumInfo</a></td>
<td width=50 ><a href=\"favcon.php?filename=$filename\">[X]</a></td>
</tr>
</table>
");
}
//---------Display the Error Message Table-------------------
function print_err() {
global $status,$gl,$language;
require("lang/$language/usercp.php");
msg_box("$gl[53]",$step2_error[16]);
}
//+-----------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -