| @@ -166,7 +166,7 @@ if ($dopost == 'quick') { | |||
| } | |||
| //创建目录 | |||
| if ($ispart != 2) { | |||
| $true_typedir = str_replace("{cmspath}", "", $typedir); | |||
| $true_typedir = str_replace("{cmspath}", $cfg_cmspath, $typedir); | |||
| $true_typedir = preg_replace("#\/{1,}#", "/", $true_typedir); | |||
| if (!CreateDir($true_typedir)) { | |||
| ShowMsg("创建目录{$true_typedir}失败,请检查路径是否存在问题", "-1"); | |||
| @@ -157,7 +157,7 @@ if (!empty($noeditor)) { | |||
| window.opener.CKEDITOR.tools.callFunction(funcNum, reimg); | |||
| } | |||
| if (typeof window.opener.CKEDITOR.instances["<?php echo $f ?>"] !== "undefined") { | |||
| let addonHTML = `<a href='${reimg}' target='_blank'><img src='/static/web/img/icon_addon.png'> 附件:${reimg}</a>`; | |||
| let addonHTML = `<a href='${reimg}' target='_blank'><img src='<?php echo $cfg_cmspath ?>/static/web/img/icon_addon.png'>附件:${reimg}</a>`; | |||
| window.opener.CKEDITOR.instances["<?php echo $f ?>"].insertHtml(addonHTML); | |||
| } | |||
| if (window.opener.document.<?php echo $f ?> != null) { | |||
| @@ -10,7 +10,7 @@ | |||
| */ | |||
| require(dirname(__FILE__)."/config.php"); | |||
| CheckPurview('plus_文件管理器'); | |||
| if (!isset($activepath)) $activepath = DEDEBIZ_SAFE_MODE? $cfg_medias_dir : '/'; | |||
| if (!isset($activepath)) $activepath = DEDEBIZ_SAFE_MODE? $cfg_medias_dir : $cfg_cmspath; | |||
| $inpath = ''; | |||
| $activepath = str_replace("..", "", $activepath); | |||
| $activepath = preg_replace("#^\/{1,}#", "/", $activepath); | |||
| @@ -60,7 +60,7 @@ if ($dopost == "delete") { | |||
| $fullfilename = DEDEROOT.'/static/flink/'.$logoimg_name; | |||
| move_uploaded_file($logoimg, $fullfilename) or die("上传文件到".$fullfilename."失败"); | |||
| @unlink($logoimg); | |||
| $logo = '/static/flink/'.$logoimg_name; | |||
| $logo = $cfg_cmspath.'/static/flink/'.$logoimg_name; | |||
| } | |||
| $sortrank = isset($sortrank)? intval($sortrank) : 1; | |||
| $url = isset($url)? HtmlReplace($url, -1) : ''; | |||
| @@ -153,7 +153,7 @@ function GetFieldValue($dvalue, $dtype, $aid = 0, $job = 'add', $addvar = '') | |||
| fclose($fp); | |||
| return $addvar; | |||
| } else { | |||
| $ipath = '/data/textdata'; | |||
| $ipath = $GLOBALS['cfg_cmspath']."/data/textdata"; | |||
| $tpath = ceil($aid / 5000); | |||
| if (!is_dir($GLOBALS['cfg_basedir'].$ipath)) { | |||
| MkdirAll($GLOBALS['cfg_basedir'].$ipath, $cfg_dir_purview); | |||
| @@ -20,7 +20,7 @@ if (empty($maxpagesize)) $maxpagesize = 30; | |||
| $startid = isset($startid) ? intval($startid) : 0; | |||
| $endid = isset($endid) ? intval($endid) : 0; | |||
| $tagid = isset($tagid) ? intval($tagid) : 0; | |||
| $tagsdir = str_replace("{cmspath}", "", $cfg_tags_dir); | |||
| $tagsdir = str_replace("{cmspath}", $cfg_cmspath, $cfg_tags_dir); | |||
| //生成 | |||
| if ($tagid > 0) { | |||
| $upall = 0; //更新单个模式 | |||
| @@ -50,7 +50,7 @@ if ($ctagid == 0 && $allfinish) { | |||
| } | |||
| $tag = $dsql->GetOne("SELECT * FROM `#@__tagindex` WHERE id='$ctagid' LIMIT 0,1;"); | |||
| //创建TAGS目录 | |||
| $tagsDir = str_replace("{cmspath}", "", $cfg_tags_dir); | |||
| $tagsDir = str_replace("{cmspath}",$cfg_cmspath,$cfg_tags_dir); | |||
| MkdirAll($cfg_basedir.$tagsDir, $cfg_dir_purview); | |||
| if (is_array($tag) && count($tag) > 0) { | |||
| $dlist = new TagList($tag['id'], 'tag_list.htm'); | |||
| @@ -237,7 +237,8 @@ if ($action == '') { | |||
| $setupsql = preg_replace("#TYPE=MyISAM#i", $sql41tmp, $setupsql); | |||
| } | |||
| //_ROOTURL_ | |||
| $rooturl = $cfg_basehost; | |||
| if ($cfg_cmspath == '/') $cfg_cmspath = ''; | |||
| $rooturl = $cfg_basehost.$cfg_cmspath; | |||
| $setupsql = preg_replace("#_ROOTURL_#i", $rooturl, $setupsql); | |||
| $setupsql = preg_replace("#[\r\n]{1,}#", "\n", $setupsql); | |||
| $sqls = preg_split('/;[ \t]{0,}\n/', $setupsql); | |||
| @@ -440,7 +440,7 @@ if ($dopost == "show") { | |||
| $addonfields = ''; | |||
| } | |||
| $template = trim($template); | |||
| $forms = "<form action=\"/apps/advancedsearch.php\" method=\"post\">"; | |||
| $forms = "<form action=\"$cfg_cmspath/apps/advancedsearch.php\" method=\"post\">"; | |||
| $forms .= "<input type=\"hidden\" name=\"mid\" value=\"$mid\">"; | |||
| $forms .= "<input type=\"hidden\" name=\"dopost\" value=\"search\">"; | |||
| $forms .= "<label>关键词:<input type=\"text\" name=\"q\"></label><br>"; | |||
| @@ -16,7 +16,7 @@ | |||
| <div class="card shadow-sm"> | |||
| <div class="card-header">更新专题</div> | |||
| <div class="card-body"> | |||
| <div class="alert alert-info">发布专题后需要手动更新,建议专题目录设置仅可读写权限,存放目录:<?php echo $cfg_special.'/index.html';?></div> | |||
| <div class="alert alert-info">发布专题后需要手动更新,建议专题目录设置仅可读写权限,存放目录:<?php echo $cfg_cmspath.$cfg_special."/index.html"?></div> | |||
| <form name="form1" action="makehtml_spec.php" method="get" target="stafrm"> | |||
| <input type="hidden" name="dopost" value="ok"> | |||
| <div class="table-responsive"> | |||
| @@ -45,7 +45,7 @@ if ($dopost == "saveedit") { | |||
| ShowMsg("系统文件禁止重名", "javascript:;"); | |||
| exit(); | |||
| } | |||
| $oldfilename = $cfg_basedir.'/'.$oldfilename; | |||
| $oldfilename = $cfg_basedir.$cfg_cmspath."/".$oldfilename; | |||
| if (is_file($oldfilename)) { | |||
| unlink($oldfilename); | |||
| } | |||
| @@ -64,7 +64,7 @@ if ($dopost == "saveedit") { | |||
| exit(); | |||
| } else if ($dopost == "delete") { | |||
| $row = $dsql->GetOne("SELECT filename FROM `#@__sgpage` WHERE aid='$aid'"); | |||
| $filename = preg_replace("#\/{1,}#", "/", $cfg_basedir."/".$row['filename']); | |||
| $filename = preg_replace("#\/{1,}#", "/", $cfg_basedir.$cfg_cmspath."/".$row['filename']); | |||
| $dsql->ExecuteNoneQuery(" DELETE FROM `#@__sgpage` WHERE aid='$aid' "); | |||
| if (is_file($filename)) { | |||
| unlink($filename); | |||
| @@ -74,7 +74,7 @@ if ($action == 'post') { | |||
| $goto = "diy.php?action=list&diyid={$diy->diyid}"; | |||
| $bkmsg = '提交成功,正在前往表单列表'; | |||
| } else { | |||
| $goto = '/'; | |||
| $goto = !empty($cfg_cmspath) ? $cfg_cmspath : '/'; | |||
| $bkmsg = '提交成功,请等待管理员处理'; | |||
| } | |||
| ShowMsg($bkmsg, $goto); | |||
| @@ -65,7 +65,7 @@ if ($action == '' || $action == 'show') { | |||
| $dsql->Execute('fb', $querystring." LIMIT 20 "); | |||
| $data = array(); | |||
| while ($row = $dsql->GetArray('fb')) { | |||
| $row['face'] = empty($row['mface']) ? '/static/web/img/admin.png' : $row['mface']; | |||
| $row['face'] = empty($row['mface']) ? $GLOBALS['cfg_cmspath'].'/static/web/img/admin.png' : $row['mface']; | |||
| $row['dtimestr'] = MyDate('Y-m-d', $row['dtime']); | |||
| unset($row['ip']); | |||
| $data[] = $row; | |||
| @@ -219,7 +219,7 @@ class Archives | |||
| //处理默认缩略图等 | |||
| if (isset($this->Fields['litpic'])) { | |||
| if ($this->Fields['litpic'] == '-' || $this->Fields['litpic'] == '') { | |||
| $this->Fields['litpic'] = '/static/web/img/thumbnail.jpg'; | |||
| $this->Fields['litpic'] = $GLOBALS['cfg_cmspath'].'/static/web/img/thumbnail.jpg'; | |||
| } | |||
| if (!preg_match("#^http:\/\/#i", $this->Fields['litpic']) && $GLOBALS['cfg_multi_site'] == 'Y') { | |||
| $this->Fields['litpic'] = $GLOBALS['cfg_mainsite'].$this->Fields['litpic']; | |||
| @@ -232,7 +232,7 @@ class Archives | |||
| if (isset($this->Fields['voteid']) && !empty($this->Fields['voteid'])) { | |||
| $this->Fields['vote'] = ''; | |||
| $voteid = $this->Fields['voteid']; | |||
| $this->Fields['vote'] = "<script src='/data/vote/vote_{$voteid}.js'></script>"; | |||
| $this->Fields['vote'] = "<script src='{$GLOBALS['cfg_cmspath']}/data/vote/vote_{$voteid}.js'></script>"; | |||
| if ($GLOBALS['cfg_multi_site'] == 'Y') { | |||
| $this->Fields['vote'] = "<script src='{$GLOBALS['cfg_mainsite']}/data/vote/vote_{$voteid}.js'></script>"; | |||
| } | |||
| @@ -681,7 +681,7 @@ class Archives | |||
| $preRow['siteurl'], | |||
| $preRow['sitepath'] | |||
| ); | |||
| $preRow['litpic'] = (empty($preRow['litpic'])) ? '/static/web/img/thumbnail.jpg' : $preRow['litpic']; | |||
| $preRow['litpic'] = (empty($preRow['litpic'])) ? $GLOBALS['cfg_cmspath'].'/static/web/img/thumbnail.jpg' : $preRow['litpic']; | |||
| $this->PreNext['diy']['pre']['id'] = $preRow['id']; | |||
| $this->PreNext['diy']['pre']['arcurl'] = $mlink; | |||
| $this->PreNext['diy']['pre']['title'] = $preRow['title']; | |||
| @@ -709,7 +709,7 @@ class Archives | |||
| $nextRow['siteurl'], | |||
| $nextRow['sitepath'] | |||
| ); | |||
| $nextRow['litpic'] = (empty($nextRow['litpic'])) ? '/static/web/img/thumbnail.jpg' : $nextRow['litpic']; | |||
| $nextRow['litpic'] = (empty($nextRow['litpic'])) ? $GLOBALS['cfg_cmspath'].'/static/web/img/thumbnail.jpg' : $nextRow['litpic']; | |||
| $this->PreNext['diy']['next']['id'] = $nextRow['id']; | |||
| $this->PreNext['diy']['next']['arcurl'] = $mlink; | |||
| $this->PreNext['diy']['next']['title'] = $nextRow['title']; | |||
| @@ -229,7 +229,7 @@ class FreeList | |||
| $this->dtp->SaveTo($makeFile); | |||
| } | |||
| if ($this->FLInfos['nodefault'] == 0) { | |||
| $murl = '/'.str_replace('{cmspath}', $this->FLInfos['listdir']); | |||
| $murl = '/'.str_replace('{cmspath}', $GLOBALS['cfg_cmspath'], $this->FLInfos['listdir']); | |||
| $murl .= '/'.$this->FLInfos['defaultpage']; | |||
| $indexfile = $GLOBALS['cfg_basedir'].$murl; | |||
| $murl = preg_replace("#\/{1,}#", "/", $murl); | |||
| @@ -355,7 +355,7 @@ class FreeList | |||
| $okfile = ''; | |||
| $namerule = $this->FLInfos['namerule']; | |||
| $listdir = $this->FLInfos['listdir']; | |||
| $listdir = str_replace('{cmspath}', $listdir); | |||
| $listdir = str_replace('{cmspath}', $GLOBALS['cfg_cmspath'], $listdir); | |||
| $okfile = str_replace('{listid}', $this->FLInfos['aid'], $namerule); | |||
| $okfile = str_replace('{listdir}', $listdir, $okfile); | |||
| $okfile = str_replace("\\", "/", $okfile); | |||
| @@ -540,7 +540,7 @@ class FreeList | |||
| } | |||
| $row['description'] = cn_substr($row['description'], $infolen); | |||
| if ($row['litpic'] == '-' || $row['litpic'] == '') { | |||
| $row['litpic'] = '/static/web/img/thumbnail.jpg'; | |||
| $row['litpic'] = $GLOBALS['cfg_cmspath'].'/static/web/img/thumbnail.jpg'; | |||
| } | |||
| /*if (!preg_match("#^http:\/\/#i", $row['litpic']) && $GLOBALS['cfg_multi_site'] == 'Y') { | |||
| $row['litpic'] = $GLOBALS['cfg_mainsite'].$row['litpic']; | |||
| @@ -525,7 +525,7 @@ class ListView | |||
| $row['sitepath'] | |||
| ); | |||
| if ($row['litpic'] == '-' || $row['litpic'] == '') { | |||
| $row['litpic'] = '/static/web/img/thumbnail.jpg'; | |||
| $row['litpic'] = $GLOBALS['cfg_cmspath'].'/static/web/img/thumbnail.jpg'; | |||
| } | |||
| /*if (!preg_match("/^http:\/\//i", $row['litpic']) && $GLOBALS['cfg_multi_site'] == 'Y') { | |||
| $row['litpic'] = $GLOBALS['cfg_mainsite'].$row['litpic']; | |||
| @@ -945,7 +945,7 @@ class ListView | |||
| $row['sitepath'] | |||
| ); | |||
| if ($row['litpic'] == '-' || $row['litpic'] == '') { | |||
| $row['litpic'] = '/static/web/img/thumbnail.jpg'; | |||
| $row['litpic'] = $GLOBALS['cfg_cmspath'].'/static/web/img/thumbnail.jpg'; | |||
| } | |||
| /*if (!preg_match("/^http:\/\//i", $row['litpic']) && $GLOBALS['cfg_multi_site'] == 'Y') { | |||
| $row['litpic'] = $GLOBALS['cfg_mainsite'].$row['litpic']; | |||
| @@ -1014,6 +1014,7 @@ class ListView | |||
| */ | |||
| function GetPageListST($list_len, $listitem = "index,end,pre,next,pageno") | |||
| { | |||
| global $cfg_cmspath; | |||
| $prepage = $nextpage = ''; | |||
| $prepagenum = $this->PageNo - 1; | |||
| $nextpagenum = $this->PageNo + 1; | |||
| @@ -1102,7 +1103,7 @@ class ListView | |||
| */ | |||
| function GetPageListDM($list_len, $listitem = "index,end,pre,next,pageno") | |||
| { | |||
| global $cfg_rewrite; | |||
| global $cfg_cmspath, $cfg_rewrite; | |||
| $prepage = $nextpage = ''; | |||
| $prepagenum = $this->PageNo - 1; | |||
| $nextpagenum = $this->PageNo + 1; | |||
| @@ -568,7 +568,7 @@ class SearchView | |||
| $row["title"] = $this->GetRedKeyWord(cn_substr($row["title"], $titlelen)); | |||
| $row["id"] = $row["id"]; | |||
| if ($row['litpic'] == '-' || $row['litpic'] == '') { | |||
| $row['litpic'] = '/static/web/img/thumbnail.jpg'; | |||
| $row['litpic'] = $GLOBALS['cfg_cmspath'].'/static/web/img/thumbnail.jpg'; | |||
| } | |||
| /*if (!preg_match("/^(http|https):\/\//", $row['litpic']) && $GLOBALS['cfg_multi_site'] == 'Y') { | |||
| $row['litpic'] = $GLOBALS['cfg_mainsite'].$row['litpic']; | |||
| @@ -431,7 +431,7 @@ class SgListView | |||
| $row['sitepath'] | |||
| ); | |||
| if ($row['litpic'] == '-' || $row['litpic'] == '') { | |||
| $row['litpic'] = '/static/web/img/thumbnail.jpg'; | |||
| $row['litpic'] = $GLOBALS['cfg_cmspath'].'/static/web/img/thumbnail.jpg'; | |||
| } | |||
| /*if (!preg_match("/^http:\/\//", $row['litpic']) && $GLOBALS['cfg_multi_site'] == 'Y') { | |||
| $row['litpic'] = $GLOBALS['cfg_mainsite'].$row['litpic']; | |||
| @@ -780,7 +780,7 @@ class SgListView | |||
| $row['sitepath'] | |||
| ); | |||
| if ($row['litpic'] == '-' || $row['litpic'] == '') { | |||
| $row['litpic'] = '/static/web/img/thumbnail.jpg'; | |||
| $row['litpic'] = $GLOBALS['cfg_cmspath'].'/static/web/img/thumbnail.jpg'; | |||
| } | |||
| if (!preg_match("/^http:\/\//", $row['litpic']) && $GLOBALS['cfg_multi_site'] == 'Y') { | |||
| $row['litpic'] = $GLOBALS['cfg_mainsite'].$row['litpic']; | |||
| @@ -80,7 +80,7 @@ class sgpage | |||
| */ | |||
| function SaveToHtml() | |||
| { | |||
| $filename = $GLOBALS['cfg_basedir'].'/'.$this->Fields['filename']; | |||
| $filename = $GLOBALS['cfg_basedir'].$GLOBALS['cfg_cmspath'].'/'.$this->Fields['filename']; | |||
| $filename = preg_replace("/\/{1,}/", '/', $filename); | |||
| $this->dtp->SaveTo($filename); | |||
| } | |||
| @@ -348,7 +348,7 @@ class SpecView | |||
| $row["title"] = cn_substr($row["title"], $titlelen); | |||
| $row["id"] = $row["id"]; | |||
| if ($row['litpic'] == '-' || $row['litpic'] == '') { | |||
| $row['litpic'] = '/static/web/img/thumbnail.jpg'; | |||
| $row['litpic'] = $GLOBALS['cfg_cmspath'].'/static/web/img/thumbnail.jpg'; | |||
| } | |||
| if (!preg_match("/^http:\/\//", $row['litpic']) && $GLOBALS['cfg_multi_site'] == 'Y') { | |||
| $row['litpic'] = $GLOBALS['cfg_mainsite'].$row['litpic']; | |||
| @@ -156,8 +156,8 @@ class TagList | |||
| */ | |||
| function Display() | |||
| { | |||
| global $cfg_tags_dir; | |||
| $tagsDir = str_replace("{cmspath}", "", $cfg_tags_dir); | |||
| global $cfg_cmspath, $cfg_tags_dir; | |||
| $tagsDir = str_replace("{cmspath}",$cfg_cmspath,$cfg_tags_dir); | |||
| $makeDir = empty($this->Tag) ? $this->GetTruePath().$tagsDir."/index.html" : $this->GetTruePath().$tagsDir."/".$this->Tag."/index.html"; | |||
| if ($this->Tag != '') { | |||
| $this->CountRecord(); | |||
| @@ -346,7 +346,7 @@ class TagList | |||
| $row['sitepath'] | |||
| ); | |||
| if ($row['litpic'] == '-' || $row['litpic'] == '') { | |||
| $row['litpic'] = '/static/web/img/thumbnail.jpg'; | |||
| $row['litpic'] = $GLOBALS['cfg_cmspath'].'/static/web/img/thumbnail.jpg'; | |||
| } | |||
| /*if (!preg_match("/^http:\/\//", $row['litpic']) && $GLOBALS['cfg_multi_site'] == 'Y') { | |||
| $row['litpic'] = $GLOBALS['cfg_mainsite'].$row['litpic']; | |||
| @@ -559,16 +559,16 @@ class TagList | |||
| } | |||
| function SetTagsDir($dir = '') | |||
| { | |||
| global $cfg_tags_dir; | |||
| if ($dir == "") $dir = str_replace("{cmspath}", "", $cfg_tags_dir); | |||
| global $cfg_tags_dir, $cfg_cmspath; | |||
| if ($dir == "") $dir = str_replace("{cmspath}", $cfg_cmspath, $cfg_tags_dir); | |||
| $this->tagsDir = $dir; | |||
| } | |||
| //生成静态标签 | |||
| function MakeHtml($startpage = 1, $makepagesize = 0) | |||
| { | |||
| global $cfg_dir_purview, $envs, $cfg_tags_dir, $cfg_cmsurl; | |||
| global $cfg_dir_purview, $envs, $cfg_cmspath, $cfg_tags_dir, $cfg_cmsurl; | |||
| $envs['makeTag'] = 1; | |||
| $tagsdir = str_replace("{cmspath}", "", $cfg_tags_dir); | |||
| $tagsdir = str_replace("{cmspath}", $cfg_cmspath, $cfg_tags_dir); | |||
| if (isset($envs['makeTag']) && $envs['makeTag'] == 1) { | |||
| $this->Fields['position'] = $cfg_cmsurl.$tagsdir."/"; | |||
| } | |||
| @@ -152,32 +152,32 @@ if (PHP_SAPI === 'cli') { | |||
| $cfg_clihost = 'http://'.$_SERVER['HTTP_HOST']; | |||
| } | |||
| //站点根目录 | |||
| $cfg_basedir = preg_replace('#'.'\/system$#i', '', DEDEINC); | |||
| $cfg_basedir = preg_replace('#'.$cfg_cmspath.'\/system$#i', '', DEDEINC); | |||
| if ($cfg_multi_site == 'Y') { | |||
| $cfg_mainsite = $cfg_basehost; | |||
| } else { | |||
| $cfg_mainsite = ''; | |||
| } | |||
| //模板存放目录 | |||
| $cfg_templets_dir = '/theme'; | |||
| $cfg_templets_dir = $cfg_cmspath.'/theme'; | |||
| $cfg_templeturl = $cfg_mainsite.$cfg_templets_dir; | |||
| $cfg_templets_skin = empty($cfg_df_style) ? $cfg_mainsite.$cfg_templets_dir."/templets" : $cfg_mainsite.$cfg_templets_dir."/$cfg_df_style"; | |||
| //安装目录网址 | |||
| $cfg_cmsurl = $cfg_mainsite; | |||
| $cfg_cmsurl = $cfg_mainsite.$cfg_cmspath; | |||
| //模块插件目录 | |||
| $cfg_plus_dir = '/apps'; | |||
| $cfg_plus_dir = $cfg_cmspath.'/apps'; | |||
| $cfg_phpurl = $cfg_mainsite.$cfg_plus_dir; | |||
| //一些缓存配置数据存放目录 | |||
| $cfg_data_dir = '/data'; | |||
| $cfg_data_dir = $cfg_cmspath.'/data'; | |||
| $cfg_dataurl = $cfg_mainsite.$cfg_data_dir; | |||
| //专题存放目录 | |||
| $cfg_special = '/a/special'; | |||
| $cfg_special = $cfg_cmspath.'/a/special'; | |||
| $cfg_specialurl = $cfg_mainsite.$cfg_special; | |||
| //会员会员目录 | |||
| $cfg_member_dir = '/user'; | |||
| $cfg_member_dir = $cfg_cmspath.'/user'; | |||
| $cfg_memberurl = $cfg_mainsite.$cfg_member_dir; | |||
| //静态文件存放目录 | |||
| $cfg_static_dir = '/static'; | |||
| $cfg_static_dir = $cfg_cmspath.'/static'; | |||
| $cfg_staticurl = $cfg_mainsite.$cfg_static_dir; | |||
| //上传图片存放目录,建议按默认 | |||
| $cfg_image_dir = $cfg_medias_dir.'/allimg'; | |||
| @@ -188,7 +188,7 @@ $cfg_soft_dir = $cfg_medias_dir.'/soft'; | |||
| //上传多媒体文件存放目录 | |||
| $cfg_other_medias = $cfg_medias_dir.'/media'; | |||
| //附件目录 | |||
| $cfg_medias_dir = $cfg_medias_dir; | |||
| $cfg_medias_dir = $cfg_cmspath.$cfg_medias_dir; | |||
| $cfg_mediasurl = $cfg_mainsite.$cfg_medias_dir; | |||
| //程序信息摘要,请不要删除则系统无法接收升级信息 | |||
| $cfg_version = 'V6'; | |||
| @@ -38,19 +38,20 @@ function GetFormItem($ctag, $admintype = 'admin') | |||
| $myformItem .= "</select>"; | |||
| $innertext = $myformItem; | |||
| } else if ($fieldType == 'stepselect') { | |||
| global $hasSetEnumJs; | |||
| global $hasSetEnumJs, $cfg_cmspath; | |||
| $cmspath = ((empty($cfg_cmspath) || !preg_match('/[/$]/', $cfg_cmspath)) ? $cfg_cmspath.'/' : $cfg_cmspath); | |||
| $myformItem = ''; | |||
| $myformItem .= "<input type='hidden' id='hidden_{$fieldname}' name='{$fieldname}' value='0'>"; | |||
| $myformItem .= "<span id='span_{$fieldname}'></span>"; | |||
| $myformItem .= "<span id='span_{$fieldname}_son'></span>"; | |||
| $myformItem .= "<span id='span_{$fieldname}_sec'></span>"; | |||
| if ($hasSetEnumJs != 'hasset') { | |||
| $myformItem .= '<script src="/static/web/js/enums.js"></script>'.""; | |||
| $myformItem .= '<script src="'.$cmspath.'static/web/js/enums.js"></script>'.""; | |||
| $GLOBALS['hasSetEnumJs'] = 'hasset'; | |||
| } | |||
| $myformItem .= "<script> | |||
| var em_{$fieldname}s = []; | |||
| fetch('/static/enums/{$fieldname}.json').then((resp)=>resp.json()).then((d) => { | |||
| fetch('{$cmspath}static/enums/{$fieldname}.json').then((resp)=>resp.json()).then((d)=>{ | |||
| Object.entries(d).forEach(v=>{ | |||
| em_{$fieldname}s[parseFloat(v[0])]= v[1]; | |||
| }); | |||
| @@ -156,7 +157,7 @@ EOT; | |||
| */ | |||
| function GetFieldValue($dvalue, $dtype, $aid = 0, $job = 'add', $addvar = '', $admintype = 'admin', $fieldname = '') | |||
| { | |||
| global $cfg_basedir, $adminid, $cfg_ml, $cfg_cookie_encode; | |||
| global $cfg_basedir, $cfg_cmspath, $adminid, $cfg_ml, $cfg_cookie_encode; | |||
| if (!empty($adminid)) { | |||
| $adminid = $adminid; | |||
| } else { | |||
| @@ -200,7 +201,7 @@ function GetFieldValue($dvalue, $dtype, $aid = 0, $job = 'add', $addvar = '', $a | |||
| } | |||
| return $dvalue; | |||
| } else if ($dtype == "textdata") { | |||
| $ipath = '/data/textdata'; | |||
| $ipath = $cfg_cmspath."/data/textdata"; | |||
| $tpath = ceil($aid / 5000); | |||
| if (!is_dir($cfg_basedir.$ipath)) { | |||
| MkdirAll($cfg_basedir.$ipath, $GLOBALS['cfg_dir_purview']); | |||
| @@ -271,19 +272,20 @@ function GetFormItemValue($ctag, $fvalue, $admintype = 'admin', $fieldname = '') | |||
| $myformItem .= "</select>"; | |||
| $innertext = $myformItem; | |||
| } else if ($ctag->GetAtt("type") == 'stepselect') { | |||
| global $hasSetEnumJs; | |||
| global $hasSetEnumJs, $cfg_cmspath; | |||
| $cmspath = ((empty($cfg_cmspath) || preg_match('/[/$]/', $cfg_cmspath)) ? $cfg_cmspath.'/' : $cfg_cmspath); | |||
| $myformItem = ''; | |||
| $myformItem .= "<input type='hidden' id='hidden_{$fieldname}' name='{$fieldname}' value='{$fvalue}'>"; | |||
| $myformItem .= "<span id='span_{$fieldname}'></span>"; | |||
| $myformItem .= "<span id='span_{$fieldname}_son'></span>"; | |||
| $myformItem .= "<span id='span_{$fieldname}_sec'></span>"; | |||
| if ($hasSetEnumJs != 'hasset') { | |||
| $myformItem .= '<script src="/static/web/js/enums.js"></script>'.""; | |||
| $myformItem .= '<script src="'.$cmspath.'static/web/js/enums.js"></script>'.""; | |||
| $GLOBALS['hasSetEnumJs'] = 'hasset'; | |||
| } | |||
| $myformItem .= "<script> | |||
| var em_{$fieldname}s = []; | |||
| fetch('/static/enums/{$fieldname}.json').then((resp)=>resp.json()).then((d) => { | |||
| fetch('{$cmspath}static/enums/{$fieldname}.json').then((resp)=>resp.json()).then((d)=>{ | |||
| Object.entries(d).forEach(v=>{ | |||
| em_{$fieldname}s[parseFloat(v[0])]= v[1]; | |||
| }); | |||
| @@ -25,12 +25,12 @@ if (!function_exists('obtaintheme')) { | |||
| if (!function_exists('obtaintags')) { | |||
| function obtaintags($aid, $num = 3) | |||
| { | |||
| global $dsql; | |||
| global $dsql, $cfg_cmspath; | |||
| $tags = ''; | |||
| $query = "SELECT * FROM `#@__taglist` WHERE aid='$aid' LIMIT $num"; | |||
| $dsql->Execute('tag', $query); | |||
| while($row = $dsql->GetArray('tag')) { | |||
| $link = "/apps/tags.php?/{$row['tid']}"; | |||
| $link = $cfg_cmspath."/apps/tags.php?/{$row['tid']}"; | |||
| $tags .= ($tags == '' ? "<a href='{$link}'>{$row['tag']}</a>" : "<a href='{$link}'>{$row['tag']}</a>"); | |||
| } | |||
| return $tags; | |||
| @@ -52,7 +52,7 @@ class DedeStatistics { | |||
| ksort($pm); | |||
| $pm['sign'] = sha1(http_build_query($pm).md5($cfg_cookie_encode)); | |||
| $pm['dopost'] = "stat"; | |||
| $url = '/apps/statistics.php?'.http_build_query($pm); | |||
| $url = $GLOBALS['cfg_cmspath'].'/apps/statistics.php?'.http_build_query($pm); | |||
| return " | |||
| (function() { | |||
| let u = '{$url}'; | |||
| @@ -344,7 +344,7 @@ function lib_arclistDone (&$refObj, &$ctag, $typeid=0, $row=10, $col=1, $titlele | |||
| $row['sitepath'] | |||
| ); | |||
| if ($row['litpic'] == '-' || $row['litpic'] == '') { | |||
| $row['litpic'] = '/static/web/img/thumbnail.jpg'; | |||
| $row['litpic'] = $GLOBALS['cfg_cmspath'].'/static/web/img/thumbnail.jpg'; | |||
| } | |||
| if (!preg_match("#^(http|https):\/\/#i", $row['litpic']) && $GLOBALS['cfg_multi_site'] == 'Y') { | |||
| $row['litpic'] = $GLOBALS['cfg_mainsite'].$row['litpic']; | |||
| @@ -178,7 +178,7 @@ function lib_arclistsg(&$ctag, &$refObj) | |||
| $row['sitepath'] | |||
| ); | |||
| if ($row['litpic'] == '-' || $row['litpic'] == '') { | |||
| $row['litpic'] = '/static/web/img/thumbnail.jpg'; | |||
| $row['litpic'] = $GLOBALS['cfg_cmspath'].'/static/web/img/thumbnail.jpg'; | |||
| } | |||
| if (!preg_match("#^(http|https):\/\/#i", $row['litpic']) && $GLOBALS['cfg_multi_site'] == 'Y') { | |||
| $row['litpic'] = $GLOBALS['cfg_mainsite'].$row['litpic']; | |||
| @@ -45,7 +45,7 @@ function lib_feedback(&$ctag, &$refObj) | |||
| $ctp->LoadSource($innertext); | |||
| $dsql->Execute('fb', $equery); | |||
| while ($arr = $dsql->GetArray('fb')) { | |||
| $arr['face'] = empty($arr['mface']) ? '/static/web/img/admin.png' : $arr['mface']; | |||
| $arr['face'] = empty($arr['mface']) ? $GLOBALS['cfg_cmspath'].'/static/web/img/admin.png' : $arr['mface']; | |||
| $arr['userurl'] = $GLOBALS['cfg_memberurl'].'/index.php?uid='.$arr['userid']; | |||
| $arr['title'] = cn_substr($arr['arctitle'], $titlelen); | |||
| $arr['msg'] = jsTrim(Html2Text($arr['msg']), $infolen); | |||
| @@ -11,7 +11,8 @@ if (!defined('DEDEINC')) exit ('dedebiz'); | |||
| */ | |||
| function lib_infoguide(&$ctag, &$refObj) | |||
| { | |||
| global $dsql, $nativeplace, $infotype, $hasSetEnumJs, $cfg_mainsite; | |||
| global $dsql, $nativeplace, $infotype, $hasSetEnumJs, $cfg_cmspath, $cfg_mainsite; | |||
| $cmspath = ((empty($cfg_cmspath) || preg_match('#[/$]#', $cfg_cmspath)) ? $cfg_cmspath.'/' : $cfg_cmspath); | |||
| if (empty($refObj->Fields['typeid'])) { | |||
| $row = $dsql->GetOne("SELECT id FROM `#@__arctype` WHERE channeltype='-8' And reid = '0' "); | |||
| $typeid = (is_array($row) ? $row['id'] : 0); | |||
| @@ -29,7 +30,7 @@ function lib_infoguide(&$ctag, &$refObj) | |||
| $revalue = $seli = ''; | |||
| $fields = array('nativeplace' => '', 'infotype' => '', 'typeid' => $typeid); | |||
| if ($hasSetEnumJs != 'has') { | |||
| $revalue .= '<script src="'.$cfg_mainsite.'/static/web/js/enums.js"></script>'."\r\n"; | |||
| $revalue .= '<script src="'.$cfg_mainsite.$cmspath.'static/web/js/enums.js"></script>'."\r\n"; | |||
| $GLOBALS['hasSetEnumJs'] = 'hasset'; | |||
| } | |||
| $fields['nativeplace'] = $fields['infotype'] = ''; | |||
| @@ -40,7 +41,7 @@ function lib_infoguide(&$ctag, &$refObj) | |||
| $fields['nativeplace'] .= "<span id='span_nativeplace_son'></span>\r\n<span id='span_nativeplace_sec'></span>\r\n"; | |||
| $fields['nativeplace'] .= "<script> | |||
| var em_nativeplaces = []; | |||
| fetch('/static/enums/nativeplace.json').then((resp)=>resp.json()).then((d)=>{ | |||
| fetch('{$cmspath}static/enums/nativeplace.json').then((resp)=>resp.json()).then((d)=>{ | |||
| Object.entries(d).forEach(v=>{ | |||
| em_nativeplaces[parseFloat(v[0])]= v[1]; | |||
| }); | |||
| @@ -52,7 +53,7 @@ function lib_infoguide(&$ctag, &$refObj) | |||
| $fields['infotype'] .= "<span id='span_infotype_son'></span><span id='span_infotype_sec'></span>\r\n"; | |||
| $fields['infotype'] .= "<script> | |||
| var em_infotypes = []; | |||
| fetch('/static/enums/infotype.json').then((resp)=>resp.json()).then((d)=>{ | |||
| fetch('{$cmspath}static/enums/infotype.json').then((resp)=>resp.json()).then((d)=>{ | |||
| Object.entries(d).forEach(v=>{ | |||
| em_infotypes[parseFloat(v[0])]= v[1]; | |||
| }); | |||
| @@ -25,11 +25,12 @@ function is_str_float($value){ | |||
| } | |||
| function lib_infolink(&$ctag, &$refObj) | |||
| { | |||
| global $dsql, $nativeplace, $infotype, $cfg_rewrite, $cfg_mainsite, $em_nativeplaces, $em_infotypes; | |||
| global $dsql, $nativeplace, $infotype, $cfg_rewrite, $cfg_cmspath, $cfg_mainsite, $em_nativeplaces, $em_infotypes; | |||
| //$attlist="row|10,titlelen|30"; | |||
| //FillAttsDefault($ctag->CAttribute->Items,$attlist); | |||
| //extract($ctag->CAttribute->Items, EXTR_SKIP); | |||
| $baseurl = preg_replace("#\/$#", '', $cfg_mainsite); | |||
| $cmspath = ((empty($cfg_cmspath) || !preg_match("#\/$#", $cfg_cmspath)) ? $cfg_cmspath.'/' : $cfg_cmspath); | |||
| $baseurl = preg_replace("#\/$#", '', $cfg_mainsite).$cmspath; | |||
| $smalltypes = ''; | |||
| if (!empty($refObj->TypeLink->TypeInfos['smalltypes'])) { | |||
| $smalltypes = explode(',', $refObj->TypeLink->TypeInfos['smalltypes']); | |||
| @@ -122,7 +122,7 @@ function lib_likearticle(&$ctag, &$refObj) | |||
| $row['sitepath'] | |||
| ); | |||
| if ($row['litpic'] == '-' || $row['litpic'] == '') { | |||
| $row['litpic'] = '/static/web/img/thumbnail.jpg'; | |||
| $row['litpic'] = $GLOBALS['cfg_cmspath'].'/static/web/img/thumbnail.jpg'; | |||
| } | |||
| if (!preg_match("#^(http|https):\/\/#i", $row['litpic']) && $GLOBALS['cfg_multi_site'] == 'Y') { | |||
| $row['litpic'] = $GLOBALS['cfg_mainsite'].$row['litpic']; | |||
| @@ -108,7 +108,7 @@ function lib_relation(&$ctag, &$refObj) | |||
| $row['sitepath'] | |||
| ); | |||
| if ($row['litpic'] == '-' || $row['litpic'] == '') { | |||
| $row['litpic'] = '/static/web/img/thumbnail.jpg'; | |||
| $row['litpic'] = $GLOBALS['cfg_cmspath'].'/static/web/img/thumbnail.jpg'; | |||
| } | |||
| if (!preg_match("#^(http|https):\/\/#i", $row['litpic']) && $GLOBALS['cfg_multi_site'] == 'Y') { | |||
| $row['litpic'] = $GLOBALS['cfg_mainsite'].$row['litpic']; | |||
| @@ -21,7 +21,7 @@ function lib_statistics(&$ctag, &$refObj) | |||
| $pms['typeid'] = isset($envs['typeid'])? $envs['typeid'] : 0; | |||
| $pms['aid'] = isset($envs['aid'])? $envs['aid'] : 0; | |||
| $pms['value'] = isset($envs['value'])? $envs['value'] : ''; | |||
| $revalue = '<script async src="'.'/apps/statistics.php?'.http_build_query($pms).'"></script>'; | |||
| $revalue = '<script async src="'.$GLOBALS['cfg_cmspath'].'/apps/statistics.php?'.http_build_query($pms).'"></script>'; | |||
| return $revalue; | |||
| } | |||
| ?> | |||
| @@ -21,7 +21,7 @@ function lib_tag(&$ctag, &$refObj) | |||
| $ltype = $sort; | |||
| $num = $row; | |||
| $addsql = ''; | |||
| $tagsdir = str_replace("{cmspath}", "", $cfg_tags_dir); | |||
| $tagsdir = str_replace("{cmspath}", $cfg_cmspath, $cfg_tags_dir); | |||
| if ($getall == 0 && isset($refObj->Fields['tags']) && !empty($refObj->Fields['aid'])) { | |||
| $dsql->SetQuery("SELECT tid FROM `#@__taglist` WHERE aid = '{$refObj->Fields['aid']}' "); | |||
| $dsql->Execute(); | |||
| @@ -28,7 +28,7 @@ function plus_userarclist(&$atts, &$refObj, &$fields) | |||
| $row['arcrank'],$row['namerule'],$row['typedir'],$row['money'],$row['filename'],$row['moresite'],$row['siteurl'],$row['sitepath']); | |||
| $row['typeurl'] = GetTypeUrl($row['typeid'],$row['typedir'],$row['isdefault'],$row['defaultname'],$row['ispart'], | |||
| $row['namerule2'],$row['moresite'],$row['siteurl'],$row['sitepath']); | |||
| if ($row['litpic']=='') $row['litpic'] = '/static/web/img/thumbnail.jpg'; | |||
| if ($row['litpic']=='') $row['litpic'] = $GLOBALS['cfg_cmspath'].'/static/web/img/thumbnail.jpg'; | |||
| if (!preg_match("#^(http|https):\/\/#i", $row['litpic'])) { | |||
| $row['picname'] = $row['litpic'] = $GLOBALS['cfg_cmsurl'].$row['litpic']; | |||
| } else { | |||
| @@ -75,7 +75,7 @@ class TypeLink | |||
| function GetTypeDir() | |||
| { | |||
| if (empty($this->TypeInfos['typedir'])) { | |||
| return $GLOBALS['cfg_arcdir']; | |||
| return $GLOBALS['cfg_cmspath'].$GLOBALS['cfg_arcdir']; | |||
| } else { | |||
| return $this->TypeInfos['typedir']; | |||
| } | |||
| @@ -23,7 +23,7 @@ class TypeUnit | |||
| function __construct() | |||
| { | |||
| $this->idCounter = 0; | |||
| $this->artDir = $GLOBALS['cfg_arcdir']; | |||
| $this->artDir = $GLOBALS['cfg_cmspath'].$GLOBALS['cfg_arcdir']; | |||
| $this->baseDir = $GLOBALS['cfg_basedir']; | |||
| $this->shortName = $GLOBALS['art_shortname']; | |||
| $this->idArray = array(); | |||
| @@ -21,7 +21,7 @@ if ($fmdo == 'sendMail') { | |||
| exit(); | |||
| } | |||
| $userhash = md5($cfg_cookie_encode.'--'.$cfg_ml->fields['mid'].'--'.$cfg_ml->fields['email']); | |||
| $url = $cfg_basehost.$cfg_memberurl."/index_do.php?fmdo=checkMail&mid={$cfg_ml->fields['mid']}&userhash={$userhash}&do=1"; | |||
| $url = $cfg_basehost.(empty($cfg_cmspath) ? '/' : $cfg_cmspath)."/user/index_do.php?fmdo=checkMail&mid={$cfg_ml->fields['mid']}&userhash={$userhash}&do=1"; | |||
| $url = preg_replace("#http:\/\/#i", '', $url); | |||
| $proto = IsSSL()? "https://" : "http://"; | |||
| $url = $proto.preg_replace("#\/\/#i", '/', $url); | |||