标签:orderby 文章 dir lis his col style listview where
找到 /include/arc.listview.class.php
if($orderby=="senddate" || $orderby=="id") { $ordersql=" ORDER BY arc.id $orderWay"; } else if($orderby=="hot" || $orderby=="click") { $ordersql = " ORDER BY arc.click $orderWay"; } else if($orderby=="lastpost") { $ordersql = " ORDER BY arc.lastpost $orderWay"; } else if($orderby=="weight") { // 新增 $ordersql = " order by arc.weight $orderWay"; } else { $ordersql=" ORDER BY arc.sortrank $orderWay"; }
if(preg_match(‘/hot|click|weight|lastpost/‘, $orderby)) // 新增 { $query = "SELECT arc.*,tp.typedir,tp.typename,tp.isdefault,tp.defaultname, tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath $addField FROM `#@__archives` arc LEFT JOIN `#@__arctype` tp ON arc.typeid=tp.id $addJoin WHERE {$this->addSql} $ordersql LIMIT $limitstart,$row"; }
模板中 :
orderby=‘weight‘ orderway=‘asc‘
标签:orderby 文章 dir lis his col style listview where
原文地址:https://www.cnblogs.com/Skate0rDie/p/10737320.html