默认帝国手动相关链接添加后会按照ID倒序自动排列

跟踪代码发现原因是由于下列语句的order by newstime desc造成的
e\admin\info\OtherLinkShow.php
$infosql=$empire->query("select isurl,titleurl,classid,id,newstime,username,userid,title from {$dbtbpre}ecms_".$class_r[$classid][tbname]." where id in (".$ids.") order by newstime desc limit ".$showlinknum);

将上述语句修改如下即可按照手工添加顺序显示相关链接:
$infosql=$empire->query("select isurl,titleurl,classid,id,newstime,username,userid,title from {$dbtbpre}ecms_".$class_r[$classid][tbname]." where id in (".$ids.") order by field(id,".$ids.") limit ".$showlinknum);

以上数据添加后存储在ecms_news_data_1表的keyid字段

原文链接:https://blog.csdn.net/nanj/article/details/119873994?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522166669233216800192296661%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fblog.%2522%257D&request_id=166669233216800192296661&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~blog~first_rank_ecpm_v1~times_rank-25-119873994-null-null.nonecase&utm_term=%E5%B8%9D%E5%9B%BDcms

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注