@@ -63,9 +63,7 @@ if (!empty($noeditor)) { | |||||
?> | ?> | ||||
</select> | </select> | ||||
</div> | </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> | ||||
</div> | </div> | ||||
<script> | <script> | ||||
@@ -66,7 +66,7 @@ if ($action == 'post') { | |||||
} | } | ||||
} | } | ||||
} | } | ||||
//判断$name是否输入中文包括繁体则提交失败,$name改成您表单字段标识,恢复注释代码使用 | |||||
//判断$name是否输入违禁词,在后台-系统设置:禁用关键词添加,$name改成您表单字段标识,恢复注释代码使用 | |||||
/*if ($name != '' && preg_match("#".$cfg_notallowstr."#i", $name)) { | /*if ($name != '' && preg_match("#".$cfg_notallowstr."#i", $name)) { | ||||
ShowMsg("您输入的信息存在违禁,请重新填写", "-1"); | ShowMsg("您输入的信息存在违禁,请重新填写", "-1"); | ||||
exit(); | exit(); | ||||
@@ -98,6 +98,8 @@ if ($action == 'post') { | |||||
require_once(DEDEINC.'/libraries/mail.class.php'); | require_once(DEDEINC.'/libraries/mail.class.php'); | ||||
$smtp = new smtp($cfg_smtp_server, $cfg_smtp_port, true, $cfg_smtp_usermail, $cfg_smtp_password); | $smtp = new smtp($cfg_smtp_server, $cfg_smtp_port, true, $cfg_smtp_usermail, $cfg_smtp_password); | ||||
$smtp->debug = false; | $smtp->debug = false; | ||||
//除了cfg_adminemail接收邮件外,自定义发送其他指定邮件,恢复注释代码使用 | |||||
//$cfg_smtp_usermail2 = "admin@qq.com"; | |||||
$smtp->sendmail($cfg_adminemail, $cfg_webname, $cfg_smtp_usermail, $mailtitle, $mailbody, $mailtype); | $smtp->sendmail($cfg_adminemail, $cfg_webname, $cfg_smtp_usermail, $mailtitle, $mailbody, $mailtype); | ||||
} else { | } else { | ||||
@mail($cfg_adminemail, $mailtitle, $mailbody, $headers); | @mail($cfg_adminemail, $mailtitle, $mailbody, $headers); | ||||
@@ -56,6 +56,7 @@ if (empty($typeid)) { | |||||
$typeid = intval($typeid); | $typeid = intval($typeid); | ||||
$keyword = addslashes(cn_substr($keyword, 30)); | $keyword = addslashes(cn_substr($keyword, 30)); | ||||
$typeid = intval($typeid); | $typeid = intval($typeid); | ||||
//判断关键词是否输入违禁词,在后台-系统设置:禁用关键词添加 | |||||
if ($keyword != '' && ($cfg_notallowstr != '' && preg_match("#".$cfg_notallowstr."#i", $keyword))) { | if ($keyword != '' && ($cfg_notallowstr != '' && preg_match("#".$cfg_notallowstr."#i", $keyword))) { | ||||
ShowMsg("您输入的关键词存在违禁,请重新填写", "-1"); | ShowMsg("您输入的关键词存在违禁,请重新填写", "-1"); | ||||
exit(); | exit(); | ||||
@@ -17,7 +17,7 @@ define('ALERT_WARNING', 5); | |||||
define('ALERT_INFO', 6); | define('ALERT_INFO', 6); | ||||
define('ALERT_LIGHT', 7); | define('ALERT_LIGHT', 7); | ||||
define('ALERT_DARK', 8); | define('ALERT_DARK', 8); | ||||
define("ALERT_TPL", '<div style="position:relative;padding:0.75rem 1.25rem;margin-bottom:1rem;width:auto;font-size:14px;color:~color~;background:~background~;border-color:~border~;border:1px solid transparent;border-radius:0.5rem">~content~</div>'); | |||||
define("ALERT_TPL", '<div style="padding:1rem"><div style="position:relative;padding:0.75rem 1.25rem;font-size:14px;color:~color~;background:~background~;border-color:~border~;border:1px solid transparent;border-radius:0.5rem">~content~</div></div>'); | |||||
//$content:文档,$type:alert类型 | //$content:文档,$type:alert类型 | ||||
function DedeAlert($content, $type = ALERT_PRIMARY, $isHTML = false) | function DedeAlert($content, $type = ALERT_PRIMARY, $isHTML = false) | ||||
{ | { | ||||
@@ -22,21 +22,23 @@ if (!function_exists('obtaintheme')) { | |||||
} | } | ||||
} | } | ||||
//标签调用[field:id function='obtaintags(@me,3)'/]3表示调用文档3个标签 | //标签调用[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']}"; | $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' | |||||
//提取文档多图片[field:body function='obtainimgs(@me,3)'/]3表示调用文档3张图片,例如:文档模型body字段,列表附加字段添加body,dede:arclist标签调用添加channelid='1' addfields='body' | |||||
if (!function_exists('obtainimgs')) { | if (!function_exists('obtainimgs')) { | ||||
function obtainimgs($string, $num) | function obtainimgs($string, $num) | ||||
{ | { | ||||
@@ -44,10 +46,10 @@ if (!function_exists('obtainimgs')) { | |||||
$imgsrc_arr = array_unique($matches[3]); | $imgsrc_arr = array_unique($matches[3]); | ||||
$i = 0; | $i = 0; | ||||
$result = ''; | $result = ''; | ||||
foreach($imgsrc_arr as $imgsrc) | |||||
foreach ($imgsrc_arr as $imgsrc) | |||||
{ | { | ||||
if ($i == $num) break; | if ($i == $num) break; | ||||
$result .= "<img src=\"$imgsrc\">"; | |||||
$result .= "<img src=\"{$imgsrc}\">"; | |||||
$i++; | $i++; | ||||
} | } | ||||
return $result; | return $result; | ||||
@@ -65,10 +67,11 @@ function obtainalt($newalt) | |||||
//去掉图片宽度和高度 | //去掉图片宽度和高度 | ||||
$newalt = preg_replace("/style=\"width\:(.*)\"/", "", $newalt); | $newalt = preg_replace("/style=\"width\:(.*)\"/", "", $newalt); | ||||
//去掉结尾 | //去掉结尾 | ||||
$newalt = str_ireplace(" ", " ", $newalt); | |||||
$newalt = str_ireplace(" /", "", $newalt); | $newalt = str_ireplace(" /", "", $newalt); | ||||
return $newalt; | return $newalt; | ||||
} | } | ||||
//联动单筛选{dede:php}obtainfilter(模型id,类型,'字段1,字段2');{/dede:php}类型表示前台展现方式对应case值 | |||||
//联动单筛选{dede:php}obtainfilter(模型id,类型,'字段1,字段2');{/dede:php}类型表示前台展现方式,对应case值,例如:文档模型style字段radio选项卡类型,列表附加字段类别添加style,标签调用{dede:php}obtainfilter(1,1,'style');{/dede:php} | |||||
function obtainfilter($channelid, $type = 1, $fieldsnamef = '', $defaulttid = 0, $toptid = 0, $loadtype = 'autofield') | function obtainfilter($channelid, $type = 1, $fieldsnamef = '', $defaulttid = 0, $toptid = 0, $loadtype = 'autofield') | ||||
{ | { | ||||
global $tid, $dsql, $id, $aid; | global $tid, $dsql, $id, $aid; | ||||
@@ -437,8 +437,8 @@ function checkCode($code) | |||||
function htmlErrors($errors = null) | function htmlErrors($errors = null) | ||||
{ | { | ||||
if ($errors) { | if ($errors) { | ||||
$errorsHTML = "<div style='width:98%;margin:1rem auto;color:#842029;background:#f8d7da;border-color:#842029;position:relative;padding:0.75rem 1.25rem;border:1px solid transparent;border-radius:0.5rem'>"; | |||||
$errorsHTML .= '内嵌脚本缺失,请添加该函数:'; | |||||
$errorsHTML = "<div style='padding:1rem'><div style='position:relative;padding:0.75rem 1.25rem;font-size:14px;color:#842029;background:#f8d7da;border-color:#842029;border:1px solid transparent;border-radius:0.5rem'>"; | |||||
$errorsHTML .= '<p>内嵌脚本缺失,请添加该函数:</p>'; | |||||
$errorsHTML .= '<dl>'; | $errorsHTML .= '<dl>'; | ||||
foreach ($errors as $error) { | foreach ($errors as $error) { | ||||
if ($error['line']) { | if ($error['line']) { | ||||
@@ -447,7 +447,7 @@ function htmlErrors($errors = null) | |||||
$errorsHTML .= '<dd>'.$error['name'].'</dd>'; | $errorsHTML .= '<dd>'.$error['name'].'</dd>'; | ||||
} | } | ||||
$errorsHTML .= '</dl>'; | $errorsHTML .= '</dl>'; | ||||
$errorsHTML .= "</div>\r\n"; | |||||
$errorsHTML .= "</div></div>"; | |||||
echo $errorsHTML; | echo $errorsHTML; | ||||
} | } | ||||
} | } |
@@ -11,7 +11,7 @@ if (!defined('DEDEINC')) exit ('dedebiz'); | |||||
*/ | */ | ||||
function lib_tag(&$ctag, &$refObj) | 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"; | $attlist = "row|30,sort|new,getall|0,typeid|0,ishtml|0"; | ||||
FillAttsDefault($ctag->CAttribute->Items, $attlist); | FillAttsDefault($ctag->CAttribute->Items, $attlist); | ||||
extract($ctag->CAttribute->Items, EXTR_SKIP); | extract($ctag->CAttribute->Items, EXTR_SKIP); | ||||