@@ -71,7 +71,7 @@ $randcode = mt_rand(10000, 99999); | |||
$safecode = substr(md5($cfg_cookie_encode.$randcode), 0, 24); | |||
$typeOptions = ''; | |||
//递归获取分类 | |||
function getTypeOptions($id=0,$sep="└") | |||
function getTypeOptions($id=0,$sep="└─") | |||
{ | |||
global $dsql,$typeOptions; | |||
$dsql->SetQuery("SELECT id,typename,ispart FROM `#@__arctype` WHERE reid={$id} AND (ispart=0 OR ispart=1 OR ispart=2) ORDER BY sortrank"); | |||
@@ -111,7 +111,7 @@ if ($dopost == 'saveedit') { | |||
$randcode = mt_rand(10000, 99999); | |||
$safecode = substr(md5($cfg_cookie_encode.$randcode), 0, 24); | |||
//递归获取分类 | |||
function getTypeOptions($id=0,$sep="└") | |||
function getTypeOptions($id=0,$sep="└─") | |||
{ | |||
global $dsql,$typeOptions,$typeids; | |||
$dsql->SetQuery("SELECT id,typename,ispart FROM `#@__arctype` WHERE reid={$id} AND (ispart=0 OR ispart=1 OR ispart=2) ORDER BY sortrank"); | |||
@@ -46,7 +46,7 @@ | |||
</form> | |||
</li> | |||
</ul> | |||
<div class="d-none d-lg-block"> | |||
<div class="navbar-admin d-none d-xl-block"> | |||
<ul class="nav"> | |||
<li class="nav-item"><a class="nav-link" href="javascript:document.getElementById('main').contentWindow.location.reload(true);"><i class="fa fa-refresh" title="刷新页面"></i></a></li> | |||
<li class="nav-item"><a class="nav-link user" href="sys_admin_user_edit.php?id=<?php echo $cuserLogin->getUserID();?>&dopost=edit" target="main"><img src="<?php echo $cuserLogin->getUserFace();?>"><?php echo $cuserLogin->getUserName();?></a></li> | |||
@@ -55,10 +55,10 @@ | |||
<tr> | |||
<td width="160">变量说明</td> | |||
<td width="370"><input type="text" name="varmsg" id="varmsg" class="admin-input-lg"></td> | |||
<td width="160">变量名称</td> | |||
<td><input type="text" name="nvarname" id="nvarname" class="admin-input-lg"></td> | |||
<td width="160">变量值</td> | |||
<td width="370"><input type="text" name="nvarvalue" id="nvarvalue" class="admin-input-lg"></td> | |||
<td width="160">变量名称</td> | |||
<td><input type="text" name="nvarname" id="nvarname" class="admin-input-lg"></td> | |||
</tr> | |||
<tr> | |||
<td>变量类型</td> | |||
@@ -143,9 +143,9 @@ | |||
} else if ($row['type']=='img') { | |||
echo "<input type='text' name='edit___{$row['varname']}' id='edit___{$row['varname']}' value='{$row['value']}' class='w-50'> <input type='button' name='set9' class='btn btn-success btn-sm' onclick="."SelectImage('form1.edit___{$row['varname']}','','idd_{$row['varname']}');"." value='选择'>"; | |||
if ($row['value']) { | |||
echo " <img src=".$row['value']." id='idd_{$row['varname']}' class='thumbnail-md'>"; | |||
echo " <img src=".$row['value']." id='idd_{$row['varname']}' class='thumbnail-md ml-3'>"; | |||
} else { | |||
echo " <img src='/static/web/img/thumbnail.jpg' id='idd_{$row['varname']}' class='thumbnail-md'>"; | |||
echo " <img src='/static/web/img/thumbnail.jpg' id='idd_{$row['varname']}' class='thumbnail-md ml-3'>"; | |||
} | |||
} else { | |||
$addstr=''; | |||
@@ -1,5 +0,0 @@ | |||
<?php | |||
//混淆串 | |||
#www.dedebiz.com | |||
#dedebiz.com | |||
?> |
@@ -201,10 +201,8 @@ textarea { | |||
vertical-align:middle | |||
} | |||
.admin-head .logo .version { | |||
padding:0 0.15rem; | |||
font-size:12px; | |||
color:var(--white); | |||
vertical-align:top | |||
color:var(--white) | |||
} | |||
.admin-head .nav-item { | |||
position:relative | |||
@@ -718,7 +716,7 @@ span.page-link { | |||
color:var(--white); | |||
background:var(--green) | |||
} | |||
input,select,textarea,button,.colordlg,.pubdlg,.quickselitem .topcat,.mysource,.mywriter,#edsta,.cke_chrome,.cke_inner,.card,.form-control,.btn,.alert,.rounded { | |||
input,select,textarea,.colordlg,.pubdlg,.quickselitem .topcat,.mysource,.mywriter,#edsta,.cke_chrome,.cke_inner,.card,.form-control,.btn,.alert,.rounded { | |||
border-radius:var(--b-radius)!important | |||
} | |||
.cke_top { | |||
@@ -748,7 +746,7 @@ input,select,textarea,button,.colordlg,.pubdlg,.quickselitem .topcat,.mysource,. | |||
border-radius:var(--b-radius-sm)!important | |||
} | |||
.btn+.btn { | |||
margin-left:0.5rem | |||
margin-left:0.5rem!important | |||
} | |||
.shadow-sm { | |||
box-shadow:0 0.125rem 0.25rem rgba(0,0,0,0.015)!important | |||
@@ -767,17 +765,22 @@ input,select,textarea,button,.colordlg,.pubdlg,.quickselitem .topcat,.mysource,. | |||
td { | |||
white-space:nowrap | |||
} | |||
.install-box,.tips-box,.w-65,.w-35,.admin-textarea-sm,.admin-input-lg,.admin-input-md,.admin-input-sm { | |||
width:100% | |||
.install-box,.tips-box,.w-65,.w-35 { | |||
width:100%!important | |||
} | |||
.admin-textarea-sm,.admin-input-lg,.admin-input-md,.admin-input-sm { | |||
width:auto!important; | |||
min-width:35% | |||
} | |||
.admin-head .navbar-nav { | |||
margin-left:auto | |||
} | |||
body.menu-hide .admin-aside { | |||
display:block | |||
display:block; | |||
width:100% | |||
} | |||
body.menu-hide .admin-content { | |||
left:220px | |||
left:100% | |||
} | |||
body.menu-show .admin-aside { | |||
display:none | |||
@@ -69,6 +69,9 @@ input[type=radio],input[type=checkbox],input[type=radio]:focus,input[type=checkb | |||
.body-bg { | |||
background:var(--bg) | |||
} | |||
.logo img { | |||
height:36px | |||
} | |||
#carouselDede .carousel-caption h2 { | |||
color:var(--white) | |||
} | |||
@@ -299,9 +302,6 @@ input[type=radio],input[type=checkbox],input[type=radio]:focus,input[type=checkb | |||
font-weight:300; | |||
color:var(--gray) | |||
} | |||
.logo img { | |||
height:36px | |||
} | |||
.pannel-main-container { | |||
padding:1.5rem; | |||
background:var(--white) | |||
@@ -607,36 +607,31 @@ function GetMimeTypeOrExtension($str, $t = 0) { | |||
return "dedebiz"; | |||
} | |||
} | |||
// 用于实际请求接口并返回处理结果 | |||
//用于实际请求接口并返回处理结果 | |||
function DedeSearchDo($action, $parms=array()) { | |||
if ($action === 'update') { | |||
DedeSearchDo('delete', $parms); | |||
return DedeSearchDo('add', $parms); | |||
} | |||
// 生成完整请求 URL | |||
//生成完整请求URL | |||
$url = DedeSearchAPIURL($action, $parms); | |||
// 初始化 cURL | |||
//初始化cURL | |||
$ch = curl_init(); | |||
curl_setopt($ch, CURLOPT_URL, $url); // 设置请求 URL | |||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // 返回结果而不是直接输出 | |||
curl_setopt($ch, CURLOPT_TIMEOUT, 10); // 设置超时时间(秒) | |||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5); // 设置连接超时(秒) | |||
curl_setopt($ch, CURLOPT_USERAGENT, 'DedeSearchAPI/1.0'); // 设置 User-Agent | |||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // 支持https连接 | |||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); // 支持https连接 | |||
// 执行请求 | |||
curl_setopt($ch, CURLOPT_URL, $url); //设置请求URL | |||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); //返回结果而不是直接输出 | |||
curl_setopt($ch, CURLOPT_TIMEOUT, 10); //设置超时时间(秒) | |||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5); //设置连接超时(秒) | |||
curl_setopt($ch, CURLOPT_USERAGENT, 'DedeSearchAPI/1.0'); //设置User-Agent | |||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); //支持https连接 | |||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); //支持https连接 | |||
//执行请求 | |||
$response = curl_exec($ch); | |||
// 获取 HTTP 状态码和错误信息 | |||
//获取HTTP状态码和错误信息 | |||
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); | |||
$curlError = curl_error($ch); | |||
// 关闭 cURL 资源 | |||
//关闭cURL资源 | |||
curl_close($ch); | |||
// 处理 HTTP 错误 | |||
//处理HTTP错误 | |||
if ($response === false || $httpCode !== 200) { | |||
return array( | |||
'code' => -1, | |||
@@ -644,8 +639,7 @@ function DedeSearchDo($action, $parms=array()) { | |||
'data' => null, | |||
); | |||
} | |||
// 解析返回的 JSON 数据 | |||
//解析返回的JSON数据 | |||
$result = json_decode($response, true); | |||
if (json_last_error() !== JSON_ERROR_NONE) { | |||
return array( | |||
@@ -654,8 +648,7 @@ function DedeSearchDo($action, $parms=array()) { | |||
'data' => null, | |||
); | |||
} | |||
// 检查返回的业务逻辑中的 code | |||
//检查返回的业务逻辑中的code | |||
if (!isset($result['code']) || $result['code'] !== 0) { | |||
return array( | |||
'code' => isset($result['code'])? $result['code'] : -3, | |||
@@ -663,21 +656,19 @@ function DedeSearchDo($action, $parms=array()) { | |||
'data' => null, | |||
); | |||
} | |||
// 返回成功结果 | |||
//返回成功结果 | |||
return array( | |||
'code' => 0, | |||
'message' => 'Success', | |||
'data' => isset($result['data'])? $result['data'] : null, | |||
); | |||
} | |||
// 获取接口地址 | |||
//获取接口地址 | |||
function DedeSearchAPIURL($action, $parms=array()) | |||
{ | |||
$baseUrl = DEDEBIZSEARCHHOST."/api/$action"; // 替换为实际的 API 地址 | |||
// 添加公共参数 | |||
$timestamp = time(); // 当前时间戳 | |||
$baseUrl = DEDEBIZSEARCHHOST."/api/$action"; //替换为实际的API地址 | |||
//添加公共参数 | |||
$timestamp = time(); //当前时间戳 | |||
$parms['timestamp'] = $timestamp; | |||
$parms['pageSize'] = isset($parms['pageSize'])? $parms['pageSize']:10; | |||
$parms['page'] = isset($parms['page'])? $parms['page']:1; | |||
@@ -687,16 +678,15 @@ function DedeSearchAPIURL($action, $parms=array()) | |||
$parms['page'] = 0; | |||
$parms['q'] = isset($parms['id'])? $parms['id']:""; | |||
} | |||
// 生成签名字符串 | |||
//生成签名字符串 | |||
$signBaseString = "key=" . DEDEBIZSEARCHKEY . "&q=".$parms['q']. "&pageSize=".$parms['pageSize']. "&page=".$parms['page']. "×tamp=".$parms['timestamp']; | |||
$parms['sign'] = md5($signBaseString); // 使用 MD5 生成签名 | |||
$parms['sign'] = md5($signBaseString); //使用MD5生成签名 | |||
if ($action == "delete" || $action == "add") { | |||
unset($parms['q']); | |||
unset($parms['pageSize']); | |||
unset($parms['page']); | |||
} | |||
// 拼接完整 URL | |||
//拼接完整URL | |||
$finalQueryString = http_build_query($parms); | |||
$finalUrl = $baseUrl . '?' . $finalQueryString; | |||
@@ -91,6 +91,8 @@ function lib_channel(&$ctag, &$refObj) | |||
$row['typelink'] = GetOneTypeUrlA($row); | |||
$linkOkstr = str_replace("~rel~", $row['rel'], $linkOkstr); | |||
$linkOkstr = str_replace("~id~", $row['id'], $linkOkstr); | |||
$linkOkstr = str_replace("~bigpic~", $row['bigpic'], $linkOkstr); | |||
$linkOkstr = str_replace("~litimg~", $row['litimg'], $linkOkstr); | |||
$linkOkstr = str_replace("~typelink~", $row['typelink'], $linkOkstr); | |||
$linkOkstr = str_replace("~typename~", $row['typename'], $linkOkstr); | |||
$likeType .= $linkOkstr; | |||