dede調用文章內第一張圖

文件修改include\helpers\extend.helper.php最後添加

/**
* 多縮略圖插件
*
* @return string
*/
if( ! function_exists('simgs'))

{

function simgs($aid){
global $dsql;
$arcRow = GetOneArchive($aid);
$docdir =$arcRow[typedir];
$senddate =$arcRow[senddate];
//$senddated=MyDate('Y/md',$senddate);
//$docurl = str_replace("{cmspath}","$docdir","$senddated");
$sql = "SELECT url FROM #分隔符@__uploads WHERE arcid='$aid' ORDER BY aid DESC LIMIT 1";
$dsql->SetQuery($sql);
$dsql->Execute();
while ($row = $dsql->GetArray()) {
$spics .= "$row[url]";
}
return $spics;
}
}

前臺標籤[field:id function="simgs(@me)"/] 調用的是圖片路徑


注:方法中的‘分隔符’ 三個字自行刪除
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章