2、在织梦内容页模板里写dede:sql标签
{dede:sql sql="SELECT * FROM dede_archives WHERE arcrank>-1 AND id in(~自定义字段名~) ORDER BY FIELD(id,~自定义字段名~)"} <a href=http://www.dede58.com/a/dedejq/"[field:id runphp=yes]$id=@me;$url=GetOneArchive($id);@me=$url['arcurl'];[/field:id]"><img src=http://www.dede58.com/a/dedejq/"[field:litpic/]">[field:title/]</a> <p>[field:description/]</p> {/dede:sql}~自定义字段名~ 有2处,改成你自己的字段名,例如 ~likeids~
3、打开 /include/taglib/sql.lib.php 找到
$sql = str_replace($conditions[0][$key], "'".addslashes($refObj->Fields[$value])."'", $sql);改成
if(is_numeric(str_replace(',','',$refObj->Fields[$value]))) { $sql = str_replace($conditions[0][$key], addslashes($refObj->Fields[$value]), $sql); } else { $sql = str_replace($conditions[0][$key], "'".addslashes($refObj->Fields[$value])."'", $sql); }