diff --git a/src/include/arc.archives.class.php b/src/include/arc.archives.class.php
index a1293d6d..67d1d660 100755
--- a/src/include/arc.archives.class.php
+++ b/src/include/arc.archives.class.php
@@ -12,7 +12,6 @@ if (!defined('DEDEINC')) exit("Request Error!");
require_once(DEDEINC . "/typelink.class.php");
require_once(DEDEINC . "/channelunit.class.php");
require_once(DEDEINC . "/downmix.inc.php");
-
@set_time_limit(0);
/**
* 主文档类(Archives类)
@@ -42,7 +41,6 @@ class Archives
var $PreNext;
var $addTableRow;
var $remoteDir;
-
/**
* php5构造函数
*
@@ -56,7 +54,6 @@ class Archives
$this->IsError = FALSE;
$this->ArcID = $aid;
$this->PreNext = array();
-
$this->dsql = $dsql;
$query = "SELECT channel,typeid FROM `#@__arctiny` WHERE id='$aid' ";
$arr = $this->dsql->GetOne($query);
@@ -67,12 +64,12 @@ class Archives
$this->ChannelUnit = new ChannelUnit($arr['channel'], $aid);
$this->TypeLink = new TypeLink($arr['typeid']);
if ($this->ChannelUnit->ChannelInfos['issystem'] != -1) {
- // 如果当前文档不是系统模型,为单表模型
+ // 如果当前文档不是系统模型,为单表模型
$query = "SELECT arc.*,tp.reid,tp.typedir,ch.addtable
- FROM `#@__archives` arc
- LEFT JOIN #@__arctype tp on tp.id=arc.typeid
- LEFT JOIN #@__channeltype as ch on arc.channel = ch.id
- WHERE arc.id='$aid' ";
+ FROM `#@__archives` arc
+ LEFT JOIN #@__arctype tp on tp.id=arc.typeid
+ LEFT JOIN #@__channeltype as ch on arc.channel = ch.id
+ WHERE arc.id='$aid' ";
$this->Fields = $this->dsql->GetOne($query);
} else {
$this->Fields['title'] = '';
@@ -81,11 +78,9 @@ class Archives
$this->Fields['ismake'] = 1;
$this->Fields['filename'] = '';
}
-
if ($this->TypeLink->TypeInfos['corank'] > 0 && $this->Fields['arcrank'] == 0) {
$this->Fields['arcrank'] = $this->TypeLink->TypeInfos['corank'];
}
-
$this->Fields['tags'] = GetTags($aid);
$this->dtp = new DedeTagParse();
$this->dtp->SetRefObj($this);
@@ -102,24 +97,20 @@ class Archives
} else {
$this->NowPage = $GLOBALS['pageno'];
}
-
//特殊的字段数据处理
$this->Fields['aid'] = $aid;
$this->Fields['id'] = $aid;
$this->Fields['position'] = $this->TypeLink->GetPositionLink(TRUE);
$this->Fields['typeid'] = $arr['typeid'];
-
//设置一些全局参数的值
foreach ($GLOBALS['PubFields'] as $k => $v) {
$this->Fields[$k] = $v;
}
-
//为了减少重复查询,这里直接把附加表查询记录放在 $this->addTableRow 中,在 ParAddTable() 不再查询
if ($this->ChannelUnit->ChannelInfos['addtable'] != '') {
$query = "SELECT * FROM `{$this->ChannelUnit->ChannelInfos['addtable']}` WHERE `aid` = '$aid'";
$this->addTableRow = $this->dsql->GetOne($query);
}
-
//issystem==-1 表示单表模型,单表模型不支持redirecturl这类参数,因此限定内容普通模型才进行下面查询
if ($this->ChannelUnit->ChannelInfos['addtable'] != '' && $this->ChannelUnit->ChannelInfos['issystem'] != -1) {
if (is_array($this->addTableRow)) {
@@ -135,13 +126,11 @@ class Archives
}
} //!error
}
-
//php4构造函数
function Archives($aid)
{
$this->__construct($aid);
}
-
/**
* 解析附加表的内容
*
@@ -162,7 +151,6 @@ class Archives
$this->Fields['money'] = 0;
$this->Fields['filename'] = '';
}
-
if (is_array($row)) {
foreach ($row as $k => $v) $row[strtolower($k)] = $v;
}
@@ -204,10 +192,19 @@ 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("Fields['title']."\" title=\"".$this->Fields['title']."\" style=\"margin:20px 0;box-shadow:0 1px 2px rgba(0,0,0,.1)\"",$this->Fields['body']);
+ //图集的图片注释替换为标题
+ $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("
Fields['title']."\" title=\"".$this->Fields['title']."\" ",$this->Fields['imgurls']);
+ //去掉文章图片的宽度和高度
+ $this->Fields['body'] = preg_replace("/style=\"width\:(.*)\"/","",$this->Fields['body']);
}
//完成附加表信息读取
unset($row);
-
//处理要分页显示的字段
$this->SplitTitles = array();
if ($this->SplitPageField != '' && $GLOBALS['cfg_arcsptitle'] = 'Y'
@@ -235,7 +232,6 @@ class Archives
$this->TotalPage = count($this->SplitFields);
$this->Fields['totalpage'] = $this->TotalPage;
}
-
//处理默认缩略图等
if (isset($this->Fields['litpic'])) {
if ($this->Fields['litpic'] == '-' || $this->Fields['litpic'] == '') {
@@ -245,7 +241,6 @@ class Archives
$this->Fields['litpic'] = $GLOBALS['cfg_mainsite'] . $this->Fields['litpic'];
}
$this->Fields['picname'] = $this->Fields['litpic'];
-
//模板里直接使用{dede:field name='image'/}获取缩略图
$this->Fields['image'] = (!preg_match('/jpg|gif|png/i', $this->Fields['picname']) ? '' : "
");
}
@@ -258,7 +253,6 @@ class Archives
$this->Fields['vote'] = "";
}
}
-
if (isset($this->Fields['goodpost']) && isset($this->Fields['badpost'])) {
//digg
if ($this->Fields['goodpost'] + $this->Fields['badpost'] == 0) {
@@ -269,7 +263,6 @@ class Archives
}
}
}
-
//获得当前字段参数
function GetCurTag($fieldname)
{
@@ -285,7 +278,6 @@ class Archives
}
return '';
}
-
/**
* 生成静态HTML
*
@@ -311,7 +303,6 @@ class Archives
$this->Fields['ismake'] = empty($this->Fields['ismake']) ? 0 : $this->Fields['ismake'];
$this->Fields['money'] = empty($this->Fields['money']) ? 0 : $this->Fields['money'];
$this->Fields['filename'] = empty($this->Fields['filename']) ? '' : $this->Fields['filename'];
-
//分析要创建的文件名称
$filename = GetFileNewName(
$this->ArcID,
@@ -325,7 +316,6 @@ class Archives
$this->Fields['money'],
$this->Fields['filename']
);
-
$filenames = explode(".", $filename);
$this->ShortName = $filenames[count($filenames) - 1];
if ($this->ShortName == '') $this->ShortName = 'html';
@@ -336,7 +326,6 @@ class Archives
if ($this->NameFirst == '') {
$this->NameFirst = $this->arcID;
}
-
//获得当前文档的全名
$filenameFull = GetFileUrl(
$this->ArcID,
@@ -354,12 +343,9 @@ class Archives
$this->TypeLink->TypeInfos['sitepath']
);
$this->Fields['arcurl'] = $this->Fields['fullname'] = $filenameFull;
-
//对于已设置不生成HTML的文章直接返回网址
if (
- $this->Fields['ismake'] == -1 || $this->Fields['arcrank'] != 0 || $this->Fields['money'] > 0
- || ($this->Fields['typeid'] == 0 && $this->Fields['channel'] != -1)
- ) {
+ $this->Fields['ismake'] == -1 || $this->Fields['arcrank'] != 0 || $this->Fields['money'] > 0 || ($this->Fields['typeid'] == 0 && $this->Fields['channel'] != -1)) {
return $this->GetTrueUrl($filename);
}
//循环生成HTML文件
@@ -385,7 +371,6 @@ class Archives
$this->dsql->ExecuteNoneQuery("Update `#@__archives` SET ismake=1 WHERE id='" . $this->ArcID . "'");
return $this->GetTrueUrl($filename);
}
-
/**
* 获得真实连接路径
*
@@ -411,7 +396,6 @@ class Archives
$this->TypeLink->TypeInfos['sitepath']
);
}
-
/**
* 获得站点的真实根路径
*
@@ -423,7 +407,6 @@ class Archives
$TRUEpath = $GLOBALS["cfg_basedir"];
return $TRUEpath;
}
-
/**
* 获得指定键值的字段
*
@@ -454,7 +437,6 @@ class Archives
}
return '';
}
-
/**
* 获得模板文件位置
*
@@ -494,7 +476,6 @@ class Archives
if (!preg_match("#.htm$#", $tmpfile)) return FALSE;
return $tmpfile;
}
-
/**
* 动态输出结果
*
@@ -512,16 +493,14 @@ class Archives
//预编译
$this->LoadTemplet();
$this->ParAddTable();
-
$this->ParseTempletsFirst();
-
//跳转网址
$this->Fields['flag'] = empty($this->Fields['flag']) ? "" : $this->Fields['flag'];
if (preg_match("#j#", $this->Fields['flag']) && $this->Fields['redirecturl'] != '') {
if ($GLOBALS['cfg_jump_once'] == 'N') {
$pageHtml = "\r\n