Browse Source

调整tag标签调用伪静态问题,图片自动alt功能静态发布提示错误

tags/6.5.6
叙述、别离 1 week ago
parent
commit
69766c1e20
3 changed files with 16 additions and 17 deletions
  1. +1
    -3
      src/admin/ai_dialog.php
  2. +14
    -13
      src/system/extend.func.php
  3. +1
    -1
      src/system/taglib/tag.lib.php

+ 1
- 3
src/admin/ai_dialog.php View File

@@ -63,9 +63,7 @@ if (!empty($noeditor)) {
?>
</select>
</div>
<div class="form-group">
<button type="button" id="btnAIAction" class="btn btn-success btn-sm">确定</button>
</div>
<button type="button" id="btnAIAction" class="btn btn-success btn-sm">确定</button>
</div>
</div>
<script>


+ 14
- 13
src/system/extend.func.php View File

@@ -22,19 +22,21 @@ 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'
if (!function_exists('obtainimgs')) {
@@ -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;
@@ -58,7 +60,6 @@ function obtainalt($newalt)
{
global $dsql, $id, $aid;
$myid = isset($id) ? $id : $aid;
$title = isset($row['title']) ? $row['title'] : '';
$row = $dsql->GetOne("SELECT title FROM `#@__archives` WHERE id='$myid'");
//图片注释自动为标题
$newalt = str_ireplace(array('alt=""', 'alt=\'\'', 'title=""', 'title=\'\''), "", $newalt);


+ 1
- 1
src/system/taglib/tag.lib.php View File

@@ -11,7 +11,7 @@ if (!defined('DEDEINC')) exit ('dedebiz');
*/
function lib_tag(&$ctag, &$refObj)
{
global $dsql, $envs, $cfg_cmsurl, $cfg_tags_dir ,$cfg_rewrite;
global $dsql, $envs, $cfg_cmsurl, $cfg_tags_dir, $cfg_rewrite;
$attlist = "row|30,sort|new,getall|0,typeid|0,ishtml|0";
FillAttsDefault($ctag->CAttribute->Items, $attlist);
extract($ctag->CAttribute->Items, EXTR_SKIP);


Loading…
Cancel
Save