1.在source/space_blog.php找到如下代码
//读取日志
$query = $_SGLOBAL['db']->query("Select bf.*, b.* FROM ".tname('blog')." b LEFT JOIN ".tname('blogfield')." bf ON bf.blogid=b.blogid Where b.blogid='$id' AND b.uid='$space[uid]'"); $blog = $_SGLOBAL['db']->fetch_array($query);
在此代码后面加上下面的代码
//uchome日志分页代码开始
$pagesperpage = 1; $blogdefaultsize = 1000;//默认分页字数 $blogpage = empty($_GET['page'])?1:intval($_GET['page']); if($blogpage<1) $blogpage = 1; $blogpagestart = ($blogpage-1)*$pagesperpage; ckstart($blogpagestart,$pagesperpage); $blog['message'] = str_replace('<FONT color=#ff0000>#uchome_blog_page#</FONT>','<font color="#ff0000">#uchome_blog_page#</font>',$blog['message']); $blog['message'] = explode('<font color="#ff0000">#uchome_blog_page#</font>',$blog['message']); $blogpages = count($blog['message']); if($blogpages>1) { $blog['message']= $blog['message'][$blogpagestart]; } else { $blog['message']= $blog['message'][0]; } $theurl = 'space.php?uid='.$uid.'&do=blog&id='.$id; $blogmulti = multi($blogpages,$pagesperpage,$blogpage, $theurl); //uchome日志分页代码结束
2.在template/default/cp_blog.htm找到如下代码
<input type="text" class="t_input" size="40" id="tag" name="tag" value="$blog[tag]"> <input type="button" name="clickbutton[]" value="自动获取" class="button">
在后面加上
<input type="button" class="button" value="插入分页标签" />
3.在/template/default/space_blog_view.htm找到如下代码
$blog[message] 在后面加上
<div class="page">$blogmulti</div>
4.设置完以上步骤后的效果如下 |