/**
* 插入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中

免责声明:本站所有文章和图片均来自用户分享和网络收集,文章和图片版权归原作者及原出处所有,仅供学习与参考,请勿用于商业用途,如果损害了您的权利,请联系网站客服处理。

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。