【插件名称】短消息加回分页功能
【适用版本】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");