Browse Source

系统优化

pull/54/head
叙述、别离 1 month ago
parent
commit
bcedbf44e8
5 changed files with 21 additions and 15 deletions
  1. +2
    -0
      docs/changelog.md
  2. +1
    -1
      src/admin/inc/inc_archives_functions.php
  3. +2
    -2
      src/install/config.cache.inc.php
  4. +0
    -12
      src/system/archive/archives.class.php
  5. +16
    -0
      src/system/extend.func.php

+ 2
- 0
docs/changelog.md View File

@@ -6,6 +6,8 @@
- 优化会员账号注册和修改限制;
- 优化系统一方式提示;
- 优化后台链接官方资源加载超时,依然保持流畅;
- 优化自动关键词默认状态;
- 优化图片自动alt;
- 重做响应式后台登录页面;
- 其他常规问题修复;



+ 1
- 1
src/admin/inc/inc_archives_functions.php View File

@@ -535,7 +535,7 @@ function AnalyseHtmlBody($body, &$description, &$litpic, &$keywords, $dtype = ''
$litpic = GetDDImgFromBody($body);
}
//自动获取关键词
if ($autokey == 2 && $keywords == '') {
if ($autokey == 1 && $keywords == '') {
$subject = $title;
$message = $body;
//采用DedeBIZ Core分词组件分词


+ 2
- 2
src/install/config.cache.inc.php View File

@@ -50,8 +50,8 @@ $cfg_makesign_cache = 'N';
$cfg_rm_remote = 'Y';
$cfg_arc_dellink = 'N';
$cfg_arc_autopic = 'Y';
$cfg_arc_autokeyword = 'Y';
$cfg_title_maxlen = 60;
$cfg_arc_autokeyword = 'N';
$cfg_title_maxlen = 255;
$cfg_album_width = 800;
$cfg_album_row = 3;
$cfg_album_col = 4;


+ 0
- 12
src/system/archive/archives.class.php View File

@@ -188,18 +188,6 @@ class Archives
//设置全局环境变量
$this->Fields['typename'] = $this->TypeLink->TypeInfos['typename'];
@SetSysEnv($this->Fields['typeid'], $this->Fields['typename'], $this->Fields['id'], $this->Fields['title'], 'archives');
//文档模型正文图片注释自动为标题
$this->Fields['body'] = str_ireplace(array('alt=""','alt=\'\''),'',$this->Fields['body']);
$this->Fields['body'] = preg_replace("@ [\s]{0,}alt[\s]{0,}=[\"'\s]{0,}[\s\S]{0,}[\"'\s] @isU","",$this->Fields['body']);
$this->Fields['body'] = str_ireplace("<img","<img alt=\"".$this->Fields['title']."\" title=\"".$this->Fields['title']."\" ",$this->Fields['body']);
//图片模型正文图片注释自动为标题
if (isset($this->Fields['imgurls']) && is_array($this->Fields['imgurls'])) {
$this->Fields['imgurls'] = str_ireplace(array('alt=""','alt=\'\''),'',$this->Fields['imgurls']);
$this->Fields['imgurls'] = preg_replace("@ [\s]{0,}alt[\s]{0,}=[\"'\s]{0,}[\s\S]{0,}[\"'\s] @isU","",$this->Fields['imgurls']);
$this->Fields['imgurls'] = str_ireplace("<img","<img alt=\"".$this->Fields['title']."\" title=\"".$this->Fields['title']."\"",$this->Fields['imgurls']);
}
//移除文档模型正文图片宽度和高度,适配响应式网站
$this->Fields['body'] = preg_replace("/style=\"width\:(.*)\"/","",$this->Fields['body']);
}
//完成附加表信息读取
unset($row);


+ 16
- 0
src/system/extend.func.php View File

@@ -53,6 +53,22 @@ if (!function_exists('obtainimgs')) {
return $result;
}
}
//文档图片注释自动为标题{dede:field.body function='obtainalt(@me)'/}
function obtainalt($newalt)
{
global $dsql, $id;
$row = $dsql->GetOne("SELECT title FROM `#@__archives` WHERE id='$id'");
//图片注释自动为标题
$newalt = str_ireplace(array('alt=""','alt=\'\''),'',$newalt);
$newalt = preg_replace("@ [\s]{0,}alt[\s]{0,}=[\"'\s]{0,}[\s\S]{0,}[\"'\s] @isU","",$newalt);
$newalt = str_ireplace("<img ", "<img alt=\"".$row['title']."\" title=\"".$row['title']."\"", $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值
function obtainfilter($channelid, $type = 1, $fieldsnamef = '', $defaulttid = 0, $toptid = 0, $loadtype = 'autofield')
{


Loading…
Cancel
Save