模板文件:
{%get name=plist class="did":$read.did,pid:$read.pid%} <li class="fl">{%if $read.ctitle!=‘‘%}上一篇:<a class="infolist2" title="{%$read.title%}" href="{%$read.link%}">{%$read.ctitle%}</a>{%/if%}</li> {%/get%} {%get name=plist class="did":$read.did,pid:$read.pid,class:1%} <li class="fr">{%if $read.ctitle!=‘‘%}下一篇:<a class="infolist2" title="{%$read.title%}" href="{%$read.link%}">{%$read.ctitle%}</a>{%/if%}</li> {%/get%}
修改php文件:
/interface/lib_plist.php
增加17行$pid = intval($para[‘pid‘]);//print($pid); 修改28行: if ($class) { $sql = "SELECT * FROM $db_table WHERE isclass=1 AND tid = $read[tid] AND pid > $pid ORDER BY pid ASC LIMIT 0,1"; } else { $sql = "SELECT * FROM $db_table WHERE isclass=1 AND tid = $read[tid] AND pid < $pid ORDER BY pid DESC LIMIT 0,1"; }
/interface/lib_plist.php
<?php class lib_plist extends connector { function lib_plist() { $this->softbase(); parent::start_pagetemplate(); $this->pagetemplate->libfile = true; } function call_plist($lng, $para, $filename = ‘plist‘, $outHTML = null) { $para = $this->fun->array_getvalue($para); $lngpack = $lng ? $lng : $this->CON[‘is_lancode‘]; $lng = ($lng == ‘big5‘) ? $this->CON[‘is_lancode‘] : $lng; include admin_ROOT . ‘datacache/‘ . $lng . ‘_pack.php‘; $did = intval($para[‘did‘]);//print($did); $pid = intval($para[‘pid‘]);//print($pid); if (empty($did)) { return false; } $class = intval($para[‘class‘]); $class = empty($class) ? 0 : $class; $db_table = db_prefix . ‘document‘; $read = $this->get_documentview($did); if (!$read[‘tid‘]) { return false; } if ($class) { $sql = "SELECT * FROM $db_table WHERE isclass=1 AND tid = $read[tid] AND pid > $pid ORDER BY pid ASC LIMIT 0,1"; } else { $sql = "SELECT * FROM $db_table WHERE isclass=1 AND tid = $read[tid] AND pid < $pid ORDER BY pid DESC LIMIT 0,1"; } $rslist = $this->db->fetch_first($sql); if (is_array($rslist)) { $typeread = $this->get_type($rslist[‘tid‘]); $rslist[‘typename‘] = $typeread[‘typename‘]; $rslist[‘typelink‘] = $this->get_link(‘type‘, $typeread, $lngpack); $rslist[‘pageclass‘] = $typeread[‘pageclass‘]; $rslist[‘link‘] = $this->get_link(‘doc‘, $rslist, $lngpack); $rslist[‘buylink‘] = $this->get_link(‘buylink‘, $rslist, $lngpack); $rsList[‘enqlink‘] = $this->get_link(‘enqlink‘, $rsList, $lngpack); $rslist[‘ctitle‘] = empty($rslist[‘color‘]) ? $rslist[‘title‘] : "<font color=‘" . $rslist[‘color‘] . "‘>" . $rslist[‘title‘] . "</font>"; } $this->pagetemplate->assign(‘read‘, $rslist); $this->pagetemplate->assign(‘lng‘, $lng); $this->pagetemplate->assign(‘lngpack‘, $LANPACK); if (!empty($outHTML)) { $output = $this->pagetemplate->fetch(null, null, $outHTML); } else { $output = $this->pagetemplate->fetch($lng . ‘/lib/‘ . $filename); } return $output; } }
时间: 2024-12-12 12:12:54