啥都不說(shuō)了,這個(gè)頁(yè)面就是用于ajax的,直接上代碼,哈哈,喜歡的人到時(shí)候送我?guī)讉€(gè)IP就行了
1. <?php
2. require_once(dirname(__FILE__)."/../include/common.inc.php");
3. require_once(dirname(__FILE__)."/../include/channelunit.func.php");
4.
5.
6. foreach($_REQUEST as $k=>$v)
7. {
8. $$k=$v;
9. }
10.
11.
12. if (empty($order)) $order = "pubdate";
13. if (empty($orderway)) $orderway = "desc";
14. if (empty($rs_start)) $rs_start = 0;
15. if (empty($rs_end)) $rs_end = 10;
16.
17. $wherejoin = array();
18.
19. if (!empty($arcid)) $wherejoin[]= " arc.id in ($arcid) ";
20. if (!empty($tid)) $wherejoin[]=" arc.typeid=’$tid’ ";
21.
22. $wheresql = join(‘ and ‘,$wherejoin);
23. if (!empty($wheresql)) $wheresql="where " . $wheresql;
24.
25. if (empty($mod)) $mod=’static’;
26.
27.
28.
29. $query = "Select arc.*,tp.typedir,tp.typename,tp.corank,tp.isdefault,tp.defaultname,tp.namerule,tp.namerule2,tp.ispart,
30. tp.moresite,tp.sitepath,tp.siteurl
31. from `dede_archives` arc left join `dede_arctype` tp on arc.typeid=tp.id
32. $wheresql order by $order $orderway limit $rs_start,$rs_end
33. ";
34.
35.
36.
37. $dsql->SetQuery($query);
38. $dsql->Execute();
39.
40.
41. while($row = $dsql->GetArray())
42. {
43.
44. if ($mod==’static’)
45. {
46.
47. $row['filename'] = $row['arcurl'] = GetFileUrl($row['id'],$row['typeid'],$row['senddate'],$row['title'],$row['ismake'],
48. $row['arcrank'],$row['namerule'],$row['typedir'],$row['money'],$row['filename'],$row['moresite'],$row['siteurl'],$row['sitepath']);
49.
50. $arcurl="{$row['filename']}";
51.
52. }
53.
54. else if ($mod==’dynamic’)
55. {
56.
57. $arcurl="/plus/view.php?aid={$row['id']}";
58.
59. }
60.
61.
62. echo "<li><a href=’$arcurl’>{$row['title']}</a></li>";
63.
64.
65. }
66. ?>
獲取方法
網(wǎng)站最新文章10篇 /plus/typearc.php
網(wǎng)站最新文章20篇 /plus/typearc.php?rs_end=20
網(wǎng)站最新文章從第5條開(kāi)始的10條記錄 /plus/typearc.php?rs_start=5&rs_end=10
網(wǎng)站文章按照id順序排列 /plus/typearc.php?order=id&orderway=asc
網(wǎng)站欄目id為8的最新文章10篇 /plus/typearc.php?tid=8
文章id為178和179的文章 /plus/typearc.php?arcid=178,179
獲得靜態(tài)的文章鏈接 /plus/typearc.php?mod=static
獲取動(dòng)態(tài)的文章鏈接 /plus/typearc.php?mod=dynamic
獲取方法示例(jquery.ajax)
function gettypearc(id,Element){
$.ajax({
type: "POST",
url: ‘plus/typearc.php’,
data: ‘mod=dynamic&tid=’+id,
success: function(html){
$(Element).html(html);
}
});
}
<a href="javascript:" onclick="gettypearc(’8′,’type8′)">刷新文章列表</a>
<p id=’type8′>
{dede:arclist
…..
}
</p>
這樣文章就能填充進(jìn)來(lái)了
文章來(lái)自 dede論壇 作者liujin834
版權(quán)聲明: 本站資源均來(lái)自互聯(lián)網(wǎng)或會(huì)員發(fā)布,如果侵犯了您的權(quán)益請(qǐng)與我們聯(lián)系,我們將在24小時(shí)內(nèi)刪除!謝謝!
轉(zhuǎn)載請(qǐng)注明: Dedecms 文章列表動(dòng)態(tài)調(diào)用