コードページ番号足の変換は、夢のdedecmsの記事を詳細追求します:
<リンクのrel = "標準的な"のhref = " http://www.sdfymb.com {DEDE:フィールド名= 'arcurl' /}" />
<スクリプトSRC =」http://msite.baidu.com/sdk/ ?c.js APPID = 1634404368209099" > </ SCRIPT> 。
<スクリプトタイプ= "アプリケーション/ LD + JSON">
{
"@Context": " https://ziyuan.baidu.com/contexts/cambrian.jsonld "、
"@id": " HTTP://www.sdfymb。 COM {DEDE:フィールド名= 'arcurl' /}」、
"APPID": "1634404368209099"、
"タイトル": "{DEDE:field.title /} -方圆模板"、
"イメージ":[{DEDE:フィールド。身体機能= getbodypics(私、3 @)/}]、
"pubDateの":「{DEDE:フィールド。
しかしgetbodypics機能は存在しません、元のプログラムの夢を織るには、我々はファイルを変更する必要があります:/include/extend.func.phpは、
最終的にはファイルに追加します。
// 获取文章主题图片
function getbodypics($string, $num)
{
preg_match_all("/<img([^>]*)\s*src=('|\")([^'\"]+)('|\")/",$string,$matches);
$imgsrc_arr = array_unique($matches[3]);
$count = count($imgsrc_arr);
$i = 0;
if($count>2){
foreach($imgsrc_arr as $imgsrc)
{
if($i == $num) break;
if($i == 2){$result .= "\"http://www.sdfymb.com$imgsrc\"";break;}
$result .= "\"http://www.sdfymb.com$imgsrc\",";
$i++;
}
}else{
foreach($imgsrc_arr as $imgsrc)
{
if($i == 1) break;
$result .= "\"http://www.sdfymb.com$imgsrc\"";
$i++;
}
}
return $result;
}
これは、詳細ページを一覧表示する完全な変換足数のDEDECMSを達成することができるようになります!