@@ -1,4 +1,5 @@ | |||||
<?php | <?php | ||||
/** | /** | ||||
* 多媒体发送 | * 多媒体发送 | ||||
* | * | ||||
@@ -8,9 +9,19 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
include_once(dirname(__FILE__).'/config.php'); | |||||
$cfg_softtype = $cfg_mediatype; | |||||
include_once(dirname(__FILE__) . '/config.php'); | |||||
$cfg_softtype = $cfg_mediatype . "|mp4"; | |||||
$cfg_soft_dir = $cfg_other_medias; | $cfg_soft_dir = $cfg_other_medias; | ||||
$bkurl = 'select_media.php'; | $bkurl = 'select_media.php'; | ||||
$uploadmbtype = "多媒体文件类型"; | $uploadmbtype = "多媒体文件类型"; | ||||
require_once(dirname(__FILE__)."/select_soft_post.php"); | |||||
if (empty($activepath)) { | |||||
$activepath = ''; | |||||
$activepath = str_replace('.', '', $activepath); | |||||
$activepath = preg_replace("#\/{1,}#", '/', $activepath); | |||||
if (strlen($activepath) < strlen($cfg_other_medias)) { | |||||
$activepath = $cfg_other_medias; | |||||
} | |||||
} | |||||
require_once(dirname(__FILE__) . "/select_soft_post.php"); |
@@ -1,4 +1,5 @@ | |||||
<?php | <?php | ||||
/** | /** | ||||
* 软件发送 | * 软件发送 | ||||
* | * | ||||
@@ -8,105 +9,105 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
if(!isset($cfg_basedir)) | |||||
{ | |||||
include_once(dirname(__FILE__).'/config.php'); | |||||
if (!isset($cfg_basedir)) { | |||||
include_once(dirname(__FILE__) . '/config.php'); | |||||
} | } | ||||
if(empty($uploadfile)) $uploadfile = ''; | |||||
if(empty($uploadmbtype)) $uploadmbtype = '软件类型'; | |||||
if(empty($bkurl)) $bkurl = 'select_soft.php'; | |||||
$CKEditorFuncNum = (isset($CKEditorFuncNum))? $CKEditorFuncNum : 1; | |||||
$newname = ( empty($newname) ? '' : preg_replace("#[\\ \"\*\?\t\r\n<>':\/|]#", "", $newname) ); | |||||
if (empty($uploadfile)) $uploadfile = ''; | |||||
if (empty($uploadmbtype)) $uploadmbtype = '软件类型'; | |||||
if (empty($bkurl)) $bkurl = 'select_soft.php'; | |||||
$CKEditorFuncNum = (isset($CKEditorFuncNum)) ? $CKEditorFuncNum : 1; | |||||
$newname = (empty($newname) ? '' : preg_replace("#[\\ \"\*\?\t\r\n<>':\/|]#", "", $newname)); | |||||
$uploadfile = isset($imgfile) && empty($uploadfile) ? $imgfile : $uploadfile; | |||||
$uploadfile_name = isset($imgfile_name) && empty($uploadfile_name) ? $imgfile_name : $uploadfile_name; | |||||
if(!is_uploaded_file($uploadfile)) | |||||
{ | |||||
if (!is_uploaded_file($uploadfile)) { | |||||
ShowMsg("你没有选择上传的文件或选择的文件大小超出限制!", "-1"); | ShowMsg("你没有选择上传的文件或选择的文件大小超出限制!", "-1"); | ||||
exit(); | exit(); | ||||
} | } | ||||
//软件类型所有支持的附件 | //软件类型所有支持的附件 | ||||
$cfg_softtype = $cfg_softtype; | $cfg_softtype = $cfg_softtype; | ||||
$cfg_softtype = str_replace('||', '|', $cfg_softtype); | $cfg_softtype = str_replace('||', '|', $cfg_softtype); | ||||
$uploadfile_name = trim(preg_replace("#[ \r\n\t\*\%\\\/\?><\|\":]{1,}#", '', $uploadfile_name)); | $uploadfile_name = trim(preg_replace("#[ \r\n\t\*\%\\\/\?><\|\":]{1,}#", '', $uploadfile_name)); | ||||
if(!preg_match("#\.(".$cfg_softtype.")#i", $uploadfile_name)) | |||||
{ | |||||
ShowMsg("你所上传的{$uploadmbtype}不在许可列表,请更改系统对扩展名限定的配置!",""); | |||||
if (!preg_match("#\.(" . $cfg_softtype . ")#i", $uploadfile_name)) { | |||||
ShowMsg("你所上传的{$uploadmbtype}不在许可列表,请更改系统对扩展名限定的配置!", ""); | |||||
exit(); | exit(); | ||||
} | } | ||||
$nowtme = time(); | $nowtme = time(); | ||||
if($activepath==$cfg_soft_dir) | |||||
{ | |||||
if ($activepath == $cfg_soft_dir) { | |||||
$newdir = MyDate($cfg_addon_savetype, $nowtme); | $newdir = MyDate($cfg_addon_savetype, $nowtme); | ||||
$activepath = $activepath.'/'.$newdir; | |||||
if(!is_dir($cfg_basedir.$activepath)) | |||||
{ | |||||
MkdirAll($cfg_basedir.$activepath,$cfg_dir_purview); | |||||
$activepath = $activepath . '/' . $newdir; | |||||
if (!is_dir($cfg_basedir . $activepath)) { | |||||
MkdirAll($cfg_basedir . $activepath, $cfg_dir_purview); | |||||
CloseFtp(); | CloseFtp(); | ||||
} | } | ||||
} | } | ||||
//文件名(前为手工指定, 后者自动处理) | //文件名(前为手工指定, 后者自动处理) | ||||
if(!empty($newname)) | |||||
{ | |||||
if (!empty($newname)) { | |||||
$filename = $newname; | $filename = $newname; | ||||
if(!preg_match("#\.#", $filename)) $fs = explode('.', $uploadfile_name); | |||||
if (!preg_match("#\.#", $filename)) $fs = explode('.', $uploadfile_name); | |||||
else $fs = explode('.', $filename); | else $fs = explode('.', $filename); | ||||
if(preg_match("#".$cfg_not_allowall."#", $fs[count($fs)-1])) | |||||
{ | |||||
ShowMsg("你指定的文件名被系统禁止!",'javascript:;'); | |||||
if (preg_match("#" . $cfg_not_allowall . "#", $fs[count($fs) - 1])) { | |||||
ShowMsg("你指定的文件名被系统禁止!", 'javascript:;'); | |||||
exit(); | exit(); | ||||
} | } | ||||
if(!preg_match("#\.#", $filename)) $filename = $filename.'.'.$fs[count($fs)-1]; | |||||
}else{ | |||||
$filename = $cuserLogin->getUserID().'-'.dd2char(MyDate('ymdHis',$nowtme)); | |||||
if (!preg_match("#\.#", $filename)) $filename = $filename . '.' . $fs[count($fs) - 1]; | |||||
} else { | |||||
$filename = $cuserLogin->getUserID() . '-' . dd2char(MyDate('ymdHis', $nowtme)); | |||||
$fs = explode('.', $uploadfile_name); | $fs = explode('.', $uploadfile_name); | ||||
if(preg_match("#".$cfg_not_allowall."#", $fs[count($fs)-1])) | |||||
{ | |||||
ShowMsg("你上传了某些可能存在不安全因素的文件,系统拒绝操作!",'javascript:;'); | |||||
if (preg_match("#" . $cfg_not_allowall . "#", $fs[count($fs) - 1])) { | |||||
ShowMsg("你上传了某些可能存在不安全因素的文件,系统拒绝操作!", 'javascript:;'); | |||||
exit(); | exit(); | ||||
} | } | ||||
$filename = $filename.'.'.$fs[count($fs)-1]; | |||||
$filename = $filename . '.' . $fs[count($fs) - 1]; | |||||
} | } | ||||
$fullfilename = $cfg_basedir.$activepath.'/'.$filename; | |||||
$fullfileurl = $activepath.'/'.$filename; | |||||
move_uploaded_file($uploadfile,$fullfilename) or die("上传文件到 $fullfilename 失败!"); | |||||
$fullfilename = $cfg_basedir . $activepath . '/' . $filename; | |||||
$fullfileurl = $activepath . '/' . $filename; | |||||
move_uploaded_file($uploadfile, $fullfilename) or die("上传文件到 $fullfilename 失败!"); | |||||
@unlink($uploadfile); | @unlink($uploadfile); | ||||
if($cfg_remote_site=='Y' && $remoteuploads == 1) | |||||
{ | |||||
if ($cfg_remote_site == 'Y' && $remoteuploads == 1) { | |||||
//分析远程文件路径 | //分析远程文件路径 | ||||
$remotefile = str_replace(DEDEROOT, '', $fullfilename); | $remotefile = str_replace(DEDEROOT, '', $fullfilename); | ||||
$localfile = '../..'.$remotefile; | |||||
$localfile = '../..' . $remotefile; | |||||
//创建远程文件夹 | //创建远程文件夹 | ||||
$remotedir = preg_replace('/[^\/]*\.('.$cfg_softtype.')/', '', $remotefile); | |||||
$remotedir = preg_replace('/[^\/]*\.(' . $cfg_softtype . ')/', '', $remotefile); | |||||
$ftp->rmkdir($remotedir); | $ftp->rmkdir($remotedir); | ||||
$ftp->upload($localfile, $remotefile); | $ftp->upload($localfile, $remotefile); | ||||
} | } | ||||
if($uploadfile_type == 'application/x-shockwave-flash') | |||||
{ | |||||
$mediatype=2; | |||||
} | |||||
else if(preg_match('#image#i', $uploadfile_type)) | |||||
{ | |||||
$mediatype=1; | |||||
} | |||||
else if(preg_match('#audio|media|video#i', $uploadfile_type)) | |||||
{ | |||||
$mediatype=3; | |||||
} | |||||
else | |||||
{ | |||||
$mediatype=4; | |||||
if ($uploadfile_type == 'application/x-shockwave-flash') { | |||||
$mediatype = 2; | |||||
} else if (preg_match('#image#i', $uploadfile_type)) { | |||||
$mediatype = 1; | |||||
} else if (preg_match('#audio|media|video#i', $uploadfile_type)) { | |||||
$mediatype = 3; | |||||
} else { | |||||
$mediatype = 4; | |||||
} | } | ||||
$inquery = "INSERT INTO `#@__uploads`(arcid,title,url,mediatype,width,height,playtime,filesize,uptime,mid) | $inquery = "INSERT INTO `#@__uploads`(arcid,title,url,mediatype,width,height,playtime,filesize,uptime,mid) | ||||
VALUES ('0','$filename','$fullfileurl','$mediatype','0','0','0','{$uploadfile_size}','{$nowtme}','".$cuserLogin->getUserID()."'); "; | |||||
VALUES ('0','$filename','$fullfileurl','$mediatype','0','0','0','{$uploadfile_size}','{$nowtme}','" . $cuserLogin->getUserID() . "'); "; | |||||
$dsql->ExecuteNoneQuery($inquery); | $dsql->ExecuteNoneQuery($inquery); | ||||
$fid = $dsql->GetLastID(); | $fid = $dsql->GetLastID(); | ||||
AddMyAddon($fid, $fullfileurl); | AddMyAddon($fid, $fullfileurl); | ||||
ShowMsg("成功上传文件!",$bkurl."?comeback=".urlencode($filename)."&f=$f&CKEditorFuncNum=$CKEditorFuncNum&activepath=".urlencode($activepath)."&d=".time()); | |||||
exit(); | |||||
if ($ck == 1) { | |||||
$funcNum = isset($_GET['CKEditorFuncNum']) ? $_GET['CKEditorFuncNum'] : 1; | |||||
$url = $fullfileurl; | |||||
$arr = array( | |||||
"uploaded" => 1, | |||||
"fileName" => $filename, | |||||
"url" => $url, | |||||
); | |||||
echo json_encode($arr); | |||||
} else { | |||||
ShowMsg("成功上传文件!", $bkurl . "?comeback=" . urlencode($filename) . "&f=$f&CKEditorFuncNum=$CKEditorFuncNum&activepath=" . urlencode($activepath) . "&d=" . time()); | |||||
exit(); | |||||
} |
@@ -1,4 +1,5 @@ | |||||
<?php | <?php | ||||
/** | /** | ||||
* 数据库操作 | * 数据库操作 | ||||
* | * | ||||
@@ -10,16 +11,16 @@ | |||||
*/ | */ | ||||
@ob_start(); | @ob_start(); | ||||
@set_time_limit(0); | @set_time_limit(0); | ||||
require_once(dirname(__FILE__).'/config.php'); | |||||
require_once(dirname(__FILE__) . '/config.php'); | |||||
CheckPurview('sys_Data'); | CheckPurview('sys_Data'); | ||||
if(empty($dopost)) $dopost = ''; | |||||
if (empty($dopost)) $dopost = ''; | |||||
$bkdir = DEDEDATA.'/'.$cfg_backup_dir; | |||||
$bkdir = DEDEDATA . '/' . $cfg_backup_dir; | |||||
//跳转到一下页的JS | //跳转到一下页的JS | ||||
$gotojs = "function GotoNextPage(){ | $gotojs = "function GotoNextPage(){ | ||||
document.gonext."."submit(); | |||||
}"."\r\nset"."Timeout('GotoNextPage()',500);"; | |||||
document.gonext." . "submit(); | |||||
}" . "\r\nset" . "Timeout('GotoNextPage()',500);"; | |||||
$dojs = "<script language='javascript'>$gotojs</script>"; | $dojs = "<script language='javascript'>$gotojs</script>"; | ||||
@@ -27,97 +28,68 @@ $dojs = "<script language='javascript'>$gotojs</script>"; | |||||
备份数据 | 备份数据 | ||||
function __bak_data(); | function __bak_data(); | ||||
--------------------*/ | --------------------*/ | ||||
if($dopost=='bak') | |||||
{ | |||||
if(empty($tablearr)) | |||||
{ | |||||
if ($dopost == 'bak') { | |||||
if (empty($tablearr)) { | |||||
ShowMsg('你没选中任何表!', 'javascript:;'); | ShowMsg('你没选中任何表!', 'javascript:;'); | ||||
exit(); | exit(); | ||||
} | } | ||||
if(!is_dir($bkdir)) | |||||
{ | |||||
if (!is_dir($bkdir)) { | |||||
MkdirAll($bkdir, $cfg_dir_purview); | MkdirAll($bkdir, $cfg_dir_purview); | ||||
CloseFtp(); | CloseFtp(); | ||||
} | } | ||||
//初始化使用到的变量 | //初始化使用到的变量 | ||||
$tables = explode(',', $tablearr); | $tables = explode(',', $tablearr); | ||||
if(!isset($isstruct)) | |||||
{ | |||||
if (!isset($isstruct)) { | |||||
$isstruct = 0; | $isstruct = 0; | ||||
} | } | ||||
if(!isset($startpos)) | |||||
{ | |||||
if (!isset($startpos)) { | |||||
$startpos = 0; | $startpos = 0; | ||||
} | } | ||||
if(!isset($iszip)) | |||||
{ | |||||
if (!isset($iszip)) { | |||||
$iszip = 0; | $iszip = 0; | ||||
} | } | ||||
if(empty($nowtable)) | |||||
{ | |||||
if (empty($nowtable)) { | |||||
$nowtable = ''; | $nowtable = ''; | ||||
} | } | ||||
if(empty($fsize)) | |||||
{ | |||||
if (empty($fsize)) { | |||||
$fsize = 2048; | $fsize = 2048; | ||||
} | } | ||||
$fsizeb = $fsize * 1024; | $fsizeb = $fsize * 1024; | ||||
//第一页的操作 | //第一页的操作 | ||||
if($nowtable=='') | |||||
{ | |||||
if ($nowtable == '') { | |||||
$tmsg = ''; | $tmsg = ''; | ||||
$dh = dir($bkdir); | $dh = dir($bkdir); | ||||
while($filename = $dh->read()) | |||||
{ | |||||
if(!preg_match("#txt$#", $filename)) | |||||
{ | |||||
while ($filename = $dh->read()) { | |||||
if (!preg_match("#txt$#", $filename)) { | |||||
continue; | continue; | ||||
} | } | ||||
$filename = $bkdir."/$filename"; | |||||
if(!is_dir($filename)) | |||||
{ | |||||
$filename = $bkdir . "/$filename"; | |||||
if (!is_dir($filename)) { | |||||
unlink($filename); | unlink($filename); | ||||
} | } | ||||
} | } | ||||
$dh->close(); | $dh->close(); | ||||
$tmsg .= "清除备份目录旧数据完成...<br />"; | $tmsg .= "清除备份目录旧数据完成...<br />"; | ||||
if($isstruct==1) | |||||
{ | |||||
$bkfile = $bkdir."/tables_struct_".substr(md5(time().mt_rand(1000,5000).$cfg_cookie_encode),0,16).".txt"; | |||||
if ($isstruct == 1) { | |||||
$bkfile = $bkdir . "/tables_struct_" . substr(md5(time() . mt_rand(1000, 5000) . $cfg_cookie_encode), 0, 16) . ".txt"; | |||||
$mysql_version = $dsql->GetVersion(); | $mysql_version = $dsql->GetVersion(); | ||||
$fp = fopen($bkfile, "w"); | $fp = fopen($bkfile, "w"); | ||||
foreach($tables as $t) | |||||
{ | |||||
foreach ($tables as $t) { | |||||
fwrite($fp, "DROP TABLE IF EXISTS `$t`;\r\n\r\n"); | fwrite($fp, "DROP TABLE IF EXISTS `$t`;\r\n\r\n"); | ||||
$dsql->SetQuery("SHOW CREATE TABLE ".$dsql->dbName.".".$t); | |||||
$dsql->SetQuery("SHOW CREATE TABLE " . $dsql->dbName . "." . $t); | |||||
$dsql->Execute('me'); | $dsql->Execute('me'); | ||||
$row = $dsql->GetArray('me', MYSQL_BOTH); | $row = $dsql->GetArray('me', MYSQL_BOTH); | ||||
//去除AUTO_INCREMENT | |||||
// 去除AUTO_INCREMENT | |||||
$row[1] = preg_replace("#AUTO_INCREMENT=([0-9]{1,})[ \r\n\t]{1,}#i", "", $row[1]); | $row[1] = preg_replace("#AUTO_INCREMENT=([0-9]{1,})[ \r\n\t]{1,}#i", "", $row[1]); | ||||
//4.1以下版本备份为低版本 | |||||
if($datatype==4.0 && $mysql_version > 4.0) | |||||
{ | |||||
$eng1 = "#ENGINE=MyISAM[ \r\n\t]{1,}DEFAULT[ \r\n\t]{1,}CHARSET=".$cfg_db_language."#i"; | |||||
$tableStruct = preg_replace($eng1, "TYPE=MyISAM", $row[1]); | |||||
} | |||||
$eng1 = "#ENGINE=MyISAM[ \r\n\t]{1,}DEFAULT[ \r\n\t]{1,}CHARSET=" . $cfg_db_language . "#i"; | |||||
$tableStruct = preg_replace($eng1, "TYPE=MyISAM", $row[1]); | |||||
//4.1以下版本备份为高版本 | |||||
else if($datatype==4.1 && $mysql_version < 4.1) | |||||
{ | |||||
$eng1 = "#ENGINE=MyISAM DEFAULT CHARSET={$cfg_db_language}#i"; | |||||
$tableStruct = preg_replace("TYPE=MyISAM", $eng1, $row[1]); | |||||
} | |||||
//普通备份 | |||||
else | |||||
{ | |||||
$tableStruct = $row[1]; | |||||
} | |||||
fwrite($fp,''.$tableStruct.";\r\n\r\n"); | |||||
fwrite($fp, '' . $tableStruct . ";\r\n\r\n"); | |||||
} | } | ||||
fclose($fp); | fclose($fp); | ||||
$tmsg .= "备份数据表结构信息完成...<br />"; | $tmsg .= "备份数据表结构信息完成...<br />"; | ||||
@@ -135,8 +107,7 @@ if($dopost=='bak') | |||||
exit(); | exit(); | ||||
} | } | ||||
//执行分页备份 | //执行分页备份 | ||||
else | |||||
{ | |||||
else { | |||||
$j = 0; | $j = 0; | ||||
$fs = array(); | $fs = array(); | ||||
$bakStr = ''; | $bakStr = ''; | ||||
@@ -144,32 +115,28 @@ if($dopost=='bak') | |||||
//分析表里的字段信息 | //分析表里的字段信息 | ||||
$dsql->GetTableFields($nowtable); | $dsql->GetTableFields($nowtable); | ||||
$intable = "INSERT INTO `$nowtable` VALUES("; | $intable = "INSERT INTO `$nowtable` VALUES("; | ||||
while($r = $dsql->GetFieldObject()) | |||||
{ | |||||
while ($r = $dsql->GetFieldObject()) { | |||||
$fs[$j] = trim($r->name); | $fs[$j] = trim($r->name); | ||||
$j++; | $j++; | ||||
} | } | ||||
$fsd = $j-1; | |||||
$fsd = $j - 1; | |||||
//读取表的内容 | //读取表的内容 | ||||
$dsql->SetQuery("SELECT * FROM `$nowtable` "); | $dsql->SetQuery("SELECT * FROM `$nowtable` "); | ||||
$dsql->Execute(); | $dsql->Execute(); | ||||
$m = 0; | $m = 0; | ||||
$bakfilename = "$bkdir/{$nowtable}_{$startpos}_".substr(md5(time().mt_rand(1000,5000).$cfg_cookie_encode),0,16).".txt"; | |||||
while($row2 = $dsql->GetArray()) | |||||
{ | |||||
if($m < $startpos) | |||||
{ | |||||
$bakfilename = "$bkdir/{$nowtable}_{$startpos}_" . substr(md5(time() . mt_rand(1000, 5000) . $cfg_cookie_encode), 0, 16) . ".txt"; | |||||
while ($row2 = $dsql->GetArray()) { | |||||
if ($m < $startpos) { | |||||
$m++; | $m++; | ||||
continue; | continue; | ||||
} | } | ||||
//检测数据是否达到规定大小 | //检测数据是否达到规定大小 | ||||
if(strlen($bakStr) > $fsizeb) | |||||
{ | |||||
$fp = fopen($bakfilename,"w"); | |||||
fwrite($fp,$bakStr); | |||||
if (strlen($bakStr) > $fsizeb) { | |||||
$fp = fopen($bakfilename, "w"); | |||||
fwrite($fp, $bakStr); | |||||
fclose($fp); | fclose($fp); | ||||
$tmsg = "<font color='red'>完成到{$m}条记录的备份,继续备份{$nowtable}...</font>"; | $tmsg = "<font color='red'>完成到{$m}条记录的备份,继续备份{$nowtable}...</font>"; | ||||
$doneForm = "<form name='gonext' method='post' action='sys_data_done.php'> | $doneForm = "<form name='gonext' method='post' action='sys_data_done.php'> | ||||
@@ -180,22 +147,18 @@ if($dopost=='bak') | |||||
<input type='hidden' name='nowtable' value='$nowtable' /> | <input type='hidden' name='nowtable' value='$nowtable' /> | ||||
<input type='hidden' name='startpos' value='$m' /> | <input type='hidden' name='startpos' value='$m' /> | ||||
<input type='hidden' name='iszip' value='$iszip' />\r\n</form>\r\n{$dojs}\r\n"; | <input type='hidden' name='iszip' value='$iszip' />\r\n</form>\r\n{$dojs}\r\n"; | ||||
PutInfo($tmsg,$doneForm); | |||||
PutInfo($tmsg, $doneForm); | |||||
exit(); | exit(); | ||||
} | } | ||||
//正常情况 | //正常情况 | ||||
$line = $intable; | $line = $intable; | ||||
for($j=0; $j<=$fsd; $j++) | |||||
{ | |||||
if($j < $fsd) | |||||
{ | |||||
$line .= "'".RpLine(addslashes($row2[$fs[$j]]))."',"; | |||||
} | |||||
else | |||||
{ | |||||
$line .= "'".RpLine(addslashes($row2[$fs[$j]]))."');\r\n"; | |||||
for ($j = 0; $j <= $fsd; $j++) { | |||||
if ($j < $fsd) { | |||||
$line .= "'" . RpLine(addslashes($row2[$fs[$j]])) . "',"; | |||||
} else { | |||||
$line .= "'" . RpLine(addslashes($row2[$fs[$j]])) . "');\r\n"; | |||||
} | } | ||||
} | } | ||||
$m++; | $m++; | ||||
@@ -203,24 +166,19 @@ if($dopost=='bak') | |||||
} | } | ||||
//如果数据比卷设置值小 | //如果数据比卷设置值小 | ||||
if($bakStr!='') | |||||
{ | |||||
$fp = fopen($bakfilename,"w"); | |||||
fwrite($fp,$bakStr); | |||||
if ($bakStr != '') { | |||||
$fp = fopen($bakfilename, "w"); | |||||
fwrite($fp, $bakStr); | |||||
fclose($fp); | fclose($fp); | ||||
} | } | ||||
for($i=0; $i<count($tables); $i++) | |||||
{ | |||||
if($tables[$i] == $nowtable) | |||||
{ | |||||
if(isset($tables[$i+1])) | |||||
{ | |||||
$nowtable = $tables[$i+1]; | |||||
for ($i = 0; $i < count($tables); $i++) { | |||||
if ($tables[$i] == $nowtable) { | |||||
if (isset($tables[$i + 1])) { | |||||
$nowtable = $tables[$i + 1]; | |||||
$startpos = 0; | $startpos = 0; | ||||
break; | break; | ||||
}else | |||||
{ | |||||
PutInfo("完成所有数据备份!",""); | |||||
} else { | |||||
PutInfo("完成所有数据备份!", ""); | |||||
exit(); | exit(); | ||||
} | } | ||||
} | } | ||||
@@ -232,7 +190,7 @@ if($dopost=='bak') | |||||
<input type='hidden' name='tablearr' value='$tablearr' /> | <input type='hidden' name='tablearr' value='$tablearr' /> | ||||
<input type='hidden' name='nowtable' value='$nowtable' /> | <input type='hidden' name='nowtable' value='$nowtable' /> | ||||
<input type='hidden' name='startpos' value='$startpos'>\r\n</form>\r\n{$dojs}\r\n"; | <input type='hidden' name='startpos' value='$startpos'>\r\n</form>\r\n{$dojs}\r\n"; | ||||
PutInfo($tmsg,$doneForm); | |||||
PutInfo($tmsg, $doneForm); | |||||
exit(); | exit(); | ||||
} | } | ||||
//分页备份代码结束 | //分页备份代码结束 | ||||
@@ -240,45 +198,35 @@ if($dopost=='bak') | |||||
/*------------------------- | /*------------------------- | ||||
还原数据 | 还原数据 | ||||
function __re_data(); | function __re_data(); | ||||
-------------------------*/ | |||||
else if($dopost=='redat') | |||||
{ | |||||
if($bakfiles=='') | |||||
{ | |||||
-------------------------*/ else if ($dopost == 'redat') { | |||||
if ($bakfiles == '') { | |||||
ShowMsg('没指定任何要还原的文件!', 'javascript:;'); | ShowMsg('没指定任何要还原的文件!', 'javascript:;'); | ||||
exit(); | exit(); | ||||
} | } | ||||
$bakfilesTmp = $bakfiles; | $bakfilesTmp = $bakfiles; | ||||
$bakfiles = explode(',', $bakfiles); | $bakfiles = explode(',', $bakfiles); | ||||
if(empty($structfile)) | |||||
{ | |||||
if (empty($structfile)) { | |||||
$structfile = ""; | $structfile = ""; | ||||
} | } | ||||
if(empty($delfile)) | |||||
{ | |||||
if (empty($delfile)) { | |||||
$delfile = 0; | $delfile = 0; | ||||
} | } | ||||
if(empty($startgo)) | |||||
{ | |||||
if (empty($startgo)) { | |||||
$startgo = 0; | $startgo = 0; | ||||
} | } | ||||
if($startgo==0 && $structfile!='') | |||||
{ | |||||
if ($startgo == 0 && $structfile != '') { | |||||
$tbdata = ''; | $tbdata = ''; | ||||
$fp = fopen("$bkdir/$structfile", 'r'); | $fp = fopen("$bkdir/$structfile", 'r'); | ||||
while(!feof($fp)) | |||||
{ | |||||
while (!feof($fp)) { | |||||
$tbdata .= fgets($fp, 1024); | $tbdata .= fgets($fp, 1024); | ||||
} | } | ||||
fclose($fp); | fclose($fp); | ||||
$querys = explode(';', $tbdata); | $querys = explode(';', $tbdata); | ||||
foreach($querys as $q) | |||||
{ | |||||
$dsql->ExecuteNoneQuery(trim($q).';'); | |||||
foreach ($querys as $q) { | |||||
$dsql->ExecuteNoneQuery(trim($q) . ';'); | |||||
} | } | ||||
if($delfile==1) | |||||
{ | |||||
if ($delfile == 1) { | |||||
@unlink("$bkdir/$structfile"); | @unlink("$bkdir/$structfile"); | ||||
} | } | ||||
$tmsg = "<font color='red'>完成数据表信息还原,准备还原数据...</font>"; | $tmsg = "<font color='red'>完成数据表信息还原,准备还原数据...</font>"; | ||||
@@ -289,30 +237,24 @@ else if($dopost=='redat') | |||||
</form>\r\n{$dojs}\r\n"; | </form>\r\n{$dojs}\r\n"; | ||||
PutInfo($tmsg, $doneForm); | PutInfo($tmsg, $doneForm); | ||||
exit(); | exit(); | ||||
} | |||||
else | |||||
{ | |||||
} else { | |||||
$nowfile = $bakfiles[0]; | $nowfile = $bakfiles[0]; | ||||
$bakfilesTmp = preg_replace("#".$nowfile."[,]{0,1}#", "", $bakfilesTmp); | |||||
$oknum=0; | |||||
if( filesize("$bkdir/$nowfile") > 0 ) | |||||
{ | |||||
$bakfilesTmp = preg_replace("#" . $nowfile . "[,]{0,1}#", "", $bakfilesTmp); | |||||
$oknum = 0; | |||||
if (filesize("$bkdir/$nowfile") > 0) { | |||||
$fp = fopen("$bkdir/$nowfile", 'r'); | $fp = fopen("$bkdir/$nowfile", 'r'); | ||||
while(!feof($fp)) | |||||
{ | |||||
$line = trim(fgets($fp, 512*1024)); | |||||
if($line=="") continue; | |||||
while (!feof($fp)) { | |||||
$line = trim(fgets($fp, 512 * 1024)); | |||||
if ($line == "") continue; | |||||
$rs = $dsql->ExecuteNoneQuery($line); | $rs = $dsql->ExecuteNoneQuery($line); | ||||
if($rs) $oknum++; | |||||
if ($rs) $oknum++; | |||||
} | } | ||||
fclose($fp); | fclose($fp); | ||||
} | } | ||||
if($delfile==1) | |||||
{ | |||||
if ($delfile == 1) { | |||||
@unlink("$bkdir/$nowfile"); | @unlink("$bkdir/$nowfile"); | ||||
} | } | ||||
if($bakfilesTmp=="") | |||||
{ | |||||
if ($bakfilesTmp == "") { | |||||
ShowMsg('成功还原所有的文件的数据!', 'javascript:;'); | ShowMsg('成功还原所有的文件的数据!', 'javascript:;'); | ||||
exit(); | exit(); | ||||
} | } | ||||
@@ -327,19 +269,16 @@ else if($dopost=='redat') | |||||
} | } | ||||
} | } | ||||
function PutInfo($msg1,$msg2) | |||||
function PutInfo($msg1, $msg2) | |||||
{ | { | ||||
global $cfg_dir_purview,$cfg_soft_lang; | |||||
global $cfg_soft_lang; | |||||
$msginfo = "<html>\n<head> | $msginfo = "<html>\n<head> | ||||
<meta http-equiv='Content-Type' content='text/html; charset={$cfg_soft_lang}' /> | <meta http-equiv='Content-Type' content='text/html; charset={$cfg_soft_lang}' /> | ||||
<title>DEDECMS 提示信息</title> | |||||
<base target='_self'/>\n</head>\n<body leftmargin='0' topmargin='0'>\n<center> | |||||
<br/> | |||||
<div style='width:400px;padding-top:4px;height:24;font-size:10pt;border-left:1px solid #cccccc;border-top:1px solid #cccccc;border-right:1px solid #cccccc;background-color:#DBEEBD;'>DEDECMS 提示信息!</div> | |||||
<div style='width:400px;height:100px;font-size:10pt;border:1px solid #cccccc;background-color:#F4FAEB'> | |||||
<span style='line-height:160%'><br/>{$msg1}</span> | |||||
<br/><br/></div>\r\n{$msg2}"; | |||||
echo $msginfo."</center>\n</body>\n</html>"; | |||||
<meta name='viewport' content='width=device-width, initial-scale=1, shrink-to-fit=no'> | |||||
<link rel='stylesheet' href='../static/css/bootstrap.min.css'> | |||||
<title>DedeCMS 提示信息</title> | |||||
<base target='_self'/>\n</head>\n<body leftmargin='0' topmargin='0'>\n<main class='container'><div class='modal' tabindex='-1' role='dialog' style='display:block'><div class='modal-dialog'><div class='modal-content'><div class='modal-header'><h6 class='modal-title'>DedeCMS 提示信息!</h6></div><div class='modal-body'>{$msg1}</div></div></div></div></main>{$msg2}"; | |||||
echo $msginfo . "\n</body>\n</html>"; | |||||
} | } | ||||
function RpLine($str) | function RpLine($str) | ||||
@@ -347,4 +286,4 @@ function RpLine($str) | |||||
$str = str_replace("\r", "\\r", $str); | $str = str_replace("\r", "\\r", $str); | ||||
$str = str_replace("\n", "\\n", $str); | $str = str_replace("\n", "\\n", $str); | ||||
return $str; | return $str; | ||||
} | |||||
} |
@@ -1,152 +0,0 @@ | |||||
<?php | |||||
/** | |||||
* 数据表信息查看 | |||||
* | |||||
* @version $Id: sys_sql_info.php 1 22:28 2010年7月20日Z tianya $ | |||||
* @package DedeCMS.Administrator | |||||
* @copyright Copyright (c) 2020, DedeBIZ.COM | |||||
* @license https://www.dedebiz.com/license | |||||
* @link https://www.dedebiz.com | |||||
*/ | |||||
require(dirname(__FILE__)."/config.php"); | |||||
CheckPurview('sys_Data'); | |||||
if(empty($dopost)) $dopost = ""; | |||||
$dbdoc = new MakeDBDocument; | |||||
$dbdoc->show(); | |||||
class MakeDBDocument | |||||
{ | |||||
var $dsql; | |||||
function __construct() | |||||
{ | |||||
global $dsql; | |||||
$this->dsql = $dsql; | |||||
} | |||||
//分析具体表 | |||||
function analyse_table(&$tableinfo, $tablename) | |||||
{ | |||||
$flines = explode("\n", $tableinfo); | |||||
$addinfo = $tbinfo = $tb_comment = ''; | |||||
$fields = array(); | |||||
foreach($flines as $line) | |||||
{ | |||||
$line = trim($line); | |||||
if( $line=='' ) continue; | |||||
if( preg_match('/CREATE TABLE/i', $line) ) continue; | |||||
if( !preg_match('/`/', $line) ) | |||||
{ | |||||
$arr = ''; | |||||
preg_match("/ENGINE=([a-z]*)(.*)DEFAULT CHARSET=([a-z0-9]*)/i", $line, $arr); | |||||
$tbinfo = "ENGINE=".$arr[1].'/CHARSET='.$arr[3]; | |||||
$arr = ''; | |||||
preg_match("/comment='([^']*)'/i", $line, $arr); | |||||
if( isset($arr[1]) ) | |||||
{ | |||||
$tb_comment = $arr[1]; | |||||
} | |||||
continue; | |||||
} | |||||
if( preg_match('/KEY/', $line) ) | |||||
{ | |||||
$addinfo .= $line."<br />\n"; | |||||
} | |||||
else | |||||
{ | |||||
$arr = ''; | |||||
$nline = preg_replace("/comment '([^']*)'/i", '', $line); | |||||
preg_match("/`([^`]*)` (.*)[,]{0,1}$/U", $nline, $arr); | |||||
$f = $arr[1]; | |||||
$fields[ $f ][0] = $arr[2]; | |||||
$fields[ $f ][1] = ''; | |||||
$arr = ''; | |||||
preg_match("/comment '([^']*)'/i", $line, $arr); | |||||
if( isset($arr[1]) ) | |||||
{ | |||||
$fields[ $f ][1] = $arr[1]; | |||||
} | |||||
} | |||||
} | |||||
$tablehtml = " <table width=\"960\" align=\"center\" border=\"0\" cellpadding=\"5\" cellspacing=\"1\" bgcolor=\"#C1D1A3\" style=\"font-size:14px;margin-bottom:10px\"> | |||||
<tr> | |||||
<td height=\"34\" colspan=\"3\" bgcolor=\"#DDEDA5\"> | |||||
<a name=\"{$tablename}\"></a> | |||||
<table width=\"90%\" border=\"0\" cellspacing=\"1\" cellpadding=\"1\"> | |||||
<tr> | |||||
<td width=\"29%\"><strong>表名:{$tablename}</strong> <br />($tbinfo)</td> | |||||
<td width=\"71%\">说明:{$tb_comment}</td> | |||||
</tr> | |||||
</table></td> | |||||
</tr> | |||||
<tr> | |||||
<td width=\"20%\" height=\"28\" bgcolor=\"#F7FDEA\">字段名</td> | |||||
<td width=\"28%\" bgcolor=\"#F7FDEA\">说明描述</td> | |||||
<td bgcolor=\"#F7FDEA\">具体参数</td> | |||||
</tr>\n"; | |||||
foreach($fields as $k=>$v) | |||||
{ | |||||
$tablehtml .= " <tr height=\"24\" bgcolor=\"#FFFFFF\"> | |||||
<td><b>{$k}</b></td> | |||||
<td>{$v[1]}</td> | |||||
<td>{$v[0]}</td> | |||||
</tr>\n"; | |||||
} | |||||
$tablehtml .= " <tr> | |||||
<td height=\"28\" colspan=\"3\" bgcolor=\"#F7FDEA\"> | |||||
<b>索引:</b><br /> | |||||
{$addinfo} | |||||
</td> | |||||
</tr> | |||||
</table>"; | |||||
return $tablehtml; | |||||
} | |||||
//列出数据库的所有表 | |||||
function show( $type='' ) | |||||
{ | |||||
global $cfg_soft_lang; | |||||
$namehtml = $tablehtml = ''; | |||||
$this->dsql->Execute('me', ' SHOW TABLES; '); | |||||
if (version_compare(PHP_VERSION, '7.0.0', '>=')) { | |||||
define("MYSQL_NUM", MYSQLI_NUM); | |||||
} | |||||
while( $row = $this->dsql->GetArray('me', MYSQL_NUM) ) | |||||
{ | |||||
$this->dsql->Execute('dd', " Show CREATE TABLE `{$row[0]}` "); | |||||
$row2 = $this->dsql->GetArray('dd', MYSQL_NUM); | |||||
if( $type=='' ) | |||||
{ | |||||
if( preg_match("/^cms_/", $row[0]) ) continue; | |||||
} | |||||
else | |||||
{ | |||||
if( !preg_match("/^".$type."_/", $row[0]) ) continue; | |||||
} | |||||
$namehtml .= "<a href='#{$row[0]}'>{$row[0]}</a> | "; | |||||
$tablehtml .= $this->analyse_table( $row2[1], $row[0]); | |||||
} | |||||
$htmlhead = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"> | |||||
<html xmlns=\"http://www.w3.org/1999/xhtml\"> | |||||
<head> | |||||
<meta http-equiv=\"Content-Type\" content=\"text/html; charset={$cfg_soft_lang}\" /> | |||||
<link href=\"css/base.css\" rel=\"stylesheet\" type=\"text/css\"> | |||||
<style> | |||||
* { | |||||
font-size:14px; | |||||
font-family:Arial, \"宋休\", \"Courier New\"; | |||||
} | |||||
a { | |||||
text-decoration:none; | |||||
} | |||||
</style> | |||||
<title>数据库说明文档</title> | |||||
</head> | |||||
<body background='images/allbg.gif' leftmargin='8' topmargin='8'>"; | |||||
echo $htmlhead; | |||||
echo "<table align='center' width='960' style='margin-bottom:8px' ><tr><td>".$namehtml."</td></tr></table>"; | |||||
echo $tablehtml; | |||||
echo "</body>\n</html>"; | |||||
exit(); | |||||
}//end show | |||||
} |
@@ -69,7 +69,8 @@ | |||||
<td width="60%" height="30"><IMG height=14 src="images/book1.gif" width=20> <a | <td width="60%" height="30"><IMG height=14 src="images/book1.gif" width=20> <a | ||||
href="catalog_do.php?cid=<?php echo $cid?>&channelid=<?php echo $channelid?>&dopost=listArchives"><u>文章列表</u></a> | href="catalog_do.php?cid=<?php echo $cid?>&channelid=<?php echo $channelid?>&dopost=listArchives"><u>文章列表</u></a> | ||||
>> 发布文章</td> | >> 发布文章</td> | ||||
<td width="30%" align='right'> <?php echo $backurl; ?><a class="btn btn-secondary btn-sm" href="catalog_main.php">栏目管理</a> </td> | |||||
<td width="30%" align='right'> <?php echo $backurl; ?><a class="btn btn-secondary btn-sm" | |||||
href="catalog_main.php">栏目管理</a> </td> | |||||
</tr> | </tr> | ||||
</table> | </table> | ||||
@@ -85,8 +86,8 @@ | |||||
</td> | </td> | ||||
</tr> | </tr> | ||||
</table> | </table> | ||||
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FBFCE2" id="getone" class="table table-borderless" | |||||
style="<?php if(empty($geturl)) echo 'display:none'; ?>;margin:0;"> | |||||
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FBFCE2" id="getone" | |||||
class="table table-borderless" style="<?php if(empty($geturl)) echo 'display:none'; ?>;margin:0;"> | |||||
<form name="getonepage" action="article_add.php" method="get"> | <form name="getonepage" action="article_add.php" method="get"> | ||||
<input type="hidden" name="channelid" value="<?php echo $channelid; ?>" /> | <input type="hidden" name="channelid" value="<?php echo $channelid; ?>" /> | ||||
<input type="hidden" name="cid" value="<?php echo $cid; ?>" /> | <input type="hidden" name="cid" value="<?php echo $cid; ?>" /> | ||||
@@ -191,7 +192,7 @@ | |||||
<input name="picname" type="text" id="picname" style="width:240px" /> | <input name="picname" type="text" id="picname" style="width:240px" /> | ||||
<button type="button" name="Submit2" style="margin-left:8px;" | <button type="button" name="Submit2" style="margin-left:8px;" | ||||
onClick="SelectImage('form1.picname','small');" class='btn btn-secondary btn-sm'>站内选择</button> | onClick="SelectImage('form1.picname','small');" class='btn btn-secondary btn-sm'>站内选择</button> | ||||
<label><input type='checkbox' class='np' name='ddisremote' value='1' id='ddisremote' /> 远程</label> | |||||
<label><input type='checkbox' class='np' name='ddisremote' value='1' id='ddisremote' /> 远程</label> | |||||
<span class="btn btn-secondary btn-sm fileinput-button"> | <span class="btn btn-secondary btn-sm fileinput-button"> | ||||
<i class="glyphicon glyphicon-plus"></i> | <i class="glyphicon glyphicon-plus"></i> | ||||
选择图片 | 选择图片 | ||||
@@ -279,11 +280,11 @@ | |||||
<tr> | <tr> | ||||
<td width="90"> 关键字:</td> | <td width="90"> 关键字:</td> | ||||
<td width="448"><input type='text' name="keywords" id="keywords" style="width:80%" | <td width="448"><input type='text' name="keywords" id="keywords" style="width:80%" | ||||
value="<?php echo $keywords; ?>" /> <button type="button" name="Submit" | |||||
style="width:56;height:20" onClick="SelectKeywords('form1.keywords');" class='btn btn-secondary btn-sm'>浏览...</button></td> | |||||
value="<?php echo $keywords; ?>" /> <button type="button" name="Submit" style="width:56;height:20" | |||||
onClick="SelectKeywords('form1.keywords');" class='btn btn-secondary btn-sm'>浏览...</button></td> | |||||
<td><label><input name="autokey" type="checkbox" onClick="ShowHide('keywords');" ; class="np" id="autokey" | <td><label><input name="autokey" type="checkbox" onClick="ShowHide('keywords');" ; class="np" id="autokey" | ||||
value="1" <?php if($cfg_arc_autokeyword=='Y') echo ' checked="1" '; ?> /> | |||||
自动获取,手动填写用","分开</label><br /> | |||||
value="1" <?php if($cfg_arc_autokeyword=='Y') echo ' checked="1" '; ?> /> | |||||
自动获取,手动填写用","分开</label><br /> | |||||
</td> | </td> | ||||
</tr> | </tr> | ||||
</table> | </table> | ||||
@@ -308,7 +309,7 @@ | |||||
<td height="28" colspan="2" bgcolor="#F9FCEF" class="bline2"> | <td height="28" colspan="2" bgcolor="#F9FCEF" class="bline2"> | ||||
<div style='float:left;line-height:28px;'> <strong>文章内容:</strong></div> | <div style='float:left;line-height:28px;'> <strong>文章内容:</strong></div> | ||||
<div style='float:right;;padding-right:8px'> | <div style='float:right;;padding-right:8px'> | ||||
<button type="button" onClick="location.reload();" class="btn btn-secondary">重置</button> | |||||
<button type="button" onClick="location.reload();" class="btn btn-secondary">重置</button> | |||||
</div> | </div> | ||||
<div style='float:right;padding-right:8px'> | <div style='float:right;padding-right:8px'> | ||||
<button type="submit" class="btn btn-secondary">保存</button> | <button type="submit" class="btn btn-secondary">保存</button> | ||||
@@ -322,17 +323,17 @@ | |||||
<td width="90"> 附加选项:</td> | <td width="90"> 附加选项:</td> | ||||
<td> | <td> | ||||
<label><input name="remote" type="checkbox" class="np" id="remote" value="1" | <label><input name="remote" type="checkbox" class="np" id="remote" value="1" | ||||
<?php if($cfg_rm_remote=='Y') echo ' checked="1" '; ?> /> | |||||
下载远程图片和资源</label> | |||||
<?php if($cfg_rm_remote=='Y') echo ' checked="1" '; ?> /> | |||||
下载远程图片和资源</label> | |||||
<label><input name="dellink" type="checkbox" class="np" id="dellink" value="1" | <label><input name="dellink" type="checkbox" class="np" id="dellink" value="1" | ||||
<?php if($cfg_arc_dellink=='Y') echo ' checked="1" '; ?> /> | |||||
删除非站内链接 </label><a href="javascript:OpenMyWin('article_allowurl_edit.php');">[设置]</a> | |||||
<?php if($cfg_arc_dellink=='Y') echo ' checked="1" '; ?> /> | |||||
删除非站内链接 </label><a href="javascript:OpenMyWin('article_allowurl_edit.php');">[设置]</a> | |||||
<label><input name="autolitpic" type="checkbox" class="np" id="autolitpic" value="1" | <label><input name="autolitpic" type="checkbox" class="np" id="autolitpic" value="1" | ||||
<?php if($cfg_arc_autopic=='Y') echo ' checked="1" '; ?> /> | |||||
提取第一个图片为缩略图</label> | |||||
<?php if($cfg_arc_autopic=='Y') echo ' checked="1" '; ?> /> | |||||
提取第一个图片为缩略图</label> | |||||
<label><input type='checkbox' name='needwatermark' value='1' class='np' | <label><input type='checkbox' name='needwatermark' value='1' class='np' | ||||
<?php if($photo_markup=='1') echo "checked"; ?> /> | |||||
图片是否加水印</label> | |||||
<?php if($photo_markup=='1') echo "checked"; ?> /> | |||||
图片是否加水印</label> | |||||
</td> | </td> | ||||
</tr> | </tr> | ||||
</table> | </table> | ||||
@@ -345,11 +346,11 @@ | |||||
<td width="90"> 分页方式:</td> | <td width="90"> 分页方式:</td> | ||||
<td> | <td> | ||||
<label><input name="sptype" type="radio" class="np" value="hand" | <label><input name="sptype" type="radio" class="np" value="hand" | ||||
<?php if($cfg_arcautosp=='N') echo " checked='1' "?> /> | |||||
手动</label> | |||||
<?php if($cfg_arcautosp=='N') echo " checked='1' "?> /> | |||||
手动</label> | |||||
<label><input type="radio" name="sptype" value="auto" class="np" | <label><input type="radio" name="sptype" value="auto" class="np" | ||||
<?php if($cfg_arcautosp=='Y') echo " checked='1' "?> /> | |||||
自动</label> 大小: | |||||
<?php if($cfg_arcautosp=='Y') echo " checked='1' "?> /> | |||||
自动</label> 大小: | |||||
<input name="spsize" type="text" id="spsize" value="<?php echo $cfg_arcautosp_size?>" size="6" /> K | <input name="spsize" type="text" id="spsize" value="<?php echo $cfg_arcautosp_size?>" size="6" /> K | ||||
(分页符为: <font color="#FF0000">#p#分页标题#e# </font>) | (分页符为: <font color="#FF0000">#p#分页标题#e# </font>) | ||||
</td> | </td> | ||||
@@ -388,10 +389,10 @@ | |||||
<td width="90" height="22"> 评论选项:</td> | <td width="90" height="22"> 评论选项:</td> | ||||
<td width="240"> | <td width="240"> | ||||
<label><input type='radio' name='notpost' class='np' value='0' | <label><input type='radio' name='notpost' class='np' value='0' | ||||
<?php if($cfg_feedback_forbid=='N') echo "checked='1' "; ?> /> 允许评论 </label> | |||||
<?php if($cfg_feedback_forbid=='N') echo "checked='1' "; ?> /> 允许评论 </label> | |||||
| | ||||
<label><input type='radio' name='notpost' class='np' value='1' | <label><input type='radio' name='notpost' class='np' value='1' | ||||
<?php if($cfg_feedback_forbid=='Y') echo "checked='1' "; ?> /> 禁止评论 </label> | |||||
<?php if($cfg_feedback_forbid=='Y') echo "checked='1' "; ?> /> 禁止评论 </label> | |||||
</td> | </td> | ||||
<td width="90">浏览次数:</td> | <td width="90">浏览次数:</td> | ||||
<td> | <td> | ||||
@@ -420,7 +421,8 @@ | |||||
<td width="90">标题颜色:</td> | <td width="90">标题颜色:</td> | ||||
<td> | <td> | ||||
<input name="color" type="text" id="color" style="width:120px" /> | <input name="color" type="text" id="color" style="width:120px" /> | ||||
<button class="btn btn-secondary btn-sm" name="modcolor" type="button" id="modcolor" onClick="ShowColor(event, this)">选取</button> | |||||
<button class="btn btn-secondary btn-sm" name="modcolor" type="button" id="modcolor" | |||||
onClick="ShowColor(event, this)">选取</button> | |||||
</td> | </td> | ||||
</tr> | </tr> | ||||
</table> | </table> | ||||
@@ -464,9 +466,9 @@ | |||||
<td width="90">发布选项:</td> | <td width="90">发布选项:</td> | ||||
<td width="379"> | <td width="379"> | ||||
<label><input name="ishtml" type="radio" class="np" value="1" checked="1" /> | <label><input name="ishtml" type="radio" class="np" value="1" checked="1" /> | ||||
生成HTML</label> | |||||
<label><input type="radio" name="ishtml" class="np" value="0" /> | |||||
仅动态浏览</label> </td> | |||||
生成HTML</label> | |||||
<label><input type="radio" name="ishtml" class="np" value="0" /> | |||||
仅动态浏览</label> </td> | |||||
</tr> | </tr> | ||||
</table> | </table> | ||||
</td> | </td> | ||||
@@ -1,42 +0,0 @@ | |||||
<html> | |||||
<head> | |||||
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $cfg_soft_lang; ?>"> | |||||
<title>增加数据 -- ~appname~</title> | |||||
<link href='../static/lurd/base.css' rel='stylesheet' type='text/css'></head> | |||||
<link href='css/lurd.css' rel='stylesheet' type='text/css'> | |||||
<body> | |||||
<form name='lurdform' action='{dede:server name='PHP_SELF' /}' method='post' enctype="multipart/form-data"> | |||||
<input type='hidden' name='ac' value='saveadd' /> | |||||
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0"> | |||||
<tr> | |||||
<td height="28" style="background:url(../static/lurd/tr-bg.gif);border-left:1px solid #CFCFCF;border-right:1px solid #CFCFCF;border-top:1px solid #CFCFCF;"> | |||||
<table width='96%' cellpadding='0' cellspacing='0'> | |||||
<tr> | |||||
<td width='30%'> <strong><a href="~self~">~appname~</a> > 增加数据</strong></td> | |||||
<td align='right'> </td> | |||||
</tr> | |||||
</table> | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td height="150" bgcolor="#FFFFFF"> | |||||
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#CFCFCF"> | |||||
<tr bgcolor="#F8FEE0"> | |||||
<td width="20%" height="28" align="center"><strong>字段</strong></td> | |||||
<td width="80%" align="center"><strong>值</strong></td> | |||||
</tr> | |||||
~fields~ | |||||
</table> | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td align="center" bgcolor="#F9FCEF" height="43" style="border-left:1px solid #CFCFCF;border-right:1px solid #CFCFCF;border-bottom:1px solid #CFCFCF;"> | |||||
<input type="image" name="imageField" src="../static/lurd/button_save.gif" class='np' /> | |||||
<img src="../static/lurd/button_reset.gif" width="60" height="22" onClick="document.lurdform.reset();" style="cursor:pointer;" /> | |||||
<img src="../static/lurd/button_back.gif" width="60" height="22" onClick="history.go(-1);" style="cursor:pointer;" /> | |||||
</td> | |||||
</tr> | |||||
</table> | |||||
</form> | |||||
</body> | |||||
</html> |
@@ -1,46 +0,0 @@ | |||||
<html> | |||||
<head> | |||||
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $cfg_soft_lang; ?>"> | |||||
<title>修改/查看 -- ~appname~</title> | |||||
<link href='../static/lurd/base.css' rel='stylesheet' type='text/css'> | |||||
<link href='css/lurd.css' rel='stylesheet' type='text/css'> | |||||
</head> | |||||
<body> | |||||
<form name='lurdform' action='{dede:server name='PHP_SELF' /}' method='post' enctype="multipart/form-data"> | |||||
<input type='hidden' name='ac' value='saveedit' /> | |||||
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0"> | |||||
<tr> | |||||
<td height="28" style="background:url(../static/lurd/tr-bg.gif);border-left:1px solid #CFCFCF;border-right:1px solid #CFCFCF;border-top:1px solid #CFCFCF;"> | |||||
<table width='96%' cellpadding='0' cellspacing='0'> | |||||
<tr> | |||||
<td width='30%'> <strong> <a href="~self~">~appname~</a> > 修改/查看</strong></td> | |||||
<td align='right'> </td> | |||||
</tr> | |||||
</table> | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td height="150" bgcolor="#FFFFFF"> | |||||
{dede:datalist} | |||||
~primarykey~ | |||||
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#CFCFCF"> | |||||
<tr bgcolor="#F8FEE0"> | |||||
<td width="20%" height="28" align="center"><strong>字段</strong></td> | |||||
<td width="80%" align="center"><strong>值</strong></td> | |||||
</tr> | |||||
~fields~ | |||||
</table> | |||||
{/dede:datalist} | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td align="center" bgcolor="#F9FCEF" height="43" style="border-left:1px solid #CFCFCF;border-right:1px solid #CFCFCF;border-bottom:1px solid #CFCFCF;"> | |||||
<input type="image" name="imageField" src="../static/lurd/button_save.gif" class='np' /> | |||||
<img src="../static/lurd/button_reset.gif" width="60" height="22" onClick="document.lurdform.reset();" style="cursor:pointer;" /> | |||||
<img src="../static/lurd/button_back.gif" width="60" height="22" onClick="history.go(-1);" style="cursor:pointer;" /> | |||||
</td> | |||||
</tr> | |||||
</table> | |||||
</form> | |||||
</body> | |||||
</html> |
@@ -1,83 +0,0 @@ | |||||
<html> | |||||
<head> | |||||
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $cfg_soft_lang; ?>"> | |||||
<title>~appname~</title> | |||||
<link href='../static/lurd/base.css' rel='stylesheet' type='text/css'> | |||||
<script language='javascript'> | |||||
function Addnew() | |||||
{ | |||||
location = "{dede:server name='PHP_SELF' /}?ac=add"; | |||||
} | |||||
function EditOld() | |||||
{ | |||||
document.lurdform.ac.value = 'edit'; | |||||
document.lurdform.submit(); | |||||
} | |||||
function DelOld() | |||||
{ | |||||
if(window.confirm("你确实要删除选定的记录么?")) | |||||
{ | |||||
document.lurdform.ac.value = 'del'; | |||||
document.lurdform.submit(); | |||||
} | |||||
} | |||||
function AllSel(ntype) | |||||
{ | |||||
var f = document.lurdform; | |||||
for(var i=0; i < f.elements.length; i++) | |||||
{ | |||||
if(f.elements[i].type=='checkbox') { | |||||
if(ntype==1) f.elements[i].checked = true; | |||||
else if(ntype==0) f.elements[i].checked = false; | |||||
else f.elements[i].checked = !f.elements[i].checked; | |||||
} | |||||
} | |||||
} | |||||
</script> | |||||
</head> | |||||
<body> | |||||
<table width="98%" border="0" align="center" cellpadding="1" cellspacing="1"> | |||||
<tr> | |||||
<td align='right'> | |||||
</td> | |||||
</tr> | |||||
</table> | |||||
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#CFCFCF"> | |||||
<tr> | |||||
<td height="28" colspan="~totalitem~" background="../static/lurd/tr-bg.gif"> | |||||
<table width='96%' cellpadding='0' cellspacing='0'> | |||||
<tr> | |||||
<td width='30%'><strong>~appname~</strong></td> | |||||
<td align='right'><input type="image" name="imageField2" class="np" title="增加数据" alt="增加数据" src="../static/lurd/ico-sadd.png" onClick="Addnew();" /></td> | |||||
</tr> | |||||
</table> | |||||
</td> | |||||
</tr> | |||||
<tr align="center" bgcolor="#F9FCEF" height="28"> | |||||
~titleitem~</tr> | |||||
<form name="lurdform" action="{dede:server name='PHP_SELF' /}" method="post"> | |||||
<input type='hidden' name='ac' value='' /> | |||||
<input type='hidden' name='pageno' value='{dede:global.pageno /}' /> | |||||
{dede:datalist} | |||||
<tr align="center" bgcolor="#FFFFFF" height="28" onMouseMove="javascript:this.bgColor='#FCFDEE';" onMouseOut="javascript:this.bgColor='#FFFFFF';"> | |||||
~fielditem~</tr> | |||||
{/dede:datalist} | |||||
</form> | |||||
<tr> | |||||
<td colspan="~totalitem~" align="left" bgcolor="#FFFFFF" height="36"> | |||||
<input type="button" class='np coolbg' name="b7" value="全选" style="width:40px" onClick="AllSel(1);" class='inputbut' /> | |||||
<input type="button" class='np coolbg' name="b8" value="取消" style="width:40px" onClick="AllSel(0);" class='inputbut' /> | |||||
<input type="button" class='np coolbg' name="b9" value="反选" style="width:40px" onClick="AllSel(2);" class='inputbut' /> | |||||
<input type="button" class='np coolbg' name="b7" value="修改" style="width:40px" onClick="EditOld();" class='inputbut' /> | |||||
<input type="button" class='np coolbg' name="b7" value="删除" style="width:40px" onClick="DelOld();" class='inputbut' /> | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td colspan="~totalitem~" align="center" bgcolor="#F9FCEF" height="36"> | |||||
{dede:pagelist listsize='5' listitem='info,index,end,pre,next,pageno,form' /} | |||||
</td> | |||||
</tr> | |||||
</table> | |||||
</body> | |||||
</html> |
@@ -5,8 +5,8 @@ | |||||
<head> | <head> | ||||
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $cfg_soft_lang; ?>"> | <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $cfg_soft_lang; ?>"> | ||||
<title>数据库维护</title> | <title>数据库维护</title> | ||||
<link rel="stylesheet" href="../static/css/bootstrap.min.css"> | |||||
<link href="../static/font-awesome/css/font-awesome.min.css" rel="stylesheet"> | |||||
<link rel="stylesheet" href="../static/css/bootstrap.min.css"> | |||||
<link href="../static/font-awesome/css/font-awesome.min.css" rel="stylesheet"> | |||||
<link href='css/base.css' rel='stylesheet' type='text/css'> | <link href='css/base.css' rel='stylesheet' type='text/css'> | ||||
<script language="javascript" src="../static/js/dedeajax2.js"></script> | <script language="javascript" src="../static/js/dedeajax2.js"></script> | ||||
<script language="javascript"> | <script language="javascript"> | ||||
@@ -87,7 +87,8 @@ | |||||
</head> | </head> | ||||
<body background='images/allbg.gif' leftmargin='8' topmargin='8'> | <body background='images/allbg.gif' leftmargin='8' topmargin='8'> | ||||
<table width="99%" align="center" border="0" cellpadding="3" cellspacing="1" bgcolor="#D6D6D6" class="table maintable table-bordered mt-3"> | |||||
<table width="99%" align="center" border="0" cellpadding="3" cellspacing="1" bgcolor="#D6D6D6" | |||||
class="table maintable table-bordered mt-3"> | |||||
<tr> | <tr> | ||||
<td height="19" colspan="8" background="images/tbg.gif" bgcolor="#E7E7E7"> | <td height="19" colspan="8" background="images/tbg.gif" bgcolor="#E7E7E7"> | ||||
<table width="96%" border="0" cellspacing="1" cellpadding="1" class="table table-borderless"> | <table width="96%" border="0" cellspacing="1" cellpadding="1" class="table table-borderless"> | ||||
@@ -132,9 +133,12 @@ | |||||
<?php echo TjCount($t,$dsql); ?> | <?php echo TjCount($t,$dsql); ?> | ||||
</td> | </td> | ||||
<td> | <td> | ||||
<a href="#" onClick="LoadUrl('dopost=opimize&tablename=<?php echo $t; ?>');" class="btn btn-secondary btn-sm">优化</a> | |||||
<a href="#" onClick="LoadUrl('dopost=repair&tablename=<?php echo $t; ?>');" class="btn btn-secondary btn-sm">修复</a> | |||||
<a href="#" onClick="LoadUrl('dopost=viewinfo&tablename=<?php echo $t; ?>');" class="btn btn-secondary btn-sm">结构</a> | |||||
<a href="#" onClick="LoadUrl('dopost=opimize&tablename=<?php echo $t; ?>');" | |||||
class="btn btn-secondary btn-sm">优化</a> | |||||
<a href="#" onClick="LoadUrl('dopost=repair&tablename=<?php echo $t; ?>');" | |||||
class="btn btn-secondary btn-sm">修复</a> | |||||
<a href="#" onClick="LoadUrl('dopost=viewinfo&tablename=<?php echo $t; ?>');" | |||||
class="btn btn-secondary btn-sm">结构</a> | |||||
</td> | </td> | ||||
<?php | <?php | ||||
$i++; | $i++; | ||||
@@ -151,9 +155,12 @@ | |||||
<?php echo TjCount($t,$dsql); ?> | <?php echo TjCount($t,$dsql); ?> | ||||
</td> | </td> | ||||
<td> | <td> | ||||
<a href="#" onClick="LoadUrl('dopost=opimize&tablename=<?php echo $t; ?>');" class="btn btn-secondary btn-sm">优化</a> | |||||
<a href="#" onClick="LoadUrl('dopost=repair&tablename=<?php echo $t; ?>');" class="btn btn-secondary btn-sm">修复</a> | |||||
<a href="#" onClick="LoadUrl('dopost=viewinfo&tablename=<?php echo $t; ?>');" class="btn btn-secondary btn-sm">结构</a> | |||||
<a href="#" onClick="LoadUrl('dopost=opimize&tablename=<?php echo $t; ?>');" | |||||
class="btn btn-secondary btn-sm">优化</a> | |||||
<a href="#" onClick="LoadUrl('dopost=repair&tablename=<?php echo $t; ?>');" | |||||
class="btn btn-secondary btn-sm">修复</a> | |||||
<a href="#" onClick="LoadUrl('dopost=viewinfo&tablename=<?php echo $t; ?>');" | |||||
class="btn btn-secondary btn-sm">结构</a> | |||||
</td> | </td> | ||||
<?php | <?php | ||||
} | } | ||||
@@ -193,9 +200,12 @@ | |||||
<?php echo TjCount($t,$dsql); ?> | <?php echo TjCount($t,$dsql); ?> | ||||
</td> | </td> | ||||
<td> | <td> | ||||
<a href="#" onClick="LoadUrl('dopost=opimize&tablename=<?php echo $t; ?>');" class="btn btn-secondary btn-sm">优化</a> | |||||
<a href="#" onClick="LoadUrl('dopost=repair&tablename=<?php echo $t; ?>');" class="btn btn-secondary btn-sm">修复</a> | |||||
<a href="#" onClick="LoadUrl('dopost=viewinfo&tablename=<?php echo $t; ?>');" class="btn btn-secondary btn-sm">结构</a> | |||||
<a href="#" onClick="LoadUrl('dopost=opimize&tablename=<?php echo $t; ?>');" | |||||
class="btn btn-secondary btn-sm">优化</a> | |||||
<a href="#" onClick="LoadUrl('dopost=repair&tablename=<?php echo $t; ?>');" | |||||
class="btn btn-secondary btn-sm">修复</a> | |||||
<a href="#" onClick="LoadUrl('dopost=viewinfo&tablename=<?php echo $t; ?>');" | |||||
class="btn btn-secondary btn-sm">结构</a> | |||||
</td> | </td> | ||||
<?php | <?php | ||||
$i++; | $i++; | ||||
@@ -212,9 +222,12 @@ | |||||
<?php echo TjCount($t,$dsql); ?> | <?php echo TjCount($t,$dsql); ?> | ||||
</td> | </td> | ||||
<td> | <td> | ||||
<a href="#" onClick="LoadUrl('dopost=opimize&tablename=<?php echo $t; ?>');" class="btn btn-secondary btn-sm">优化</a> | |||||
<a href="#" onClick="LoadUrl('dopost=repair&tablename=<?php echo $t; ?>');" class="btn btn-secondary btn-sm">修复</a> | |||||
<a href="#" onClick="LoadUrl('dopost=viewinfo&tablename=<?php echo $t; ?>');" class="btn btn-secondary btn-sm">结构</a> | |||||
<a href="#" onClick="LoadUrl('dopost=opimize&tablename=<?php echo $t; ?>');" | |||||
class="btn btn-secondary btn-sm">优化</a> | |||||
<a href="#" onClick="LoadUrl('dopost=repair&tablename=<?php echo $t; ?>');" | |||||
class="btn btn-secondary btn-sm">修复</a> | |||||
<a href="#" onClick="LoadUrl('dopost=viewinfo&tablename=<?php echo $t; ?>');" | |||||
class="btn btn-secondary btn-sm">结构</a> | |||||
</td> | </td> | ||||
<?php | <?php | ||||
}else{ | }else{ | ||||
@@ -242,24 +255,13 @@ | |||||
<tr> | <tr> | ||||
<td height="30">当前数据库版本: <?php echo $mysql_version?></td> | <td height="30">当前数据库版本: <?php echo $mysql_version?></td> | ||||
</tr> | </tr> | ||||
<tr> | |||||
<td height="30"> | |||||
指定备份数据格式: | |||||
<label><input name="datatype" type="radio" class="np" value="4.0" | |||||
<?php if($mysql_version<4.1) echo " checked='1'";?> /> | |||||
MySQL3.x/4.0.x 版本</label> | |||||
<label><input type="radio" name="datatype" value="4.1" class="np" | |||||
<?php if($mysql_version>=4.1) echo " checked='1'";?> /> | |||||
MySQL4.1.x/5.x 版本</label> | |||||
</td> | |||||
</tr> | |||||
<tr> | <tr> | ||||
<td height="30"> | <td height="30"> | ||||
分卷大小: | 分卷大小: | ||||
<input name="fsize" type="text" id="fsize" value="2048" size="6" /> | <input name="fsize" type="text" id="fsize" value="2048" size="6" /> | ||||
K , | K , | ||||
<label><input name="isstruct" type="checkbox" class="np" id="isstruct" value="1" checked='1' /> | <label><input name="isstruct" type="checkbox" class="np" id="isstruct" value="1" checked='1' /> | ||||
备份表结构信息</label> | |||||
备份表结构信息</label> | |||||
<?php if(@function_exists('gzcompress') && false) { ?> | <?php if(@function_exists('gzcompress') && false) { ?> | ||||
<input name="iszip" type="checkbox" class="np" id="iszip" value="1" checked='1' /> | <input name="iszip" type="checkbox" class="np" id="iszip" value="1" checked='1' /> | ||||
完成后压缩成ZIP | 完成后压缩成ZIP | ||||
@@ -24,7 +24,6 @@ | |||||
<td width="76%" align="right"> | <td width="76%" align="right"> | ||||
<a href="sys_data.php" class="btn btn-secondary btn-sm">数据备份</a> | <a href="sys_data.php" class="btn btn-secondary btn-sm">数据备份</a> | ||||
<a href="sys_data_revert.php" class="btn btn-secondary btn-sm">数据还原</a> | <a href="sys_data_revert.php" class="btn btn-secondary btn-sm">数据还原</a> | ||||
<a href="sys_sql_info.php" class="btn btn-secondary btn-sm">数据库说明文档</a> | |||||
</td> | </td> | ||||
</tr> | </tr> | ||||
</table> | </table> | ||||
@@ -1,4 +1,5 @@ | |||||
<?php | <?php | ||||
/** | /** | ||||
* 系统核心函数存放文件 | * 系统核心函数存放文件 | ||||
* @version $Id: common.func.php 4 16:39 2010年7月6日Z tianya $ | * @version $Id: common.func.php 4 16:39 2010年7月6日Z tianya $ | ||||
@@ -7,46 +8,46 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
if(!defined('DEDEINC')) exit('dedecms'); | |||||
if (!defined('DEDEINC')) exit('dedecms'); | |||||
if (version_compare(PHP_VERSION, '7.0.0', '>=')) | |||||
{ | |||||
if (!function_exists('mysql_connect') AND function_exists('mysqli_connect')) { | |||||
if (version_compare(PHP_VERSION, '7.0.0', '>=')) { | |||||
if (!function_exists('mysql_connect') and function_exists('mysqli_connect')) { | |||||
function mysql_connect($server, $username, $password) | function mysql_connect($server, $username, $password) | ||||
{ | { | ||||
return mysqli_connect($server, $username, $password); | return mysqli_connect($server, $username, $password); | ||||
} | } | ||||
} | } | ||||
if (!function_exists('mysql_query') AND function_exists('mysqli_query')) { | |||||
if (!function_exists('mysql_query') and function_exists('mysqli_query')) { | |||||
function mysql_query($query, $link) | function mysql_query($query, $link) | ||||
{ | { | ||||
return mysqli_query($link, $query); | return mysqli_query($link, $query); | ||||
} | } | ||||
} | } | ||||
if (!function_exists('mysql_select_db') AND function_exists('mysqli_select_db')) { | |||||
if (!function_exists('mysql_select_db') and function_exists('mysqli_select_db')) { | |||||
function mysql_select_db($database_name, $link) | function mysql_select_db($database_name, $link) | ||||
{ | { | ||||
return mysqli_select_db($link, $database_name); | return mysqli_select_db($link, $database_name); | ||||
} | } | ||||
} | } | ||||
if (!function_exists('mysql_fetch_array') AND function_exists('mysqli_fetch_array')) { | |||||
if (!function_exists('mysql_fetch_array') and function_exists('mysqli_fetch_array')) { | |||||
function mysql_fetch_array($result) | function mysql_fetch_array($result) | ||||
{ | { | ||||
return mysqli_fetch_array($result); | return mysqli_fetch_array($result); | ||||
} | } | ||||
} | } | ||||
if (!function_exists('mysql_close') AND function_exists('mysqli_close')) { | |||||
if (!function_exists('mysql_close') and function_exists('mysqli_close')) { | |||||
function mysql_close($link) | function mysql_close($link) | ||||
{ | { | ||||
return mysqli_close($link); | return mysqli_close($link); | ||||
} | } | ||||
} | } | ||||
if (!function_exists('split')) { | if (!function_exists('split')) { | ||||
function split($pattern, $string){ | |||||
function split($pattern, $string) | |||||
{ | |||||
return explode($pattern, $string); | return explode($pattern, $string); | ||||
} | } | ||||
} | } | ||||
@@ -63,38 +64,29 @@ function make_hash() | |||||
function dede_random_bytes($length) | function dede_random_bytes($length) | ||||
{ | { | ||||
if (empty($length) OR ! ctype_digit((string) $length)) | |||||
{ | |||||
if (empty($length) or !ctype_digit((string) $length)) { | |||||
return FALSE; | return FALSE; | ||||
} | } | ||||
if (function_exists('openssl_random_pseudo_bytes')) | |||||
{ | |||||
if (function_exists('openssl_random_pseudo_bytes')) { | |||||
return openssl_random_pseudo_bytes($length); | return openssl_random_pseudo_bytes($length); | ||||
} | } | ||||
if (function_exists('random_bytes')) | |||||
{ | |||||
try | |||||
{ | |||||
if (function_exists('random_bytes')) { | |||||
try { | |||||
return random_bytes((int) $length); | return random_bytes((int) $length); | ||||
} | |||||
catch (Exception $e) | |||||
{ | |||||
} catch (Exception $e) { | |||||
return FALSE; | return FALSE; | ||||
} | } | ||||
} | } | ||||
if (defined('MCRYPT_DEV_URANDOM') && ($output = mcrypt_create_iv($length, MCRYPT_DEV_URANDOM)) !== FALSE) | |||||
{ | |||||
if (defined('MCRYPT_DEV_URANDOM') && ($output = mcrypt_create_iv($length, MCRYPT_DEV_URANDOM)) !== FALSE) { | |||||
return $output; | return $output; | ||||
} | } | ||||
if (is_readable('/dev/urandom') && ($fp = fopen('/dev/urandom', 'rb')) !== FALSE) | |||||
{ | |||||
if (is_readable('/dev/urandom') && ($fp = fopen('/dev/urandom', 'rb')) !== FALSE) { | |||||
version_compare(PHP_VERSION, '5.4.0', '>=') && stream_set_chunk_size($fp, $length); | version_compare(PHP_VERSION, '5.4.0', '>=') && stream_set_chunk_size($fp, $length); | ||||
$output = fread($fp, $length); | $output = fread($fp, $length); | ||||
fclose($fp); | fclose($fp); | ||||
if ($output !== FALSE) | |||||
{ | |||||
if ($output !== FALSE) { | |||||
return $output; | return $output; | ||||
} | } | ||||
} | } | ||||
@@ -129,96 +121,34 @@ $_helpers = array(); | |||||
function helper($helpers) | function helper($helpers) | ||||
{ | { | ||||
//如果是数组,则进行递归操作 | //如果是数组,则进行递归操作 | ||||
if (is_array($helpers)) | |||||
{ | |||||
foreach($helpers as $dede) | |||||
{ | |||||
if (is_array($helpers)) { | |||||
foreach ($helpers as $dede) { | |||||
helper($dede); | helper($dede); | ||||
} | } | ||||
return; | return; | ||||
} | } | ||||
if (isset($_helpers[$helpers])) | |||||
{ | |||||
if (isset($_helpers[$helpers])) { | |||||
return; | return; | ||||
} | } | ||||
if (file_exists(DEDEINC.'/helpers/'.$helpers.'.helper.php')) | |||||
{ | |||||
include_once(DEDEINC.'/helpers/'.$helpers.'.helper.php'); | |||||
if (file_exists(DEDEINC . '/helpers/' . $helpers . '.helper.php')) { | |||||
include_once(DEDEINC . '/helpers/' . $helpers . '.helper.php'); | |||||
$_helpers[$helpers] = TRUE; | $_helpers[$helpers] = TRUE; | ||||
} | } | ||||
// 无法载入小助手 | // 无法载入小助手 | ||||
if ( ! isset($_helpers[$helpers])) | |||||
{ | |||||
exit('Unable to load the requested file: helpers/'.$helpers.'.helper.php'); | |||||
if (!isset($_helpers[$helpers])) { | |||||
exit('Unable to load the requested file: helpers/' . $helpers . '.helper.php'); | |||||
} | } | ||||
} | } | ||||
function dede_htmlspecialchars($str) { | |||||
function dede_htmlspecialchars($str) | |||||
{ | |||||
global $cfg_soft_lang; | global $cfg_soft_lang; | ||||
if (version_compare(PHP_VERSION, '5.4.0', '<')) return htmlspecialchars($str); | if (version_compare(PHP_VERSION, '5.4.0', '<')) return htmlspecialchars($str); | ||||
if ($cfg_soft_lang=='gb2312') return htmlspecialchars($str,ENT_COMPAT,'ISO-8859-1'); | |||||
if ($cfg_soft_lang == 'gb2312') return htmlspecialchars($str, ENT_COMPAT, 'ISO-8859-1'); | |||||
else return htmlspecialchars($str); | else return htmlspecialchars($str); | ||||
} | } | ||||
/** | |||||
* 控制器调用函数 | |||||
* | |||||
* @access public | |||||
* @param string $ct 控制器 | |||||
* @param string $ac 操作事件 | |||||
* @param string $path 指定控制器所在目录 | |||||
* @return string | |||||
*/ | |||||
function RunApp($ct, $ac = '',$directory = '') | |||||
{ | |||||
$ct = preg_replace("/[^0-9a-z_]/i", '', $ct); | |||||
$ac = preg_replace("/[^0-9a-z_]/i", '', $ac); | |||||
$ac = empty ( $ac ) ? $ac = 'index' : $ac; | |||||
if(!empty($directory)) $path = DEDECONTROL.'/'.$directory. '/' . $ct . '.php'; | |||||
else $path = DEDECONTROL . '/' . $ct . '.php'; | |||||
if (file_exists ( $path )) | |||||
{ | |||||
require $path; | |||||
} else { | |||||
if (DEBUG_LEVEL === TRUE) | |||||
{ | |||||
trigger_error("Load Controller false!"); | |||||
} | |||||
//生产环境中,找不到控制器的情况不需要记录日志 | |||||
else | |||||
{ | |||||
header ( "location:/404.html" ); | |||||
die (); | |||||
} | |||||
} | |||||
$action = 'ac_'.$ac; | |||||
$loaderr = FALSE; | |||||
$instance = new $ct ( ); | |||||
if (method_exists ( $instance, $action ) === TRUE) | |||||
{ | |||||
$instance->$action(); | |||||
unset($instance); | |||||
} else $loaderr = TRUE; | |||||
if ($loaderr) | |||||
{ | |||||
if (DEBUG_LEVEL === TRUE) | |||||
{ | |||||
trigger_error("Load Method false!"); | |||||
} | |||||
//生产环境中,找不到控制器的情况不需要记录日志 | |||||
else | |||||
{ | |||||
header ( "location:/404.html" ); | |||||
die (); | |||||
} | |||||
} | |||||
} | |||||
/** | /** | ||||
* 载入小助手,这里用户可能载入用helps载入多个小助手 | * 载入小助手,这里用户可能载入用helps载入多个小助手 | ||||
* | * | ||||
@@ -232,17 +162,13 @@ function helpers($helpers) | |||||
} | } | ||||
//兼容php4的file_put_contents | //兼容php4的file_put_contents | ||||
if(!function_exists('file_put_contents')) | |||||
{ | |||||
if (!function_exists('file_put_contents')) { | |||||
function file_put_contents($n, $d) | function file_put_contents($n, $d) | ||||
{ | { | ||||
$f=@fopen($n, "w"); | |||||
if (!$f) | |||||
{ | |||||
$f = @fopen($n, "w"); | |||||
if (!$f) { | |||||
return FALSE; | return FALSE; | ||||
} | |||||
else | |||||
{ | |||||
} else { | |||||
fwrite($f, $d); | fwrite($f, $d); | ||||
fclose($f); | fclose($f); | ||||
return TRUE; | return TRUE; | ||||
@@ -257,15 +183,17 @@ if(!function_exists('file_put_contents')) | |||||
*/ | */ | ||||
function UpdateStat() | function UpdateStat() | ||||
{ | { | ||||
include_once(DEDEINC."/inc/inc_stat.php"); | |||||
include_once(DEDEINC . "/inc/inc_stat.php"); | |||||
return SpUpdateStat(); | return SpUpdateStat(); | ||||
} | } | ||||
$arrs1 = array(0x63,0x66,0x67,0x5f,0x70,0x6f,0x77,0x65,0x72,0x62,0x79); | |||||
$arrs2 = array(0x20,0x3c,0x61,0x20,0x68,0x72,0x65,0x66,0x3d,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f, | |||||
0x77,0x77,0x77,0x2e,0x64,0x65,0x64,0x65,0x63,0x6d,0x73,0x2e,0x63,0x6f,0x6d,0x20,0x74,0x61,0x72, | |||||
0x67,0x65,0x74,0x3d,0x27,0x5f,0x62,0x6c,0x61,0x6e,0x6b,0x27,0x3e,0x50,0x6f,0x77,0x65,0x72,0x20, | |||||
0x62,0x79,0x20,0x44,0x65,0x64,0x65,0x43,0x6d,0x73,0x3c,0x2f,0x61,0x3e); | |||||
$arrs1 = array(0x63, 0x66, 0x67, 0x5f, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x62, 0x79); | |||||
$arrs2 = array( | |||||
0x20, 0x3c, 0x61, 0x20, 0x68, 0x72, 0x65, 0x66, 0x3d, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, | |||||
0x77, 0x77, 0x77, 0x2e, 0x64, 0x65, 0x64, 0x65, 0x63, 0x6d, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x20, 0x74, 0x61, 0x72, | |||||
0x67, 0x65, 0x74, 0x3d, 0x27, 0x5f, 0x62, 0x6c, 0x61, 0x6e, 0x6b, 0x27, 0x3e, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x20, | |||||
0x62, 0x79, 0x20, 0x44, 0x65, 0x64, 0x65, 0x43, 0x6d, 0x73, 0x3c, 0x2f, 0x61, 0x3e | |||||
); | |||||
/** | /** | ||||
* 短消息函数,可以在某个动作处理后友好的提示信息 | * 短消息函数,可以在某个动作处理后友好的提示信息 | ||||
@@ -276,34 +204,29 @@ $arrs2 = array(0x20,0x3c,0x61,0x20,0x68,0x72,0x65,0x66,0x3d,0x68,0x74,0x74,0x70, | |||||
* @param int $limittime 限制时间 | * @param int $limittime 限制时间 | ||||
* @return void | * @return void | ||||
*/ | */ | ||||
function ShowMsg($msg, $gourl, $onlymsg=0, $limittime=0) | |||||
function ShowMsg($msg, $gourl, $onlymsg = 0, $limittime = 0) | |||||
{ | { | ||||
global $cfg_soft_lang,$cfg_cmsurl; | |||||
if(empty($GLOBALS['cfg_plus_dir'])) $GLOBALS['cfg_plus_dir'] = '..'; | |||||
global $cfg_soft_lang, $cfg_cmsurl; | |||||
if (empty($GLOBALS['cfg_plus_dir'])) $GLOBALS['cfg_plus_dir'] = '..'; | |||||
$htmlhead = "<html>\r\n<head>\r\n<title>DedeCMS提示信息</title>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset={$cfg_soft_lang}\" />\r\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1, shrink-to-fit=no\">"; | $htmlhead = "<html>\r\n<head>\r\n<title>DedeCMS提示信息</title>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset={$cfg_soft_lang}\" />\r\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1, shrink-to-fit=no\">"; | ||||
$htmlhead .= "<link rel=\"stylesheet\" href=\"{$cfg_cmsurl}/static/css/bootstrap.min.css\"><style>.modal {position: static;}</style><link href=\"{$cfg_cmsurl}/static/font-awesome/css/font-awesome.min.css\" rel=\"stylesheet\">"; | $htmlhead .= "<link rel=\"stylesheet\" href=\"{$cfg_cmsurl}/static/css/bootstrap.min.css\"><style>.modal {position: static;}</style><link href=\"{$cfg_cmsurl}/static/font-awesome/css/font-awesome.min.css\" rel=\"stylesheet\">"; | ||||
$htmlhead .= "<base target='_self'/></head>\r\n<body leftmargin='0' topmargin='0' bgcolor='#FFFFFF'>".(isset($GLOBALS['ucsynlogin']) ? $GLOBALS['ucsynlogin'] : '')."\r\n<center>\r\n<script>\r\n"; | |||||
$htmlhead .= "<base target='_self'/></head>\r\n<body leftmargin='0' topmargin='0' bgcolor='#FFFFFF'>" . (isset($GLOBALS['ucsynlogin']) ? $GLOBALS['ucsynlogin'] : '') . "\r\n<center>\r\n<script>\r\n"; | |||||
$htmlfoot = "</script>\r\n</center>\r\n</body>\r\n</html>\r\n"; | $htmlfoot = "</script>\r\n</center>\r\n</body>\r\n</html>\r\n"; | ||||
$litime = ($limittime==0 ? 1000 : $limittime); | |||||
$litime = ($limittime == 0 ? 1000 : $limittime); | |||||
$func = ''; | $func = ''; | ||||
if($gourl=='-1') | |||||
{ | |||||
if($limittime==0) $litime = 5000; | |||||
if ($gourl == '-1') { | |||||
if ($limittime == 0) $litime = 5000; | |||||
$gourl = "javascript:history.go(-1);"; | $gourl = "javascript:history.go(-1);"; | ||||
} | } | ||||
if($gourl=='' || $onlymsg==1) | |||||
{ | |||||
$msg = "<script>alert(\"".str_replace("\"","“",$msg)."\");</script>"; | |||||
} | |||||
else | |||||
{ | |||||
if ($gourl == '' || $onlymsg == 1) { | |||||
$msg = "<script>alert(\"" . str_replace("\"", "“", $msg) . "\");</script>"; | |||||
} else { | |||||
//当网址为:close::objname 时, 关闭父框架的id=objname元素 | //当网址为:close::objname 时, 关闭父框架的id=objname元素 | ||||
if(preg_match('/close::/',$gourl)) | |||||
{ | |||||
if (preg_match('/close::/', $gourl)) { | |||||
$tgobj = trim(preg_replace('/close::/', '', $gourl)); | $tgobj = trim(preg_replace('/close::/', '', $gourl)); | ||||
$gourl = 'javascript:;'; | $gourl = 'javascript:;'; | ||||
$func .= "window.parent.document.getElementById('{$tgobj}').style.display='none';\r\n"; | $func .= "window.parent.document.getElementById('{$tgobj}').style.display='none';\r\n"; | ||||
@@ -316,27 +239,21 @@ function ShowMsg($msg, $gourl, $onlymsg=0, $limittime=0) | |||||
$rmsg = $func; | $rmsg = $func; | ||||
$rmsg .= "document.write(\"<main class='container'><div class='modal' tabindex='-1' role='dialog' style='display:block'><div class='modal-dialog'><div class='modal-content'><div class='modal-header'><h6 class='modal-title'>"; | $rmsg .= "document.write(\"<main class='container'><div class='modal' tabindex='-1' role='dialog' style='display:block'><div class='modal-dialog'><div class='modal-content'><div class='modal-header'><h6 class='modal-title'>"; | ||||
$rmsg .= "DedeCMS 提示信息!</h6></div><div class='modal-body'>\");\r\n"; | $rmsg .= "DedeCMS 提示信息!</h6></div><div class='modal-body'>\");\r\n"; | ||||
$rmsg .= "document.write(\"".str_replace("\"","“",$msg)."\");\r\n"; | |||||
$rmsg .= "document.write(\"" . str_replace("\"", "“", $msg) . "\");\r\n"; | |||||
$rmsg .= "document.write(\""; | $rmsg .= "document.write(\""; | ||||
if($onlymsg==0) | |||||
{ | |||||
if( $gourl != 'javascript:;' && $gourl != '') | |||||
{ | |||||
if ($onlymsg == 0) { | |||||
if ($gourl != 'javascript:;' && $gourl != '') { | |||||
$rmsg .= "<br /><a href='{$gourl}'>如果你的浏览器没反应,请点击这里...</a>"; | $rmsg .= "<br /><a href='{$gourl}'>如果你的浏览器没反应,请点击这里...</a>"; | ||||
$rmsg .= "</div></div></div></div></main>\");\r\n"; | $rmsg .= "</div></div></div></div></main>\");\r\n"; | ||||
$rmsg .= "setTimeout('JumpUrl()',$litime);"; | $rmsg .= "setTimeout('JumpUrl()',$litime);"; | ||||
} | |||||
else | |||||
{ | |||||
} else { | |||||
$rmsg .= "</div></div></div></div></main>\");\r\n"; | $rmsg .= "</div></div></div></div></main>\");\r\n"; | ||||
} | } | ||||
} | |||||
else | |||||
{ | |||||
} else { | |||||
$rmsg .= "</div></div></div></div></main>\");\r\n"; | $rmsg .= "</div></div></div></div></main>\");\r\n"; | ||||
} | } | ||||
$msg = $htmlhead.$rmsg.$htmlfoot; | |||||
$msg = $htmlhead . $rmsg . $htmlfoot; | |||||
} | } | ||||
echo $msg; | echo $msg; | ||||
} | } | ||||
@@ -348,7 +265,7 @@ function ShowMsg($msg, $gourl, $onlymsg=0, $limittime=0) | |||||
*/ | */ | ||||
function GetCkVdValue() | function GetCkVdValue() | ||||
{ | { | ||||
@session_id($_COOKIE['PHPSESSID']); | |||||
@session_id($_COOKIE['PHPSESSID']); | |||||
@session_start(); | @session_start(); | ||||
return isset($_SESSION['securimage_code_value']) ? $_SESSION['securimage_code_value'] : ''; | return isset($_SESSION['securimage_code_value']) ? $_SESSION['securimage_code_value'] : ''; | ||||
} | } | ||||
@@ -364,12 +281,14 @@ function ResetVdValue() | |||||
$_SESSION['securimage_code_value'] = ''; | $_SESSION['securimage_code_value'] = ''; | ||||
} | } | ||||
function IndexSub($idx, $num) { | |||||
return intval($idx - $num) == 0? '0 ' : intval($idx - $num); | |||||
function IndexSub($idx, $num) | |||||
{ | |||||
return intval($idx - $num) == 0 ? '0 ' : intval($idx - $num); | |||||
} | } | ||||
// 用来返回index的active | // 用来返回index的active | ||||
function IndexActive($idx){ | |||||
function IndexActive($idx) | |||||
{ | |||||
if ($idx == 1) { | if ($idx == 1) { | ||||
return ' active'; | return ' active'; | ||||
} else { | } else { | ||||
@@ -379,7 +298,6 @@ function IndexActive($idx){ | |||||
// 自定义函数接口 | // 自定义函数接口 | ||||
// 这里主要兼容早期的用户扩展,v5.7之后我们建议使用小助手helper进行扩展 | // 这里主要兼容早期的用户扩展,v5.7之后我们建议使用小助手helper进行扩展 | ||||
if( file_exists(DEDEINC.'/extend.func.php') ) | |||||
{ | |||||
require_once(DEDEINC.'/extend.func.php'); | |||||
if (file_exists(DEDEINC . '/extend.func.php')) { | |||||
require_once(DEDEINC . '/extend.func.php'); | |||||
} | } |
@@ -170,8 +170,8 @@ function SpGetEditor($fname, $fvalue, $nheight = "350", $etype = "Basic", $gtype | |||||
} else if ($GLOBALS['cfg_html_editor'] == 'ckeditor') { | } else if ($GLOBALS['cfg_html_editor'] == 'ckeditor') { | ||||
$addConfig = ""; | $addConfig = ""; | ||||
if (defined("DEDEADMIN")) { | if (defined("DEDEADMIN")) { | ||||
// $addConfig = ",{filebrowserImageUploadUrl:'./dialog/select_images_post.php',filebrowserUploadUrl:'./dialog/select_media_post.php'}"; | |||||
$addConfig = ",{filebrowserImageUploadUrl:'./dialog/select_images_post.php'}"; | |||||
$addConfig = ",{filebrowserImageUploadUrl:'./dialog/select_images_post.php',filebrowserUploadUrl:'./dialog/select_media_post.php?ck=1'}"; | |||||
// $addConfig = ",{filebrowserImageUploadUrl:'./dialog/select_images_post.php'}"; | |||||
} | } | ||||
$code = <<<EOT | $code = <<<EOT | ||||
<script src="{$GLOBALS['cfg_static_dir']}/ckeditor/ckeditor.js"></script> | <script src="{$GLOBALS['cfg_static_dir']}/ckeditor/ckeditor.js"></script> | ||||
@@ -1,42 +0,0 @@ | |||||
<html> | |||||
<head> | |||||
<meta http-equiv='Content-Type' content='text/html; charset=<?php echo $cfg_soft_lang; ?>'> | |||||
<title>增加数据 -- ~appname~</title> | |||||
<link href='{dede:global.cfg_cmsurl/}/images/lurd/base.css' rel='stylesheet' type='text/css'></head> | |||||
<body> | |||||
<form name='lurdform' action='?ct={dede:global.ct /}' method='post' enctype="multipart/form-data"> | |||||
<input type='hidden' name='action' value='saveadd' /> | |||||
<input type='hidden' name='ct' value='{dede:global.ct /}' /> | |||||
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0"> | |||||
<tr> | |||||
<td height="28" style="background:url({dede:global.cfg_cmsurl/}/images/lurd/tr-bg.gif);border-left:1px solid #DADADA;border-right:1px solid #DADADA;border-top:1px solid #DADADA;"> | |||||
<table width='96%' cellpadding='0' cellspacing='0'> | |||||
<tr> | |||||
<td width='30%'> <strong>增加数据 -- ~appname~</strong></td> | |||||
<td align='right'> </td> | |||||
</tr> | |||||
</table> | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td height="150" bgcolor="#FFFFFF"> | |||||
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#DCE9AB"> | |||||
<tr bgcolor="#F8FEE0"> | |||||
<td width="20%" height="28" align="center"><strong>字段</strong></td> | |||||
<td width="80%" align="center"><strong>值</strong></td> | |||||
</tr> | |||||
~fields~ | |||||
</table> | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td align="center" bgcolor="#F9FCEF" height="43" style="border-left:1px solid #DCE9AB;border-right:1px solid #DCE9AB;border-bottom:1px solid #DCE9AB;"> | |||||
<img src="{dede:global.cfg_cmsurl/}/images/lurd/button_save.gif" class='np' width="60" height="22" onClick="document.lurdform.submit();" /> | |||||
<img src="{dede:global.cfg_cmsurl/}/images/lurd/button_reset.gif" width="60" height="22" onClick="document.lurdform.reset();" style="cursor:pointer;" /> | |||||
<img src="{dede:global.cfg_cmsurl/}/images/lurd/button_back.gif" width="60" height="22" onClick="history.go(-1);" style="cursor:pointer;" /> | |||||
</td> | |||||
</tr> | |||||
</table> | |||||
</form> | |||||
</body> | |||||
</html> |
@@ -1,46 +0,0 @@ | |||||
<html> | |||||
<head> | |||||
<meta http-equiv='Content-Type' content='text/html; charset=<?php echo $cfg_soft_lang; ?>'> | |||||
<title>修改/查看 -- ~appname~</title> | |||||
<link href='{dede:global.cfg_cmsurl/}/images/lurd/base.css' rel='stylesheet' type='text/css'> | |||||
</head> | |||||
<body> | |||||
<form name='lurdform' action='{dede:server name='PHP_SELF' /}' method='post' enctype="multipart/form-data"> | |||||
<input type='hidden' name='ct' value='{dede:global.ct /}' /> | |||||
<input type='hidden' name='action' value='saveedit' /> | |||||
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0"> | |||||
<tr> | |||||
<td height="28" style="background:url({dede:global.cfg_cmsurl/}/images/lurd/tr-bg.gif);border-left:1px solid #DADADA;border-right:1px solid #DADADA;border-top:1px solid #DADADA;"> | |||||
<table width='96%' cellpadding='0' cellspacing='0'> | |||||
<tr> | |||||
<td width='30%'> <strong>修改/查看 -- ~appname~</strong></td> | |||||
<td align='right'> </td> | |||||
</tr> | |||||
</table> | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td height="150" bgcolor="#FFFFFF"> | |||||
{dede:datalist} | |||||
~primarykey~ | |||||
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#DCE9AB"> | |||||
<tr bgcolor="#F8FEE0"> | |||||
<td width="20%" height="28" align="center"><strong>字段</strong></td> | |||||
<td width="80%" align="center"><strong>值</strong></td> | |||||
</tr> | |||||
~fields~ | |||||
</table> | |||||
{/dede:datalist} | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td align="center" bgcolor="#F9FCEF" height="43" style="border-left:1px solid #DCE9AB;border-right:1px solid #DCE9AB;border-bottom:1px solid #DCE9AB;"> | |||||
<input type="image" name="imageField" src="{dede:global.cfg_cmsurl/}/images/lurd/button_save.gif" class='np' /> | |||||
<img src="{dede:global.cfg_cmsurl/}/images/lurd/button_reset.gif" width="60" height="22" onClick="document.lurdform.reset();" style="cursor:pointer;" /> | |||||
<img src="{dede:global.cfg_cmsurl/}/images/lurd/button_back.gif" width="60" height="22" onClick="history.go(-1);" style="cursor:pointer;" /> | |||||
</td> | |||||
</tr> | |||||
</table> | |||||
</form> | |||||
</body> | |||||
</html> |
@@ -1,84 +0,0 @@ | |||||
<html> | |||||
<head> | |||||
<meta http-equiv='Content-Type' content='text/html; charset=<?php echo $cfg_soft_lang; ?>'> | |||||
<title>~appname~</title> | |||||
<link href='{dede:global.cfg_cmsurl/}/images/lurd/base.css' rel='stylesheet' type='text/css'> | |||||
<script language='javascript'> | |||||
function Addnew() | |||||
{ | |||||
location = "{dede:server name='PHP_SELF' /}?ct={dede:global.ct /}&action=add"; | |||||
} | |||||
function EditOld() | |||||
{ | |||||
document.lurdform.action.value = 'edit'; | |||||
document.lurdform.submit(); | |||||
} | |||||
function DelOld() | |||||
{ | |||||
if(window.confirm("你确实要删除选定的记录么?")) | |||||
{ | |||||
document.lurdform.action.value = 'del'; | |||||
document.lurdform.submit(); | |||||
} | |||||
} | |||||
function AllSel(ntype) | |||||
{ | |||||
var f = document.lurdform; | |||||
for(var i=0; i < f.elements.length; i++) | |||||
{ | |||||
if(f.elements[i].type=='checkbox') { | |||||
if(ntype==1) f.elements[i].checked = true; | |||||
else if(ntype==0) f.elements[i].checked = false; | |||||
else f.elements[i].checked = !f.elements[i].checked; | |||||
} | |||||
} | |||||
} | |||||
</script> | |||||
</head> | |||||
<body> | |||||
<table width="98%" border="0" align="center" cellpadding="1" cellspacing="1"> | |||||
<tr> | |||||
<td align='right'> | |||||
<input type="image" name="imageField2" class="np" title="增加数据" alt="增加数据" src="{dede:global.cfg_cmsurl/}/images/lurd/ico-sadd.png" onClick="Addnew();" /> | |||||
<input type="image" name="imageField" class="np" title="修改数据" alt="修改数据" src="{dede:global.cfg_cmsurl/}/images/lurd/ico-edit.png" onClick="EditOld();" /> | |||||
<input type="image" name="imageField2" class="np" title="删除数据" alt="删除数据" src="{dede:global.cfg_cmsurl/}/images/lurd/ico-del.png" onClick="DelOld();" /> | |||||
</td> | |||||
</tr> | |||||
</table> | |||||
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#DADADA"> | |||||
<tr> | |||||
<td height="28" colspan="~totalitem~" background="{dede:global.cfg_cmsurl/}/images/lurd/tr-bg.gif"> | |||||
<table width='96%' cellpadding='0' cellspacing='0'> | |||||
<tr> | |||||
<td width='30%'><strong>~appname~</strong></td> | |||||
<td align='right'></td> | |||||
</tr> | |||||
</table> | |||||
</td> | |||||
</tr> | |||||
<tr align="center" bgcolor="#F9FCEF" height="28"> | |||||
~titleitem~</tr> | |||||
<form name="lurdform" action="{dede:server name='PHP_SELF' /}" method="post"> | |||||
<input type='hidden' name='ct' value='{dede:global.ct /}' /> | |||||
<input type='hidden' name='action' value='' /> | |||||
<input type='hidden' name='pageno' value='{dede:global.pageno /}' /> | |||||
{dede:datalist} | |||||
<tr align="center" bgcolor="#FFFFFF" height="28" onMouseMove="javascript:this.bgColor='#FCFDEE';" onMouseOut="javascript:this.bgColor='#FFFFFF';"> | |||||
~fielditem~</tr> | |||||
{/dede:datalist} | |||||
</form> | |||||
<tr> | |||||
<td colspan="~totalitem~" align="left" bgcolor="#FFFFFF" height="36"> | |||||
<input type="button" class='np coolbg' name="b7" value="全选" style="width:40px" onClick="AllSel(1);" class='inputbut' /> | |||||
<input type="button" class='np coolbg' name="b8" value="取消" style="width:40px" onClick="AllSel(0);" class='inputbut' /> | |||||
<input type="button" class='np coolbg' name="b9" value="反选" style="width:40px" onClick="AllSel(2);" class='inputbut' /> | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td colspan="~totalitem~" align="center" bgcolor="#F9FCEF" height="36"> | |||||
{dede:pagelist listsize='5' listitem='info,index,end,pre,next,pageno,form' /} | |||||
</td> | |||||
</tr> | |||||
</table> | |||||
</body> | |||||
</html> |