【插件名稱】短消息加回分頁功能
【適用版本】3.01
【插件來源】轉貼
【插件類型】優化
【是否升級資料庫】否
【插件介紹】 修改檔案
message.php
template/wind/message.htm
template/wind/message.htm找
複製程式
<form name='del' action='$secondurl' method=POST>
<table width=100% cellspacing=1 cellpadding=3 $i_table>
改為
複製程式
<!--
EOT;
if($fenye){print <<<EOT
-->
<table width=100% cellspacing=0 cellpadding=0 align=center>
<tr><td>$fenye
<tr><td height=2>
</td></tr></table>
<!--
EOT;
}print <<<EOT
-->
<table width=100% cellspacing=1 cellpadding=3 $i_table>
<form name='del' action='$secondurl' method=POST>
再找
複製程式
<br><center>
<input name=towhere type=hidden value='$towhere'>
<input name=action type=radio value='down'> 下載
<input name=action type=radio value='del' checked> 刪除
<input type='button' name='chkall' value='全 選' onclick='CheckAll(this.form)'>
<input type=submit value='確 定'>
</center></form>
之上加入 ( 緊記加在上面 )
複製程式
<table width=100% cellspacing=0 cellpadding=0 align=center>
<tr><td height=2>
<tr><td>$fenye
</td></tr></table>
message.php 最頂找
複製程式
require_once('./global.php');
下面加入
複製程式
require_once(R_P.'require/forum.php');
再找
複製程式
$gp_maxmsg==0 && Showmsg('msg_group_right');
下面加入 (注意 $db_perpage=20; 20 是每頁顯示多少篇 請自行修改)
複製程式
$db_perpage=20;
if(!is_numeric($page) || $page<0){
$page=1;
}
再找
複製程式
if ($action=="receivebox"){
下面加入
複製程式
$start=($page-1)*$db_perpage;
$numofpage=$msgcount%$db_perpage==0 ? floor($msgcount/$db_perpage) : floor($msgcount/$db_perpage)+1;
$fenye=numofpage($msgcount,$page,$numofpage,"message.php?action=receivebox&",$msgcounts);
再找
複製程式
$query = $db->query("SELECT mid,fromuid,touid,username,ifnew,title,mdate FROM pw_msg WHERE type='rebox' AND touid='$winduid' ORDER BY mdate DESC");
改為
複製程式
$query = $db->query("SELECT mid,fromuid,touid,username,ifnew,title,mdate FROM pw_msg WHERE type='rebox' AND touid='$winduid' ORDER BY mdate DESC LIMIT $start,$db_perpage");
再找
複製程式
下面加入
複製程式
$sebox = $db->get_one("SELECT COUNT(*) AS count FROM pw_msg WHERE type='sebox' AND fromuid='$winduid'");
$seboxcount = $sebox['count'];
$start=($page-1)*$db_perpage;
$numofpage=$seboxcount%$db_perpage==0 ? floor($seboxcount/$db_perpage) : floor($seboxcount/$db_perpage)+1;
$fenye=numofpage($seboxcount,$page,$numofpage,"message.php?action=sendbox&",$counts);
再找
複製程式
$query = $db->query("SELECT mid,fromuid,touid,username,ifnew,title,mdate FROM pw_msg WHERE type='sebox' AND fromuid='$winduid' ORDER BY mdate DESC");
改為
複製程式
$query = $db->query("SELECT mid,fromuid,touid,username,ifnew,title,mdate FROM pw_msg WHERE type='sebox' AND fromuid='$winduid' ORDER BY mdate DESC LIMIT $start,$db_perpage");
再找
複製程式
下面加入
複製程式
$rebox = $db->get_one("SELECT COUNT(*) AS count FROM pw_msg WHERE type='rebox' AND fromuid='$winduid'");
$reboxcount = $rebox['count'];
$start=($page-1)*$db_perpage;
$numofpage=$reboxcount%$db_perpage==0 ? floor($reboxcount/$db_perpage) : floor($reboxcount/$db_perpage)+1;
$fenye=numofpage($reboxcount,$page,$numofpage,"message.php?action=scout&",$counts);
再找
複製程式
$query = $db->query("SELECT mid,fromuid,touid,ms.username,me.username AS toname,ifnew,title,mdate FROM pw_msg ms LEFT JOIN pw_members me ON me.uid=ms.touid WHERE type='rebox' AND fromuid='$winduid' ORDER BY mdate DESC LIMIT $gp_maxmsg");
改為
複製程式
$query = $db->query("SELECT mid,fromuid,touid,ms.username,me.username AS toname,ifnew,title,mdate FROM pw_msg ms LEFT JOIN pw_members me ON me.uid=ms.touid WHERE type='rebox' AND fromuid='$winduid' ORDER BY mdate DESC LIMIT $start,$db_perpage");