本站资源均来自互联网,仅供学习与参考,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
Copyright @ 2015-2020 织梦园 版权所有
Power by DedeCms
鲁ICP备15039853号-1
鲁公网安备 37132302000249号
模板标签 TAG标签 网站地图 XML地图 今日更新 返回顶部
/**
* 插入Tags
*
* @access public
* @param string $tag tag标签
* @param int $aid 文档AID
* @return void
*/
if ( ! function_exists('InsertTags'))
{
function InsertTags($tag, $aid)
{
$tags = explode(',',$tag);
foreach($tags as $tag)
{
$tag = trim($tag);
if(isset($tag[20]) || $tag!=stripslashes($tag))
{
continue;
}
InsertOneTag($tag,$aid);
}
}
}
通过如下函数获取保存在表里的TAGS标签:
/**
* 获得某文档的所有tag
*
* @param int $aid 文档id
* @return string
*/
if ( ! function_exists('GetTags'))
{
function GetTags($aid)
{
global $dsql;
$tags = '';
$query = "SELECT tag FROM `dede_taglist` WHERE aid='$aid' ";
$dsql->Execute('tag',$query);
while($row = $dsql->GetArray('tag'))
{
$tags .= ($tags=='' ? $row['tag'] : ','.$row['tag']);
}
return $tags;
}
}
函数在/include/helpers/archive.helper.php中