01 |
function GetPreNext($gtype='') |
04 |
if(count($this->PreNext)<2) |
07 |
$preR = $this->dsql->GetOne("Select id From `dede_arctiny` where id<$aid And arcrank>-1 And typeid='{$this->Fields['typeid']}' order by id desc"); |
08 |
$nextR = $this->dsql->GetOne("Select id From `dede_arctiny` where id>$aid And arcrank>-1 And typeid='{$this->Fields['typeid']}' order by id asc"); |
09 |
$next = (is_array($nextR) ? " where arc.id={$nextR['id']} " : ' where 1>2 '); |
10 |
$pre = (is_array($preR) ? " where arc.id={$preR['id']} " : ' where 1>2 '); |
11 |
$query = "Select arc.id,arc.title,arc.shorttitle,arc.typeid,
arc.ismake,arc.senddate,arc.arcrank,arc.money,arc.filename,arc.litpic, |
12 |
t.typedir,t.typename,t.namerule,t.namerule2,t.ispart,t.moresite,t.siteurl,t.sitepath |
13 |
from `dede_archives` arc left join dede_arctype t on arc.typeid=t.id "; |
14 |
$nextRow = $this->dsql->GetOne($query.$next); |
15 |
$preRow = $this->dsql->GetOne($query.$pre); |
18 |
$mlink = GetFileUrl($preRow['id'],$preRow['typeid'],$preRow['senddate'],
$preRow['title'],$preRow['ismake'],$preRow['arcrank'], |
19 |
$preRow['namerule'],$preRow['typedir'],$preRow['money'],$preRow['filename'],$preRow
['moresite'],$preRow['siteurl'],$preRow['sitepath']); |
20 |
$mobile_mlink = "/m/view.php?aid=".$preRow['id']; |
23 |
$this->PreNext['preimg'] = " "; |
27 |
$this->PreNext['pre'] = "上一篇:没有了 "; |
28 |
$this->PreNext['mobile_pre'] = "上一篇:没有了 "; |
29 |
$this->PreNext['preimg'] =" "; |
31 |
if(is_array($nextRow)) |
33 |
$mlink = GetFileUrl($nextRow['id'],$nextRow['typeid'],$nextRow['senddate'],$nextRow['title']
,$nextRow['ismake'],$nextRow['arcrank'], |
34 |
$nextRow['namerule'],$nextRow['typedir'],$nextRow['money'],
$nextRow['filename'],$nextRow['moresite'],$nextRow['siteurl'],$nextRow['sitepath']); |
35 |
$mobile_mlink = "/m/view.php?aid=".$nextRow['id']; |
38 |
$this->PreNext['nextimg'] = " "; |
42 |
$this->PreNext['next'] = "下一篇:没有了 "; |
43 |
$this->PreNext['mobile_next'] = "下一篇:没有了 "; |
49 |
$rs = $this->PreNext['pre']; |
51 |
else if($gtype=='preimg'){ |
52 |
$rs = $this->PreNext['preimg']; |
54 |
else if($gtype=='mobile_pre'){ |
55 |
$rs = $this->PreNext['mobile_pre']; |
57 |
else if($gtype=='next') |
59 |
$rs = $this->PreNext['next']; |
61 |
else if($gtype=='mobile_next') |
63 |
$rs = $this->PreNext['mobile_next']; |
65 |
else if($gtype=='nextimg'){ |
66 |
$rs = $this->PreNext['nextimg']; |
70 |
$rs = $this->PreNext['pre']." ".$this->PreNext['next']; |
|