|
|
@@ -22,21 +22,23 @@ if (!function_exists('obtaintheme')) { |
|
|
|
}
|
|
|
|
}
|
|
|
|
//标签调用[field:id function='obtaintags(@me,3)'/]3表示调用文档3个标签
|
|
|
|
if (!function_exists('obtaintags')) {
|
|
|
|
function obtaintags($aid, $num = 3)
|
|
|
|
{
|
|
|
|
global $dsql, $cfg_cmspath;
|
|
|
|
$tags = '';
|
|
|
|
$query = "SELECT * FROM `#@__taglist` WHERE aid='$aid' LIMIT $num";
|
|
|
|
$dsql->Execute('tag', $query);
|
|
|
|
while($row = $dsql->GetArray('tag')) {
|
|
|
|
function obtaintags($aid, $num = 3)
|
|
|
|
{
|
|
|
|
global $dsql, $cfg_cmspath, $cfg_rewrite;
|
|
|
|
$tags = '';
|
|
|
|
$query = "SELECT * FROM `#@__taglist` WHERE aid='$aid' LIMIT $num";
|
|
|
|
$dsql->Execute('tag', $query);
|
|
|
|
while ($row = $dsql->GetArray('tag')) {
|
|
|
|
if ($cfg_rewrite == 'Y') {
|
|
|
|
$link = $cfg_cmspath."/tags/{$row['tid']}";
|
|
|
|
} else {
|
|
|
|
$link = $cfg_cmspath."/apps/tags.php?/{$row['tid']}";
|
|
|
|
$tags .= ($tags == '' ? "<a href='{$link}'>{$row['tag']}</a>" : "、<a href='{$link}'>{$row['tag']}</a>");
|
|
|
|
}
|
|
|
|
return $tags;
|
|
|
|
$tags .= ($tags == '' ? "<a href=\"{$link}\">{$row['tag']}</a>" : "、<a href=\"{$link}\">{$row['tag']}</a>");
|
|
|
|
}
|
|
|
|
return $tags;
|
|
|
|
}
|
|
|
|
//提取文档多图片[field:body function='obtainimgs(@me,3)'/]3表示调用文档3张图片,则附加字段需添加body字段调用channelid='模型id' addfields='字段1,字段2'
|
|
|
|
//提取文档多图片[field:body function='obtainimgs(@me,3)'/]3表示调用文档3张图片,例如:文档模型body字段,列表附加字段添加body,dede:arclist标签调用添加channelid='1' addfields='body'
|
|
|
|
if (!function_exists('obtainimgs')) {
|
|
|
|
function obtainimgs($string, $num)
|
|
|
|
{
|
|
|
@@ -44,10 +46,10 @@ if (!function_exists('obtainimgs')) { |
|
|
|
$imgsrc_arr = array_unique($matches[3]);
|
|
|
|
$i = 0;
|
|
|
|
$result = '';
|
|
|
|
foreach($imgsrc_arr as $imgsrc)
|
|
|
|
foreach ($imgsrc_arr as $imgsrc)
|
|
|
|
{
|
|
|
|
if ($i == $num) break;
|
|
|
|
$result .= "<img src=\"$imgsrc\">";
|
|
|
|
$result .= "<img src=\"{$imgsrc}\">";
|
|
|
|
$i++;
|
|
|
|
}
|
|
|
|
return $result;
|
|
|
@@ -65,10 +67,11 @@ function obtainalt($newalt) |
|
|
|
//去掉图片宽度和高度
|
|
|
|
$newalt = preg_replace("/style=\"width\:(.*)\"/", "", $newalt);
|
|
|
|
//去掉结尾
|
|
|
|
$newalt = str_ireplace(" ", " ", $newalt);
|
|
|
|
$newalt = str_ireplace(" /", "", $newalt);
|
|
|
|
return $newalt;
|
|
|
|
}
|
|
|
|
//联动单筛选{dede:php}obtainfilter(模型id,类型,'字段1,字段2');{/dede:php}类型表示前台展现方式对应case值
|
|
|
|
//联动单筛选{dede:php}obtainfilter(模型id,类型,'字段1,字段2');{/dede:php}类型表示前台展现方式,对应case值,例如:文档模型style字段radio选项卡类型,列表附加字段类别添加style,标签调用{dede:php}obtainfilter(1,1,'style');{/dede:php}
|
|
|
|
function obtainfilter($channelid, $type = 1, $fieldsnamef = '', $defaulttid = 0, $toptid = 0, $loadtype = 'autofield')
|
|
|
|
{
|
|
|
|
global $tid, $dsql, $id, $aid;
|
|
|
|