@@ -118,7 +118,7 @@ a{text-decoration:none!important} | |||||
window.opener.document.getElementById('litPic').src = reimg; | window.opener.document.getElementById('litPic').src = reimg; | ||||
} | } | ||||
if (document.all) window.opener = true; | if (document.all) window.opener = true; | ||||
} else if (window.opener.CKEDITOR.instances.<?php echo $f ?>) { | |||||
} else if (typeof window.opener.CKEDITOR.instances["<?php echo $f ?>"] !== "undefined") { | |||||
let addonHTML = `<img src='${reimg}'>`; | let addonHTML = `<img src='${reimg}'>`; | ||||
window.opener.CKEDITOR.instances["<?php echo $f ?>"].insertHtml(addonHTML); | window.opener.CKEDITOR.instances["<?php echo $f ?>"].insertHtml(addonHTML); | ||||
} | } | ||||
@@ -60,19 +60,19 @@ a{text-decoration:none!important} | |||||
return; | return; | ||||
} | } | ||||
function ReturnValue(reimg) { | function ReturnValue(reimg) { | ||||
if (window.opener.document.<?php echo $f ?> != null) { | |||||
window.opener.document.<?php echo $f ?>.value = reimg; | |||||
window.close(); | |||||
return | |||||
} | |||||
var funcNum = <?php echo isset($CKEditorFuncNum) ? $CKEditorFuncNum : 1; ?>; | var funcNum = <?php echo isset($CKEditorFuncNum) ? $CKEditorFuncNum : 1; ?>; | ||||
if (window.opener.CKEDITOR != null && funcNum != 1) { | if (window.opener.CKEDITOR != null && funcNum != 1) { | ||||
window.opener.CKEDITOR.tools.callFunction(funcNum, reimg); | window.opener.CKEDITOR.tools.callFunction(funcNum, reimg); | ||||
} | } | ||||
if (window.opener.CKEDITOR.instances.<?php echo $f ?>) { | |||||
if (typeof window.opener.CKEDITOR.instances["<?php echo $f ?>"] !== "undefined") { | |||||
let addonHTML = `<a href='${reimg}' target='_blank'><img src='<?php echo $cfg_cmspath ?>/static/web/img/addon.gif'>附件:${reimg}</a>`; | let addonHTML = `<a href='${reimg}' target='_blank'><img src='<?php echo $cfg_cmspath ?>/static/web/img/addon.gif'>附件:${reimg}</a>`; | ||||
window.opener.CKEDITOR.instances["<?php echo $f ?>"].insertHtml(addonHTML); | window.opener.CKEDITOR.instances["<?php echo $f ?>"].insertHtml(addonHTML); | ||||
} | } | ||||
if (window.opener.document.<?php echo $f ?> != null) { | |||||
window.opener.document.<?php echo $f ?>.value = reimg; | |||||
window.close(); | |||||
return | |||||
} | |||||
window.close(); | window.close(); | ||||
} | } | ||||
</script> | </script> | ||||
@@ -465,14 +465,8 @@ class Archives | |||||
$tmpfile = $cfg_basedir.$cfg_templets_dir."/{$cfg_df_style}/article_spec.htm"; | $tmpfile = $cfg_basedir.$cfg_templets_dir."/{$cfg_df_style}/article_spec.htm"; | ||||
} | } | ||||
} | } | ||||
if (defined('DEDEMOB')) { | |||||
$tmpfile = str_replace('.htm', '_m.htm', $tmpfile); | |||||
} | |||||
if (!file_exists($tmpfile)) { | if (!file_exists($tmpfile)) { | ||||
$tmpfile = $cfg_basedir.$cfg_templets_dir."/{$cfg_df_style}/".($cid == 'spec' ? 'article_spec.htm' : 'article_default.htm'); | $tmpfile = $cfg_basedir.$cfg_templets_dir."/{$cfg_df_style}/".($cid == 'spec' ? 'article_spec.htm' : 'article_default.htm'); | ||||
if (defined('DEDEMOB')) { | |||||
$tmpfile = str_replace('.htm', '_m.htm', $tmpfile); | |||||
} | |||||
} | } | ||||
if (!preg_match("#.htm$#", $tmpfile)) return FALSE; | if (!preg_match("#.htm$#", $tmpfile)) return FALSE; | ||||
return $tmpfile; | return $tmpfile; | ||||
@@ -695,25 +689,21 @@ class Archives | |||||
$nextRow = $this->dsql->GetOne($query.$next); | $nextRow = $this->dsql->GetOne($query.$next); | ||||
$preRow = $this->dsql->GetOne($query.$pre); | $preRow = $this->dsql->GetOne($query.$pre); | ||||
if (is_array($preRow)) { | if (is_array($preRow)) { | ||||
if (defined('DEDEMOB')) { | |||||
$mlink = 'view.php?aid='.$preRow['id']; | |||||
} else { | |||||
$mlink = GetFileUrl( | |||||
$preRow['id'], | |||||
$preRow['typeid'], | |||||
$preRow['senddate'], | |||||
$preRow['title'], | |||||
$preRow['ismake'], | |||||
$preRow['arcrank'], | |||||
$preRow['namerule'], | |||||
$preRow['typedir'], | |||||
$preRow['money'], | |||||
$preRow['filename'], | |||||
$preRow['moresite'], | |||||
$preRow['siteurl'], | |||||
$preRow['sitepath'] | |||||
); | |||||
} | |||||
$mlink = GetFileUrl( | |||||
$preRow['id'], | |||||
$preRow['typeid'], | |||||
$preRow['senddate'], | |||||
$preRow['title'], | |||||
$preRow['ismake'], | |||||
$preRow['arcrank'], | |||||
$preRow['namerule'], | |||||
$preRow['typedir'], | |||||
$preRow['money'], | |||||
$preRow['filename'], | |||||
$preRow['moresite'], | |||||
$preRow['siteurl'], | |||||
$preRow['sitepath'] | |||||
); | |||||
//二次开发上一篇属性 | //二次开发上一篇属性 | ||||
$preRow['litpic'] = (empty($preRow['litpic'])) ? $GLOBALS['cfg_cmspath'].'/static/web/img/defaultpic.jpg' : $preRow['litpic']; | $preRow['litpic'] = (empty($preRow['litpic'])) ? $GLOBALS['cfg_cmspath'].'/static/web/img/defaultpic.jpg' : $preRow['litpic']; | ||||
$this->PreNext['diy']['pre']['id'] = $preRow['id']; | $this->PreNext['diy']['pre']['id'] = $preRow['id']; | ||||
@@ -728,25 +718,21 @@ class Archives | |||||
$this->PreNext['preimg'] = "<img src=\"/templets/default/images/nophoto.jpg\" alt=\"对不起,没有上一图集了\"/>"; | $this->PreNext['preimg'] = "<img src=\"/templets/default/images/nophoto.jpg\" alt=\"对不起,没有上一图集了\"/>"; | ||||
} | } | ||||
if (is_array($nextRow)) { | if (is_array($nextRow)) { | ||||
if (defined('DEDEMOB')) { | |||||
$mlink = 'view.php?aid='.$preRow['id']; | |||||
} else { | |||||
$mlink = GetFileUrl( | |||||
$nextRow['id'], | |||||
$nextRow['typeid'], | |||||
$nextRow['senddate'], | |||||
$nextRow['title'], | |||||
$nextRow['ismake'], | |||||
$nextRow['arcrank'], | |||||
$nextRow['namerule'], | |||||
$nextRow['typedir'], | |||||
$nextRow['money'], | |||||
$nextRow['filename'], | |||||
$nextRow['moresite'], | |||||
$nextRow['siteurl'], | |||||
$nextRow['sitepath'] | |||||
); | |||||
} | |||||
$mlink = GetFileUrl( | |||||
$nextRow['id'], | |||||
$nextRow['typeid'], | |||||
$nextRow['senddate'], | |||||
$nextRow['title'], | |||||
$nextRow['ismake'], | |||||
$nextRow['arcrank'], | |||||
$nextRow['namerule'], | |||||
$nextRow['typedir'], | |||||
$nextRow['money'], | |||||
$nextRow['filename'], | |||||
$nextRow['moresite'], | |||||
$nextRow['siteurl'], | |||||
$nextRow['sitepath'] | |||||
); | |||||
//二次开发下一篇属性 | //二次开发下一篇属性 | ||||
$nextRow['litpic'] = (empty($nextRow['litpic'])) ? $GLOBALS['cfg_cmspath'].'/static/web/img/defaultpic.jpg' : $nextRow['litpic']; | $nextRow['litpic'] = (empty($nextRow['litpic'])) ? $GLOBALS['cfg_cmspath'].'/static/web/img/defaultpic.jpg' : $nextRow['litpic']; | ||||
$this->PreNext['diy']['next']['id'] = $nextRow['id']; | $this->PreNext['diy']['next']['id'] = $nextRow['id']; | ||||
@@ -232,14 +232,8 @@ class ListView | |||||
$tempfile = $GLOBALS['cfg_basedir'].$GLOBALS['cfg_templets_dir']."/".$this->TypeLink->TypeInfos['templist']; | $tempfile = $GLOBALS['cfg_basedir'].$GLOBALS['cfg_templets_dir']."/".$this->TypeLink->TypeInfos['templist']; | ||||
$tempfile = str_replace("{tid}", $this->TypeID, $tempfile); | $tempfile = str_replace("{tid}", $this->TypeID, $tempfile); | ||||
$tempfile = str_replace("{cid}", $this->ChannelUnit->ChannelInfos['nid'], $tempfile); | $tempfile = str_replace("{cid}", $this->ChannelUnit->ChannelInfos['nid'], $tempfile); | ||||
if (defined('DEDEMOB')) { | |||||
$tempfile = str_replace('.htm', '_m.htm', $tempfile); | |||||
} | |||||
if (!file_exists($tempfile)) { | if (!file_exists($tempfile)) { | ||||
$tempfile = $GLOBALS['cfg_basedir'].$GLOBALS['cfg_templets_dir']."/".$GLOBALS['cfg_df_style']."/list_default.htm"; | $tempfile = $GLOBALS['cfg_basedir'].$GLOBALS['cfg_templets_dir']."/".$GLOBALS['cfg_df_style']."/list_default.htm"; | ||||
if (defined('DEDEMOB')) { | |||||
$tempfile = str_replace('.htm', '_m.htm', $tempfile); | |||||
} | |||||
} | } | ||||
if (!file_exists($tempfile) || !is_file($tempfile)) { | if (!file_exists($tempfile) || !is_file($tempfile)) { | ||||
echo "模板文件不存在,无法解析文档"; | echo "模板文件不存在,无法解析文档"; | ||||
@@ -357,14 +351,8 @@ class ListView | |||||
$tempfile = str_replace("{tid}", $this->TypeID, $this->Fields['tempindex']); | $tempfile = str_replace("{tid}", $this->TypeID, $this->Fields['tempindex']); | ||||
$tempfile = str_replace("{cid}", $this->ChannelUnit->ChannelInfos['nid'], $tempfile); | $tempfile = str_replace("{cid}", $this->ChannelUnit->ChannelInfos['nid'], $tempfile); | ||||
$tempfile = $tmpdir."/".$tempfile; | $tempfile = $tmpdir."/".$tempfile; | ||||
if (defined('DEDEMOB')) { | |||||
$tempfile = str_replace('.htm', '_m.htm', $tempfile); | |||||
} | |||||
if (!file_exists($tempfile)) { | if (!file_exists($tempfile)) { | ||||
$tempfile = $tmpdir."/".$GLOBALS['cfg_df_style']."/index_default.htm"; | $tempfile = $tmpdir."/".$GLOBALS['cfg_df_style']."/index_default.htm"; | ||||
if (defined('DEDEMOB')) { | |||||
$tempfile = str_replace('.htm', '_m.htm', $tempfile); | |||||
} | |||||
} | } | ||||
$this->dtp->LoadTemplate($tempfile); | $this->dtp->LoadTemplate($tempfile); | ||||
} | } | ||||
@@ -388,14 +376,8 @@ class ListView | |||||
$tempfile = str_replace("{tid}", $this->TypeID, $this->Fields['tempindex']); | $tempfile = str_replace("{tid}", $this->TypeID, $this->Fields['tempindex']); | ||||
$tempfile = str_replace("{cid}", $this->ChannelUnit->ChannelInfos['nid'], $tempfile); | $tempfile = str_replace("{cid}", $this->ChannelUnit->ChannelInfos['nid'], $tempfile); | ||||
$tempfile = $tmpdir."/".$tempfile; | $tempfile = $tmpdir."/".$tempfile; | ||||
if (defined('DEDEMOB')) { | |||||
$tempfile = str_replace('.htm', '_m.htm', $tempfile); | |||||
} | |||||
if (!file_exists($tempfile)) { | if (!file_exists($tempfile)) { | ||||
$tempfile = $tmpdir."/".$GLOBALS['cfg_df_style']."/index_default.htm"; | $tempfile = $tmpdir."/".$GLOBALS['cfg_df_style']."/index_default.htm"; | ||||
if (defined('DEDEMOB')) { | |||||
$tempfile = str_replace('.htm', '_m.htm', $tempfile); | |||||
} | |||||
} | } | ||||
$this->PartView->SetTemplet($tempfile); | $this->PartView->SetTemplet($tempfile); | ||||
} else if ($this->Fields['ispart'] == 2) { | } else if ($this->Fields['ispart'] == 2) { | ||||
@@ -433,14 +415,8 @@ class ListView | |||||
$tempfile = str_replace("{tid}", $this->TypeID, $this->Fields['tempindex']); | $tempfile = str_replace("{tid}", $this->TypeID, $this->Fields['tempindex']); | ||||
$tempfile = str_replace("{cid}", $this->ChannelUnit->ChannelInfos['nid'], $tempfile); | $tempfile = str_replace("{cid}", $this->ChannelUnit->ChannelInfos['nid'], $tempfile); | ||||
$tempfile = $tmpdir."/".$tempfile; | $tempfile = $tmpdir."/".$tempfile; | ||||
if (defined('DEDEMOB')) { | |||||
$tempfile = str_replace('.htm', '_m.htm', $tempfile); | |||||
} | |||||
if (!file_exists($tempfile)) { | if (!file_exists($tempfile)) { | ||||
$tempfile = $tmpdir."/".$GLOBALS['cfg_df_style']."/index_default.htm"; | $tempfile = $tmpdir."/".$GLOBALS['cfg_df_style']."/index_default.htm"; | ||||
if (defined('DEDEMOB')) { | |||||
$tempfile = str_replace('.htm', '_m.htm', $tempfile); | |||||
} | |||||
} | } | ||||
$this->PartView->SetTemplet($tempfile); | $this->PartView->SetTemplet($tempfile); | ||||
} else if ($this->Fields['ispart'] == 2) { | } else if ($this->Fields['ispart'] == 2) { | ||||
@@ -114,9 +114,6 @@ class SearchView | |||||
} | } | ||||
$this->CountRecord(); | $this->CountRecord(); | ||||
$tempfile = $GLOBALS['cfg_basedir'].$GLOBALS['cfg_templets_dir']."/".$GLOBALS['cfg_df_style']."/search.htm"; | $tempfile = $GLOBALS['cfg_basedir'].$GLOBALS['cfg_templets_dir']."/".$GLOBALS['cfg_df_style']."/search.htm"; | ||||
if (defined('DEDEMOB')) { | |||||
$tempfile = str_replace('.htm', '_m.htm', $tempfile); | |||||
} | |||||
if (!file_exists($tempfile) || !is_file($tempfile)) { | if (!file_exists($tempfile) || !is_file($tempfile)) { | ||||
echo "模板文件不存在,无法解析"; | echo "模板文件不存在,无法解析"; | ||||
exit(); | exit(); | ||||
@@ -182,14 +182,8 @@ class SgListView | |||||
$tempfile = $GLOBALS['cfg_basedir'].$GLOBALS['cfg_templets_dir']."/".$this->TypeLink->TypeInfos['templist']; | $tempfile = $GLOBALS['cfg_basedir'].$GLOBALS['cfg_templets_dir']."/".$this->TypeLink->TypeInfos['templist']; | ||||
$tempfile = str_replace("{tid}", $this->TypeID, $tempfile); | $tempfile = str_replace("{tid}", $this->TypeID, $tempfile); | ||||
$tempfile = str_replace("{cid}", $this->ChannelUnit->ChannelInfos['nid'], $tempfile); | $tempfile = str_replace("{cid}", $this->ChannelUnit->ChannelInfos['nid'], $tempfile); | ||||
if (defined('DEDEMOB')) { | |||||
$tempfile = str_replace('.htm', '_m.htm', $tempfile); | |||||
} | |||||
if (!file_exists($tempfile)) { | if (!file_exists($tempfile)) { | ||||
$tempfile = $GLOBALS['cfg_basedir'].$GLOBALS['cfg_templets_dir']."/".$GLOBALS['cfg_df_style']."/list_default_sg.htm"; | $tempfile = $GLOBALS['cfg_basedir'].$GLOBALS['cfg_templets_dir']."/".$GLOBALS['cfg_df_style']."/list_default_sg.htm"; | ||||
if (defined('DEDEMOB')) { | |||||
$tempfile = str_replace('.htm', '_m.htm', $tempfile); | |||||
} | |||||
} | } | ||||
if (!file_exists($tempfile) || !is_file($tempfile)) { | if (!file_exists($tempfile) || !is_file($tempfile)) { | ||||
echo "模板文件不存在,无法解析文档"; | echo "模板文件不存在,无法解析文档"; | ||||
@@ -333,14 +327,8 @@ class SgListView | |||||
$tempfile = str_replace("{tid}", $this->TypeID, $this->Fields['tempindex']); | $tempfile = str_replace("{tid}", $this->TypeID, $this->Fields['tempindex']); | ||||
$tempfile = str_replace("{cid}", $this->ChannelUnit->ChannelInfos['nid'], $tempfile); | $tempfile = str_replace("{cid}", $this->ChannelUnit->ChannelInfos['nid'], $tempfile); | ||||
$tempfile = $tmpdir."/".$tempfile; | $tempfile = $tmpdir."/".$tempfile; | ||||
if (defined('DEDEMOB')) { | |||||
$tempfile = str_replace('.htm', '_m.htm', $tempfile); | |||||
} | |||||
if (!file_exists($tempfile)) { | if (!file_exists($tempfile)) { | ||||
$tempfile = $tmpdir."/".$GLOBALS['cfg_df_style']."/index_default_sg.htm"; | $tempfile = $tmpdir."/".$GLOBALS['cfg_df_style']."/index_default_sg.htm"; | ||||
if (defined('DEDEMOB')) { | |||||
$tempfile = str_replace('.htm', '_m.htm', $tempfile); | |||||
} | |||||
} | } | ||||
$this->PartView->SetTemplet($tempfile); | $this->PartView->SetTemplet($tempfile); | ||||
} else if ($this->Fields['ispart'] == 2) { | } else if ($this->Fields['ispart'] == 2) { | ||||
@@ -377,14 +365,8 @@ class SgListView | |||||
$tempfile = str_replace("{tid}", $this->TypeID, $this->Fields['tempindex']); | $tempfile = str_replace("{tid}", $this->TypeID, $this->Fields['tempindex']); | ||||
$tempfile = str_replace("{cid}", $this->ChannelUnit->ChannelInfos['nid'], $tempfile); | $tempfile = str_replace("{cid}", $this->ChannelUnit->ChannelInfos['nid'], $tempfile); | ||||
$tempfile = $tmpdir."/".$tempfile; | $tempfile = $tmpdir."/".$tempfile; | ||||
if (defined('DEDEMOB')) { | |||||
$tempfile = str_replace('.htm', '_m.htm', $tempfile); | |||||
} | |||||
if (!file_exists($tempfile)) { | if (!file_exists($tempfile)) { | ||||
$tempfile = $tmpdir."/".$GLOBALS['cfg_df_style']."/index_default_sg.htm"; | $tempfile = $tmpdir."/".$GLOBALS['cfg_df_style']."/index_default_sg.htm"; | ||||
if (defined('DEDEMOB')) { | |||||
$tempfile = str_replace('.htm', '_m.htm', $tempfile); | |||||
} | |||||
} | } | ||||
$this->PartView->SetTemplet($tempfile); | $this->PartView->SetTemplet($tempfile); | ||||
} else if ($this->Fields['ispart'] == 2) { | } else if ($this->Fields['ispart'] == 2) { | ||||
@@ -96,12 +96,7 @@ class TypeLink | |||||
//islink 表示返回的列表是否带连接 | //islink 表示返回的列表是否带连接 | ||||
function GetPositionLink($islink = true) | function GetPositionLink($islink = true) | ||||
{ | { | ||||
if (defined('DEDEMOB')) { | |||||
$indexpage = "<li class='breadcrumb-item'><a href='index.php'>".$this->indexName."</a></li>"; | |||||
} else { | |||||
$indexpage = "<li class='breadcrumb-item'><a href='".$this->indexUrl."'>".$this->indexName."</a></li>"; | |||||
} | |||||
$indexpage = "<li class='breadcrumb-item'><a href='".$this->indexUrl."'>".$this->indexName."</a></li>"; | |||||
if ($this->valuePosition != "" && $islink) { | if ($this->valuePosition != "" && $islink) { | ||||
return $this->valuePosition; | return $this->valuePosition; | ||||
} else if ($this->valuePositionName != "" && !$islink) { | } else if ($this->valuePositionName != "" && !$islink) { | ||||
@@ -162,21 +157,17 @@ class TypeLink | |||||
//获得某分类连接的URL | //获得某分类连接的URL | ||||
function GetOneTypeUrl($typeinfos) | function GetOneTypeUrl($typeinfos) | ||||
{ | { | ||||
if (defined('DEDEMOB')) { | |||||
return 'list.php?tid='.$typeinfos['id']; | |||||
} else { | |||||
return GetTypeUrl( | |||||
$typeinfos['id'], | |||||
MfTypedir($typeinfos['typedir']), | |||||
$typeinfos['isdefault'], | |||||
$typeinfos['defaultname'], | |||||
$typeinfos['ispart'], | |||||
$typeinfos['namerule2'], | |||||
$typeinfos['moresite'], | |||||
$typeinfos['siteurl'], | |||||
$typeinfos['sitepath'] | |||||
); | |||||
} | |||||
return GetTypeUrl( | |||||
$typeinfos['id'], | |||||
MfTypedir($typeinfos['typedir']), | |||||
$typeinfos['isdefault'], | |||||
$typeinfos['defaultname'], | |||||
$typeinfos['ispart'], | |||||
$typeinfos['namerule2'], | |||||
$typeinfos['moresite'], | |||||
$typeinfos['siteurl'], | |||||
$typeinfos['sitepath'] | |||||
); | |||||
} | } | ||||
//获得类别列表 | //获得类别列表 | ||||
//hid 是指默认选中类目,0 表示“请选择类目”或“不限类目” | //hid 是指默认选中类目,0 表示“请选择类目”或“不限类目” | ||||