code stringlengths 1 2.01M | language stringclasses 1 value |
|---|---|
<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header', 'admin');
?>
<div class="pad_10">
<div id="searchid">
<form name="searchform" action="" method="get" >
<input type="hidden" value="comment" name="m">
<input type="hidden" value="comment_admin" name="c">
<input type="hidden" value="listinfo" name="a">
<input type="hidden" value="1" name="search">
<input type="hidden" value="<?php echo $_SESSION['pc_hash']?>" name="pc_hash">
<table width="100%" cellspacing="0" class="search-form">
<tbody>
<tr>
<td>
<div class="explain-col">
<?php if($max_table > 1) {?>
<?php echo L('choose_database')?>:<select name="tableid" onchange="show_tbl(this)"><?php for($i=1;$i<=$max_table;$i++) {?><option value="<?php echo $i?>" <?php if($i==$tableid){?>selected<?php }?>><?php echo $this->comment_data_db->db_tablepre?>comment_data_<?php echo $i?></option><?php }?></select>
<?php }?>
<select name="searchtype">
<option value='0' <?php if($_GET['searchtype']==0) echo 'selected';?>><?php echo L('original').L('title');?></option>
<option value='1' <?php if($_GET['searchtype']==1) echo 'selected';?>><?php echo L('original');?>ID</option>
<option value='2' <?php if($_GET['searchtype']==2) echo 'selected';?>><?php echo L('username');?></option>
</select>
<input name="keyword" type="text" value="<?php if(isset($keywords)) echo $keywords;?>" class="input-text" />
<input type="submit" name="search" class="button" value="<?php echo L('search');?>" />
</div>
</td>
</tr>
</tbody>
</table>
</form>
</div>
</div>
<div class="pad-lr-10">
<form name="myform" id="myform" action="" method="get" >
<input type="hidden" value="comment" name="m">
<input type="hidden" value="comment_admin" name="c">
<input type="hidden" value="del" name="a">
<input type="hidden" value="<?php echo $tableid?>" name="tableid">
<input type="hidden" value="1" name="dosubmit">
<div class="table-list comment">
<table width="100%">
<thead>
<tr>
<th width="16"><input type="checkbox" value="" id="check_box" onclick="selectall('ids[]');"></th>
<th width="130"><?php echo L('author')?></th>
<th><?php echo L('comment')?></th>
<th width="230"><?php echo L('original').L('title');?></th>
<th width="72"><?php echo L('operations_manage');?></th>
</tr>
</thead>
<tbody class="add_comment">
<?php
if(is_array($data)) {
foreach($data as $v) {
$comment_info = $this->comment_db->get_one(array('commentid'=>$v['commentid']));
if (strpos($v['content'], '<div class="content">') !==false) {
$pos = strrpos($v['content'], '</div>');
$v['content'] = substr($v['content'], $pos+6);
}
?>
<tr id="tbody_<?php echo $v['id']?>">
<td align="center" width="16"><input class="inputcheckbox " name="ids[]" value="<?php echo $v['id'];?>" type="checkbox"></td>
<td width="130"><?php echo $v['username']?><br /><?php echo $v['ip']?></td>
<td><font color="#888888"><?php echo L('chez')?> <?php echo format::date($v['creat_at'], 1)?> <?php echo L('release')?></font><br /><?php echo $v['content']?></td>
<td width="230"><a href="?m=comment&c=comment_admin&a=listinfo&search=1&searchtype=0&keyword=<?php echo urlencode($comment_info['title'])?>&pc_hash=<?php echo $_SESSION['pc_hash']?>&tableid=<?php echo $tableid?>"><?php echo $comment_info['title']?></td>
<td align='center' width="72"><a href="?m=comment&c=comment_admin&a=del&ids=<?php echo $v['id']?>&tableid=<?php echo $tableid?>&dosubmit=1" onclick="return check(<?php echo $v['id']?>, -1, '<?php echo $v['commentid']?>')"><?php echo L('delete');?></a> </td>
</tr>
<?php }
}
?>
</tbody>
</table>
<div class="btn"><label for="check_box"><?php echo L('selected_all');?>/<?php echo L('cancel');?></label>
<input type="hidden" value="<?php echo $_SESSION['pc_hash'];?>" name="pc_hash">
<input type="submit" class="button" value="<?php echo L('delete');?>" />
</div>
<div id="pages"><?php echo $pages;?></div>
</div>
</form>
</div>
<script type="text/javascript">
window.top.$('#display_center_id').css('display','none');
function check(id, type, commentid) {
if(type == -1 && !confirm('<?php echo L('are_you_sure_you_want_to_delete')?>')) {
return false;
}
return true;
}
function show_tbl(obj) {
var pdoname = $(obj).val();
location.href='?m=comment&c=comment_admin&a=listinfo&tableid='+pdoname+'&pc_hash=<?php echo $_SESSION['pc_hash']?>';
}
function confirm_delete(){
if(confirm('<?php echo L('confirm_delete', array('message' => L('selected')));?>')) $('#myform').submit();
}
</script>
</body>
</html> | PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header', 'admin');
?>
<div class="pad-10">
<form action="?m=comment&c=comment_admin&a=init" method="post" id="myform">
<fieldset>
<legend><?php echo L('comments_module_configuration')?></legend>
<table width="100%" class="table_form">
<tr>
<th width="120"><?php echo L('comment_on_whether_to_allow_visitors')?>:</th>
<td class="y-bg"><input type="checkbox" name="guest" value="1" <?php if ($data['guest']){echo 'checked';}?> /></td>
</tr>
<tr>
<th width="120"><?php echo L("check_comment")?>:</th>
<td class="y-bg"><input type="checkbox" name="check" value="1" <?php if ($data['check']){echo 'checked';}?> /></td>
</tr>
<tr>
<th width="120"><?php echo L('whether_to_validate')?>:</th>
<td class="y-bg"><input type="checkbox" name="code" value="1" <?php if ($data['code']){echo 'checked';}?> /></td>
</tr>
<tr>
<th width="120"><?php echo L('comments_on_points_awards')?>:</th>
<td class="y-bg"><input type="input" name="add_point" value="<?php echo isset($data['add_point']) ? $data['add_point'] : '0'?>" /> <?php echo L('to_operate')?></td>
</tr>
<tr>
<th width="120"><?php echo L('be_deleted_from_the_review_points')?>:</th>
<td class="y-bg"><input type="input" name="del_point" value="<?php echo isset($data['del_point']) ? $data['del_point'] : '0'?>" /> <?php echo L('to_operate')?></td>
</tr>
</table>
<div class="bk15"></div>
<input type="submit" id="dosubmit" name="dosubmit" class="button" value="<?php echo L('submit')?>" />
</fieldset>
</form>
</div>
</body>
</html> | PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header', 'admin');
?>
<div class="pad-lr-10">
<div class="comment_button"><a href="?m=comment&c=comment_admin&a=lists&show_center_id=1&commentid=<?php echo $commentid?>&hot=0"<?php if (empty($hot)) {?> class="on"<?php }?>>最新</a> <a href="?m=comment&c=comment_admin&a=lists&show_center_id=1&commentid=<?php echo $commentid?>&hot=1"<?php if ($hot==1) {?> class="on"<?php }?>>最热</a></div>
<div class="btn"><label for="check_box"><?php echo L('select_all')?>/<?php echo L('cancel')?></label></div>
<form action="?" method="get">
<input type="hidden" name="m" value="comment">
<input type="hidden" name="c" value="check">
<input type="hidden" name="a" value="ajax_checks">
<input type="hidden" name="type" value="-1">
<input type="hidden" name="form" value="1">
<input type="hidden" name="commentid" value="<?php echo $commentid?>">
<div class="comment">
<?php if(is_array($list)) foreach($list as $v) :
?>
<div id="tbody_<?php echo $v['id']?>">
<h5 class="title fn" ><span class="rt"><input class="button" type="button" value="<?php echo L('delete')?>" onclick="check(<?php echo $v['id']?>, -1, '<?php echo $v['commentid']?>')" />
</span><input type="checkbox" name="id[]" value="<?php echo $v['id']?>"><?php echo direction($v['direction'])?> <?php echo $v['username']?> (<?php echo $v['ip']?>) <?php echo L('chez')?> <?php echo format::date($v['creat_at'], 1)?> <?php echo L('release')?> <?php echo L('support')?>:<?php echo $v['support']?></h5>
<div class="content">
<pre><?php echo $v['content']?></pre>
</div>
<div class="bk20 hr mb8"></div>
</div>
<?php endforeach;?>
</div>
<div class="btn"><label for="check_box"><input type="checkbox" onclick="selectall('id[]');" id="check_box" style="width:0px;height: 0px;" /><?php echo L('select_all')?>/<?php echo L('cancel')?></label> <input type="submit" onclick="return confirm('<?php echo L('are_you_sure_you_want_to_delete')?>')" class="button" value="<?php echo L('delete')?>" /></div>
</form>
<div id="pages"><?php echo $pages;?></div>
</div>
<script type="text/javascript">
<?php if(!isset($_GET['show_center_id'])) {?> window.top.$('#display_center_id').css('display','none');<?php }?>
function check(id, type, commentid) {
if(type == -1 && !confirm('<?php echo L('are_you_sure_you_want_to_delete')?>')) {
return false;
}
$.get('?m=comment&c=check&a=ajax_checks&id='+id+'&type='+type+'&commentid='+commentid+'&'+Math.random(), function(data){if(data!=1){if(data==0){alert('<?php echo L('illegal_parameters')?>')}else{alert(data)}}else{$('#tbody_'+id).remove();}});
}
</script>
</body>
</html> | PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header', 'admin');
?>
<div class="pad_10">
<div class="subnav">
<h1 class="title-2"><?php echo L('comment_check')?> (<?php echo L('for_audit_several')?>:<span id="wait" style="color:red"><?php echo $total?></span>)</h1>
</div>
</div>
<div class="pad-lr-10">
<div class="comment">
<?php if(is_array($comment_check_data)) foreach($comment_check_data as $v) :
$this->comment_data_db->table_name($v['tableid']);
$data = $this->comment_data_db->get_one(array('id'=>$v['comment_data_id'], 'siteid'=>$this->get_siteid()));
?>
<div id="tbody_<?php echo $data['id']?>">
<h5 class="title fn" ><span class="rt"><input type="button" value="<?php echo L('pass')?>" class="button" onclick="check(<?php echo $data['id']?>, 1, '<?php echo $data['commentid']?>')" /> <input class="button" type="button" value="<?php echo L('delete')?>" onclick="check(<?php echo $data['id']?>, -1, '<?php echo $data['commentid']?>')" />
</span><?php echo $data['username']?> (<?php echo $data['ip']?>) <?php echo L('chez')?> <?php echo format::date($data['creat_at'], 1)?> <?php echo L('release')?> </h5>
<div class="content">
<pre><?php echo $data['content']?></pre>
</div>
<div class="bk20 hr mb8"></div>
</div>
<?php endforeach;?>
</div>
</div>
<script type="text/javascript">
window.top.$('#display_center_id').css('display','none');
function check(id, type, commentid) {
if(type == -1 && !confirm('<?php echo L('are_you_sure_you_want_to_delete')?>')) {
return false;
}
$.get('?m=comment&c=check&a=ajax_checks&id='+id+'&type='+type+'&commentid='+commentid+'&'+Math.random(), function(data){if(data!=1){if(data==0){alert('<?php echo L('illegal_parameters')?>')}else{alert(data)}}else{$('#tbody_'+id).remove();
$.getJSON('?m=comment&c=check&a=public_get_one&'+Math.random(), function(data){
if (data) {
$('#wait').html(data.total);
val = data.data;
if (val.content) {
html = '<div id="tbody_'+val.id+'"><h5 class="title fn" ><span class="rt"><input type="button" value="<?php echo L('pass')?>" class="button" onclick="check('+val.id+', 1, \''+val.commentid+'\')" /> <input class="button" type="button" value="<?php echo L('delete')?>" onclick="check('+val.id+', -1, \''+val.commentid+'\')" /></span>'+val.username+' ('+val.ip+') <?php echo L('chez')?> '+val.creat_at+' <?php echo L('release')?> </h5><div class="content"><pre>'+val.content+'</pre></div><div class="bk20 hr mb8"></div></div>';
$('.comment').append(html);
}
}
});
}});
}
</script>
</body>
</html> | PHP |
<?php
defined('IN_PHPCMS') or exit('No permission resources.');
class index {
protected $commentid, $modules, $siteid, $format;
function __construct() {
pc_base::load_app_func('global');
pc_base::load_sys_class('format', '', 0);
$this->commentid = isset($_GET['commentid']) && trim(urldecode($_GET['commentid'])) ? trim(urldecode($_GET['commentid'])) : $this->_show_msg(L('illegal_parameters'));
$this->commentid = safe_replace($this->commentid);
$this->format = isset($_GET['format']) ? $_GET['format'] : '';
list($this->modules, $this->contentid, $this->siteid) = decode_commentid($this->commentid);
define('SITEID', $this->siteid);
}
public function init() {
$hot = isset($_GET['hot']) && intval($_GET['hot']) ? intval($_GET['hot']) : 0;
pc_base::load_sys_class('form');
$commentid =& $this->commentid;
$modules =& $this->modules;
$contentid =& $this->contentid;
$siteid =& $this->siteid;
$username = param::get_cookie('_username',L('phpcms_friends'));
$userid = param::get_cookie('_userid');
$comment_setting_db = pc_base::load_model('comment_setting_model');
$setting = $comment_setting_db->get_one(array('siteid'=>$this->siteid));
//SEO
$SEO = seo($siteid, '', $title);
//通过API接口调用数据的标题、URL地址
if (!$data = get_comment_api($commentid)) {
$this->_show_msg(L('illegal_parameters'));
} else {
$title = $data['title'];
$url = $data['url'];
if (isset($data['allow_comment']) && empty($data['allow_comment'])) {
showmessage(L('canot_allow_comment'));
}
unset($data);
}
if (isset($_GET['iframe'])) {
if (strpos($url,APP_PATH) === 0) {
$domain = APP_PATH;
} else {
$urls = parse_url($url);
$domain = $urls['scheme'].'://'.$urls['host'].(isset($urls['port']) && !empty($urls['port']) ? ":".$urls['port'] : '').'/';
}
include template('comment', 'show_list');
} else {
include template('comment', 'list');
}
}
public function post() {
$comment = pc_base::load_app_class('comment');
$id = isset($_GET['id']) && intval($_GET['id']) ? intval($_GET['id']) : '';
$SITE = siteinfo($this->siteid);
$username = param::get_cookie('_username',$SITE['name'].L('phpcms_friends'));
$userid = param::get_cookie('_userid');
$comment_setting_db = pc_base::load_model('comment_setting_model');
$setting = $comment_setting_db->get_one(array('siteid'=>$this->siteid));
if (!empty($setting)) {
//是否允许游客
if (!$setting['guest']) {
if (!$username || !$userid) {
$this->_show_msg(L('landing_users_to_comment'), HTTP_REFERER);
}
}
if ($setting['code']) {
$session_storage = 'session_'.pc_base::load_config('system','session_storage');
pc_base::load_sys_class($session_storage);
session_start();
$code = isset($_POST['code']) && trim($_POST['code']) ? strtolower(trim($_POST['code'])) : $this->_show_msg(L('please_enter_code'), HTTP_REFERER);
if ($code != $_SESSION['code']) {
$this->_show_msg(L('code_error'), HTTP_REFERER);
}
}
}
//通过API接口调用数据的标题、URL地址
if (!$data = get_comment_api($this->commentid)) {
$this->_show_msg(L('illegal_parameters'));
} else {
$title = $data['title'];
$url = $data['url'];
unset($data);
}
if (strpos($url,APP_PATH) === 0) {
$domain = APP_PATH;
} else {
$urls = parse_url($url);
$domain = $urls['scheme'].'://'.$urls['host'].(isset($urls['port']) && !empty($urls['port']) ? ":".$urls['port'] : '').'/';
}
$content = isset($_POST['content']) && trim($_POST['content']) ? trim($_POST['content']) : $this->_show_msg(L('please_enter_content'), HTTP_REFERER);
$direction = isset($_POST['direction']) && intval($_POST['direction']) ? intval($_POST['direction']) : '';
$data = array('userid'=>$userid, 'username'=>$username, 'content'=>$content, 'direction'=>$direction);
$comment->add($this->commentid, $this->siteid, $data, $id, $title, $url);
$this->_show_msg($comment->get_error()."<iframe width='0' id='top_src' height='0' src='$domain/js.html?200'></iframe>", (in_array($comment->msg_code, array(0,7)) ? HTTP_REFERER : ''), (in_array($comment->msg_code, array(0,7)) ? 1 : 0));
}
public function support() {
$id = isset($_GET['id']) && intval($_GET['id']) ? intval($_GET['id']) : $this->_show_msg(L('illegal_parameters'), HTTP_REFERER);
if (param::get_cookie('comment_'.$id)) {
$this->_show_msg(L('dragonforce'), HTTP_REFERER);
}
$comment = pc_base::load_app_class('comment');
if ($comment->support($this->commentid, $id)) {
param::set_cookie('comment_'.$id, $id, SYS_TIME+3600);
}
$this->_show_msg($comment->get_error(), ($comment->msg_code == 0 ? HTTP_REFERER : ''), ($comment->msg_code == 0 ? 1 : 0));
}
public function ajax() {
$commentid =& $this->commentid;
$siteid =& $this->siteid;
$num = isset($_GET['num']) && intval($_GET['num']) ? intval($_GET['num']) : 20;
$direction = isset($_GET['direction']) && intval($_GET['direction']) ? intval($_GET['direction']) : 0;
$pc_tag = pc_base::load_app_class('comment_tag');
$comment = array();
if ($comment = $pc_tag->get_comment(array('commentid'=>$commentid))) {
$page = isset($_GET['page']) && intval($_GET['page']) ? intval($_GET['page']) : 1;
$offset = ($page-1)*$num;
$data = array('commentid'=>$commentid, 'site'=>$siteid, 'limit'=>$offset.','.$num, 'direction'=>$direction);
$comment['data'] = $pc_tag->lists($data);
pc_base::load_sys_class('format', '', 0);
foreach ($comment['data'] as $k=>$v) {
$comment['data'][$k]['format_time'] = format::date($v['creat_at'], 1);
}
switch ($direction) {
case '1'://正
$total = $comment['square'];
break;
case '2'://反
$total = $comment['anti'];
break;
case '3'://中
$total = $comment['neutral'];
break;
default:
$total = $comment['total'];
break;
}
$comment['pages'] = pages($total, $page, $num, 'javascript:comment_next_page({$page})');
if (pc_base::load_config('system', 'charset') == 'gbk') {
$comment = array_iconv($comment, 'gbk', 'utf-8');
}
echo json_encode($comment);
} else {
exit('0');
}
}
//提示信息处理
protected function _show_msg($msg, $url = '', $status = 0) {
switch ($this->format) {
case 'json':
$msg = pc_base::load_config('system', 'charset') == 'gbk' ? iconv('gbk', 'utf-8', $msg) : $msg;
echo json_encode(array('msg'=>$msg, 'status'=>$status));
exit;
break;
case 'jsonp':
$msg = pc_base::load_config('system', 'charset') == 'gbk' ? iconv('gbk', 'utf-8', $msg) : $msg;
echo trim_script($_GET['callback']).'('.json_encode(array('msg'=>$msg, 'status'=>$status)).')';
exit;
break;
default:
showmessage($msg, $url);
break;
}
}
} | PHP |
<?php
class comment_tag {
//数据库连接
private $comment_db, $comment_setting_db, $comment_data_db, $comment_table_db;
public function __construct() {
$this->comment_db = pc_base::load_model('comment_model');
$this->comment_setting_db = pc_base::load_model('comment_setting_model');
$this->comment_data_db = pc_base::load_model('comment_data_model');
$this->comment_table_db = pc_base::load_model('comment_table_model');
}
/**
*
* PC标签数据数量计算函数
* @param array $data PC标签中的配置参数传入
*/
public function count($data) {
if($data['action']=='get_comment') return 0;
$commentid = $data['commentid'];
if (empty($commentid)) return false;
$siteid = $data['siteid'];
if (empty($siteid)) {
pc_base::load_app_func('global', 'comment');
list($module,$contentid, $siteid) = decode_commentid($commentid);
}
$comment = $this->comment_db->get_one(array('commentid'=>$commentid, 'siteid'=>$siteid));
if (!$comment) return false;
//是否按评论方向获取
$direction = isset($data['direction']) && intval($data['direction']) ? intval($data['direction']) : 0;
switch ($direction) {
case 1://正方
return $comment['square'];
break;
case 2://反方
return $comment['anti'];
break;
case 3://中立方
return $comment['neutral'];
break;
default://获取所有
return $comment['total'];
}
}
/**
*
* 获取评论总表信息
* @param array $data PC标签中的配置参数传入
*/
public function get_comment($data) {
$commentid = $data['commentid'];
if (empty($commentid)) return false;
return $this->comment_db->get_one(array('commentid'=>$commentid));
}
/**
*
* 获取评论数据
* @param array $data PC标签中的配置参数传入
*/
public function lists($data) {
$commentid = $data['commentid'];
if (empty($commentid)) return false;
$siteid = $data['siteid'];
if (empty($siteid)) {
pc_base::load_app_func('global', 'comment');
list($module,$contentid, $siteid) = decode_commentid($commentid);
}
$comment = $this->comment_db->get_one(array('commentid'=>$commentid, 'siteid'=>$siteid));
if (!$comment) return false;
//设置存储数据表
$this->comment_data_db->table_name($comment['tableid']);
$hot = 'id';
if (isset($data['hot']) && !empty($data['hot'])) {
$hot = 'support desc, id';
}
//是否按评论方向获取
$direction = isset($data['direction']) && intval($data['direction']) ? intval($data['direction']) : 0;
if (!in_array($direction, array(0,1,2,3))) {
$direction = 0;
}
switch ($direction) {
case 1://正方
$sql = array('commentid'=>$commentid, 'direction'=>1, 'status'=>1);
break;
case 2://反方
$sql = array('commentid'=>$commentid, 'direction'=>2, 'status'=>1);
break;
case 3://中立方
$sql = array('commentid'=>$commentid, 'direction'=>3, 'status'=>1);
break;
default://获取所有
$sql = array('commentid'=>$commentid, 'status'=>1);
}
return $this->comment_data_db->select($sql, '*', $data['limit'], $hot.' desc ');
}
/**
*
* 评论排行榜
* @param array $data PC标签中的配置参数传入
*/
public function bang($data) {
$data['limit'] = intval($data['limit']);
if (!isset($data['limit']) || empty($data['limit'])) {
$data['limit'] = 10;
}
$sql = array();
$data['siteid'] = intval($data['siteid']);
if (isset($data['siteid']) && !empty($data['siteid'])) {
$sql = array('siteid'=>$data['siteid']);
}
return $this->comment_db->select($sql, "*", $data['limit'], "total desc");
}
/**
*
* PC标签,可视化显示参数配置。
*/
public function pc_tag() {
$sites = pc_base::load_app_class('sites','admin');
$sitelist = $sites->pc_tag_list();
return array(
'action'=>array('lists'=>L('list','', 'comment'), 'get_comment'=>L('comments_on_the_survey', '', 'comment'), 'bang'=>L('comment_bang', '', 'comment')),
'lists'=>array(
'commentid'=>array('name'=>L('comments_id', '', 'comment'),'htmltype'=>'input', 'validator'=>array('min'=>1)),
'siteid'=>array('name'=>L('site_id', '', 'comment'),'htmltype'=>'input_select', 'data'=>$sitelist,'validator'=>array('min'=>1)),
'direction'=>array('name'=>L('comments_direction', '', 'comment'), 'htmltype'=>'select', 'data'=>array('0'=>L('jiushishuo', '', 'comment'), '1'=>L('tetragonal', '', 'comment'), '2'=>L('cons', '', 'comment'), '3'=>L('neutrality', '', 'comment'))),
'hot'=>array('name'=>L('sort', '', 'comment'), 'htmltype'=>'select','data'=>array('0'=>L('new', '', 'comment'), '1'=>L('hot', '', 'comment'))),
),
'get_comment'=>array('commentid'=>array('name'=>L('comments_id', '', 'comment'),'htmltype'=>'input', 'defaultdata'=>'$commentid')),
);
}
} | PHP |
<?php
/**
* 评论操作类
* @author chenzhouyu
*
*/
class comment {
//数据库连接
private $comment_db, $comment_setting_db, $comment_data_db, $comment_table_db, $comment_check_db;
public $msg_code = 0;
public function __construct() {
$this->comment_db = pc_base::load_model('comment_model');
$this->comment_setting_db = pc_base::load_model('comment_setting_model');
$this->comment_data_db = pc_base::load_model('comment_data_model');
$this->comment_table_db = pc_base::load_model('comment_table_model');
$this->comment_check_db = pc_base::load_model('comment_check_model');
}
/**
* 添加评论
* @param string $commentid 评论ID
* @param integer $siteid 站点ID
* @param array $data 内容数组应该包括array('userid'=>用户ID,'username'=>用户名,'content'=>内容,'direction'=>方向(0:没有方向 ,1:正方,2:反方,3:中立))
* @param string $id 回复评论的内容
* @param string $title 文章标题
* @param string $url 文章URL地址
*/
public function add($commentid, $siteid, $data, $id = '', $title = '', $url = '') {
//开始查询评论这条评论是否存在。
$title = new_addslashes($title);
if (!$comment = $this->comment_db->get_one(array('commentid'=>$commentid, 'siteid'=>$siteid), 'tableid, commentid')) { //评论不存在
//取得当前可以使用的内容数据表
$r = $this->comment_table_db->get_one('', 'tableid, total', 'tableid desc');
$tableid = $r['tableid'];
if ($r['total'] >= 1000000) {
//当上一张数据表存的数据已经达到1000000时,创建新的数据存储表,存储数据。
if (!$tableid = $this->comment_table_db->creat_table()) {
$this->msg_code = 4;
return false;
}
}
//新建评论到评论总表中。
$comment_data = array('commentid'=>$commentid, 'siteid'=>$siteid, 'tableid'=>$tableid, 'display_type'=>($data['direction']>0 ? 1 : 0));
if (!empty($title)) $comment_data['title'] = $title;
if (!empty($url)) $comment_data['url'] = $url;
if (!$this->comment_db->insert($comment_data)) {
$this->msg_code = 5;
return false;
}
} else {//评论存在时
$tableid = $comment['tableid'];
}
if (empty($tableid)) {
$this->msg_code = 1;
return false;
}
//为数据存储数据模型设置 数据表名。
$this->comment_data_db->table_name($tableid);
//检查数据存储表。
if (!$this->comment_data_db->table_exists('comment_data_'.$tableid)) {
//当存储数据表不存时,尝试创建数据表。
if (!$tableid = $this->comment_table_db->creat_table($tableid)) {
$this->msg_code = 2;
return false;
}
}
//向数据存储表中写入数据。
$data['commentid'] = $commentid;
$data['siteid'] = $siteid;
$data['ip'] = ip();
$data['status'] = 1;
$data['creat_at'] = SYS_TIME;
//对评论的内容进行关键词过滤。
$data['content'] = strip_tags($data['content']);
$badword = pc_base::load_model('badword_model');
$data['content'] = $badword->replace_badword($data['content']);
if ($id) {
$r = $this->comment_data_db->get_one(array('id'=>$id));
if ($r) {
pc_base::load_sys_class('format', '', 0);
if ($r['reply']) {
$data['content'] = '<div class="content">'.str_replace('<span></span>', '<span class="blue f12">'.$r['username'].' '.L('chez').' '.format::date($r['creat_at'], 1).L('release').'</span>', $r['content']).'</div><span></span>'.$data['content'];
} else {
$data['content'] = '<div class="content"><span class="blue f12">'.$r['username'].' '.L('chez').' '.format::date($r['creat_at'], 1).L('release').'</span><pre>'.$r['content'].'</pre></div><span></span>'.$data['content'];
}
$data['reply'] = 1;
}
}
//判断当前站点是否需要审核
$site = $this->comment_setting_db->site($siteid);
if ($site['check']) {
$data['status'] = 0;
}
if ($comment_data_id = $this->comment_data_db->insert($data, true)) {
//需要审核,插入到审核表
if ($data['status']==0) {
$this->comment_check_db->insert(array('comment_data_id'=>$comment_data_id, 'siteid'=>$siteid,'tableid'=>$tableid));
} elseif (!empty($data['userid']) && !empty($site['add_point']) && module_exists('pay')) { //不需要审核直接给用户添加积分
pc_base::load_app_class('receipts', 'pay', 0);
receipts::point($site['add_point'], $data['userid'], $data['username'], '', 'selfincome', 'Comment');
}
//开始更新数据存储表数据总条数
$this->comment_table_db->edit_total($tableid, '+=1');
//开始更新评论总表数据总数
$sql['lastupdate'] = SYS_TIME;
//只有在评论通过的时候才更新评论主表的评论数
if ($data['status'] == 1) {
$sql['total'] = '+=1';
switch ($data['direction']) {
case 1: //正方
$sql['square'] = '+=1';
break;
case 2://反方
$sql['anti'] = '+=1';
break;
case 3://中立方
$sql['neutral'] = '+=1';
break;
}
}
$this->comment_db->update($sql, array('commentid'=>$commentid));
if ($site['check']) {
$this->msg_code = 7;
} else {
$this->msg_code = 0;
}
return true;
} else {
$this->msg_code = 3;
return false;
}
}
/**
* 支持评论
* @param integer $commentid 评论ID
* @param integer $id 内容ID
*/
public function support($commentid, $id) {
if ($data = $this->comment_db->get_one(array('commentid'=>$commentid), 'tableid')) {
$this->comment_data_db->table_name($data['tableid']);
if ($this->comment_data_db->update(array('support'=>'+=1'), array('id'=>$id))) {
$this->msg_code = 0;
return true;
} else {
$this->msg_code = 3;
return false;
}
} else {
$this->msg_code = 6;
return false;
}
}
/**
* 更新评论的状态
* @param string $commentid 评论ID
* @param integer $id 内容ID
* @param integer $status 状态{1:通过 ,0:未审核, -1:不通过,将做删除操作}
*/
public function status($commentid, $id, $status = -1) {
if (!$comment = $this->comment_db->get_one(array('commentid'=>$commentid), 'tableid, commentid')) {
$this->msg_code = 6;
return false;
}
//为数据存储数据模型设置 数据表名。
$this->comment_data_db->table_name($comment['tableid']);
if (!$comment_data = $this->comment_data_db->get_one(array('id'=>$id, 'commentid'=>$commentid))) {
$this->msg_code = 6;
return false;
}
//读取评论的站点配置信息
$site = $this->comment_setting_db->get_one(array('siteid'=>$comment_data['siteid']));
if ($status == 1) {//通过的时候
$sql['total'] = '+=1';
switch ($comment_data['direction']) {
case 1: //正方
$sql['square'] = '+=1';
break;
case 2://反方
$sql['anti'] = '+=1';
break;
case 3://中立方
$sql['neutral'] = '+=1';
break;
}
//当评论被设置为通过的时候,更新评论总表的数量。
$this->comment_db->update($sql, array('commentid'=>$comment['commentid']));
//更新评论内容状态
$this->comment_data_db->update(array('status'=>$status), array('id'=>$id, 'commentid'=>$commentid));
//当评论用户ID不为空,而且站点配置了积分添加项,支付模块也存在的时候,为用户添加积分。
if (!empty($comment_data['userid']) && !empty($site['add_point']) && module_exists('pay')) {
pc_base::load_app_class('receipts', 'pay', 0);
receipts::point($site['add_point'], $comment_data['userid'], $comment_data['username'], '', 'selfincome', 'Comment');
}
} elseif ($status == -1) { //删除数据
//如果数据原有状态为已经通过,需要删除评论总表中的总数
if ($comment_data['status'] == 1) {
$sql['total'] = '-=1';
switch ($comment_data['direction']) {
case '1': //正方
$sql['square'] = '-=1';
break;
case '2'://反方
$sql['anti'] = '-=1';
break;
case '3'://中立方
$sql['neutral'] = '-=1';
break;
}
$this->comment_db->update($sql, array('commentid'=>$comment['commentid']));
}
//删除存储表的数据
$this->comment_data_db->delete(array('id'=>$id, 'commentid'=>$commentid));
//删除存储表总数记录
$this->comment_table_db->edit_total($comment['tableid'], '-=1');
//当评论ID不为空,站点配置了删除的点数,支付模块存在的时候,删除用户的点数。
if (!empty($comment_data['userid']) && !empty($site['del_point']) && module_exists('pay')) {
pc_base::load_app_class('spend', 'pay', 0);
$op_userid = param::get_cookie('userid');
$op_username = param::get_cookie('admin_username');
spend::point($site['del_point'], L('comment_point_del', '', 'comment'), $comment_data['userid'], $comment_data['username'], $op_userid, $op_username);
}
}
//删除审核表中的数据
$this->comment_check_db->delete(array('comment_data_id'=>$id));
$this->msg_code = 0;
return true;
}
/**
*
* 删除评论
* @param string $commentid 评论ID
* @param intval $siteid 站点ID
* @param intval $id 内容ID
* @param intval $catid 栏目ID
*/
public function del($commentid, $siteid, $id, $catid) {
if ($commentid != id_encode('content_'.$catid, $id, $siteid)) return false;
//循环评论内容表删除commentid的评论内容
for ($i=1; ;$i++) {
$table = 'comment_data_'.$i; //构建评论内容存储表名
if ($this->comment_data_db->table_exists($table)) { //检查构建的表名是否存在,如果存在执行删除操作
$this->comment_data_db->table_name($i);
$this->comment_data_db->delete(array('commentid'=>$commentid));
} else { //不存在,则退出循环
break;
}
}
$this->comment_db->delete(array('commentid'=>$commentid)); //删除评论主表的内容
return true;
}
/**
*
* 获取报错的详细信息。
*/
public function get_error() {
$msg = array('0'=>L('operation_success'),
'1'=>L('coment_class_php_1'),
'2'=>L('coment_class_php_2'),
'3'=>L('coment_class_php_3'),
'4'=>L('coment_class_php_4'),
'5'=>L('coment_class_php_5'),
'6'=>L('coment_class_php_6'),
'7'=>L('coment_class_php_7'),
);
return $msg[$this->msg_code];
}
} | PHP |
<?php
defined('IN_PHPCMS') or exit('Access Denied');
defined('INSTALL') or exit('Access Denied');
return array('comment', 'comment_check', 'comment_data', 'comment_setting', 'comment_table');
?> | PHP |
<?php
defined('IN_PHPCMS') or exit('Access Denied');
defined('INSTALL') or exit('Access Denied');
return array (
'show_list.html' => '内容页评论列表',
'list.html' => '评论列表',
);
?> | PHP |
<?php
defined('IN_PHPCMS') or exit('Access Denied');
defined('INSTALL') or exit('Access Denied');
$parentid = $menu_db->insert(array('name'=>'comment', 'parentid'=>'29', 'm'=>'comment', 'c'=>'comment_admin', 'a'=>'init', 'data'=>'', 'listorder'=>0, 'display'=>'1'), true);
$mid = $menu_db->insert(array('name'=>'comment_manage', 'parentid'=>'821', 'm'=>'comment', 'c'=>'comment_admin', 'a'=>'listinfo', 'data'=>'', 'listorder'=>0, 'display'=>'1'), true);
$menu_db->insert(array('name'=>'comment_check', 'parentid'=>$mid, 'm'=>'comment', 'c'=>'check', 'a'=>'checks', 'data'=>'', 'listorder'=>0, 'display'=>'1'));
$menu_db->insert(array('name'=>'comment_list', 'parentid'=>$parentid, 'm'=>'comment', 'c'=>'comment_admin', 'a'=>'lists', 'data'=>'', 'listorder'=>0, 'display'=>'0'));
$language = array('comment'=>'评论', 'comment_mange'=>'评论管理', 'comment_check'=>'评论审核', 'comment_list'=>'评论列表');
?> | PHP |
<?php
defined('IN_PHPCMS') or exit('Access Denied');
defined('INSTALL') or exit('Access Denied');
$module = 'comment';
$modulename = '评论';
$introduce = '评论模块';
$author = 'phpcms team';
$authorsite = 'http://www.phpcms.cn';
$authoremail = '';
?> | PHP |
<?php
$LANG['coment_class_php_1'] = '没有获取到正常的数据存储表。';
$LANG['coment_class_php_2'] = '数据存储表不存在,并在尝试创建数据存储表时出现错误,请联系管理员。';
$LANG['coment_class_php_3'] = '写入数据存储表时出错,请联系管理员。';
$LANG['coment_class_php_4'] = '自动创建数据存储表时出错,请联系管理员。';
$LANG['coment_class_php_5'] = '尝试添加评论数据时出错,请联系管理员。';
$LANG['coment_class_php_6'] = '评论没有找到。';
$LANG['coment_class_php_7'] = '评论发表成功,需要等待管理员审核,才会显示。';
$LANG['phpcms_friends'] = '网友';
$LANG['no_comment'] = '评论没有找到!';
$LANG['no_check_comments'] = '没有待审评论。';
$LANG['comments_module_configuration'] = '评论模块配置';
$LANG['comment_on_whether_to_allow_visitors'] = '是否允许游客评论';
$LANG['check_comment'] = '是否需要审核';
$LANG['whether_to_validate'] = '是否开启验证码';
$LANG['chez'] = '于';
$LANG['release'] = '发布';
$LANG['are_you_sure_you_want_to_delete'] = '您确定删除吗?';
$LANG['for_audit_several'] = '待审核数';
$LANG['pass'] = '通过';
$LANG['list'] = '列表';
$LANG['comments_on_the_survey'] = '评论概况';
$LANG['count'] = '计数';
$LANG['comments_id'] = '评论ID';
$LANG['site_id'] = '站点ID';
$LANG['comments_direction'] = '评论方向';
$LANG['jiushishuo'] = '无方向';
$LANG['tetragonal'] = '正方';
$LANG['cons'] = '反方';
$LANG['neutrality'] = '中立';
$LANG['sort'] = '排序';
$LANG['new'] = '最新';
$LANG['hot'] = '最热';
$LANG['support'] = '支持数';
$LANG['landing_users_to_comment'] = '登陆用户才可发表评论。';
$LANG['code_error'] = '验证码错误!';
$LANG['please_enter_code'] = '请输入验证码。';
$LANG['comment_bang'] = '评论排行榜';
$LANG['please_enter_content'] = '请输入内容。';
$LANG['dragonforce'] = '已经支持过了。';
$LANG['comment_point_del'] = '评论被删除,扣除积分。';
$LANG['comments_on_points_awards'] = '评论积分奖励';
$LANG['be_deleted_from_the_review_points'] = '评论被删除扣除积分';
$LANG['to_operate'] = ' 分,0为不操作。';
$LANG['canot_allow_comment'] = ' 该文不可评论。';
$LANG['please_chose_comment'] = '请选择评论,再进行删除操作。'; | PHP |
<?php
/**
* 解析评论ID
* @param $commentid 评论ID
*/
function decode_commentid($commentid) {
return explode('-', $commentid);
}
/**
* 方向生成
* @param $direction
*/
function direction($direction) {
switch($direction){
case 1:
return '<img src="'.IMG_PATH.'/icon/zheng.png" />';
break;
case 2:
return '<img src="'.IMG_PATH.'/icon/fan.png" />';
break;
case 3:
return '<img src="'.IMG_PATH.'/icon/zhong.png" />';
break;
}
}
/**
* 通过API接口调用标题和URL数据
* @param string $commentid 评论ID
* @return array($title, $url) 返回数据
*/
function get_comment_api($commentid) {
list($modules, $contentid, $siteid) = id_decode($commentid);
if (empty($modules) || empty($siteid) || empty($contentid)) {
return false;
}
$comment_api = '';
$module = explode('_', $modules);
$comment_api = pc_base::load_app_class('comment_api', $module[0]);
if (empty($comment_api)) return false;
return $comment_api->get_info($modules, $contentid, $siteid);
} | PHP |
<script src="<?php echo JS_PATH;?>colorpicker.js" type="text/javascript" language="javascript"></script>
<?php echo $html?>
<link rel="stylesheet" type="text/css" href="<?php echo CSS_PATH?>admin_visualization.css" />
</body>
</html> | PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
$show_validator = $show_scroll = $show_dialog = 1;
include $this->admin_tpl('header', 'admin');
?>
<form method="post" action="?m=special&c=special&a=add" id="myform">
<div class="pad-10">
<div class="col-tab">
<ul class="tabBut cu-li">
<li id="tab_setting_1" class="on" onclick="SwapTab('setting','on','',6,1);"><?php echo L('catgory_basic', '', 'admin');?></li>
<li id="tab_setting_2" onclick="SwapTab('setting','on','',6,2);"><?php echo L('extend_setting')?></li>
</ul>
<div id="div_setting_1" class="contentList pad-10">
<table width="100%" class="table_form ">
<tbody>
<tr>
<th width="200"><?php echo L('special_title')?>:</th>
<td><input name="special[title]" id="title" class="input-text" type="text" size="40"></td>
</tr>
<tr>
<th><?php echo L('special_banner')?>:</th>
<td><?php echo form::images('special[banner]', 'banner', '', 'special', '', 40)?></td>
</tr>
<tr>
<th><?php echo L('sepcial_thumb')?>:</th>
<td><?php echo form::images('special[thumb]', 'thumb', '', 'special', '', 40, '', '', '', array(350, 350))?></td>
</tr>
<tr>
<th><?php echo L('special_intro')?>:</th>
<td><textarea name="special[description]" id="description" cols="50" rows="6"></textarea></td>
</tr>
<tr>
<th align="right" valign="top"><?php echo L('ishtml')?>:</th>
<td valign="top"><?php echo form::radio(array('0'=>L('no'), '1'=>L('yes')),'1', 'name="special[ishtml]"');?>
</td>
</tr>
<tr id="file_div" style="display:'block';">
<th align="right" valign="top"><?php echo L('special_filename')?>:<br /><span style="font-size:9px;color:#ff4400"><?php echo L('submit_no_edit')?></span></th>
<td valign="top"><input type="text" name="special[filename]" id="filename" class="input-text" value="<?php echo $info['filename']?>" size="20">
</td>
</tr>
<tr>
<th><?php echo L('special_type')?>:<a href="javascript:addItem()" title="<?php echo L('add')?>"><span style="color:red;" >+</span></a></th>
<td valign="top"><div id="option_list">
<div class="mb6"><span><?php echo L('type_name')?>:<input type="text" id="type_name" name="type[1][name]" class="input-text" size="15"> <?php echo L('type_path')?>:<input type="text" name="type[1][typedir]" id="type_path" class="input-text" size="15"> <?php echo L('listorder')?>:<input type="text" name="type[<?php echo $k?>][listorder]" value="1" size="6" class="input-text" ></span> <span id="typeTip"></span></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div id="div_setting_2" class="contentList pad-10 hidden">
<table width="100%" class="table_form ">
<tr>
<th width="200"><?php echo L('pics_news')?>:</th>
<td><span id="relation"></span><input type="button" class="button" value="<?php echo L('choose_pic_news')?>" onclick="import_info('?m=special&c=special&a=public_get_pics','<?php echo L('choose_pic_news')?>', 'msg_id', 'relation', 'pics');"><input type="hidden" name="special[pics]" value="" id="pics"><span class="onShow">(<?php echo L('choose_pic_model')?>)</span></td>
</tr>
<tr>
<th><?php echo L('add_vote')?>:</th>
<td><span id="vote_msg"></span><input type="button" class="button" value="<?php echo L('choose_exist_vote')?>" onclick="import_info('?m=vote&c=vote&a=public_get_votelist&from_api=1&target=dialog','<?php echo L('choose_vote')?>', 'msg_id', 'vote_msg', 'voteid');"><input type="hidden" name="special[voteid]" value="" id="voteid"> <input type="button" class="button" value="<?php echo L('add_new_vote')?>" onclick="import_info('?m=vote&c=vote&a=add&from_api=1&target=dialog','<?php echo L('add_new_vote')?>', 'subject_title', 'vote_msg', 'voteid');"></td>
</tr>
<tr>
<th align="right" valign="top"><?php echo L('index_page')?>:</th>
<td valign="top"><?php echo form::radio(array('0'=>L('no'), '1'=>L('yes')), '0', 'name="special[ispage]"');?>
</td>
</tr>
<tr>
<th align="right" valign="top"><?php echo L('special_status')?>:</th>
<td valign="top"><?php echo form::radio(array('0'=>L('open'), '1'=>L('pause')), '0', 'name="special[disabled]"');?>
</td>
</tr>
<tr>
<th align="right" valign="top"><?php echo L('template_style')?>:</th>
<td valign="top"><?php echo form::select($template_list, $info['default_style'], 'name="special[style]" id="style" onchange="load_file_list(this.value)"', L('please_select'))?>
<script type="text/javascript">$.getJSON('?m=admin&c=category&a=public_tpl_file_list&style=<?php echo $info['default_style']?>&module=special&templates=index|list|show&name=special', function(data){$('#index_template').html(data.index_template);$('#list_template').html(data.list_template);$('#show_template').html(data.show_template);});</script>
</td>
</tr>
<tr>
<th align="right" valign="top"><?php echo L('special_template')?>:</th>
<td valign="top" id="index_template"><?php echo form::select_template('default', 'special', '', 'name="special[index_template]"', 'index');?>
</td>
</tr>
<tr>
<th align="right" valign="top"><?php echo L('special_type_template')?>:</th>
<td valign="top" id="list_template"><?php echo form::select_template('default', 'special', '', 'name="special[list_template]"', 'list');?>
</td>
</tr>
<tr>
<th align="right" valign="top"><?php echo L('special_content_template')?>:</th>
<td valign="top" id="show_template"><?php echo form::select_template('default', 'special', '', 'name="special[show_template]"', 'show');?>
</td>
</tr>
</table>
</div>
<div class="bk15"></div>
<input name="dosubmit" type="submit" value="<?php echo L('submit')?>" class="button">
</div></div>
</form>
</body>
</html>
<script type="text/javascript">
function load_file_list(id) {
$.getJSON('?m=admin&c=category&a=public_tpl_file_list&style='+id+'&module=special&templates=index|list|show&name=special', function(data){$('#index_template').html(data.index_template);$('#list_template').html(data.list_template);$('#show_template').html(data.show_template);});
}
function import_info(url, title, msgID, htmlID, valID) {
window.top.art.dialog({id:'selectid',iframe:url, title:title, width:'600', height:'400', lock:true},
function(){
var d = window.top.art.dialog({id:'selectid'}).data.iframe;
var form = d.document.getElementById(msgID);
var text = form.value;
var data = text.split('|');
if (data[2]) {
$('#'+htmlID).html('<ul id="relation_'+htmlID+'" class="list-dot"><li><span>'+data[2]+'</span><a onclick="remove_relation(\''+htmlID+'\', \''+valID+'\')" class="close" href="javascript:;"></a></li></ul>');
} else {
var dosubmit = d.document.getElementById('dosubmit');
dosubmit.click();
$('#'+htmlID).html('<ul id="relation_'+htmlID+'" class="list-dot"><li><span>'+text+'</span><a onclick="remove_relation(\''+htmlID+'\', \''+valID+'\')" class="close" href="javascript:;"></a></li></ul>');
}
$('#'+valID).val(text);
window.top.art.dialog({id:'selectid'}).close();
return false;
},
function(){
window.top.art.dialog({id:'selectid'}).close();
});void(0);
}
function remove_relation(htmlID, valID) {
$('#relation_'+htmlID).html('');
$('#'+valID).val('');
}
function addItem() {
var n = $('#option_list').find('input[name]').length/3+1;
var newOption = '<div class="mb6"><span><?php echo L('type_name')?>:<input type="text" name="type['+n+'][name]" class="input-text" size="15"> <?php echo L('type_path')?>:<input type="text" name="type['+n+'][typedir]" class="input-text" size="15"> <?php echo L('listorder')?>:<input type="text" name="type['+n+'][listorder]" value="'+n+'" size="6" class="input-text" ></span> <a href="javascript:;" onclick="descItem(this, '+n+');"><?php echo L('remove')?></a></div>';
$('#option_list').append(newOption);
}
function descItem(a, id) {
$(a).parent().append('<input type="hidden" name="type['+id+'][del]" value="1">');
$(a).parent().fadeOut();
}
function SwapTab(name,cls_show,cls_hide,cnt,cur){
for(i=1;i<=cnt;i++){
if(i==cur){
$('#div_'+name+'_'+i).show();
$('#tab_'+name+'_'+i).attr('class',cls_show);
}else{
$('#div_'+name+'_'+i).hide();
$('#tab_'+name+'_'+i).attr('class',cls_hide);
}
}
}
$(document).ready(function(){
$.formValidator.initConfig({formid:"myform",autotip:true,onerror:function(msg,obj){window.top.art.dialog({content:msg,lock:true,width:'220',height:'70'}, function(){this.close();$(obj).focus();})}});
$('#title').formValidator({autotip:true,onshow:"<?php echo L('please_input_special_title')?>",onfocus:"<?php echo L('min_3_title')?>",oncorrect:"<?php echo L('true')?>"}).inputValidator({min:1,onerror:"<?php echo L('please_input_special_title')?>"}).ajaxValidator({type:"get",url:"",data:"m=special&c=special&a=public_check_special",datatype:"html",cached:false,async:'true',success : function(data) {
if( data == "1" )
{
return true;
}
else
{
return false;
}
},
error: function(){alert("<?php echo L('server_no_data')?>");},
onerror : "<?php echo L('special_exist')?>",
onwait : "<?php echo L('checking')?>"
});
$('#banner').formValidator({autotip:true,onshow:"<?php echo L('please_upload_banner')?>",oncorrect:"<?php echo L('true')?>"}).inputValidator({min:1,onerror:"<?php echo L('please_upload_banner')?>"});
$('#thumb').formValidator({autotip:true,onshow:"<?php echo L('please_upload_thumb')?>",oncorrect:"<?php echo L('true')?>"}).inputValidator({min:1,onerror:"<?php echo L('please_upload_thumb')?>"});
$('#filename').formValidator({autotip:true,onshow:"<?php echo L('special_file')?>",onfocus:'<?php echo L('use_letters')?>',oncorrect:"<?php echo L('true')?>"}).functionValidator({
fun:function(val,elem){
if($("input:radio[type='radio'][checked]").val()==0){
return true;
} else if($("input:radio[type='radio'][checked]").val()==1 && val==''){
return "<?php echo L('please_input_name')?>"
} else {
return true;
}
}
}).regexValidator({regexp:"^\\w*$", onerror:"<?php echo L('error')?>"});
$("#type_name").formValidator({tipid:"typeTip",onshow:"<?php echo L('input_type_name')?>",onfocus:"<?php echo L('input_type_name')?>",oncorrect:"<?php echo L('true')?>"}).inputValidator({min:1,onerror:"<?php echo L('input_type_name')?>"});
$('#type_path').formValidator({tipid:"typeTip",onshow:"<?php echo L('input_type_path')?>",onfocus:"<?php echo L('input_type_path')?>",oncorrect:"<?php echo L('true')?>"}).inputValidator({min:2,onerror:"<?php echo L('input_type_path')?>"}).regexValidator({regexp:"^\\w*$", onerror:"<?php echo L('error')?>"});
});
$("input:radio[name='special[ishtml]']").click(function (){
if($("input:radio[name='special[ishtml]'][checked]").val()==0) {
$("#file_div").hide();
} else if($("input:radio[type='radio'][checked]").val()==1) {
$("#file_div").show();
}
});
</script> | PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
$show_header = $show_validator = $show_scroll = 1;
include $this->admin_tpl('header','admin');
?>
<br />
<div class="pad-lr-10">
<div id="searchid" style="display:">
<form name="searchform" action="" method="get" >
<input type="hidden" value="special" name="m">
<input type="hidden" value="special" name="c">
<input type="hidden" value="import" name="a">
<input type="hidden" value="<?php echo $_GET['specialid']?>" name="specialid">
<table width="100%" cellspacing="0" class="search-form">
<tbody>
<tr>
<td>
<div class="explain-col">
<?php echo $model_form?> <?php echo L('keyword')?>:<input type='text' name="key" id="key" value="<?php echo $_GET['key'];?>" size="25"> <div class="bk10"></div>
<span id="catids"></span>
<?php echo L('input_time')?>:
<?php $start_f = $_GET['start_time'] ? $_GET['start_time'] : format::date(SYS_TIME-2592000);$end_f = $_GET['end_time'] ? $_GET['end_time'] : format::date(SYS_TIME+86400);?>
<?php echo form::date('start_time', $start_f, 1)?> - <?php echo form::date('end_time', $end_f, 1)?>
<input type="submit" name="search" class="button" value="<?php echo L('search')?>" />
</div>
</td>
</tr>
</tbody>
</table>
</form>
</div>
<div class="table-list">
<form name="myform" id="myform" action="?m=special&c=special&a=import&specialid=<?php echo $_GET['specialid']?>&modelid=<?php echo $_GET['modelid']?>" method="post">
<table width="100%">
<thead>
<tr>
<th width="40"><input type="checkbox" value="" id="check_box" onclick="selectall('ids[]');"></th>
<th width="43"><?php echo L('listorder')?></th>
<th><?php echo L('content_title')?></th>
</tr>
</thead>
<tbody>
<?php if(is_array($data)) { foreach ($data as $r) {?>
<tr>
<td align="center" width="40"><input type="checkbox" class="inputcheckbox " name='ids[]' value="<?php echo $r['id'];?>"></td>
<td align='center' width='43'><input name='listorders[<?php echo $r['id'];?>]' type='text' size='3' value='<?php echo $r['listorder'];?>' class='input-text-c'></td>
<td><?php echo $r['title'];?></td>
</tr>
<?php } }?>
</tbody>
</table>
<div class="btn"><label for="check_box"><?php echo L('selected_all')?>/<?php echo L('cancel')?></label> <?php echo form::select($types, '', 'name="typeid" id="typeid"', L('please_choose_type'))?><span id="msg_id"></span> <input type="submit" name="dosubmit" id="dosubmit" class="button" value="<?php echo L('import')?>" /> </div>
<div id="pages"><?php echo $pages;?></div>
</form>
</div>
</div>
</body>
</html>
<script type="text/javascript">
function select_categorys(modelid, id) {
if(modelid) {
$.get('', {m: 'special', c: 'special', a: 'public_categorys_list', modelid: modelid, catid: id, pc_hash: pc_hash }, function(data){
if(data) {
$('#catids').html(data);
} else $('#catids').html('');
});
}
}
select_categorys(<?php echo $_GET['modelid']?>, <?php echo $_GET['catid']?>);
$(document).ready(function(){
$.formValidator.initConfig({formid:"myform",autotip:true,onerror:function(msg,obj){window.top.art.dialog({content:msg,lock:true,width:'220',height:'70'}, function(){this.close();$(obj).focus();})}});
$("#typeid").formValidator({tipid:"msg_id",onshow:"<?php echo L('please_choose_type')?>",oncorrect:"<?php echo L('true')?>"}).inputValidator({min:1,onerror:"<?php echo L('please_choose_type')?>"});
});
$("#myform").submit(function (){
var str = 0;
$("input[name='ids[]']").each(function() {
if($(this).attr('checked')==true) str = 1;
});
if(str==0) {
alert('<?php echo L('choose_news')?>');
return false;
}
return true;
});
</script> | PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
$show_header = 1;
include $this->admin_tpl('header','admin');
?>
<div class="subnav">
<div class="content-menu ib-a blue line-x">
<?php if(isset($big_menu)) { foreach($big_menu as $big) { echo '<a class="add fb" href="'.$big[0].'"><em>'.$big[1].'</em></a> '; } }?> <a class="on" href="?m=special&c=special"><em><?php echo L('special_list')?></em></a></div>
</div>
<div class="pad-10">
<div class="table-list">
<form name="myform" action="?m=special&c=content&a=listorder&specialid=<?php echo $_GET['specialid']?>" method="post">
<table width="100%">
<thead>
<tr>
<th width="40"><input type="checkbox" value="" id="check_box" onclick="selectall('id[]');"></th>
<th width="43"><?php echo L('listorder')?></th>
<th width="60">ID</th>
<th><?php echo L('content_title')?></th>
<th width="120"><?php echo L('for_type')?></th>
<th width="90"><?php echo L('inputman')?></th>
<th width="120"><?php echo L('update_time')?></th>
<th width="200"><?php echo L('operations_manage')?></th>
</tr>
</thead>
<tbody>
<?php foreach ($datas as $r) {
if ($r['curl']) {
$content_arr = explode('|', $r['curl']);
$r['url'] = go($content_arr['1'], $content_arr['0']);
}
?>
<tr>
<td align="center" width="40"><input class="inputcheckbox " name="id[]" value="<?php echo $r['id'];?>" type="checkbox"></td>
<td align='center' width='43'><input name='listorders[<?php echo $r['id'];?>]' type='text' size='3' value='<?php echo $r['listorder'];?>' class='input-text-c'></td>
<td align='center' width="60"><?php echo $r['id'];?></td>
<td><a href="<?php echo $r['url'];?>" target="_blank"><?php echo $r['title'];?></a></td>
<td align='center' width="120"><?php echo $types[$r['typeid']]['name'];?></td>
<td align='center' width="90"><?php echo $r['username'];?></td>
<td align='center' width="120"><?php echo format::date($r['updatetime'],1);?></td>
<td align='center' width="200"><a href="javascript:;" onclick="javascript:openwinx('?m=special&c=content&a=edit&specialid=<?php echo $r['specialid']?>&id=<?php echo $r['id']?>','')"><?php echo L('content_edit')?></a> </td>
</tr>
<?php }?>
</tbody>
</table>
<div class="btn"><label for="check_box"><?php echo L('selected_all')?>/<?php echo L('cancel')?></label> <input type="submit" class="button" value="<?php echo L('listorder')?>" /> <input type="submit" class="button" value="<?php echo L('delete')?>" onclick="if(confirm('<?php echo L('confirm', array('message' => L('selected')))?>')){document.myform.action='?m=special&c=content&a=delete&specialid=<?php echo $_GET['specialid']?>'}else{return false;}"/></div>
<div id="pages"><?php echo $pages;?></div>
</form>
</div>
</div>
<script language="javascript" type="text/javascript" src="<?php echo JS_PATH?>cookie.js"></script>
<script type="text/javascript">
setcookie('refersh_time', 0);
function refersh_window() {
var refersh_time = getcookie('refersh_time');
if(refersh_time==1) {
window.location.reload();
}
}
setInterval("refersh_window()", 5000);
</script>
</body>
</html> | PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header', 'admin');
?>
<div class="pad-lr-10">
<form name="myform" action="?m=special&c=special&a=listorder" method="post">
<table width="100%" cellspacing="0" class="table-list nHover">
<thead>
<tr>
<th width="40"><input type="checkbox" value="" id="check_box" onclick="selectall('id[]');"></th>
<th width="40" align="center">ID</th>
<th width="80" align="center"><?php echo L('listorder')?></th>
<th ><?php echo L('special_info')?></th>
<th width="160"><?php echo L('operations_manage')?></th>
</tr>
</thead>
<tbody>
<?php
if(is_array($infos)){
foreach($infos as $info){
?>
<tr>
<td align="center" width="40"><input class="inputcheckbox" name="id[]" value="<?php echo $info['id'];?>" type="checkbox"></td>
<td width="40" align="center"><?php echo $info['id']?></td>
<td width="80" align="center"><input type='text' name='listorder[<?php echo $info['id']?>]' value="<?php echo $info['listorder']?>" class="input-text-c" size="4"></td>
<td>
<div class="col-left mr10" style="width:146px; height:112px">
<a href="<?php echo $info['url']?>" target="_blank"><img src="<?php echo $info['thumb']?>" width="146" height="112" style="border:1px solid #eee" align="left"></a>
</div>
<div class="col-auto">
<h2 class="title-1 f14 lh28 mb6 blue"><a href="<?php echo $info['url']?>" target="_blank"><?php echo $info['title']?></a></h2>
<div class="lh22"><?php echo $info['description']?></div>
<p class="gray4"><?php echo L('create_man')?>:<a href="#" class="blue"><?php echo $info['username']?></a>, <?php echo L('create_time')?>:<?php echo format::date($info['createtime'], 1)?></p>
</div>
</td>
<td align="center"><span style="height:22"><a href='?m=special&c=content&a=init&specialid=<?php echo $info['id']?>' onclick="javascript:openwinx('?m=special&c=content&a=add&specialid=<?php echo $info['id']?>&pc_hash=<?php echo $_SESSION['pc_hash']?>','')"><?php echo L('add_news')?></a></span> |
<span style="height:22"><a href='javascript:import_c(<?php echo $info['id']?>);void(0);'><?php echo L('import_news')?></a></span><br />
<span style="height:22"><a href='?m=special&c=content&a=init&specialid=<?php echo $info['id']?>'><?php echo L('manage_news')?></a></span> |
<span style="height:22"><a href='?m=special&c=template&specialid=<?php echo $info['id']?>' style="color:red" target="_blank"><?php echo L('template_manage')?></a></span><br/>
<span style="height:22"><a href='?m=special&c=special&a=elite&value=<?php if($info['elite']==0) {?>1<?php } elseif($info['elite']==1) { ?>0<?php }?>&id=<?php echo $info['id']?>'><?php if($info['elite']==0) { echo L('elite_special'); } else {?><font color="red"><?php echo L('remove_elite')?></font><?php }?></a></span> |
<span style="height:22"><a href="javascript:comment('<?php echo id_encode('special', $info['id'], $this->get_siteid())?>', '<?php echo addslashes(htmlspecialchars($info['title']))?>');void(0);"><?php echo L('special_comment')?></a></span><br/>
<span style="height:22"><a href="?m=special&c=special&a=edit&specialid=<?php echo $info['id']?>&menuid=<?php echo $_GET['menuid']?>"><?php echo L('edit_special')?></a></span> |
<span style="height:22"><a href="?m=special&c=special&a=delete&id=<?php echo $info['id']?>" onclick="return confirm('<?php echo L('confirm', array('message'=>addslashes(htmlspecialchars($info['title']))))?>')"><?php echo L('del_special')?></a></span></td>
</tr>
<?php
}
}
?>
</tbody>
</table>
<div class="btn"><label for="check_box"><?php echo L('selected_all')?>/<?php echo L('cancel')?></label>
<input name='dosubmit' type='submit' class="button" value='<?php echo L('listorder')?>'>
<input type="submit" class="button" value="<?php echo L('delete')?>" onclick="if(confirm('<?php echo L('confirm', array('message' => L('selected')))?>')){document.myform.action='?m=special&c=special&a=delete';}else{return false;}"/>
<input type="submit" class="button" value="<?php echo L('update')?>html" onclick="document.myform.action='?m=special&c=special&a=html'"/></div>
<div id="pages"><?php echo $this->db->pages;?></div><script>window.top.$("#display_center_id").css("display","none");</script>
</form>
</div>
</body>
</html>
<script type="text/javascript">
<!--
function edit(id, name) {
window.top.art.dialog({id:'edit'}).close();
window.top.art.dialog({title:'<?php echo L('edit_special')?>--'+name, id:'edit', iframe:'?m=special&c=special&a=edit&specialid='+id ,width:'700px',height:'500px'}, function(){var d = window.top.art.dialog({id:'edit'}).data.iframe;// 使用内置接口获取iframe对象
var form = d.document.getElementById('dosubmit');form.click();return false;}, function(){window.top.art.dialog({id:'edit'}).close()});
}
function comment(id, name) {
window.top.art.dialog({id:'comment'}).close();
window.top.art.dialog({title:'<?php echo L('see_comment')?>:'+name, id:'comment', iframe:'?m=comment&c=comment_admin&a=lists&show_center_id=1&commentid='+id ,width:'700px',height:'500px'}, function(){var d = window.top.art.dialog({id:'edit'}).data.iframe;// 使用内置接口获取iframe对象
var form = d.document.getElementById('dosubmit');form.click();return false;}, function(){window.top.art.dialog({id:'edit'}).close()});
}
function import_c(id) {
window.top.art.dialog({id:'import'}).close();
window.top.art.dialog({title:'<?php echo L('import_news')?>--', id:'import', iframe:'?m=special&c=special&a=import&specialid='+id ,width:'700px',height:'500px'}, function(){var d = window.top.art.dialog({id:'import'}).data.iframe;// 使用内置接口获取iframe对象
var form = d.document.getElementById('dosubmit');form.click();return false;}, function(){window.top.art.dialog({id:'import'}).close()});
}
</script> | PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
$show_dialog = $show_validator = $show_header = 1;
include $this->admin_tpl('header','admin');
?>
<style type="text/css">
html,body{ background:#e2e9ea}
</style>
<script type="text/javascript">
<!--
var charset = '<?php echo CHARSET?>';
var uploadurl = '<?php echo pc_base::load_config('system','upload_url')?>';
//-->
</script>
<script language="javascript" type="text/javascript" src="<?php echo JS_PATH?>content_addtop.js"></script>
<script language="javascript" type="text/javascript" src="<?php echo JS_PATH?>colorpicker.js"></script>
<script language="javascript" type="text/javascript" src="<?php echo JS_PATH?>cookie.js"></script>
<form name="myform" id="myform" action="?m=special&c=content&a=add&specialid=<?php echo $_GET['specialid']?>" method="post" enctype="multipart/form-data">
<div class="addContent">
<div class="crumbs"><?php echo L('pos_info')?></div>
<div class="col-right">
<div class="col-1">
<div class="content pad-6">
<h6> <?php echo L('content_thumb')?></h6>
<div class="upload-pic img-wrap"><div class="bk10"></div><input type="hidden" name="info[thumb]" id="thumb">
<a href="javascript:;" onclick="javascript:flashupload('thumb_images', '<?php echo L('file_upload')?>','thumb',thumb_images,'1,jpg|jpeg|gif|bmp|png,300,300','content','39','<?php echo upload_key('1,jpg|jpeg|gif|bmp|png,300,300')?>')"><img src="statics/images/icon/upload-pic.png" id="thumb_preview" width="135" height="113" style="cursor:hand" /></a><input type="button" style="width: 66px;" class="button" onclick="crop_cut($('#thumb').val());return false;" value="<?php echo L('crop_thumb')?>"><script type="text/javascript">function crop_cut(id){
if (id=='') { alert('<?php echo L('please_upload_thumb')?>');return false;}
window.top.art.dialog({title:'<?php echo L('crop_thumb')?>', id:'crop', iframe:'index.php?m=content&c=content&a=public_crop&module=phpcms&picurl='+encodeURIComponent(id)+'&input=thumb&preview=thumb_preview', width:'680px', height:'480px'}, function(){var d = window.top.art.dialog({id:'crop'}).data.iframe;
d.uploadfile();return false;}, function(){window.top.art.dialog({id:'crop'}).close()});
};</script><input type="button" value="<?php echo L('cancel_thumb')?>" onclick="$('#thumb_preview').attr('src','statics/images/icon/upload-pic.png');$('#thumb').val(' ');return false;" class="button" style="width: 66px;"></div>
<h6> <?php echo L('author')?></h6>
<input type="text" name="data[author]" value="" size="30">
<h6> <?php echo L('islink')?></h6>
<input type="text" name="linkurl" id="linkurl" value="" size="30" maxlength="255" disabled> <input name="info[islink]" type="checkbox" id="islink" value="1" onclick="ruselinkurl();" > <font color="red"><?php echo L('islink')?></font>
<h6> <?php echo L('inputtime')?></h6> <?php echo form::date('info[inputtime]', format::date(SYS_TIME, 1) , 1);?>
<h6> <?php echo L('template_style')?></h6> <?php echo form::select($template_list, $style, 'name="data[style]" id="style" onchange="load_file_list(this.value)"', L('please_select'))?>
<h6> <?php echo L('show_template')?></h6> <span id="show_template"><script type="text/javascript">$.getJSON('?m=admin&c=category&a=public_tpl_file_list&style=<?php echo $style?>&module=special&templates=show&id=<?php echo $show_template?>&name=data', function(data){$('#show_template').html(data.show_template);});</script></span>
</div>
</div>
</div>
<div class="col-auto">
<div class="col-1">
<div class="content pad-6">
<table width="100%" cellspacing="0" class="table_form">
<tbody>
<tr>
<th width="80"> <font color="red">*</font> <?php echo L('for_type')?> </th>
<td><?php echo form::select($types, '', 'name="info[typeid]" id="typeid"', L('please_choose_type'))?> </td>
</tr>
<tr>
<th width="80"> <font color="red">*</font> <?php echo L('content_title')?> </th>
<td><input type="text" style="width:350px;" name="info[title]" id="title" class="measure-input " onBlur="$.post('api.php?op=get_keywords&number=3&sid='+Math.random()*5, {data:$('#title').val()}, function(data){if(data && $('#keywords').val()=='') $('#keywords').val(data); })"/>
<input type="hidden" name="info[style_color]" id="style_color" value="">
<input type="hidden" name="info[style_font_weight]" id="style_font_weight" value="">
<input type="button" class="button" id="check_title_alt" value="<?php echo L('check_exist')?>" onclick="$.get('?m=special&c=content&a=public_check_title&sid='+Math.random()*5, {data:$('#title').val(), specialid:'<?php echo $_GET['specialid']?>'}, function(data){ if(data=='1') {$('#check_title_alt').val('<?php echo L('title_exist')?>');$('#check_title_alt').css('background-color','#FFCC66');} else if(data=='0') {$('#check_title_alt').val('<?php echo L('title_no_exist')?>');$('#check_title_alt').css('background-color','#F8FFE1')}})"/> <img src="statics/images/icon/colour.png" width="15" height="16" onclick="colorpicker('title_colorpanel','set_title_color');" style="cursor:hand"/>
<img src="statics/images/icon/bold.png" width="10" height="10" onclick="input_font_bold()" style="cursor:hand"/> <span id="title_colorpanel" style="position:absolute; z-index:200" class="colorpanel"></span> </td>
</tr>
<tr>
<th width="80"> <?php echo L('keywords')?> </th>
<td><input type='text' name='info[keywords]' id='keywords' value='' style='50' > <?php echo L('more_keywords_with_blanks')?></td>
</tr>
<tr>
<th width="80"> <?php echo L('description')?> </th>
<td><textarea name="info[description]" id="description" style='width:98%;height:46px;' onkeyup="strlen_verify(this, 'description_len', 255)"></textarea> 还可输入<B><span id="description_len">255</span></B> 个字符 </td>
</tr>
<tr>
<th width="80"> <font color="red">*</font> <?php echo L('content')?> </th>
<td><div id='content_tip'></div><textarea name="data[content]" id="content" boxid="content"></textarea><?php echo form::editor('content', 'full', 'content', '', '', 1, '', '')?><div class="content_attr"><label><input name="add_introduce" type="checkbox" value="1" checked><?php echo L('iscutcontent')?></label><input type="text" name="introcude_length" value="200" size="3"><?php echo L('characters_to_contents')?>
<label><input type='checkbox' name='auto_thumb' value="1" checked><?php echo L('iscutcotent_pic')?></label><input type="text" name="auto_thumb_no" value="1" size="2" class=""><?php echo L('picture2thumb')?>
</div></td>
<tr>
<th width="80"> <?php echo L('paginationtype')?> </th>
<td><select name="data[paginationtype]" id="paginationtype" onchange="if(this.value==1)$('#paginationtype1').css('display','');else $('#paginationtype1').css('display','none');">
<option value="0"><?php echo L('no_page')?></option>
<option value="1"><?php echo L('collate_copies')?></option>
<option value="2"><?php echo L('manual_page')?></option>
</select>
<span id="paginationtype1" style="display:none"><input name="data[maxcharperpage]" type="text" id="maxcharperpage" value="10000" size="8" maxlength="8"><?php echo L('number_of_characters')?></span> </td>
</tr>
</tbody></table>
</div>
</div>
</div>
</div>
</div>
<div class="fixed-bottom">
<div class="fixed-but text-c">
<div class="button"><input value="<?php echo L('save')?>" type="submit" class="cu" name="dosubmit" onclick="refersh_window();"></div>
<div class="button"><input value="<?php echo L('save_and_add')?>" type="submit" class="cu" name="dosubmit_continue" onclick="refersh_window();"></div>
<div class="button"><input value="<?php echo L('close')?>" type="button" name="close" class="cu" onclick="refersh_window();close_window()"></div>
</div>
</div>
</form>
</body>
</html>
<script type="text/javascript">
function load_file_list(id) {
$.getJSON('?m=admin&c=category&a=public_tpl_file_list&style='+id+'&module=special&templates=show&name=data', function(data){$('#show_template').html(data.show_template);});
}
//只能放到最下面
$(function(){
$.formValidator.initConfig({formid:"myform",autotip:true,onerror:function(msg,obj){window.top.art.dialog({content:msg,lock:true,width:'200',height:'50'}, function(){$(obj).focus();
boxid = $(obj).attr('id');
if($('#'+boxid).attr('boxid')!=undefined) {
check_content(boxid);
}
})}});
$("#typeid").formValidator({autotip:true,onshow:"<?php echo L('please_choose_type')?>",onfocus:"<?php echo L('please_choose_type')?>"}).inputValidator({min:1,onerror:"<?php echo L('please_choose_type')?>"});
$("#title").formValidator({autotip:true,onshow:"<?php echo L('please_input_title')?>",onfocus:"<?php echo L('please_input_title')?>"}).inputValidator({min:1,onerror:"<?php echo L('please_input_title')?>"});
$("#content").formValidator({autotip:true,onshow:"",onfocus:"<?php echo L('content_empty')?>"}).functionValidator({
fun:function(val,elem){
//获取编辑器中的内容
var oEditor = CKEDITOR.instances.content;
var data = oEditor.getData();
if($('#islink').attr('checked')){
return true;
}else if(($('#islink').attr('checked')==false) && (data=='')){
return "<?php echo L('content_empty')?>"
} else {
return true;
}
}
});
/*
* 加载禁用外边链接
*/
$('#linkurl').attr('disabled',true);
$('#islink').attr('checked',false);
$('.edit_content').hide();
});
self.moveTo(0, 0);
function refersh_window() {
setcookie('refersh_time', 1);
}
//-->
</script> | PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
$show_validator = $show_scroll = $show_dialog = 1;
include $this->admin_tpl('header', 'admin');
?>
<form method="post" action="?m=special&c=special&a=edit&specialid=<?php echo $_GET['specialid']?>" id="myform">
<div class="pad-10">
<div class="col-tab">
<ul class="tabBut cu-li">
<li id="tab_setting_1" class="on" onclick="SwapTab('setting','on','',6,1);"><?php echo L('catgory_basic', '', 'admin');?></li>
<li id="tab_setting_2" onclick="SwapTab('setting','on','',6,2);"><?php echo L('extend_setting')?></li>
</ul>
<div id="div_setting_1" class="contentList pad-10">
<table class="table_form" width="100%" cellspacing="0">
<tbody>
<tr>
<th width="200"><?php echo L('special_title')?>:</th>
<td><input name="special[title]" id="title" class="input-text" value="<?php echo htmlspecialchars($info['title']);?>" type="text" size="40"></td>
</tr>
<tr>
<th><?php echo L('special_banner')?>:</th>
<td><?php echo form::images('special[banner]', 'banner', $info['banner'], 'special', '', 40)?></td>
</tr>
<tr>
<th><?php echo L('sepcial_thumb')?>:</th>
<td><?php echo form::images('special[thumb]', 'thumb', $info['thumb'], 'special', '', 40, '', '', '', array(350, 350))?></td>
</tr>
<tr>
<th><?php echo L('special_intro')?>:</th>
<td><textarea name="special[description]" id="description" cols="50" rows="6"><?php echo $info['description'];?></textarea></td>
</tr>
<tr>
<th align="right" valign="top"><?php echo L('ishtml')?>:</th>
<td valign="top"><?php echo form::radio(array('0'=>L('no'), '1'=>L('yes')), $info['ishtml'], 'name="special[ishtml]"');?>
</td>
</tr>
<tr id="file_div" style="display:<?php if($info['ishtml']) {?> <?php } else {?>none<?php }?>;">
<th align="right" valign="top"><?php echo L('special_filename')?>:</th>
<td valign="top"><input type="text" name="special[filename]" id="filename" class="input-text"<?php if($info['ishtml']) {?> readonly<?php }?> value="<?php echo $info['filename']?>" size="20">
</td>
</tr>
<tr>
<th width="200"><?php echo L('special_type')?>:<a href="javascript:addItem()" title="<?php echo L('add')?>"><span style="color:red;" >+</span></a></th>
<td valign="top">
<div id="option_list">
<?php if(is_array($types)) { $k = 1; foreach($types as $t) {?>
<div class="mb6"><span><?php echo L('type_id')?>:<?php echo $t['typeid']?> <?php echo L('type_name')?>:<input type="hidden" name="type[<?php echo $k?>][typeid]" value="<?php echo $t['typeid']?>"><input type="text" name="type[<?php echo $k?>][name]" <?php if ($k==1) {?>id="type_name"<?php }?> value="<?php echo htmlspecialchars($t['name'])?>" class="input-text" size="15"> <?php echo L('type_path')?>:<input type="text" name="type[<?php echo $k?>][typedir]" <?php if ($k==1) {?>id="type_path"<?php }?> value="<?php echo $t['typedir']?>" class="input-text" size="15"> <?php echo L('listorder')?>:<input type="text" name="type[<?php echo $k?>][listorder]" value="<?php echo $t['listorder']?>" size="6" class="input-text" ></span> <?php if ($k!=1) {?><a href="javascript:;" onclick="descItem(this, <?php echo $k?>);"><?php echo L('remove')?></a><?php }?></div>
<?php $k++; } }?>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div id="div_setting_2" class="contentList pad-10 hidden">
<table width="100%" class="table_form ">
<tr>
<th width="200"><?php echo L('pics_news')?>:</th>
<td><span id="relation"><?php if ($info['pics']) {?><ul id="relation_relation" class="list-dot"><li><span><?php echo $pics['2']?></span><a onclick="remove_relation('relation', 'pics')" class="close" href="javascript:void(0);"></a></li></ul><?php }?></span><input type="button" value="<?php echo L('choose_pic_news')?>" class="button" onclick="import_info('?m=special&c=special&a=public_get_pics','<?php echo L('choose_pic_news')?>', 'msg_id', 'relation', 'pics');"><input type="hidden" name="special[pics]" value="<?php echo $info['pics']?>" id="pics"><span class="onShow">(<?php echo L('choose_pic_model')?>)</span></td>
</tr>
<tr>
<th><?php echo L('add_vote')?>:</th>
<td><span id="vote_msg"><?php if ($info['voteid']) {?><ul id="relation_vote_msg" class="list-dot"><li><span><?php echo $vote_info['2']?></span><a onclick="remove_relation('vote_msg', 'voteid')" class="close" href="javascript:void(0);"></a></li></ul><?php }?></span><input type="button" class="button" value="<?php echo L('choose_exist_vote')?>" onclick="import_info('?m=vote&c=vote&a=public_get_votelist&from_api=1&target=dialog','<?php echo L('choose_vote')?>', 'msg_id', 'vote_msg', 'voteid');"><input type="hidden" name="special[voteid]" value="<?php echo $info['voteid']?>" id="voteid"> <input type="button" class="button" value="<?php echo L('add_new_vote')?>" onclick="import_info('?m=vote&c=vote&a=add&from_api=1&target=dialog','<?php echo L('add_new_vote')?>', 'subject_title', 'vote_msg', 'voteid');"></td>
</tr>
<tr>
<th align="right" valign="top"><?php echo L('template_style')?>:</th>
<td valign="top"><?php echo form::select($template_list, $info['style'], 'name="special[style]" id="style" onchange="load_file_list(this.value)"', L('please_select'))?><?php if ($info['style']) {?><script type="text/javascript">$.getJSON('?m=admin&c=category&a=public_tpl_file_list&style=<?php echo $info['style']?>&module=special&templates=index|list|show&id=<?php echo $info['index_template']?>|<?php echo $info['list_template']?>|<?php echo $info['show_template']?>&name=special', function(data){$('#index_template').html(data.index_template);$('#list_template').html(data.list_template);$('#show_template').html(data.show_template);});</script><?php }?></td>
</tr>
<tr>
<th align="right" valign="top"><?php echo L('special_template')?>:</th>
<td valign="top" id="index_template"><?php echo form::select_template('default', 'special', $info['index_template'], 'name="special[index_template]"', 'index');?></td>
</tr>
<tr>
<th align="right" valign="top"><?php echo L('special_content_template')?>:</th>
<td valign="top" id="show_template"><?php echo form::select_template('default', 'special', $info['show_template'], 'name="special[show_template]"', 'show');?></td>
</tr>
<tr>
<th align="right" valign="top"><?php echo L('index_page')?>:</th>
<td valign="top"><?php echo form::radio(array('0'=>L('no'), '1'=>L('yes')), $info['ispage'], 'name="special[ispage]"');?></td>
</tr>
<tr>
<th align="right" valign="top"><?php echo L('special_status')?>:</th>
<td valign="top"><?php echo form::radio(array('0'=>L('open'), '1'=>L('pause')), $info['disabled'], 'name="special[disabled]"');?></td>
</tr>
</table>
</div>
<div class="bk15"></div>
<input name="dosubmit" type="submit" value="<?php echo L('submit')?>" class="button">
</div></div>
</form>
</body>
</html>
<script type="text/javascript">
function import_info(url, title, msgID, htmlID, valID) {
window.top.art.dialog({id:'selectid',iframe:url, title:title, width:'600', height:'400', lock:true},
function(){
var d = window.top.art.dialog({id:'selectid'}).data.iframe;
var form = d.document.getElementById(msgID);
var text = form.value;
var data = text.split('|');
if (data[2]) {
$('#'+htmlID).html('<ul id="relation_'+htmlID+'" class="list-dot"><li><span>'+data[2]+'</span><a onclick="remove_relation(\''+htmlID+'\', \''+valID+'\')" class="close" href="javascript:;"></a></li></ul>');
} else {
var dosubmit = d.document.getElementById('dosubmit');
dosubmit.click();
$('#'+htmlID).html('<ul id="relation_'+htmlID+'" class="list-dot"><li><span>'+text+'</span><a onclick="remove_relation(\''+htmlID+'\', \''+valID+'\')" class="close" href="javascript:;"></a></li></ul>');
}
$('#'+valID).val(text);
window.top.art.dialog({id:'selectid'}).close();
return false;
},
function(){
window.top.art.dialog({id:'selectid'}).close();
});void(0);
}
function remove_relation(htmlID, valID) {
$('#relation_'+htmlID).html('');
$('#'+valID).val('');
}
function load_file_list(id) {
$.getJSON('?m=admin&c=category&a=public_tpl_file_list&style='+id+'&module=special&templates=index|list|show&name=special', function(data){$('#index_template').html(data.index_template);$('#list_template').html(data.list_template);$('#show_template').html(data.show_template);});
}
function addItem() {
var n = $('#option_list').find('input[type="text"]').length/3+1;
var newOption = '<div class="mb6"><span style="padding-left:76px"><?php echo L('type_name')?>:<input type="text" name="type['+n+'][name]" class="input-text" size="15"> <?php echo L('type_path')?>:<input type="text" name="type['+n+'][typedir]" class="input-text" size="15"> <?php echo L('listorder')?>:<input type="text" name="type['+n+'][listorder]" value="'+n+'" size="6" class="input-text" ></span> <a href="javascript:;" onclick="descItem(this);"><?php echo L('remove')?></a></div>';
$('#option_list').append(newOption);
}
function descItem(a, id) {
$(a).parent().append('<input type="hidden" name="type['+id+'][del]" value="1">');
$(a).parent().fadeOut();
}
function SwapTab(name,cls_show,cls_hide,cnt,cur){
for(i=1;i<=cnt;i++){
if(i==cur){
$('#div_'+name+'_'+i).show();
$('#tab_'+name+'_'+i).attr('class',cls_show);
}else{
$('#div_'+name+'_'+i).hide();
$('#tab_'+name+'_'+i).attr('class',cls_hide);
}
}
}
$(document).ready(function(){
$.formValidator.initConfig({formid:"myform",autotip:true,onerror:function(msg,obj){window.top.art.dialog({content:msg,lock:true,width:'220',height:'70'}, function(){this.close();$(obj).focus();})}});
$('#title').formValidator({autotip:true,onshow:"<?php echo L('please_input_special_title')?>",onfocus:"<?php echo L('min_3_title')?>",oncorrect:"<?php echo L('true')?>"}).inputValidator({min:1,onerror:"<?php echo L('please_input_special_title')?>"}).ajaxValidator({type:"get",url:"",data:"m=special&c=special&a=public_check_special&id=<?php echo $_GET['specialid']?>",datatype:"html",cached:false,async:'true',success : function(data) {
if( data == "1" )
{
return true;
}
else
{
return false;
}
},
error: function(){alert("<?php echo L('server_no_data')?>");},
onerror : "<?php echo L('special_exist')?>",
onwait : "<?php echo L('checking')?>"
}).defaultPassed();
$('#banner').formValidator({autotip:true,onshow:"<?php echo L('please_upload_banner')?>",oncorrect:"<?php echo L('true')?>"}).inputValidator({min:6,onerror:"<?php echo L('please_upload_banner')?>"}).defaultPassed();
$('#thumb').formValidator({autotip:true,onshow:"<?php echo L('please_upload_thumb')?>",oncorrect:"<?php echo L('true')?>"}).inputValidator({min:6,onerror:"<?php echo L('please_upload_thumb')?>"}).defaultPassed();
$('#filename').formValidator({autotip:true,onshow:"<?php echo L('special_file')?>",onfocus:'<?php echo L('use_letters')?>',oncorrect:"<?php echo L('true')?>"}).functionValidator({
fun:function(val,elem){
if($("input:radio[type='radio'][checked]").val()==0){
return true;
}else if($("input:radio[type='radio'][checked]").val()==1 && val==''){
return "<?php echo L('please_input_name')?>"
} else {
return true;
}
}
}).regexValidator({regexp:"^\\w*$", onerror:"<?php echo L('error')?>"}).defaultPassed();
$("#type_name").formValidator({tipid:"typeTip",onshow:"<?php echo L('input_type_name')?>",onfocus:"<?php echo L('input_type_name')?>",oncorrect:"<?php echo L('true')?>"}).inputValidator({min:1,onerror:"<?php echo L('input_type_name')?>"}).defaultPassed();
$('#type_path').formValidator({tipid:"typeTip",onshow:"<?php echo L('input_type_path')?>",onfocus:"<?php echo L('input_type_path')?>",oncorrect:"<?php echo L('true')?>"}).inputValidator({min:2,onerror:"<?php echo L('input_type_path')?>"}).regexValidator({regexp:"^\\w*$", onerror:"<?php echo L('error')?>"}).defaultPassed();
});
$("input:radio[name='special[ishtml]']").click(function (){
if($("input:radio[name='special[ishtml]'][checked]").val()==0) {
$("#file_div").hide();
} else if($("input:radio[type='radio'][checked]").val()==1) {
$("#file_div").show();
}
});
</script> | PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
$show_dialog = $show_validator = $show_header = 1;
include $this->admin_tpl('header','admin');
?>
<style type="text/css">
html,body{background:#e2e9ea}
</style>
<script type="text/javascript">
<!--
var charset = '<?php echo CHARSET?>';
var uploadurl = '<?php echo pc_base::load_config('system','upload_url')?>';
//-->
</script>
<script language="javascript" type="text/javascript" src="<?php echo JS_PATH?>content_addtop.js"></script>
<script language="javascript" type="text/javascript" src="<?php echo JS_PATH?>colorpicker.js"></script>
<script language="javascript" type="text/javascript" src="<?php echo JS_PATH?>cookie.js"></script>
<form name="myform" id="myform" action="?m=special&c=content&a=edit&specialid=<?php echo $_GET['specialid']?>&id=<?php echo $_GET['id']?>" method="post" enctype="multipart/form-data">
<div class="addContent">
<div class="crumbs"><?php echo L('edit_pos_info')?></div>
<div class="col-right">
<div class="col-1">
<div class="content pad-6">
<h6> <?php echo L('content_thumb')?></h6>
<div class="upload-pic img-wrap"><div class="bk10"></div><input type="hidden" name="info[thumb]" value="<?php echo $info['thumb']?>" id="thumb">
<a href="javascript:;" onclick="javascript:flashupload('thumb_images', '<?php echo L('file_upload')?>','thumb',thumb_images,'1,jpg|jpeg|gif|bmp|png,300,300','content','39','<?php echo upload_key('1,jpg|jpeg|gif|bmp|png,300,300')?>')"><img src="<?php if($info['thumb']) { echo $info['thumb']; } else {?>statics/images/icon/upload-pic.png<?php }?>" id="thumb_preview" width="135" height="113" style="cursor:hand" /></a><input type="button" style="width: 66px;" class="button" onclick="crop_cut($('#thumb').val());return false;" value="<?php echo L('crop_thumb')?>"><script type="text/javascript">function crop_cut(id){
if (id=='') { alert('<?php echo L('please_upload_thumb')?>');return false;}
window.top.art.dialog({title:'<?php echo L('crop_thumb')?>', id:'crop', iframe:'index.php?m=content&c=content&a=public_crop&module=phpcms&picurl='+encodeURIComponent(id)+'&input=thumb&preview=thumb_preview', width:'680px', height:'480px'}, function(){var d = window.top.art.dialog({id:'crop'}).data.iframe;
d.uploadfile();return false;}, function(){window.top.art.dialog({id:'crop'}).close()});
};</script></div>
<h6> <?php echo L('author')?></h6>
<input type="text" name="data[author]" value="<?php echo $data['author']?>" size="30">
<h6> <?php echo L('islink')?></h6>
<input type="text" name="linkurl" id="linkurl" value="<?php if($info['islink']) { echo $info['url']; }?>" size="30" maxlength="255"<?php if($info['islink']) {?> disabled<?php }?>> <input name="info[islink]" type="checkbox" id="islink" value="1"<?php if($info['islink']) {?> checked<?php }?> onclick="ruselinkurl();" > <font color="red"><?php echo L('islink')?></font>
<h6> <?php echo L('inputtime')?></h6> <?php echo form::date('info[inputtime]', format::date($info['inputtime'], 1) , 1);?>
<h6> <?php echo L('template_style')?></h6> <?php echo form::select($template_list, $data['style'], 'name="data[style]" id="style" onchange="load_file_list(this.value)"', L('please_select'))?>
<h6> <?php echo L('show_template')?></h6> <span id="show_template"><?php if ($data['style']) echo '<script type="text/javascript">$.getJSON(\'?m=admin&c=category&a=public_tpl_file_list&style='.$data['style'].'&id='.$data['show_template'].'&module=special&templates=show&name=data\', function(data){$(\'#show_template\').html(data.show_template);});</script>'?></span>
</div>
</div>
</div>
<div class="col-auto">
<div class="col-1">
<div class="content pad-6">
<table width="100%" cellspacing="0" class="table_form">
<tbody>
<tr>
<th width="80"> <font color="red">*</font> <?php echo L('for_type')?> </th>
<td><?php echo form::select($types, $info['typeid'], 'name="info[typeid]" id="typeid"', L('please_choose_type'))?> </td>
</tr>
<tr>
<th width="80"> <font color="red">*</font> <?php echo L('content_title')?> </th>
<td><input type="text" style="width:350px;" name="info[title]" id="title" value="<?php echo htmlspecialchars($info['title'])?>" class="measure-input " onBlur="$.post('api.php?op=get_keywords&number=3&sid='+Math.random()*5, {data:$('#title').val()}, function(data){if(data && $('#keywords').val()=='') $('#keywords').val(data); })" />
<input type="hidden" name="style_color" id="style_color" value="">
<input type="hidden" name="style_font_weight" id="style_font_weight" value="">
<input type="button" class="button" id="check_title_alt" value="<?php echo L('check_exist')?>" onclick="$.get('?m=special&c=content&a=public_check_title&sid='+Math.random()*5, {data:$('#title').val()}, function(data){if(data=='1') {$('#check_title_alt').val('<?php echo L('title_exist')?>');$('#check_title_alt').css('background-color','#FFCC66');} else if(data=='0') {$('#check_title_alt').val('<?php echo L('title_no_exist')?>');$('#check_title_alt').css('background-color','#F8FFE1')}})"/> <img src="statics/images/icon/colour.png" width="15" height="16" onclick="colorpicker('title_colorpanel','set_title_color');" style="cursor:hand"/>
<img src="statics/images/icon/bold.png" width="10" height="10" onclick="input_font_bold()" style="cursor:hand"/> <span id="title_colorpanel" style="position:absolute; z-index:200" class="colorpanel"></span> </td>
</tr>
<tr>
<th width="80"> <?php echo L('keywords')?> </th>
<td><input type='text' name='info[keywords]' id='keywords' value='<?php echo $info['keywords']?>' style='50' > <?php echo L('more_keywords_with_blanks')?></td>
</tr>
<tr>
<th width="60"> <?php echo L('description')?> </th>
<td><textarea name="info[description]" id="description" style='width:98%;height:46px;' onkeyup="strlen_verify(this, 'description_len', 255)"><?php echo $info['description']?></textarea> 还可输入<B><span id="description_len"><?php echo 255-strlen($info['description'])?></span></B> 个字符 </td>
</tr>
<tr>
<th width="60"> <font color="red">*</font> <?php echo L('content')?> </th>
<td><div id='content_tip'></div><textarea name="data[content]" id="content" boxid="content"><?php echo $data['content']?></textarea><?php echo form::editor('content', 'full', 'content', '', '', 1)?><div class="content_attr"><label><input name="add_introduce" type="checkbox" value="1" checked><?php echo L('iscutcontent')?></label><input type="text" name="introcude_length" value="200" size="3"><?php echo L('characters_to_contents')?>
<label><input type='checkbox' name='auto_thumb' value="1" checked><?php echo L('iscutcotent_pic')?></label><input type="text" name="auto_thumb_no" value="1" size="2" class=""><?php echo L('picture2thumb')?></div></td>
<tr>
<th width="60"> <?php echo L('paginationtype')?> </th>
<td><select name="data[paginationtype]" id="paginationtype" onchange="if(this.value==1)$('#paginationtype1').css('display','');else $('#paginationtype1').css('display','none');">
<option value="0"<?php if($data['paginationtype']==0) {?> selected<?php }?>><?php echo L('no_page')?></option>
<option value="1"<?php if($data['paginationtype']==1) {?> selected<?php }?>><?php echo L('collate_copies')?></option>
<option value="2"<?php if($data['paginationtype']==2) {?> selected<?php }?>><?php echo L('manual_page')?></option>
</select>
<span id="paginationtype1" style="display:<?php if($data['paginationtype']==1) {?>block<?php } else {?>none<?php }?>"><input name="data[maxcharperpage]" type="text" id="maxcharperpage" value="<?php echo $data['maxcharperpage']?>" size="8" maxlength="8"><?php echo L('number_of_characters')?></span> </td>
</tr>
</tbody></table>
</div>
</div>
</div>
</div>
</div>
<div class="fixed-bottom">
<div class="fixed-but text-c">
<div class="button"><input value="<?php echo L('save')?>" type="submit" class="cu" name="dosubmit" onclick="refersh_window();"></div>
<div class="button"><input value="<?php echo L('close')?>" type="button" name="close" class="cu" onclick="refersh_window();close_window()"></div>
</div>
</div>
</form>
<script type="text/javascript">
function load_file_list(id) {
$.getJSON('?m=admin&c=category&a=public_tpl_file_list&style='+id+'&module=special&templates=show&name=data', function(data){$('#show_template').html(data.show_template);});
}
</script>
</body>
</html>
<script type="text/javascript">
<!--
//只能放到最下面
$(function(){
$.formValidator.initConfig({formid:"myform",autotip:true,onerror:function(msg,obj){window.top.art.dialog({content:msg,lock:true,width:'200',height:'50'}, function(){$(obj).focus();
boxid = $(obj).attr('id');
if($('#'+boxid).attr('boxid')!=undefined) {
check_content(boxid);
}
})}});
$("#typeid").formValidator({autotip:true,onshow:"<?php echo L('please_choose_type')?>",onfocus:"<?php echo L('please_choose_type')?>"}).inputValidator({min:1,onerror:"<?php echo L('please_choose_type')?>"}).defaultPassed();
$("#title").formValidator({autotip:true,onshow:"<?php echo L('please_input_title')?>",onfocus:"<?php echo L('please_input_title')?>"}).inputValidator({min:1,onerror:"<?php echo L('please_input_title')?>"}).defaultPassed();
$("#content").formValidator({autotip:true,onshow:"",onfocus:"<?php echo L('content_empty')?>"}).functionValidator({
fun:function(val,elem){
//获取编辑器中的内容
var oEditor = CKEDITOR.instances.content;
var data = oEditor.getData();
if($('#islink').attr('checked')){
return true;
}else if(($('#islink').attr('checked')==false) && (data=='')){
return "<?php echo L('content_empty')?>"
} else { return true; }
}
}).defaultPassed();
/*
* 加载禁用外边链接
*/
<?php if($info['islink']==0) {?>
$('#linkurl').attr('disabled',true);
$('#islink').attr('checked',false);
<?php }?>
$('.edit_content').hide();
});
document.title='编辑:<?php echo $info['title']?>';
self.moveTo(0, 0);
function refersh_window() {
setcookie('refersh_time', 1);
}
//-->
</script> | PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
$show_header = $show_validator = $show_scroll = 1;
include $this->admin_tpl('header','admin');
?>
<br />
<div class="pad-lr-10">
<div id="searchid" style="display:">
<form name="searchform" action="" method="get" >
<input type="hidden" value="special" name="m">
<input type="hidden" value="special" name="c">
<input type="hidden" value="public_get_pics" name="a">
<table width="100%" cellspacing="0" class="search-form">
<tbody>
<tr>
<td>
<div class="explain-col">
<?php echo $model_form?>
<span id="catids"></span> <span id="title" style="display:none;"><?php echo L('title')?>:<input type="text" name="title" size="20"></span>
<?php echo L('input_time')?>:
<?php $start_f = $_GET['start_time'] ? $_GET['start_time'] : format::date(SYS_TIME-2592000);$end_f = $_GET['end_time'] ? $_GET['end_time'] : format::date(SYS_TIME+86400);?>
<?php echo form::date('start_time', $start_f, 1)?> - <?php echo form::date('end_time', $end_f, 1)?>
<input type="submit" name="search" class="button" value="<?php echo L('search')?>" />
</div>
</td>
</tr>
</tbody>
</table>
</form>
</div>
<div class="table-list">
<table width="100%">
<thead>
<tr>
<th><?php echo L('content_title')?></th>
</tr>
</thead>
<tbody>
<?php if(is_array($data)) { foreach ($data as $r) {?>
<tr>
<td><label style="display:block"><input type="radio" onclick="choosed(<?php echo $r['id']?>, <?php echo $r['catid']?>, '<?php echo $r['title']?>')" class="inputcheckbox " name='ids' value="<?php echo $r['id'];?>"> <?php echo $r['title'];?></label></td>
</tr>
<?php } }?>
</tbody>
</table>
<div class="btn"> <input type="hidden" name="msg_id" id="msg_id"> </div>
<div id="pages"><?php echo $pages;?></div>
</div>
</div>
</body>
</html>
<script type="text/javascript">
function choosed(contentid, catid, title) {
var msg = contentid+'|'+catid+'|'+title;
$('#msg_id').val(msg);
}
function select_categorys(modelid, id) {
if(modelid) {
$.get('', {m: 'special', c: 'special', a: 'public_categorys_list', modelid: modelid, catid: id, pc_hash: pc_hash }, function(data){
if(data) {
$('#catids').html(data);
$('#title').show();
} else {
$('#catids').html('');
$('#title').hide();
}
});
}
}
select_categorys(<?php echo $_GET['modelid']?>, <?php echo $_GET['catid']?>);
$(document).ready(function(){
$.formValidator.initConfig({formid:"myform",autotip:true,onerror:function(msg,obj){window.top.art.dialog({content:msg,lock:true,width:'220',height:'70'}, function(){this.close();$(obj).focus();})}});
$("#typeid").formValidator({tipid:"msg_id",onshow:"<?php echo L('please_choose_type')?>",oncorrect:"<?php echo L('true')?>"}).inputValidator({min:1,onerror:"<?php echo L('please_choose_type')?>"});
});
$("#myform").submit(function (){
var str = 0;
$("input[name='ids[]']").each(function() {
if($(this).attr('checked')==true) str = 1;
});
if(str==0) {
alert('<?php echo L('choose_news')?>');
return false;
}
return true;
});
</script> | PHP |
<?php
defined('IN_PHPCMS') or exit('No permission resources.');
pc_base::load_app_func('global', 'special');
class index {
private $db;
function __construct() {
$this->db = pc_base::load_model('special_model');
}
/**
* 专题列表
*/
public function special() {
$siteid = $_GET['siteid'] ? intval($_GET['siteid']) : (get_siteid() ? get_siteid() : 1);
$SEO = seo($siteid);
include template('special', 'special_list');
}
/**
* 专题首页
*/
public function init() {
$specialid = $_GET['id'] ? $_GET['id'] : ($_GET['specialid'] ? $_GET['specialid'] : 0);
if (!$specialid) showmessage(L('illegal_action'));
$info = $this->db->get_one(array('id'=>$specialid, 'disabled'=>0));
if(!$info) showmessage(L('special_not_exist'), 'back');
extract($info);
$css = get_css(unserialize($css));
if(!$ispage) {
$type_db = pc_base::load_model('type_model');
$types = $type_db->select(array('module'=>'special', 'parentid'=>$specialid), '*', '', '`listorder` ASC, `typeid` ASC', '', 'listorder');
}
if ($pics) {
$pic_data = get_pic_content($pics);
unset($pics);
}
if ($voteid) {
$vote_info = explode('|', $voteid);
$voteid = $vote_info[1];
}
$siteid = $_GET['siteid'] ? $_GET['siteid'] : get_siteid();
$SEO = seo($siteid, '', $title, $description);
$commentid = id_encode('special', $id, $siteid);
$template = $info['index_template'] ? $info['index_template'] : 'index';
include template('special', $template);
}
/**
* 专题分类
*/
public function type() {
$typeid = intval($_GET['typeid']);
$specialid = intval($_GET['specialid']);
if (!$specialid || !$typeid) showmessage(L('illegal_action'));
$info = $this->db->get_one(array('id'=>$specialid, 'disabled'=>0));
if(!$info) showmessage(L('special_not_exist'), 'back');
$page = max(intval($_GET['page']), 1);
extract($info);
$css = get_css(unserialize($css));
if(!$typeid) showmessage(L('illegal_action'));
$type_db = pc_base::load_model('type_model');
$info = $type_db->get_one(array('typeid'=>$_GET['typeid']));
$SEO = seo($siteid, '', $info['typename'], '');
$template = $list_template ? $list_template : 'list';
include template('special', $template);
}
/**
* 专题展示
*/
public function show() {
$id = intval($_GET['id']);
if(!$id) showmessage(L('content_not_exist'),'blank');
$page = max(intval($_GET['page']), 1);
$c_db = pc_base::load_model('special_content_model');
$c_data_db = pc_base::load_model('special_c_data_model');
$rs = $c_db->get_one(array('id'=>$_GET['id']));
if(!$rs) showmessage(L('content_checking'),'blank');
extract($rs);
if ($isdata) {
$arr_content = $c_data_db->get_one(array('id'=>$_GET['id']));
if (is_array($arr_content)) extract($arr_content);
}
$siteid = get_siteid();
if ($paginationtype) { //文章使用分页时
if($paginationtype==1) {
if (strpos($content, '[/page]')!==false) {
$content = preg_replace("|\[page\](.*)\[/page\]|U", '', $content);
}
if (strpos($content, '[page]')!==false) {
$content = str_replace('[page]', '', $content);
}
$contentpage = pc_base::load_app_class('contentpage', 'content'); //调用自动分页类
$content = $contentpage->get_data($content, $maxcharperpage); //自动分页,自动添加上[page]
}
} else {
if (strpos($content, '[/page]')!==false) {
$content = preg_replace("|\[page\](.*)\[/page\]|U", '', $content);
}
if (strpos($content, '[page]')!==false) {
$content = str_replace('[page]', '', $content);
}
}
$template = $show_template ? $show_template : 'show'; //调用模板
$CONTENT_POS = strpos($content, '[page]');
if ($CONTENT_POS !== false) {
$contents = array_filter(explode('[page]', $content));
$pagenumber = count($contents);
$END_POS = strpos($content, '[/page]');
if ($END_POS!==false && ($CONTENT_POS<7)) {
$pagenumber--;
}
for ($i=1; $i<=$pagenumber; $i++) {
$pageurls[$i] = content_url($_GET['id'], $i, $inputtime, 'php');
}
if ($END_POS !== false) {
if($CONTENT_POS>7) {
$content = '[page]'.$title.'[/page]'.$content;
}
if (preg_match_all("|\[page\](.*)\[/page\]|U", $content, $m, PREG_PATTERN_ORDER)) {
foreach ($m[1] as $k=>$v) {
$p = $k+1;
$titles[$p]['title'] = strip_tags($v);
$titles[$p]['url'] = $pageurls[$p][1];
}
}
}
//判断[page]出现的位置是否在第一位
if($CONTENT_POS<7) {
$content = $contents[$page];
} else {
if ($page==1 && !empty($titles)) {
$content = $title.'[/page]'.$contents[$page-1];
} else {
$content = $contents[$page-1];
}
}
if($titles) {
list($title, $content) = explode('[/page]', $content);
$content = trim($content);
if(strpos($content,'</p>')===0) {
$content = '<p>'.$content;
}
if(stripos($content,'<p>')===0) {
$content = $content.'</p>';
}
}
pc_base::load_app_func('util', 'content');
$title_pages = content_pages($pagenumber,$page, $pageurls);
}
$_special = $this->db->get_one(array('id'=>$specialid), '`title`, `url`');
pc_base::load_sys_class('format', '', 0);
$inputtime = format::date($inputtime);
$SEO = seo($siteid, '', $title);
$template = $show_template ? $show_template : 'show';
$style = $style ? $style : 'default';
include template('special', $template, $style);
}
public function comment_show() {
$commentid = isset($_GET['commentid']) ? $_GET['commentid'] : 0;
$url = isset($_GET['url']) ? $_GET['url'] : HTTP_REFERER;
$id = isset($_GET['id']) ? intval($_GET['id']) : 0;
$userid = param::get_cookie('_userid');
include template('special', 'comment_show');
}
public function comment() {
if (!$_GET['id']) return '0';
$siteid = $_GET['siteid'] ? $_GET['siteid'] : get_siteid();
$id = intval($_GET['id']);
$commentid = id_encode('special', $id, $siteid);
$username = param::get_cookie('_username');
$userid = param::get_cookie('_userid');
if (!$userid) {
showmessage(L('login_website'), APP_PATH.'index.php?m=member&c=index');
}
$date = date('m-d H:i', SYS_TIME);
if ($_POST['dosubmit']) {
$r = $this->db->get_one(array('id'=>$_POST['id']), '`title`, `url`');
$comment = pc_base::load_app_class('comment', 'comment');
if ($comment->add($commentid, $siteid, array('userid'=>$userid, 'username'=>$username, 'content'=>$_POST['content']), '', $r['title'], $r['url'])) {
exit($username.'|'.SYS_TIME.'|'.$_POST['content']);
} else {
exit(0);
}
} else {
pc_base::load_sys_class('form');
include template('special', 'comment');
}
}
}
?> | PHP |
<?php
/**
* special_tag.class.php 专题标签调用类
* @author
*
*/
class special_tag {
private $db, $c;
public function __construct() {
$this->db = pc_base::load_model('special_model');
$this->c = pc_base::load_model('special_content_model');
}
/**
* lists调用方法
* @param array $data 标签配置传递过来的配置数组,根据配置生成sql
*/
public function lists($data) {
$siteid = $data['siteid'] ? intval($data['siteid']) : get_siteid();
$where .= "`siteid`='".$siteid."'";
if ($data['elite']) $where .= " AND `elite`='1'";
if ($data['thumb']) $where .= " AND `thumb`!=''";
$listorder = array('`id` ASC', '`id` DESC', '`listorder` ASC, `id` DESC', '`listorder` DESC, `id` DESC');
return $this->db->select($where, '*', $data['limit'], $listorder[$data['listorder']]);
}
/**
* 标签中计算分页的方法
* @param array $data 标签配置数组,根据数组计算出分页
*/
public function count($data) {
$where = '1';
if($data['action'] == 'lists') {
$where = '1';
if ($data['siteid']) $where .= " AND `siteid`='".$data['siteid']."'";
if ($data['elite']) $where .= " AND `elite`='1'";
if ($data['thumb']) $where .= " AND `thumb`!=''";
$r = $this->db->get_one($where, 'COUNT(id) AS total');
} elseif ($data['action'] == 'content_list') {
if ($data['specialid']) $where .= " AND `specialid`='".$data['specialid']."'";
if ($data['typeid']) $where .= " AND `typeid`='".$data['typeid']."'";
if ($data['thumb']) $where .= " AND `thumb`!=''";
$r = $this->c->get_one($where, 'COUNT(id) AS total');
} elseif ($data['action'] == 'hits') {
$hitsid = 'special-c';
if ($data['specialid']) $hitsid .= $data['specialid'].'-';
else $hitsid .= '%-';
$hitsid = $hitsid .= '%';
$hits_db = pc_base::load_model('hits_model');
$sql = "hitsid LIKE '$hitsid'";
$r = $hits_db->get_one($sql, 'COUNT(*) AS total');
}
return $r['total'];
}
/**
* 点击排行调用方法
* @param array $data 标签配置数组
*/
public function hits($data) {
$hitsid = 'special-c-';
if ($data['specialid']) $hitsid .= $data['specialid'].'-';
else $hitsid .= '%-';
$hitsid = $hitsid .= '%';
$this->hits_db = pc_base::load_model('hits_model');
$sql = "hitsid LIKE '$hitsid'";
$listorders = array('views DESC', 'yesterdayviews DESC', 'dayviews DESC', 'weekviews DESC', 'monthviews DESC');
$result = $this->hits_db->select($sql, '*', $data['limit'], $listorders[$data['listorder']]);
foreach ($result as $key => $r) {
$ids = explode('-', $r['hitsid']);
$id = $ids[3];
$re = $this->c->get_one(array('id'=>$id));
$result[$key]['title'] = $re['title'];
$result[$key]['url'] = $re['url'];
}
return $result;
}
/**
* 内容列表调用方法
* @param array $data 标签配置数组
*/
public function content_list($data) {
$where = '1';
if ($data['specialid']) $where .= " AND `specialid`='".$data['specialid']."'";
if ($data['typeid']) $where .= " AND `typeid`='".$data['typeid']."'";
if ($data['thumb']) $where .= " AND `thumb`!=''";
$listorder = array('`id` ASC', '`id` DESC', '`listorder` ASC', '`listorder` DESC');
$result = $this->c->select($where, '*', $data['limit'], $listorder[$data['listorder']]);
if (is_array($result)) {
foreach($result as $k => $r) {
if ($r['curl']) {
$content_arr = explode('|', $r['curl']);
$r['url'] = go($content_arr['1'], $content_arr['0']);
}
$res[$k] = $r;
}
} else {
$res = array();
}
return $res;
}
/**
* 获取专题分类方法
* @param intval $specialid 专题ID
* @param string $value 默认选中值
* @param intval $id onchange影响HTML的ID
*
*/
public function get_type($specialid = 0, $value = '', $id = '') {
$type_db = pc_base::load_model('type_model');
$data = $arr = array();
$data = $type_db->select(array('module'=>'special', 'parentid'=>$specialid));
pc_base::load_sys_class('form', '', 0);
foreach($data as $r) {
$arr[$r['typeid']] = $r['name'];
}
$html = $id ? ' id="typeid" onchange="$(\'#'.$id.'\').val(this.value);"' : 'name="typeid", id="typeid"';
return form::select($arr, $value, $html, L('please_select'));
}
/**
* 标签生成方法
*/
public function pc_tag() {
//获取站点
$sites = pc_base::load_app_class('sites','admin');
$sitelist = $sites->pc_tag_list();
$result = getcache('special', 'commons');
if(is_array($result)) {
$specials = array(L('please_select'));
foreach($result as $r) {
if($r['siteid']!=get_siteid()) continue;
$specials[$r['id']] = $r['title'];
}
}
return array(
'action'=>array('lists'=>L('special_list', '', 'special'), 'content_list'=>L('content_list', '', 'special'), 'hits'=>L('hits_order','','special')),
'lists'=>array(
'siteid'=>array('name'=>L('site_id','','comment'), 'htmltype'=>'input_select', 'data'=>$sitelist),
'elite'=>array('name'=>L('iselite', '', 'special'), 'htmltype'=>'radio', 'defaultvalue'=>'0', 'data'=>array(L('no'), L('yes'))),
'thumb'=>array('name'=>L('get_thumb', '', 'special'), 'htmltype'=>'radio','defaultvalue'=>'0','data'=>array(L('no'), L('yes'))),
'listorder'=>array('name'=>L('order_type', '', 'special'), 'htmltype'=>'select', 'defaultvalue'=>'3', 'data'=>array(L('id_asc', '', 'special'), L('id_desc', '','special'), L('order_asc','','special'), L('order_desc', '','special'))),
),
'content_list'=>array(
'specialid'=>array('name'=>L('special_id','','special'),'htmltype'=>'input_select', 'data'=>$specials, 'ajax'=>array('name'=>L('for_type','','special'), 'action'=>'get_type', 'id'=>'typeid')),
'thumb'=>array('name'=>L('content_thumb','','special'),'htmltype'=>'radio','defaultvalue'=>'0','data'=>array(L('no'), L('yes'))),
'listorder'=>array('name'=>L('order_type', '', 'special'), 'htmltype'=>'select', 'defaultvalue'=>'3', 'data'=>array(L('id_asc', '', 'special'), L('id_desc', '','special'), L('order_asc','','special'), L('order_desc', '','special'))),
),
'hits' => array(
'specialid' => array('name'=>L('special_id','','special'), 'htmltype'=>'input_select', 'data'=>$specials),
'listorder' => array('name' => L('order_type', '', 'special'), 'htmltype' => 'select', 'data'=>array(L('total','','special'), L('yesterday', '','special'), L('today','','special'), L('week','','special'), L('month','','special'))),
),
);
}
}
?> | PHP |
<?php
/**
* special_api.class.php 专题接口类
*
* @copyright (C) 2005-2010 PHPCMS
* @license http://www.phpcms.cn/license/
* @lastmodify 2010-8-3
*/
defined('IN_PHPCMS') or exit('No permission resources.');
class special_api {
private $db, $type_db, $c_db, $data_db;
public $pages;
public function __construct() {
$this->db = pc_base::load_model('special_model'); //专题数据模型
$this->type_db = pc_base::load_model('type_model'); //专题分类数据模型
$this->c_db = pc_base::load_model('special_content_model'); //专题内容数据模型
$this->data_db = pc_base::load_model('special_c_data_model');
}
/**
* 更新分类
* @param intval $pid 专题ID
* @param string $type 分类字符串 每行一个分类。格式为:分类名|分类目录,例:最新新闻|news last
* @param string $a 添加时直接加入到数据库,修改是需要判断。
* @return boolen
*/
public function _update_type($specialid, $type, $a = 'add') {
$specialid = intval($specialid);
if (!$specialid) return false;
$special_info = $this->db->get_one(array('id'=>$specialid));
$app_path = substr(APP_PATH, 0, -1);
foreach ($type as $k => $v) {
if (!$v['name'] || !$v['typedir']) continue;
//添加时,无需判断直接加到数据表中,修改时应判断是否为新添加、修改还是删除
$siteid = get_siteid();
if ($a == 'add' && !$v['del']) {
$typeid = $this->type_db->insert(array('siteid'=>$siteid, 'module'=>'special', 'name'=>$v['name'], 'listorder'=>$v['listorder'], 'typedir'=>$v['typedir'], 'parentid'=>$specialid, 'listorder'=>$k), true);
if ($siteid>1) {
$site = pc_base::load_app_class('sites', 'admin');
$site_info = $site->get_by_id($siteid);
if ($special_info['ishtml']) {
$url = $site_info['domain'].'special/'.$special_info['filename'].'/'.$v['typedir'].'/'.'type-'.$typeid.'.html';
} else {
$url = $site_info['domain'].'index.php?m=special&c=index&a=type&specialid='.$specialid.'&typeid='.$typeid;
}
} else {
if($special_info['ishtml']) $url = addslashes($app_path.pc_base::load_config('system', 'html_root').'/special/'.$special_info['filename'].'/'.$v['typedir'].'/'.'type-'.$typeid.'.html');
else $url = APP_PATH.'index.php?m=special&c=index&a=type&specialid='.$specialid.'&typeid='.$typeid;
}
$this->type_db->update(array('url'=>$url), array('typeid'=>$typeid));
} elseif ($a == 'edit') {
if ((!isset($v['typeid']) || empty($v['typeid'])) && (!isset($v['del']) || empty($v['del']))) {
$typeid = $this->type_db->insert(array('siteid'=>$siteid, 'module'=>'special', 'name'=>$v['name'], 'listorder'=>$v['listorder'], 'typedir'=>$v['typedir'], 'parentid'=>$specialid, 'listorder'=>$k), true);
if ($siteid>1) {
$site = pc_base::load_app_class('sites', 'admin');
$site_info = $site->get_by_id($siteid);
if ($special_info['ishtml']) {
$url = $site_info['domain'].'special/'.$special_info['filename'].'/'.$v['typedir'].'/'.'type-'.$typeid.'.html';
} else {
$url = $site_info['domain'].'index.php?m=special&c=index&a=type&specialid='.$specialid.'&typeid='.$typeid;
}
} else {
if($special_info['ishtml']) $url = addslashes($app_path.pc_base::load_config('system', 'html_root').'/special/'.$special_info['filename'].'/'.$v['typedir'].'/'.'type-'.$typeid.'.html');
else $url = APP_PATH.'index.php?m=special&c=index&a=type&specialid='.$specialid.'&typeid='.$typeid;
}
$v['url'] = $url;
$this->type_db->update($v, array('typeid'=>$typeid));
}
if ((!isset($v['del']) || empty($v['del'])) && $v['typeid']) {
$this->type_db->update(array('name'=>$v['name'], 'typedir'=>$v['typedir'], 'listorder'=>$v['listorder']), array('typeid'=>$r['typeid']));
if ($siteid>1) {
$site = pc_base::load_app_class('sites', 'admin');
$site_info = $site->get_by_id($siteid);
if ($special_info['ishtml']) {
$url = $site_info['domain'].'special/'.$special_info['filename'].'/'.$v['typedir'].'/'.'type-'.$v['typeid'].'.html';
} else {
$url = $site_info['domain'].'index.php?m=special&c=index&a=type&specialid='.$specialid.'&typeid='.$v['typeid'];
}
} else {
if($special_info['ishtml']) $url = addslashes($app_path.pc_base::load_config('system', 'html_root').'/special/'.$special_info['filename'].'/'.$v['typedir'].'/'.'type-'.$v['typeid'].'.html');
else $url = APP_PATH.'index.php?m=special&c=index&a=type&specialid='.$specialid.'&typeid='.$v['typeid'];
}
$v['url'] = $url;
$typeid = $v['typeid'];
unset($v['typeid']);
$this->type_db->update($v, array('typeid'=>$typeid));
}
if ($v['typeid'] && $v['del']) {
$this->delete_type($v['typeid'], $siteid, $special_info['ishtml']);
}
}
}
return true;
}
/**
* 调取内容信息
* @param intval $modelid 模型ID
* @param string $where sql语句
* @param intval $page 分页
* @return array 返回调取的数据
*/
public function _get_import_data($modelid = 0, $where = '', $page) {
$c = pc_base::load_model('content_model');
if(!$modelid) return '';
$c->set_model($modelid);
$data = $c->listinfo($where, '`id` DESC', $page);
$this->pages = $c->pages;
return $data;
}
/**
* 信息推荐至专题接口
* @param array $param 属性 请求时,为模型、栏目数组。 例:array('modelid'=>1, 'catid'=>12); 提交添加为二维信息数据 。例:array(1=>array('title'=>'多发发送方法', ....))
* @param array $arr 参数 表单数据,只在请求添加时传递。
* @return 返回专题的下拉列表
*/
public function _get_special($param = array(), $arr = array()) {
if ($arr['dosubmit']) {
foreach ($param as $id => $v) {
if (!$arr['specialid'] || !$arr['typeid']) continue;
if (!$this->c_db->get_one(array('title'=>$v['title'], 'specialid'=>$arr['specialid']))) {
$info['specialid'] = $arr['specialid'];
$info['typeid'] = $arr['typeid'];
$info['title'] = $v['title'];
$info['thumb'] = $v['thumb'];
$info['url'] = $v['url'];
$info['curl'] = $v['id'].'|'.$v['catid'];
$info['description'] = $v['description'];
$info['userid'] = $v['userid'];
$info['username'] = $v['username'];
$info['inputtime'] = $v['inputtime'];
$info['updatetime'] = $v['updatetime'];
$info['islink'] = 1;
$this->c_db->insert($info, true);
}
}
return true;
} else {
$datas = getcache('special', 'commons');
$special = array(L('please_select'));
if (is_array($datas)) {
foreach ($datas as $sid => $d) {
if ($d['siteid']==get_siteid()) {
$special[$sid] = $d['title'];
}
}
}
return array(
'specialid' => array('name'=>L('special_list','','special'), 'htmltype'=>'select', 'data'=>$special, 'ajax'=>array('name'=>L('for_type','','special'), 'action'=>'_get_type', 'm'=>'special', 'id'=>'typeid')),
'validator' => '$(\'#specialid\').formValidator({autotip:true,onshow:"'.L('please_choose_special','','special').'",oncorrect:"'.L('true', '', 'special').'"}).inputValidator({min:1,onerror:"'.L('please_choose_special','','special').'"});$(\'#typeid\').formValidator({autotip:true,onshow:"'.L('please_choose_type', '', 'special').'",oncorrect:"'.L('true', '', 'special').'"}).inputValidator({min:1,onerror:"'.L('please_choose_type', '', 'special').'"});',
);
}
}
/**
* 获取分类
* @param intval $specialid 专题ID
*/
public function _get_type($specialid = 0) {
$type_db = pc_base::load_model('type_model');
$data = $arr = array();
$data = $type_db->select(array('module'=>'special', 'parentid'=>$specialid));
pc_base::load_sys_class('form', '', 0);
foreach ($data as $r) {
$arr[$r['typeid']] = $r['name'];
}
return form::select($arr, '', 'name="typeid", id="typeid"', L('please_select'));
}
/**
* 调取专题的附属分类
* @param intval $specialid 专题ID
* @return array 专题的附属分类
*/
public function _get_types($specialid = 0) {
if (!$specialid) return false;
$rs = $this->type_db->select(array('parentid'=>$specialid, 'siteid'=>get_siteid()), 'typeid, name');
$types = array();
foreach ($rs as $r) {
$types[$r['typeid']] = $r['name'];
}
return $types;
}
/**
* 删除专题 执行删除操作的方法,同时删除专题下的分类、信息、及生成静态文件和图片
* @param intval $id 专题ID
* @return boolen
*/
public function _del_special($id = 0) {
$id = intval($id);
if (!$id) return false;
//检查专题下是否有信息
$rs = $this->c_db->select(array('specialid'=>$id), 'id');
$info = $this->db->get_one(array('id'=>$id, 'siteid'=>get_siteid()), 'siteid, ispage, filename, ishtml');
//有信息时,循环删除
if (is_array($rs) && !empty($rs)) {
foreach ($rs as $r) {
$this->_delete_content($r['id'], $info['siteid'], $info['ishtml']);
}
}
//删除专题的附属分类
$type_info = $this->type_db->select(array('module'=>'special', 'parentid'=>$id, 'siteid'=>get_siteid()), '`typeid`');
if (is_array($type_info) && !empty($type_info)) {
foreach ($type_info as $t) {
$this->delete_type($t['typeid'], $info['siteid'], $info['ishtml']);
}
}
pc_base::load_sys_func('dir');
$this->db->delete(array('id'=>$id, 'siteid'=>get_siteid()));
if ($info['siteid']>1) {
if ($info['ishtml']) {
$queue = pc_base::load_model('queue_model');
$site = pc_base::load_app_class('sites', 'admin');
$site_info = $site->get_by_id($info['siteid']);
$file = pc_base::load_config('system', 'html_root').'/'.$site_info['dirname'].'/special/'.$info['filename'].'/index.html';
if ($info['ispage']) {
for ($i==1; $i>0; $i++) {
if ($i>1) {
$file = str_replace('.html', '-'.$i.'.html', $file);
}
if (!file_exists(PHPCMS_PATH.$file)) {
break;
} else {
$queue->add_queue('del', $file, $info['siteid']);
unlink(PHPCMS_PATH.$file);
}
}
} else {
$queue->add_queue('del', $file, $info['siteid']);
unlink(PHPCMS_PATH.$file);
}
$queue->add_queue('del', pc_base::load_config('system', 'html_root').'/'.$site_info['dirname'].'/special/'.$info['filename'].'/', $info['siteid']);
dir_delete(pc_base::load_config('system', 'html_root').'/'.$site_info['dirname'].'/special/'.$info['filename']);
}
} else {
if ($info['ishtml']) {
dir_delete(PHPCMS_PATH.pc_base::load_config('system', 'html_root').DIRECTORY_SEPARATOR.'special'.DIRECTORY_SEPARATOR.$info['filename']); //删除专题目录
}
}
if(pc_base::load_config('system','attachment_stat')) {
$keyid = 'special-'.$id;
$this->attachment_db = pc_base::load_model('attachment_model');
$this->attachment_db->api_delete($keyid);
}
return true;
}
/**
* 导入的数据添加到数据表
* @param intval $modelid 模型ID
* @param intval $specialid 信息的所属专题ID
* @param intval $id 信息的ID
* @param intval $typeid 信息的分类ID
* @param intval $listorder 信息的排序
*/
public function _import($modelid, $specialid, $id, $typeid, $listorder = 0) {
if (!$specialid || !$id || !$typeid) return false;
$c = pc_base::load_model('content_model');
$c->set_model($modelid);
$info = $c->get_one(array('id'=>$id, 'status'=>99), '`id`, `catid`, `title`, `thumb`, `url`, `description`, `username`, `inputtime`, `updatetime`');
if ($info) {
$info['curl'] = $info['id'].'|'.$info['catid'];
unset($info['id'], $info['catid']);
if(!$this->c_db->get_one(array('title'=>addslashes($info['title']), 'specialid'=>$specialid, 'typeid'=>$typeid))) {
$info['specialid'] = $specialid;
$info['typeid'] = $typeid;
$info['islink'] = 1;
$info['listorder'] = $listorder;
$info = new_addslashes($info);
return $this->c_db->insert($info, true);
}
}
return false;
}
/**
* 删除专题分类
* @param intval $typeid 专题附属分类ID
* @param intval $siteid 站点ID
* @param intval $ishtml 专题是否生成静态
*/
private function delete_type($typeid = 0, $siteid = 0, $ishtml = 0) {
$typeid = intval($typeid);
if (!$typeid) return false;
pc_base::load_sys_func('dir');
$info = $this->type_db->get_one(array('typeid'=>$typeid));
if ($ishtml) {
$siteid = $siteid ? intval($siteid) : get_siteid();
if ($siteid>1) {
$site = pc_base::load_app_class('sites', 'admin');
$site_info = $site->get_by_id($siteid);
$queue = pc_base::load_model('queue_model');
for ($i = 1; $i>0; $i++) {
if ($i==1) $file = str_replace($site_info['domain'], pc_base::load_config('system', 'html_root').'/'.$site_info['dirname'].'/', $info['url']);
else $file = str_replace(array($site_info['domain'], '.html'), array(pc_base::load_config('system', 'html_root').'/'.$site_info['dirname'].'/', '-'.$i.'.html'), $info['url']);
if (!file_exists(PHPCMS_PATH.$file)) {
break;
} else {
$queue->add_queue('del', $file, $siteid); //并加入到消息队列中,便以其他站点删除文件
unlink(PHPCMS_PATH.$file); //删除生成的静态文件
}
}
} else {
for ($i = 1; $i>0; $i++) {
if ($i==1) $file = str_replace(APP_PATH, '', $info['url']);
else $file = str_replace(array(APP_PATH, '.html'), array('', '-'.$i.'.html'), $info['url']);
if (!file_exists(PHPCMS_PATH.$file)) {
break;
} else {
unlink(PHPCMS_PATH.$file); //删除生成的静态文件
}
}
}
}
$this->type_db->delete(array('typeid'=>$typeid)); //删除数据表记录
return true;
}
/**
* 删除专题信息,同时删除专题的信息,及相关的静态文件、图片
* @param intval $cid 专题信息ID
* @param intval $siteid 所属站点
* @param intval $ishtml 专题是否生成静态
*/
public function _delete_content($cid = 0, $siteid = 0, $ishtml = 0) {
$info = $this->c_db->get_one(array('id'=>$cid), 'inputtime, isdata');
if ($info['isdata']) {
if ($ishtml) {
pc_base::load_app_func('global', 'special');
$siteid = $siteid ? intval($siteid) : get_siteid();
if ($siteid>1) {
$site = pc_base::load_app_class('sites', 'admin');
$site_info = $site->get_by_id($siteid);
$queue = pc_base::load_model('queue_model');
for ($i = 1; $i>0; $i++) {
$file = content_url($cid, $i, $info['inputtime'], 'html', $site_info);
if (!file_exists(PHPCMS_PATH.$file[1])) {
break;
} else {
$queue->add_queue('del', $file[1], $siteid); //并加入到消息队列中,便以其他站点删除文件
unlink(PHPCMS_PATH.$file[1]); //删除生成的静态文件
}
}
} else {
for ($i = 1; $i>0; $i++) {
$file = content_url($cid, $i, $info['inputtime']);
if (!file_exists(PHPCMS_PATH.$file[1])) {
break;
} else {
unlink(PHPCMS_PATH.$file[1]); //删除生成的静态文件
}
}
}
}
//删除全站搜索数据
$this->search_api($cid, '', '', 'delete');
// 删除数据统计表数据
$count = pc_base::load_model('hits_model');
$hitsid = 'special-c-'.$info['specialid'].'-'.$cid;
$count->delete(array('hitsid'=>$hitsid));
//删除信息内容表中的数据
$this->data_db->delete(array('id'=>$cid));
}
$this->c_db->delete(array('id'=>$cid)); //删除信息表中的数据
return true;
}
/**
* 添加到全站搜索
* @param intval $id 文章ID
* @param array $data 数组
* @param string $title 标题
* @param string $action 动作
*/
private function search_api($id = 0, $data = array(), $title, $action = 'update') {
$this->search_db = pc_base::load_model('search_model');
$siteid = get_siteid();
$type_arr = getcache('type_module_'.$siteid,'search');
$typeid = $type_arr['special'];
if($action == 'update') {
$fulltextcontent = $data['content'];
return $this->search_db->update_search($typeid ,$id, $fulltextcontent,$title);
} elseif($action == 'delete') {
$this->search_db->delete_search($typeid ,$id);
}
}
}
?> | PHP |
<?php
/**
* search_api.class.php 专题执行接口类
*
*/
defined('IN_PHPCMS') or exit('No permission resources.');
class search_api {
private $db, $c;
public function __construct() {
$this->db = pc_base::load_model('special_content_model');
$this->c = pc_base::load_model('special_c_data_model');
}
/**
* 获取内容接口
* @param intval $pagesize 每页个数
* @param intval $page 当前页数
*/
public function fulltext_api($pagesize = 100, $page = 1) {
$result = $r = $data = $tem = array();
$offset = ($page-1)*$pagesize;
$result = $this->db->select(array('isdata'=>1), '`id`, `title`, `inputtime`', $offset.','.$pagesize, '`id` ASC');
foreach ($result as $r) {
$d = $this->c->get_one(array('id'=>$r['id']), '`content`');
$tem['title'] = addslashes($r['title']);
$tem['fulltextcontent'] = $d['content'];
$tem['adddate'] = $r['inputtime'];
$data[$r['id']] = $tem;
}
return $data;
}
/**
* 计算总数接口
*/
public function total() {
$r = $this->db->get_one(array('isdata'=>1), 'COUNT(*) AS num');
return $r['num'];
}
/**
* 获取专题下内容数据
* @param string/intval $ids 多个id用“,”分开
*/
public function get_search_data($ids) {
$where = to_sqls($ids, '', 'id');
$data = $this->db->select($where, '`id`, `title`, `thumb`, `description`, `url`, `inputtime`', '', '', '', 'id');
return $data;
}
} | PHP |
<?php
/**
* push_api.class.php 专题推送接口类
*
*/
defined('IN_PHPCMS') or exit('No permission resources.');
class push_api {
private $special_api;
public function __construct() {
$this->special_api = pc_base::load_app_class('special_api', 'special');
}
/**
* 信息推荐至专题接口
* @param array $param 属性 请求时,为模型、栏目数组。 例:array('modelid'=>1, 'catid'=>12); 提交添加为二维信息数据 。例:array(1=>array('title'=>'多发发送方法', ....))
* @param array $arr 参数 表单数据,只在请求添加时传递。
* @return 返回专题的下拉列表
*/
public function _push_special($param = array(), $arr = array()) {
return $this->special_api->_get_special($param, $arr);
}
public function _get_type($specialid) {
return $this->special_api->_get_type($specialid);
}
}
?> | PHP |
<?php
/**
* 获取专题评论类
*/
defined('IN_PHPCMS') or exit('No permission resources.');
if (!module_exists('comment')) showmessage(L('module_not_exists'));
class comment_api {
private $db;
function __construct() {
$this->db = pc_base::load_model('special_model');
}
/**
* 获取评论信息
* @param $module 模型
* @param $contentid 文章ID
* @param $siteid 站点ID
*/
function get_info($module, $contentid, $siteid) {
if ($module=='special') {
$r = $this->db->get_one(array('id'=>$contentid, 'siteid'=>$siteid), 'title, url');
return array('title'=>$r['title'], 'url'=>$r['url']);
} elseif ($module=='special_content') {
$this->db = pc_base::load_model('special_content_model');
$r = $this->db->get_one(array('id'=>$contentid), 'title, url');
if ($r) {
return array('title'=>$r['title'], 'url'=>$r['url']);
} else {
return false;
}
}
}
} | PHP |
<?php
/**
* html.class.php 生成静态类
*/
defined('IN_PHPCMS') or exit('No permission resources.');
class html {
private $db, $type_db, $c_db, $data_db, $site, $queue;
public function __construct() {
$this->db = pc_base::load_model('special_model'); //专题数据模型
$this->type_db = pc_base::load_model('type_model'); //专题分类数据模型
$this->c_db = pc_base::load_model('special_content_model'); //专题内容数据模型
$this->data_db = pc_base::load_model('special_c_data_model');
$this->site = pc_base::load_app_class('sites', 'admin');
$this->queue = pc_base::load_model('queue_model');
define('HTML', true);
}
/**
* 生成文章静态页
* @param intval $contentid 文章ID
* @return string 返回文章的url
*/
public function _create_content($contentid = 0) {
if (!$contentid) return false;
pc_base::load_app_func('global', 'special');
$r = $this->c_db->get_one(array('id'=>$contentid));
$_special = $s_info = $this->db->get_one(array('id'=>$r['specialid']));
if($s_info['ishtml']==0) return content_url($contentid, '1', 0, 'php');
unset($arr_content);
$arr_content = $this->data_db->get_one(array('id'=>$contentid));
@extract($r);
$title = strip_tags($title);
if ($arr_content['paginationtype']) { //文章使用分页时
if($arr_content['paginationtype']==1) {
if (strpos($arr_content['content'], '[/page]')!==false) {
$arr_content['content'] = preg_replace("|\[page\](.*)\[/page\]|U", '', $arr_content['content']);
}
if (strpos($arr_content['content'], '[page]')!==false) {
$arr_content['content'] = str_replace('[page]', '', $data['content']);
}
$contentpage = pc_base::load_app_class('contentpage', 'content'); //调用自动分页类
$arr_content['content'] = $contentpage->get_data($arr_content['content'], $arr_content['maxcharperpage']); //自动分页,自动添加上[page]
}
} else {
if (strpos($arr_content['content'], '[/page]')!==false) {
$arr_content['content'] = preg_replace("|\[page\](.*)\[/page\]|U", '', $arr_content['content']);
}
if (strpos($arr_content['content'], '[page]')!==false) {
$arr_content['content'] = str_replace('[page]', '', $arr_content['content']);
}
}
$template = $arr_content['show_template'] ? $arr_content['show_template'] : 'show'; //调用模板
//分站时,计算分站路径
if ($s_info['siteid']>1) {
$site_info = $this->site->get_by_id($s_info['siteid']);
}
$siteid = $s_info['siteid'];
$CONTENT_POS = strpos($arr_content['content'], '[page]');
if ($CONTENT_POS !== false) {
$contents = array_filter(explode('[page]', $arr_content['content']));
$pagenumber = count($contents);
$END_POS = strpos($arr_content['content'], '[/page]');
if ($END_POS!==false && ($CONTENT_POS<7)) {
$pagenumber--;
}
for ($i=1; $i<=$pagenumber; $i++) {
$pageurls[$i] = content_url($contentid, $i, $inputtime, 'html', $site_info);
}
if ($END_POS !== false) {
if($CONTENT_POS>7) {
$arr_content['content'] = '[page]'.$title.'[/page]'.$arr_content['content'];
}
if (preg_match_all("|\[page\](.*)\[/page\]|U", $arr_content['content'], $m, PREG_PATTERN_ORDER)) {
foreach ($m[1] as $k=>$v) {
$p = $k+1;
$titles[$p]['title'] = strip_tags($v);
$titles[$p]['url'] = $pageurls[$p][1];
}
}
}
$currentpage = $filesize = 0;
for ($i=1; $i<=$pagenumber; $i++) {
$currentpage++;
//判断[page]出现的位置是否在第一位
if($CONTENT_POS<7) {
$content = $contents[$currentpage];
} else {
if ($currentpage==1 && !empty($titles)) {
$content = $title.'[/page]'.$contents[$currentpage-1];
} else {
$content = $contents[$currentpage-1];
}
}
if($titles) {
list($title, $content) = explode('[/page]', $content);
$content = trim($content);
if(strpos($content,'</p>')===0) {
$content = '<p>'.$content;
}
if(stripos($content,'<p>')===0) {
$content = $content.'</p>';
}
}
$file_url = content_url($contentid, $currentpage, $inputtime, 'html', $site_info);
if ($currentpage==1) $urls = $file_url;
pc_base::load_app_func('util', 'content');
$title_pages = content_pages($pagenumber,$currentpage, $pageurls);
$SEO = seo($s_info['siteid'], '', $title);
$file = $file_url[1];
//如果是分站的文件,将文件写入到信息队列中
$this->queue->add_queue('add', $file, $siteid);
$file = PHPCMS_PATH.$file; //生成文件的路径
ob_start();
include template('special', $template);
$this->create_html($file);
}
} else {
$page = 1;
$title = strip_tags($title);
$SEO = seo($s_info['siteid'], '', $title);
$content = $arr_content['content'];
$urls = content_url($contentid, $page, $inputtime, 'html', $site_info);
$file = $urls[1];
//如果是分站的文件,将文件写入到信息队列中
$this->queue->add_queue('add', $file, $siteid);
$file = PHPCMS_PATH.$file;
ob_start();
include template('special', $template);
$this->create_html($file);
}
//$this->_index($specialid, 20, 5); //更新专题首页
//$this->_list($typeid, 20, 5); //更新所在的分类页
return $urls;
}
/**
* 生成静态文件
* @param string $file 文件路径
* @return boolen/intval 成功返回生成文件的大小
*/
private function create_html($file) {
$data = ob_get_contents();
ob_end_clean();
pc_base::load_sys_func('dir');
dir_create(dirname($file));
$strlen = file_put_contents($file, $data);
@chmod($file, 0777);
return $strlen;
}
/**
* 生成专题首页
* @param intval $specialid 专题ID
* @param intval $pagesize 每页个数
* @param intval $pages_num 最大更新页数
* @return boolen/intval 成功返回生成文件的大小
*/
public function _index($specialid = 0, $pagesize = 20, $pages_num = 0) {
pc_base::load_app_func('global', 'special');
$specialid = intval($specialid);
if (!$specialid) return false;
$r = $this->db->get_one(array('id'=>$specialid, 'siteid'=>get_siteid()));
if (!$r['ishtml']) return true;
if (!$specialid) showmessage(L('illegal_action'));
$info = $this->db->get_one(array('id'=>$specialid, 'disabled'=>0));
if(!$info) showmessage(L('special_not_exist'), 'back');
extract($info);
if ($pics) {
$pic_data = get_pic_content($pics);
unset($pics);
}
if ($voteid) {
$vote_info = explode('|', $voteid);
$voteid = $vote_info[1];
}
$commentid = id_encode('special', $id, $siteid);
//分站时计算路径
if ($siteid>1) {
$site_info = $this->site->get_by_id($siteid);
$file = pc_base::load_config('system', 'html_root').'/'.$site_info['dirname'].'/special/'.$filename.'/index.html';
} else {
$file = pc_base::load_config('system', 'html_root').'/special/'.$filename.'/index.html';
}
if(!$ispage) {
$type_db = pc_base::load_model('type_model');
$types = $type_db->select(array('module'=>'special', 'parentid'=>$specialid), '*', '', '`listorder` ASC, `typeid` ASC', '', 'listorder');
}
$css = get_css(unserialize($css));
$template = $index_template ? $index_template : 'index';
$SEO = seo($siteid, '', $title, $description);
if($ispage) {
$re = $this->c_db->get_one(array('specialid'=>$specialid), 'COUNT(`id`) AS num');
$total = $re['num'];
$times = ceil($total/$pagesize);
if ($pages_num) $pages_num = min($times, $pages_num);
else $pages_num = $times;
for ($i=1; $i<=$pages_num; $i++) {
if ($i==1) $file_root = $file;
else $file_root = str_replace('index', 'index-'.$i, $file);
$this->queue->add_queue('add', $file_root, $siteid); //添加至信息队列
$file_root = PHPCMS_PATH.$file_root;
ob_start();
include template('special', $template);
$this->create_html($file_root);
}
return true;
} else {
$this->queue->add_queue('add', $file, $siteid); //添加至信息队列
$file = PHPCMS_PATH.$file;
ob_start();
include template('special', $template, $style);
return $this->create_html($file);
}
}
/**
* 生成列表页
*/
public function create_list() {
$siteid = get_siteid();
//分站时计算路径
if ($siteid>1) {
$site_info = $this->site->get_by_id($siteid);
$file = pc_base::load_config('system', 'html_root').'/'.$site_info['dirname'].'/special/index.html';
} else {
$file = pc_base::load_config('system', 'html_root').'/special/index.html';
}
$this->queue->add_queue('add', $file, $siteid);
$file = PHPCMS_PATH.$file;
ob_start();
include template('special', 'special_list');
return $this->create_html($file);
}
/**
* 生成分类页
* @param intval $typeid 分类ID
* @param intval $page 页数
*/
public function create_type($typeid = 0, $page = 1) {
if (!$typeid) return false;
$info = $this->type_db->get_one(array('typeid'=>$typeid));
$s_info = $this->db->get_one(array('id'=>$info['parentid']));
extract($s_info);
$site_info = $this->site->get_by_id($siteid);
define('URLRULE', $site_info['domain'].substr(pc_base::load_config('system', 'html_root'), 1).'/special/{$specialdir}/{$typedir}/type-{$typeid}.html~'.$site_info['domain'].substr(pc_base::load_config('system', 'html_root'), 1).'/special/{$specialdir}/{$typedir}/type-{$typeid}-{$page}.html');
$GLOBALS['URL_ARRAY'] = array('specialdir'=>$filename, 'typedir'=>$info['typedir'], 'typeid'=>$typeid);
$SEO = seo($siteid, '', $info['typename'], '');
$template = $list_template ? $list_template : 'list';
if ($siteid>1) {
if ($page==1) $file = pc_base::load_config('system', 'html_root').'/'.$site_info['dirname'].'/special/'.$filename.'/'.$info['typedir'].'/type-'.$typeid.'.html';
else $file = pc_base::load_config('system', 'html_root').'/'.$site_info['dirname'].'/special/'.$filename.'/'.$info['typedir'].'/type-'.$typeid.'-'.$page.'.html';
} else {
if ($page==1) $file = pc_base::load_config('system', 'html_root').'/special/'.$filename.'/'.$info['typedir'].'/type-'.$typeid.'.html';
else $file = pc_base::load_config('system', 'html_root').'/special/'.$filename.'/'.$info['typedir'].'/type-'.$typeid.'-'.$page.'.html';
}
$this->queue->add_queue('add', $file, $siteid);
$file = PHPCMS_PATH.$file;
ob_start();
include template('special', $template);
$this->create_html($file);
}
/**
* 生成分类静态页
* @param intval $typeid 分类ID
* @param intval $pagesize 每页篇数
* @param intval $pages 最大更新页数
*/
public function _list($typeid = 0, $pagesize = 20, $pages = 0) {
if (!$typeid) return false;
$r = $this->c_db->get_one(array('typeid'=>$typeid), 'COUNT(`id`) AS num');
$total = $r['num'];
$times = ceil($total/$pagesize);
if ($pages) $pages = min($times, $pages);
else $pages = $times;
for ($i=1; $i<=$pages; $i++) {
$this->create_type($typeid, $i);
}
return true;
}
}
?> | PHP |
<?php
defined('IN_PHPCMS') or exit('No permission resources.');
pc_base::load_app_class('admin','admin',0);
pc_base::load_app_func('global', 'special');
class template extends admin {
private $db;
public function __construct() {
parent::__construct();
$this->db = pc_base::load_model('special_model');
}
/**
* 编辑专题首页模板
*/
public function init() {
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
$specialid = isset($_GET['specialid']) && intval($_GET['specialid']) ? intval($_GET['specialid']) : showmessage(L('illegal_action'), HTTP_REFERER);;
if (!$specialid) showmessage(L('illegal_action'), HTTP_REFERER);
$info = $this->db->get_one(array('id'=>$specialid, 'disabled'=>'0', 'siteid'=>$this->get_siteid()));
if (!$info['id']) showmessage(L('illegal_parameters'), HTTP_REFERER);
$id = $specialid;
if($info['css']) $css_param = unserialize($info['css']);
if(!$info['ispage']) {
$type_db = pc_base::load_model('type_model');
$types = $type_db->select(array('module'=>'special', 'parentid'=>$id), '*', '', '`listorder` ASC, `typeid` ASC');
}
extract($info);
$css = get_css($css_param);
$template = $info['index_template'] ? $info['index_template'] : 'index';
pc_base::load_app_func('global', 'template');
ob_start();
include template('special', $template);
$html = ob_get_contents();
ob_clean();
$html = visualization($html, 'default', 'test', 'block.html');
include $this->admin_tpl('template_edit');
}
/**
* css编辑预览
*/
public function preview() {
define('HTML', true);
if (!$_GET['specialid']) showmessage(L('illegal_action'), HTTP_REFERER);
$info = $this->db->get_one(array('id'=>$_GET['specialid'], 'disabled'=>'0', 'siteid'=>$this->get_siteid()));
if (!$info['id']) showmessage(L('illegal_parameters'), HTTP_REFERER);
$css = get_css($_POST['info']);
$template = $info['index_template'] ? $info['index_template'] : 'index';
include template('special', $template);
}
/**
* css添加
*/
public function add() {
if (!$_GET['specialid']) showmessage(L('illegal_action'), HTTP_REFERER);
$info = $this->db->get_one(array('id'=>$_GET['specialid'], 'disabled'=>'0', 'siteid'=>$this->get_siteid()));
if (!$info['id']) showmessage(L('illegal_parameters'), HTTP_REFERER);
$data = serialize($_POST['info']);
$this->db->update(array('css'=>$data), array('id'=>$info['id']));
showmessage(L('operation_success'), HTTP_REFERER);
}
}
?> | PHP |
<?php
defined('IN_PHPCMS') or exit('No permission resources.');
pc_base::load_app_class('admin','admin',0);
pc_base::load_sys_class('form', '', 0);
pc_base::load_sys_class('format', '', 0);
class content extends admin {
private $db, $data_db, $type_db;
public function __construct() {
parent::__construct();
$this->db = pc_base::load_model('special_content_model');
$this->data_db = pc_base::load_model('special_c_data_model');
$this->type_db = pc_base::load_model('type_model');
}
/**
* 添加信息
*/
public function add() {
$_GET['specialid'] = intval($_GET['specialid']);
if (!$_GET['specialid']) showmessage(L('illegal_action'), HTTP_REFERER);
if ($_POST['dosubmit'] || $_POST['dosubmit_continue']) {
$info = $this->check($_POST['info'], 'info', 'add', $_POST['data']['content']); //验证数据的合法性
//处理外部链接情况
if ($info['islink']) {
$info['url'] = $_POST['linkurl'];
$info['isdata'] = 0;
} else {
$info['isdata'] = 1;
}
$info['specialid'] = $_GET['specialid'];
//将基础数据添加到基础表,并返回ID
$contentid = $this->db->insert($info, true);
// 向数据统计表添加数据
$count = pc_base::load_model('hits_model');
$hitsid = 'special-c-'.$info['specialid'].'-'.$contentid;
$count->insert(array('hitsid'=>$hitsid));
//如果不是外部链接,将内容加到data表中
$html = pc_base::load_app_class('html');
if ($info['isdata']) {
$data = $this->check($_POST['data'], 'data'); //验证数据的合法性
$data['id'] = $contentid;
$this->data_db->insert($data);
$searchid = $this->search_api($contentid, $data, $info['title'], 'update', $info['inputtime']);
$url = $html->_create_content($contentid);
$this->db->update(array('url'=>$url[0], 'searchid'=>$searchid), array('id'=>$contentid, 'specialid'=>$_GET['specialid']));
}
$html->_index($_GET['specialid'], 20, 5);
$html->_list($info['typeid'], 20, 5);
//更新附件状态
if(pc_base::load_config('system','attachment_stat')) {
$this->attachment_db = pc_base::load_model('attachment_model');
if ($info['thunb']) {
$this->attachment_db->api_update($info['thumb'],'special-c-'.$contentid, 1);
}
$this->attachment_db->api_update(stripslashes($data['content']),'special-c-'.$contentid);
}
if ($_POST['dosubmit']) showmessage(L('content_add_success'), HTTP_REFERER, '', '', 'setTimeout("window.close()", 2000)');
elseif ($_POST['dosubmit_continue']) showmessage(L('content_add_success'), HTTP_REFERER);
} else {
$rs = $this->type_db->select(array('parentid'=>$_GET['specialid'], 'siteid'=>$this->get_siteid()), 'typeid, name');
$types = array();
foreach ($rs as $r) {
$types[$r['typeid']] = $r['name'];
}
//获取站点模板信息
pc_base::load_app_func('global', 'admin');
$template_list = template_list(get_siteid(), 0);
foreach ($template_list as $k=>$v) {
$template_list[$v['dirname']] = $v['name'] ? $v['name'] : $v['dirname'];
unset($template_list[$k]);
}
$special_db = pc_base::load_model('special_model');
$info = $special_db->get_one(array('id'=>$_GET['specialid']));
@extract($info);
include $this->admin_tpl('content_add');
}
}
/**
* 信息修改
*/
public function edit() {
$_GET['specialid'] = intval($_GET['specialid']);
$_GET['id'] = intval($_GET['id']);
if (!$_GET['specialid'] || !$_GET['id']) showmessage(L('illegal_action'), HTTP_REFERER);
if (isset($_POST['dosubmit']) || isset($_POST['dosubmit_continue'])) {
$info = $this->check($_POST['info'], 'info', 'edit', $_POST['data']['content']); //验证数据的合法性
//处理外部链接更换情况
$r = $this->db->get_one(array('id'=>$_GET['id'], 'specialid'=>$_GET['specialid']));
if ($r['islink']!=$info['islink']) { //当外部链接和原来差别时进行操作
// 向数据统计表添加数据
$count = pc_base::load_model('hits_model');
$hitsid = 'special-c-'.$_GET['specialid'].'-'.$_GET['id'];
$count->delete(array('hitsid'=>$hitsid));
$this->data_db->delete(array('id'=>$_GET['id']));
if ($info['islink']) {
$info['url'] = $_POST['linkurl'];
$info['isdata'] = 0;
} else {
$data = $this->check($_POST['data'], 'data');
$data['id'] = $_GET['id'];
$this->data_db->insert($data);
$count->insert(array('hitsid'=>$hitsid));
}
}
//处理外部链接情况
if ($info['islink']) {
$info['url'] = $_POST['linkurl'];
$info['isdata'] = 0;
} else {
$info['isdata'] = 1;
}
$html = pc_base::load_app_class('html', 'special');
if ($info['isdata']) {
$data = $this->check($_POST['data'], 'data');
$this->data_db->update($data, array('id'=>$_GET['id']));
$url = $html->_create_content($_GET['id']);
if ($url[0]) {
$info['url'] = $url[0];
$searchid = $this->search_api($_GET['id'], $data, $info['title'], 'update', $info['inputtime']);
$this->db->update(array('url'=>$url[0], 'searchid'=>$searchid), array('id'=>$_GET['id'], 'specialid'=>$_GET['specialid']));
}
} else {
$this->db->update(array('url'=>$info['url']), array('id'=>$_GET['id'], 'specialid'=>$_GET['specialid']));
}
$this->db->update($info, array('id'=>$_GET['id'], 'specialid'=>$_GET['specialid']));
//更新附件状态
if(pc_base::load_config('system','attachment_stat')) {
$this->attachment_db = pc_base::load_model('attachment_model');
if ($info['thumb']) {
$this->attachment_db->api_update($info['thumb'],'special-c-'.$_GET['id'], 1);
}
$this->attachment_db->api_update(stripslashes($data['content']),'special-c-'.$_GET['id']);
}
$html->_index($_GET['specialid'], 20, 5);
$html->_list($info['typeid'], 20, 5);
showmessage(L('content_edit_success'), HTTP_REFERER, '', '', 'setTimeout("window.close()", 2000)');
} else {
$info = $this->db->get_one(array('id'=>$_GET['id'], 'specialid'=>$_GET['specialid']));
if($info['isdata']) $data = $this->data_db->get_one(array('id'=>$_GET['id']));
$rs = $this->type_db->select(array('parentid'=>$_GET['specialid'], 'siteid'=>$this->get_siteid()), 'typeid, name');
$types = array();
foreach ($rs as $r) {
$types[$r['typeid']] = $r['name'];
}
//获取站点模板信息
pc_base::load_app_func('global', 'admin');
$template_list = template_list($this->siteid, 0);
foreach ($template_list as $k=>$v) {
$template_list[$v['dirname']] = $v['name'] ? $v['name'] : $v['dirname'];
unset($template_list[$k]);
}
include $this->admin_tpl('content_edit');
}
}
/**
* 检查表题是否重复
*/
public function public_check_title() {
if ($_GET['data']=='' || (!$_GET['specialid'])) return '';
if (pc_base::load_config('system', 'charset')=='gbk') {
$title = safe_replace(iconv('UTF-8', 'GBK', $_GET['data']));
} else $title = $_GET['data'];
$specialid = intval($_GET['specialid']);
$r = $this->db->get_one(array('title'=>$title, 'specialid'=>$specialid));
if ($r) {
exit('1');
} else {
exit('0');
}
}
/**
* 信息列表
*/
public function init() {
$_GET['specialid'] = intval($_GET['specialid']);
if(!$_GET['specialid']) showmessage(L('illegal_action'), HTTP_REFERER);
$types = $this->type_db->select(array('module'=>'special', 'parentid'=>$_GET['specialid']), 'name, typeid', '', '`listorder` ASC, `typeid` ASC', '', 'typeid');
$page = max(intval($_GET['page']), 1);
$datas = $this->db->listinfo(array('specialid'=>$_GET['specialid']), '`listorder` ASC , `id` DESC', $page);
$pages = $this->db->pages;
$big_menu = array(array('javascript:openwinx(\'?m=special&c=content&a=add&specialid='.$_GET['specialid'].'\',\'\');void(0);', L('add_content')), array('javascript:window.top.art.dialog({id:\'import\',iframe:\'?m=special&c=special&a=import&specialid='.$_GET['specialid'].'\', title:\''.L('import_content').'\', width:\'700\', height:\'500\', lock:true}, function(){var d = window.top.art.dialog({id:\'import\'}).data.iframe;var form = d.document.getElementById(\'dosubmit\');form.click();return false;}, function(){window.top.art.dialog({id:\'import\'}).close()});void(0);', L('import_content')));
include $this->admin_tpl('content_list');
}
/**
* 信息排序 信息调用时按排序从小到大排列
*/
public function listorder() {
$_GET['specialid'] = intval($_GET['specialid']);
if (!$_GET['specialid']) showmessage(L('illegal_action'), HTTP_REFERER);
foreach ($_POST['listorders'] as $id => $v) {
$this->db->update(array('listorder'=>$v), array('id'=>$id, 'specialid'=>$_GET['specialid']));
}
showmessage(L('operation_success'), HTTP_REFERER);
}
/**
* 删除信息
*/
public function delete() {
if (!isset($_POST['id']) || empty($_POST['id']) || !$_GET['specialid']) {
showmessage(L('illegal_action'), HTTP_REFERER);
}
$specialid = $_GET['specialid'];
$special = pc_base::load_model('special_model');
$info = $special->get_one(array('id'=>$specialid));
$special_api = pc_base::load_app_class('special_api', 'special');
if (is_array($_POST['id'])) {
foreach ($_POST['id'] as $sid) {
$sid = intval($sid);
$special_api->_delete_content($sid, $info['siteid'], $info['ishtml']);
if(pc_base::load_config('system','attachment_stat')) {
$keyid = 'special-c-'.$sid;
$this->attachment_db = pc_base::load_model('attachment_model');
$this->attachment_db->api_delete($keyid);
}
}
} elseif (is_numeric($_POST['id'])){
$id = intval($_POST['id']);
$special_api->_delete_content($id, $info['siteid'], $info['ishtml']);
if(pc_base::load_config('system','attachment_stat')) {
$keyid = 'special-c-'.$id;
$this->attachment_db = pc_base::load_model('attachment_model');
$this->attachment_db->api_delete($keyid);
}
}
showmessage(L('operation_success'), HTTP_REFERER);
}
/**
* 添加到全站搜索
* @param intval $id 文章ID
* @param array $data 数组
* @param string $title 标题
* @param string $action 动作
*/
private function search_api($id = 0, $data = array(), $title, $action = 'update', $addtime) {
$this->search_db = pc_base::load_model('search_model');
$siteid = $this->get_siteid();
$type_arr = getcache('type_module_'.$siteid,'search');
$typeid = $type_arr['special'];
if($action == 'update') {
$fulltextcontent = $data['content'];
return $this->search_db->update_search($typeid ,$id, $fulltextcontent,$title, $addtime);
} elseif($action == 'delete') {
$this->search_db->delete_search($typeid ,$id);
}
}
/**
* 表单验证
* @param array $data 表单数据
* @param string $type 按数据表数据判断
* @param string $action 在添加时会加上默认数据
* @return array 数据检验后返回的数组
*/
private function check($data = array(), $type = 'info', $action = 'add', $content = '') {
if ($type == 'info') {
if (!$data['title']) showmessage(L('title_no_empty'), HTTP_REFERER);
if (!$data['typeid']) showmessage(L('no_select_type'), HTTP_REFERER);
$data['inputtime'] = $data['inputtime'] ? strtotime($data['inputtime']) : SYS_TIME;
$data['islink'] = $data['islink'] ? intval($data['islink']) : 0;
$data['style'] = '';
if ($data['style_color']) {
$data['style'] .= 'color:#00FF99;';
}
if ($data['style_font_weight']) {
$data['style'] .= 'font-weight:bold;';
}
//截取简介
if ($_POST['add_introduce'] && $data['description']=='' && !empty($content)) {
$content = stripslashes($content);
$introcude_length = intval($_POST['introcude_length']);
$data['description'] = str_cut(str_replace(array("\r\n","\t"), '', strip_tags($content)),$introcude_length);
}
//自动提取缩略图
if (isset($_POST['auto_thumb']) && $data['thumb'] == '' && !empty($content)) {
$content = $content ? $content : stripslashes($content);
$auto_thumb_no = intval($_POST['auto_thumb_no']) * 3;
if (preg_match_all("/(src)=([\"|']?)([^ \"'>]+\.(gif|jpg|jpeg|bmp|png))\\2/i", $content, $matches)) {
$data['thumb'] = $matches[$auto_thumb_no][0];
}
}
unset($data['style_color'], $data['style_font_weight']);
if ($action == 'add') {
$data['updatetime'] = SYS_TIME;
$data['username'] = param::get_cookie('admin_username');
$data['userid'] = $_SESSION['userid'];
}
} elseif ($type == 'data') {
if (!$data['content']) showmessage(L('content_no_empty'), HTTP_REFERER);
}
return $data;
}
} | PHP |
<?php
/**
* 生成css
* @param array $param css参数
*/
function get_css($param = array()) {
if (!isset($param) || empty($param)) return false;
$css = '<style type="text/css">'."\n";
if ($param['bg_path']) {
$css .= ' body{ background: url(\''.$param['bg_path'].'\');';
if ($param['repeat']) $css .= ' background-repeat: '.$param['repeat'].';';
if ($param['background-attachment']) $css .= ' background-attachment: '.$param['background-attachment'].';';
if ($param['background-position']) $css .= ' background-position: '.$param['background-position'].';';
$css .= '}'."\n";
}
if ($param['background-color']) $css .= 'body {background-color: '.$param['background-color'].'}'."\n";
if ($param['color']) $css .= 'body { color: '.$param['color'].'}'."\n";
if ($param['link_color']) $css .= 'a {color: '.$param['link_color'].'}'."\n";
$css .= '</style>';
return $css;
}
/**
* 内容页url
* @param $contentid 文章ID
* @param $page 当前页
* @param $addtime 文章发布时间
* @param $type 返回路径的格式(.html|.php)
* @param $site_info 站点信息
* @param $type 类型 静态地址 $type = 'html', 动态地址 $type='php'
*/
function content_url($contentid = 0, $page = 1, $addtime, $type = 'html', $site_info = '') {
if (!$contentid) return '';
$url = array();
$page = max(intval($page), 1);
$app_path = substr(APP_PATH, 0, -1);
switch ($type) {
case 'html':
if ($site_info['dirname']) {
if ($page==1) {
$url[0] = $site_info['domain'].'special/'.date('Y', $addtime).'/'.date('md', $addtime).'/'.$contentid.'.html';
$url[1] = pc_base::load_config('system', 'html_root').'/'.$site_info['dirname'].'/special/'.date('Y', $addtime).'/'.date('md', $addtime).'/'.$contentid.'.html';
} else {
$url[0] = $site_info['domain'].'special/'.date('Y', $addtime).'/'.date('md', $addtime).'/'.$contentid.'-'.$page.'.html';
$url[1] = pc_base::load_config('system', 'html_root').'/'.$site_info['dirname'].'/special/'.date('Y', $addtime).'/'.date('md', $addtime).'/'.$contentid.'-'.$page.'.html';
}
} else {
if ($page==1) {
$url[0] = $url[1] = pc_base::load_config('system', 'html_root').'/special/'.date('Y', $addtime).'/'.date('md', $addtime).'/'.$contentid.'.html';
$url[0] = $app_path.$url[0];
} else {
$url[0] = $url[1] = pc_base::load_config('system', 'html_root').'/special/'.date('Y', $addtime).'/'.date('md', $addtime).'/'.$contentid.'-'.$page.'.html';
$url[0] = $app_path.$url[0];
}
}
break;
case 'php':
if ($page==1) {
$url[0] = APP_PATH.'index.php?m=special&c=index&a=show&id='.$contentid;
} else {
$url[0] = APP_PATH.'index.php?m=special&c=index&a=show&id='.$contentid.'&page='.$page;
}
break;
}
return $url;
}
function get_pic_content($pics) {
if (!$pics) return '';
$info = explode('|', $pics);
$catid = intval($info[1]);
$id = intval($info[0]);
unset($info);
$db = pc_base::load_model('content_model');
if(!$catid || !$id) return false;
$siteids = getcache('category_content','commons');
$siteid = $siteids[$catid];
$CATEGORYS = getcache('category_content_'.$siteid,'commons');
if(!isset($CATEGORYS[$catid]) || $CATEGORYS[$catid]['type']!=0) return false;
$category = $CAT = $CATEGORYS[$catid];
$category_setting = string2array($category['setting']);
$siteid = $CAT['siteid'];
$MODEL = getcache('model','commons');
$modelid = $CAT['modelid'];
$tablename = $db->table_name = $db->db_tablepre.$MODEL[$modelid]['tablename'];
$r = $db->get_one(array('id'=>$id));
if(!$r || $r['status'] != 99) return false;
$db->table_name = $tablename.'_data';
$r2 = $db->get_one(array('id'=>$id));
$rs = array_merge($r,$r2);
//再次重新赋值,以数据库为准
$catid = $CATEGORYS[$r['catid']]['catid'];
$modelid = $CATEGORYS[$catid]['modelid'];
require_once CACHE_MODEL_PATH.'content_output.class.php';
$content_output = new content_output($modelid,$catid,$CATEGORYS);
$data = $content_output->get($rs);
extract($data);
if(empty($previous_page)) {
$previous_page = array('title'=>L('first_page', '', 'content'), 'thumb'=>IMG_PATH.'nopic_small.gif', 'url'=>'javascript:alert(\''.L('first_page', '', 'content').'\');');
}
if(empty($next_page)) {
$next_page = array('title'=>L('last_page', '', 'content'), 'thumb'=>IMG_PATH.'nopic_small.gif', 'url'=>'javascript:alert(\''.L('last_page', '', 'content').'\');');
}
ob_start();
include template('special', 'api_picture');
$data = ob_get_contents();
ob_clean();
return $data;
}
?> | PHP |
<?php
defined('IN_PHPCMS') or exit('No permission resources.');
pc_base::load_app_class('admin','admin',0);
pc_base::load_sys_class('form', '', 0);
pc_base::load_sys_class('format', '', 0);
class special extends admin {
private $db, $special_api;
function __construct() {
parent::__construct();
$this->db = pc_base::load_model('special_model');
$this->special_api = pc_base::load_app_class('special_api', 'special');
}
/**
* 专题列表
*/
public function init() {
$page = max(intval($_GET['page']), 1);
$infos = $this->db->listinfo(array('siteid'=>$this->get_siteid(), 'disabled'=>0), '`listorder` DESC, `id` DESC', $page, 6);
pc_base::load_sys_class('format', '', 0);
include $this->admin_tpl('special_list');
}
/**
* 添加专题
*/
public function add() {
if (isset($_POST['dosubmit']) && !empty($_POST['dosubmit'])) {
$special = $this->check($_POST['special']);
$id = $this->db->insert($special, true);
if ($id) {
$this->special_api->_update_type($id, $_POST['type']);
if ($special['siteid']>1) {
$site = pc_base::load_app_class('sites', 'admin');
$site_info = $site->get_by_id($special['siteid']);
if ($special['ishtml']) {
$url = $site_info['domain'].'special/'.$special['filename'].'/';
} else {
$url = $site_info['domain'].'index.php?m=special&c=index&id='.$id;
}
} else {
$url = $special['ishtml'] ? APP_PATH.substr(pc_base::load_config('system', 'html_root'), 1).'/special/'.$special['filename'].'/' : APP_PATH.'index.php?m=special&c=index&id='.$id;
}
$this->db->update(array('url'=>$url), array('id'=>$id, 'siteid'=>$this->get_siteid()));
//调用生成静态类
if ($special['ishtml']) {
$html = pc_base::load_app_class('html', 'special');
$html->_index($id, 20, 5);
}
//更新附件状态
if(pc_base::load_config('system','attachment_stat')) {
$this->attachment_db = pc_base::load_model('attachment_model');
$this->attachment_db->api_update(array($special['thumb'], $special['banner']),'special-'.$id, 1);
}
$this->special_cache();
}
showmessage(L('add_special_success'), HTTP_REFERER);
} else {
//获取站点模板信息
pc_base::load_app_func('global', 'admin');
$siteid = $this->get_siteid();
$template_list = template_list($siteid, 0);
$site = pc_base::load_app_class('sites','admin');
$info = $site->get_by_id($siteid);
foreach ($template_list as $k=>$v) {
$template_list[$v['dirname']] = $v['name'] ? $v['name'] : $v['dirname'];
unset($template_list[$k]);
}
include $this->admin_tpl('special_add');
}
}
/**
* 专题修改
*/
public function edit() {
if (!isset($_GET['specialid']) || empty($_GET['specialid'])) {
showmessage(L('illegal_action'), HTTP_REFERER);
}
$_GET['specialid'] = intval($_GET['specialid']);
if (isset($_POST['dosubmit']) && !empty($_POST['dosubmit'])) {
$special = $this->check($_POST['special'], 'edit');
$siteid = get_siteid();
$site = pc_base::load_app_class('sites', 'admin');
$site_info = $site->get_by_id($siteid);
if ($special['ishtml'] && $special['filename']) {
if ($siteid>1) {
$special['url'] = $site_info['domain'].'special/'.$special['filename'].'/';
} else {
$special['url'] = APP_PATH.substr(pc_base::load_config('system', 'html_root'), 1).'/special/'.$special['filename'].'/';
}
} elseif ($special['ishtml']=='0') {
if ($siteid>1) {
$special['url'] = $site_info['domain'].'index.php?m=special&c=index&specialid='.$_GET['specialid'];
} else {
$special['url'] = APP_PATH.'index.php?m=special&c=index&specialid='.$_GET['specialid'];
}
}
$this->db->update($special, array('id'=>$_GET['specialid'], 'siteid'=>$this->get_siteid()));
$this->special_api->_update_type($_GET['specialid'], $_POST['type'], 'edit');
//调用生成静态类
if ($special['ishtml']) {
$html = pc_base::load_app_class('html', 'special');
$html->_index($_GET['specialid'], 20, 5);
}
//更新附件状态
if(pc_base::load_config('system','attachment_stat')) {
$this->attachment_db = pc_base::load_model('attachment_model');
$this->attachment_db->api_update(array($special['thumb'], $special['banner']),'special-'.$_GET['specialid'], 1);
}
$this->special_cache();
showmessage(L('edit_special_success'), HTTP_REFERER);
} else {
$info = $this->db->get_one(array('id'=>$_GET['specialid'], 'siteid'=>$this->get_siteid()));
//获取站点模板信息
pc_base::load_app_func('global', 'admin');
$template_list = template_list($this->siteid, 0);
foreach ($template_list as $k=>$v) {
$template_list[$v['dirname']] = $v['name'] ? $v['name'] : $v['dirname'];
unset($template_list[$k]);
}
if ($info['pics']) {
$pics = explode('|', $info['pics']);
}
if ($info['voteid']) {
$vote_info = explode('|', $info['voteid']);
}
$type_db = pc_base::load_model('type_model');
$types = $type_db->select(array('module'=>'special', 'parentid'=>$_GET['specialid'], 'siteid'=>$this->get_siteid()), '`typeid`, `name`, `listorder`, `typedir`', '', '`listorder` ASC, `typeid` ASC');
include $this->admin_tpl('special_edit');
}
}
/**
* 信息导入专题
*/
public function import() {
if(isset($_POST['dosubmit']) || isset($_GET['dosubmit'])) {
if(!is_array($_POST['ids']) || empty($_POST['ids']) || !$_GET['modelid']) showmessage(L('illegal_action'), HTTP_REFERER);
if(!isset($_POST['typeid']) || empty($_POST['typeid'])) showmessage(L('select_type'), HTTP_REFERER);
foreach($_POST['ids'] as $id) {
$this->special_api->_import($_GET['modelid'], $_GET['specialid'], $id, $_POST['typeid'], $_POST['listorder'][$id]);
}
$html = pc_base::load_app_class('html', 'special');
$html->_index($_GET['specialid'], 20, 5);
showmessage(L('import_success'), 'blank', '', 'import');
} else {
if(!$_GET['specialid']) showmessage(L('illegal_action'), HTTP_REFERER);
$_GET['modelid'] = $_GET['modelid'] ? intval($_GET['modelid']) : 0;
$_GET['catid'] = $_GET['catid'] ? intval($_GET['catid']) : 0;
$_GET['page'] = max(intval($_GET['page']), 1);
$where = '';
if($_GET['catid']) $where .= get_sql_catid('category_content_'.$this->get_siteid(), $_GET['catid'])." AND `status`=99";
else $where .= " `status`=99";
if($_GET['start_time']) {
$where .= " AND `inputtime`>=".strtotime($_GET['start_time']);
}
if($_GET['end_time']) {
$where .= " AND `inputtime`<=".strtotime($_GET['end_time']);
}
if ($_GET['key']) {
$where .= " AND `title` LIKE '%$_GET[key]%' OR `keywords` LIKE '%$_GET[key]%'";
}
$data = $this->special_api->_get_import_data($_GET['modelid'], $where, $_GET['page']);
$pages = $this->special_api->pages;
$models = getcache('model','commons');
$model_datas = array();
foreach($models as $_k=>$_v) {
if($_v['siteid']==$this->get_siteid()) {
$model_datas[$_v['modelid']] = $_v['name'];
}
}
$model_form = form::select($model_datas, $_GET['modelid'], 'name="modelid" onchange="select_categorys(this.value)"', L('select_model'));
$types = $this->special_api->_get_types($_GET['specialid']);
include $this->admin_tpl('import_content');
}
}
public function public_get_pics() {
$_GET['modelid'] = $_GET['modelid'] ? intval($_GET['modelid']) : 0;
$_GET['catid'] = $_GET['catid'] ? intval($_GET['catid']) : 0;
$_GET['page'] = max(intval($_GET['page']), 1);
$where = '';
if($_GET['catid']) $where .= get_sql_catid('category_content_'.$this->get_siteid(), $_GET['catid'])." AND `status`=99";
else $where .= " `status`=99";
if ($_GET['title']) {
$where .= " AND `title` LIKE '%".$_GET['title']."%'";
}
if($_GET['start_time']) {
$where .= " AND `inputtime`>=".strtotime($_GET['start_time']);
}
if($_GET['end_time']) {
$where .= " AND `inputtime`<=".strtotime($_GET['end_time']);
}
$data = $this->special_api->_get_import_data($_GET['modelid'], $where, $_GET['page']);
$pages = $this->special_api->pages;
$models = getcache('model','commons');
$model_datas = array();
foreach($models as $_k=>$_v) {
if($_v['siteid']==$this->get_siteid()) {
$model_datas[$_v['modelid']] = $_v['name'];
}
}
$model_form = form::select($model_datas, $_GET['modelid'], 'name="modelid" onchange="select_categorys(this.value)"', L('select_model'));
$types = $this->special_api->_get_types($_GET['specialid']);
include $this->admin_tpl('import_pics');
}
public function html() {
if((!isset($_POST['id']) || empty($_POST['id']))) {
$result = $this->db->select(array('disabled'=>0, 'siteid'=>$this->get_siteid()), 'id', '', '', '', 'id');
$id = array_keys($result);
} else {
$id = $_POST['id'];
}
setcache('create_specials', $id, 'commons');
$this->public_create_html();
}
public function create_special_list() {
$html = pc_base::load_app_class('html');
$size = $html->create_list();
showmessage(L('index_create_finish',array('size'=>sizecount($size))));
}
/**
* 专题排序
*/
public function listorder() {
if(isset($_POST['dosubmit'])) {
foreach($_POST['listorder'] as $id => $order) {
$id = intval($id);
$order = intval($order);
$this->db->update(array('listorder'=>$order), array('id'=>$id));
}
$this->special_cache();
showmessage(L('operation_success'), HTTP_REFERER);
} else {
showmessage(L('please_in_admin'), HTTP_REFERER);
}
}
//生成专题首页控制中心
public function public_create_html() {
$specials = getcache('create_specials', 'commons');
if (is_array($specials) && !empty($specials)) {
$specialid = array_shift($specials);
setcache('create_specials', $specials, 'commons');
$this->create_index($specialid);
} else {
delcache('create_specials', 'commons');
showmessage(L('update_special_success'), '?m=special&c=special&a=init');
}
}
//生成某专题首页
private function create_index($specialid) {
$info = $this->db->get_one(array('id'=>$specialid));
if (!$info['ishtml']) {
showmessage($info['title'].L('update_success'), '?m=special&c=special&a=public_create_html');
}
$html = pc_base::load_app_class('html');
$html->_index($specialid);
showmessage($info['title'].L('index_update_success'), '?m=special&c=special&a=public_create_type&specialid='.$specialid);
}
//生成专题里列表页
public function public_create_type() {
$specialid = $_GET['specialid'] ? intval($_GET['specialid']) : 0;
if (!$specialid) showmessage(L('illegal_action'));
$page = isset($_GET['page']) ? intval($_GET['page']) : 1;
$pages = isset($_GET['pages']) ? intval($_GET['pages']) : 0;
$types = getcache('create_types', 'commons');
if (is_array($types) && !empty($types) || $pages) {
if (!isset($page) || $page==1) {
$typeids = array_keys($types);
$typeid = array_shift($typeids);
$typename = $types[$typeid];
unset($types[$typeid]);
setcache('create_types', $types, 'commons');
}
if (!$pages) {
$c = pc_base::load_model('special_content_model');
$result = $c->get_one(array('typeid'=>$typeid), 'COUNT(*) AS total');
$total = $result['total'];
$pages = ceil($total/20);
}
if ($_GET['typeid']) {
$typeid = intval($_GET['typeid']);
$typename = $_GET['typename'];
}
$maxpage = $page+10;
if ($maxpage>$pages) {
$maxpage = $pages;
}
for ($page; $page<=$maxpage; $page++) {
$html = pc_base::load_app_class('html');
$html->create_type($typeid, $page);
}
if (empty($types) && $pages==$maxpage) {
delcache('create_types', 'commons');
showmessage($typename.L('type_update_success'), '?m=special&c=special&a=public_create_content&specialid='.$specialid);
}
if ($pages<=$maxpage) {
showmessage($typename.L('update_success'), '?m=special&c=special&a=public_create_type&specialid='.$specialid);
} else {
showmessage($typename.L('type_from').($_GET['page'] ? $_GET['page'] : 1).L('type_end').$maxpage.'</font> '.L('update_success'), '?m=special&c=special&a=public_create_type&typeid='.$typeid.'&typename='.$typename.'&page='.$page.'&pages='.$pages.'&specialid='.$specialid);
}
} else {
$special_api = pc_base::load_app_class('special_api');
$types = $special_api->_get_types($specialid);
setcache('create_types', $types, 'commons');
showmessage(L('start_update_type'), '?m=special&c=special&a=public_create_type&specialid='.$specialid);
}
}
//生成内容页
public function public_create_content() {
$specialid = $_GET['specialid'] ? intval($_GET['specialid']) : 0;
if (!$specialid) showmessage(L('illegal_action'));
$pages = $_GET['pages'] ? intval($_GET['pages']) : 0;
$page = $_GET['page'] ? intval($_GET['page']) : 1;
$c = pc_base::load_model('special_content_model');
if (!$pages) {
$result = $c->get_one(array('specialid'=>$specialid, 'isdata'=>1), 'COUNT(*) AS total');
$total = $result['total'];
$pages = ceil($total/10);
}
$offset = ($page-1)*10;
$result = $c->select(array('specialid'=>$specialid, 'isdata'=>1), 'id', $offset.', 10', 'listorder ASC, id ASC');
foreach ($result as $r) {
$html = pc_base::load_app_class('html');
$urls = $html->_create_content($r['id']);
$c->update(array('url'=>$urls[0]), array('id'=>$r['id']));
}
if ($page>=$pages) {
showmessage(L('content_update_success'), '?m=special&c=special&a=public_create_html&specialid='.$specialid);
} else {
$page++;
showmessage(L('content_from').' <font color="red">'.intval($offset+1).L('type_end').intval($offset+10).'</font> '.L('update_success'), '?m=special&c=special&a=public_create_content&specialid='.$specialid.'&page='.$page.'&pages='.$pages);
}
}
/**
* 推荐专题
*/
public function elite() {
if(!isset($_GET['id']) || empty($_GET['id'])) {
showmessage(L('illegal_action'));
}
$_GET['value'] = $_GET['value'] ? intval($_GET['value']) : 0;
$this->db->update(array('elite'=>$_GET['value']), array('id'=>$_GET['id'], 'siteid'=>get_siteid()));
showmessage(L('operation_success'), HTTP_REFERER);
}
/**
* 删除专题 未执行删除操作,仅进行递归循环
*/
public function delete($id = 0) {
if((!isset($_GET['id']) || empty($_GET['id'])) && (!isset($_POST['id']) || empty($_POST['id'])) && !$id) {
showmessage(L('illegal_action'), HTTP_REFERER);
}
if(is_array($_POST['id']) && !$id) {
array_map(array($this, delete), $_POST['id']);
$this->special_cache();
showmessage(L('operation_success'), HTTP_REFERER);
} elseif(is_numeric($id) && $id) {
$id = $_GET['id'] ? intval($_GET['id']) : intval($id);
$this->special_api->_del_special($id);
return true;
} else {
$id = $_GET['id'] ? intval($_GET['id']) : intval($id);
$this->special_api->_del_special($id);
showmessage(L('operation_success'), HTTP_REFERER);
}
}
/**
* 专题缓存
*/
private function special_cache() {
$specials = array();
$result = $this->db->select(array('disabled'=>0), '`id`, `siteid`, `title`, `url`, `thumb`, `banner`, `ishtml`', '', '`listorder` DESC, `id` DESC');
foreach($result as $r) {
$specials[$r['id']] = $r;
}
setcache('special', $specials, 'commons');
return true;
}
/**
* 获取专题的分类
*
* @param intval $specialid 专题ID
* @return 返回此专题分类的下拉列表
*/
public function public_get_type() {
$_GET['specialid'] = intval($_GET['specialid']);
if(!$_GET['specialid']) return '';
$datas = $this->special_api->_get_types($_GET['specialid']);
echo form::select($types, 0, 'name="typeid" id="typeid" onchange="import_c('.$_GET['specialid'].', this.value)"', L('please_select'));
}
/**
* 按模型ID列出模型下的栏目
*/
public function public_categorys_list() {
if(!isset($_GET['modelid']) || empty($_GET['modelid'])) exit('');
$modelid = intval($_GET['modelid']);
exit(form::select_category('', $_GET['catid'], 'name="catid" id="catid"', L('please_select'), $modelid, 0, 1));
}
/**
* ajax验证专题是否已存在
*/
public function public_check_special() {
if(!$_GET['title']) exit(0);
if(pc_base::load_config('system', 'charset')=='gbk') {
$_GET['title'] = safe_replace(iconv('UTF-8', 'GBK', $_GET['title']));
}
$title = addslashes($_GET['title']);
if($_GET['id']) {
$id = intval($_GET['id']);
$r = $this->db->get_one(array('id'=>$id, 'siteid'=>$this->get_siteid()));
if($r['title'] == $title) {
exit('1');
}
}
$r = $this->db->get_one(array('siteid' => $this->get_siteid(), 'title' => $title), 'id');
if($r['id']) {
exit('0');
} else {
exit('1');
}
}
/**
* ajax检验专题静态文件名是否存在,避免专题页覆盖
*/
public function public_check_dir() {
if(!$_GET['filename']) exit(1);
if($_GET['id']) {
$id = intval($_GET['id']);
$r = $this->db->get_one(array('id'=>$id, 'siteid'=>$this->get_siteid()));
if($r['filename'] = $_GET['filename']) {
exit('1');
}
}
$r = $this->db->get_one(array('siteid'=>$this->get_siteid(), 'filename'=>$_GET['filename']), 'id');
if($r['id']) {
exit('0');
} else {
exit('1');
}
}
/**
* 表单验证
* @param array $data 表单传递的值
* @param string $a add/edit添加操作时,自动加上默认值
*/
private function check($data, $a = 'add') {
if(!$data['title']) showmessage(L('title_cannot_empty'), HTTP_REFERER);
if(!$data['banner']) showmessage(L('banner_no_empty'), HTTP_REFERER);
if(!$data['thumb']) showmessage(L('thumb_no_empty'), HTTP_REFERER);
if(is_array($data['catids']) && !empty($data['catids'])) {
$data['catids'] = ','.implode(',', $data['catids']).',';
}
if($a=='add') {
if(!$data['index_template']) $data['index_template'] = 'index';
$data['siteid'] = $this->get_siteid();
$data['createtime'] = SYS_TIME;
$data['username'] = param::get_cookie('admin_username');
$data['userid'] = $_SESSION['userid'];
}
if ($data['voteid']) {
if (strpos($data['voteid'], '|')===false) {
$vote_db = pc_base::load_model('vote_subject_model');
$r = $vote_db->get_one(array('subject'=>$data['voteid'], 'siteid'=>$this->get_siteid()), 'subjectid, subject', 'addtime DESC');
if ($r) {
$data['voteid'] = 'vote|'.$r['subjectid'].'|'.$r['subject'];
}
}
}
return $data;
}
}
?> | PHP |
<?php
defined('IN_PHPCMS') or exit('No permission resources.');
pc_base::load_app_class('admin','admin',0);
class badword extends admin {
function __construct() {
$admin_username = param::get_cookie('admin_username');
$userid = $_SESSION['userid'];
$this->db = pc_base::load_model('badword_model');
parent::__construct();
}
function init () {
$page = isset($_GET['page']) && intval($_GET['page']) ? intval($_GET['page']) : 1;
$infos = $pages = '';
$infos = $this->db->listinfo($where = '',$order = 'badid DESC',$page, $pages = '13');
$pages = $this->db->pages;
$level = array(1=>L('general'),2=>L('danger'));
$big_menu = array('javascript:window.top.art.dialog({id:\'add\',iframe:\'?m=admin&c=badword&a=add\', title:\''.L('badword_add').'\', width:\'450\', height:\'180\'}, function(){var d = window.top.art.dialog({id:\'add\'}).data.iframe;var form = d.document.getElementById(\'dosubmit\');form.click();return false;}, function(){window.top.art.dialog({id:\'add\'}).close()});void(0);', L('badword_add'));
include $this->admin_tpl('badword_list');
}
/**
* 敏感词添加
*/
function add() {
if(isset($_POST['dosubmit'])){
$_POST['info']['lastusetime'] = SYS_TIME;
$_POST['info']['replaceword'] = str_replace(" ","",trim($_POST['replaceword']));
$_POST['info']['badword'] = str_replace(" ","",trim($_POST['badword']));
if(empty($_POST['info']['badword'])) {
showmessage(L('enter_word'),'?m=admin&c=badword&a=add');
}
$this->db->insert($_POST['info']);
$this->public_cache_file();//更新缓存
showmessage(L('operation_success'),'?m=admin&c=badword&a=add','', 'add');
}else{
$show_validator = $show_scroll = $show_header = true;
include $this->admin_tpl('badword_add');
}
}
public function public_name() {
$badword = isset($_GET['badword']) && trim($_GET['badword']) ? (pc_base::load_config('system', 'charset') == 'gbk' ? iconv('utf-8', 'gbk', trim($_GET['badword'])) : trim($_GET['badword'])) : exit('0');
$badid = isset($_GET['badid']) && intval($_GET['badid']) ? intval($_GET['badid']) : '';
$data = array();
if ($badid) {
$data = $this->db->get_one(array('badid'=>$badid), 'badword');
if (!empty($data) && $data['badword'] == $badword) {
exit('1');
}
}
if ($this->db->get_one(array('badword'=>$badword), 'badid')) {
exit('0');
} else {
exit('1');
}
}
/**
* 敏感词排序
*/
function listorder() {
if(!is_array($_POST['listorders'])) return false;
foreach($_POST['listorders'] as $badid => $listorder) {
$this->db->update(array('listorder'=>$listorder),array('badid'=>$badid));
}
showmessage(L('operation_success'),'?m=admin&c=badword');
}
/**
* 敏感词修改
*/
function edit() {
if(isset($_POST['dosubmit'])){
$badid = intval($_GET['badid']);
$_POST['info']['replaceword'] = str_replace(" ","",trim($_POST['replaceword']));
$_POST['info']['badword'] = str_replace(" ","",trim($_POST['badword']));
$this->db->update($_POST['info'],array('badid'=>$badid));
$this->public_cache_file();//更新缓存
showmessage(L('operation_success'),'?m=admin&c=badword&a=edit','', 'edit');
}else{
$show_validator = $show_scroll = $show_header = true;
$info = array();
$info = $this->db->get_one(array('badid'=>$_GET['badid']));
if(!$info) showmessage(L('keywords_no_exist'));
extract($info);
include $this->admin_tpl('badword_edit');
}
}
/**
* 关键词删除 包含批量删除 单个删除
*/
function delete() {
if(is_array($_POST['badid'])){
foreach($_POST['badid'] as $badid_arr) {
$this->db->delete(array('badid'=>$badid_arr));
}
$this->public_cache_file();//更新缓存
showmessage(L('operation_success'),'?m=admin&c=badword');
}else{
$badid = intval($_GET['badid']);
if($badid < 1) return false;
$result = $this->db->delete(array('badid'=>$badid));
if($result){
$this->public_cache_file();//更新缓存
showmessage(L('operation_success'),'?m=admin&c=badword');
}else {
showmessage(L("operation_failure"),'?m=admin&c=badword');
}
}
}
/**
* 导出敏感词为文本 一行一条记录
*/
function export() {
$result = $s = '';
$result = $this->db->select($where = '', $data = '*', $limit = '', $order = 'badid DESC', $group = '');
if(!is_array($result) || empty($result)){
showmessage('暂无敏感词设置,正在返回!','?m=admin&c=badword');
}
foreach($result as $s){
extract($s);
$str .= $badword.','.$replaceword.','.$level."\n";
}
$filename = L('export');
header('Content-Type: text/x-sql');
header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Content-Disposition: attachment; filename="' . $filename . '"');
$is_ie = 'IE';
if ($is_ie == 'IE') {
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
} else {
header('Pragma: no-cache');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
}
echo $str;
exit();
}
/**
* 从文本中导入敏感词, 一行一条记录
*/
function import(){
if(isset($_POST['dosubmit'])){
$arr = $s = $str = $level_arr = '';
$s = trim($_POST['info']);
if(empty($s)) showmessage(L('not_information'),'?m=admin&c=badword&a=import');
$arr = explode("\n",$s);
if(!is_array($arr) || empty($arr)) return false;
foreach($arr as $s){
$level_arr = array("1","2");
$str = explode(",",$s);
$sql_str = array();
$sql_str['badword'] = $str[0];
$sql_str['replaceword'] = $str[1];
$sql_str['level'] = $str[2];
$sql_str['lastusetime'] = SYS_TIME;
if(!in_array($sql_str['level'],$level_arr)) $sql_str['level'] = '1';
if(empty($sql_str['badword'])){
continue;
}else{
$check_badword = $this->db->get_one(array('badword'=>$sql_str['badword']), $data = '*', $order = '', $group = '');
if($check_badword){
continue;
}
$this->db->insert($sql_str);
}
unset($sql_str,$check_badword);
}
showmessage(L('operation_success'),'?m=admin&c=badword');
}else{
include $this->admin_tpl('badword_import');
}
}
/**
* 生成缓存
*/
function public_cache_file() {
$infos = $this->db->select('','badid,badword,replaceword,level','','badid ASC');
setcache('badword', $infos, 'commons');
return true;
}
}
?> | PHP |
<?php
defined('IN_PHPCMS') or exit('No permission resources.');
pc_base::load_app_class('admin','admin',0);
class setting extends admin {
private $db;
function __construct() {
parent::__construct();
$this->db = pc_base::load_model('module_model');
pc_base::load_app_func('global');
}
/**
* 配置信息
*/
public function init() {
$show_validator = true;
$setconfig = pc_base::load_config('system');
extract($setconfig);
if(!function_exists('ob_gzhandler')) $gzip = 0;
$info = $this->db->get_one(array('module'=>'admin'));
extract(string2array($info['setting']));
$show_header = true;
$show_validator = 1;
include $this->admin_tpl('setting');
}
/**
* 保存配置信息
*/
public function save() {
$setting = array();
$setting['admin_email'] = is_email($_POST['setting']['admin_email']) ? trim($_POST['setting']['admin_email']) : showmessage(L('email_illegal'),HTTP_REFERER);
$setting['maxloginfailedtimes'] = intval($_POST['setting']['maxloginfailedtimes']);
$setting['minrefreshtime'] = intval($_POST['setting']['minrefreshtime']);
$setting['mail_type'] = intval($_POST['setting']['mail_type']);
$setting['mail_server'] = trim($_POST['setting']['mail_server']);
$setting['mail_port'] = intval($_POST['setting']['mail_port']);
$setting['mail_user'] = trim($_POST['setting']['mail_user']);
$setting['mail_auth'] = intval($_POST['setting']['mail_auth']);
$setting['mail_from'] = trim($_POST['setting']['mail_from']);
$setting['mail_password'] = trim($_POST['setting']['mail_password']);
$setting['errorlog_size'] = trim($_POST['setting']['errorlog_size']);
$setting = array2string($setting);
$this->db->update(array('setting'=>$setting), array('module'=>'admin')); //存入admin模块setting字段
//如果开始盛大通行证接入,判断服务器是否支持curl
$snda_error = '';
if($_POST['setconfig']['snda_akey'] || $_POST['setconfig']['snda_skey']) {
if(function_exists('curl_init') == FALSE) {
$snda_error = L('snda_need_curl_init');
$_POST['setconfig']['snda_enable'] = 0;
}
}
set_config($_POST['setconfig']); //保存进config文件
$this->setcache();
showmessage(L('setting_succ').$snda_error, HTTP_REFERER);
}
/*
* 测试邮件配置
*/
public function public_test_mail() {
pc_base::load_sys_func('mail');
$subject = 'phpcms test mail';
$message = 'this is a test mail from phpcms team';
$mail= Array (
'mailsend' => 2,
'maildelimiter' => 1,
'mailusername' => 1,
'server' => $_POST['mail_server'],
'port' => intval($_POST['mail_port']),
'mail_type' => intval($_POST['mail_type']),
'auth' => intval($_POST['mail_auth']),
'from' => $_POST['mail_from'],
'auth_username' => $_POST['mail_user'],
'auth_password' => $_POST['mail_password']
);
if(sendmail($_GET['mail_to'],$subject,$message,$_POST['mail_from'],$mail)) {
echo L('test_email_succ').$_GET['mail_to'];
} else {
echo L('test_email_faild');
}
}
/**
* 设置缓存
* Enter description here ...
*/
private function setcache() {
$result = $this->db->get_one(array('module'=>'admin'));
$setting = string2array($result['setting']);
setcache('common', $setting,'commons');
}
}
?> | PHP |
<?php
@set_time_limit(0);
defined('IN_PHPCMS') or exit('No permission resources.');
pc_base::load_app_class('admin','admin',0);
class database extends admin {
private $db;
function __construct() {
parent::__construct();
$this->userid = $_SESSION['userid'];
pc_base::load_sys_class('db_factory');
pc_base::load_sys_class('form');
pc_base::load_sys_func('dir');
}
/**
* 数据库导出
*/
public function export() {
$database = pc_base::load_config('database');
$dosubmit = isset($_POST['dosubmit']) ? $_POST['dosubmit'] : $_GET['dosubmit'];
if($dosubmit) {
if($_GET['pdo_select']=='' && $_POST['pdo_select'] =='') showmessage(L('select_pdo'));
$tables = $_POST['tables'] ? $_POST['tables'] : $_GET['tables'];
$sqlcharset = $_POST['sqlcharset'] ? $_POST['sqlcharset'] :$_GET['sqlcharset'];
$sqlcompat = $_POST['sqlcompat'] ? $_POST['sqlcompat'] : $_GET['sqlcompat'];
$sizelimit = $_POST['sizelimit'] ? $_POST['sizelimit'] : $_GET['sizelimit'];
$fileid = $_POST['fileid'] ? $_POST['fileid'] : trim($_GET['fileid']);
$random = $_POST['random'] ? $_POST['random'] : trim($_GET['random']);
$tableid = $_POST['tableid'] ? $_POST['tableid'] : trim($_GET['tableid']);
$startfrom = $_POST['startfrom'] ? $_POST['startfrom'] : trim($_GET['startfrom']);
$tabletype = $_POST['tabletype'] ? $_POST['tabletype'] : trim($_GET['tabletype']);
$this->pdo_name = $_POST['pdo_select'] ? $_POST['pdo_select'] : trim($_GET['pdo_select']);
$this->db = db_factory::get_instance($database)->get_database($this->pdo_name);
$r = $this->db->version();
$this->export_database($tables,$sqlcompat,$sqlcharset,$sizelimit,$action,$fileid,$random,$tableid,$startfrom,$tabletype);
} else {
foreach($database as $name=>$value) {
$pdos[$name] = $value['database'].'['.$value['hostname'].']';
}
if($_GET['pdoname']) {
delcache('bakup_tables','commons');
$pdo_name = trim($_GET['pdoname']);
$r = array();
$db = db_factory::get_instance($database)->get_database($pdo_name);
$tbl_show = $db->query("SHOW TABLE STATUS FROM `".$database[$pdo_name]['database']."`");
while(($rs = $db->fetch_next()) != false) {
$r[] = $rs;
}
$infos = $this->status($r,$database[$pdo_name]['tablepre']);
$db->free_result($tbl_show);
}
include $this->admin_tpl('database_export');
}
}
/**
* 数据库导入
*/
public function import() {
$database = pc_base::load_config('database');
if($_GET['dosubmit']) {
$admin_founders = explode(',',pc_base::load_config('system','admin_founders'));
if(!in_array($this->userid,$admin_founders)) {
showmessage(L('only_fonder_operation'));
}
$this->pdo_name = $_GET['pdoname'];
$pre = trim($_GET['pre']);
$this->fileid = trim($_GET['fileid']);
$this->db_charset = $database[$this->pdo_name]['charset'];
$this->db_tablepre = $database[$pdo_name]['tablepre'];
$this->db = db_factory::get_instance($database)->get_database($this->pdo_name);
$this->import_database($pre);
} else {
$$pdos = $others = array();
foreach($database as $name=>$value) {
$pdos[$name] = $value['database'].'['.$value['hostname'].']';
}
$pdoname = $_GET['pdoname'] ? $_GET['pdoname'] : key($pdos);
$sqlfiles = glob(CACHE_PATH.'bakup/'.$pdoname.'/*.sql');
if(is_array($sqlfiles)) {
asort($sqlfiles);
$prepre = '';
$info = $infos = $other = $others = array();
foreach($sqlfiles as $id=>$sqlfile) {
if(preg_match("/(phpcmstables_[0-9]{8}_[0-9a-z]{4}_)([0-9]+)\.sql/i",basename($sqlfile),$num)) {
$info['filename'] = basename($sqlfile);
$info['filesize'] = round(filesize($sqlfile)/(1024*1024), 2);
$info['maketime'] = date('Y-m-d H:i:s', filemtime($sqlfile));
$info['pre'] = $num[1];
$info['number'] = $num[2];
if(!$id) $prebgcolor = '#CFEFFF';
if($info['pre'] == $prepre) {
$info['bgcolor'] = $prebgcolor;
} else {
$info['bgcolor'] = $prebgcolor == '#CFEFFF' ? '#F1F3F5' : '#CFEFFF';
}
$prebgcolor = $info['bgcolor'];
$prepre = $info['pre'];
$infos[] = $info;
} else {
$other['filename'] = basename($sqlfile);
$other['filesize'] = round(filesize($sqlfile)/(1024*1024),2);
$other['maketime'] = date('Y-m-d H:i:s',filemtime($sqlfile));
$others[] = $other;
}
}
}
$show_validator = true;
include $this->admin_tpl('database_import');
}
}
/**
* 备份文件下载
*/
public function public_down() {
$admin_founders = explode(',',pc_base::load_config('system','admin_founders'));
if(!in_array($this->userid,$admin_founders)) {
showmessage(L('only_fonder_operation'));
}
$datadir = $_GET['pdoname'];
$filename = $_GET['filename'];
$fileext = fileext($filename);
if($fileext != 'sql') {
showmessage(L('only_sql_down'));
}
file_down(CACHE_PATH.'bakup'.DIRECTORY_SEPARATOR.$datadir.DIRECTORY_SEPARATOR.$filename);
}
/**
* 数据库修复、优化
*/
public function public_repair() {
$database = pc_base::load_config('database');
$tables = $_POST['tables'] ? $_POST['tables'] : trim($_GET['tables']);
$operation = trim($_GET['operation']);
$pdo_name = trim($_GET['pdo_name']);
$this->db = db_factory::get_instance($database)->get_database($pdo_name);
$tables = is_array($tables) ? implode(',',$tables) : $tables;
if($tables && in_array($operation,array('repair','optimize'))) {
$this->db->query("$operation TABLE $tables");
showmessage(L('operation_success'),'?m=admin&c=database&a=export&pdoname='.$pdo_name);
} elseif ($tables && $operation == 'showcreat') {
$this->db->query("SHOW CREATE TABLE $tables");
$structure = $this->db->fetch_next();
$structure = $structure['Create Table'];
$show_header = true;
include $this->admin_tpl('database_structure');
} else {
showmessage(L('select_tbl'),'?m=admin&c=database&a=export&pdoname='.$pdo_name);
}
}
/**
* 备份文件删除
*/
public function delete() {
$filenames = $_POST['filenames'];
$pdo_name = $_GET['pdoname'];
$bakfile_path = CACHE_PATH.'bakup'.DIRECTORY_SEPARATOR.$pdo_name.DIRECTORY_SEPARATOR;
if($filenames) {
if(is_array($filenames)) {
foreach($filenames as $filename) {
if(fileext($filename)=='sql') {
@unlink($bakfile_path.$filename);
}
}
showmessage(L('operation_success'),'?m=admin&c=database&a=import&pdoname='.$pdo_name);
} else {
if(fileext($filenames)=='sql') {
@unlink($bakfile_path.$filename);
showmessage(L('operation_success'),'?m=admin&c=database&a=import&pdoname='.$pdo_name);
}
}
} else {
showmessage(L('select_delfile'));
}
}
/**
* 获取数据表
* @param unknown_type 数据表数组
* @param unknown_type 表前缀
*/
private function status($tables,$tablepre) {
$phpcms = array();
$other = array();
foreach($tables as $table) {
$name = $table['Name'];
$row = array('name'=>$name,'rows'=>$table['Rows'],'size'=>$table['Data_length']+$row['Index_length'],'engine'=>$table['Engine'],'data_free'=>$table['Data_free'],'collation'=>$table['Collation']);
if(strpos($name, $tablepre) === 0) {
$phpcms[] = $row;
} else {
$other[] = $row;
}
}
return array('phpcmstables'=>$phpcms, 'othertables'=>$other);
}
/**
* 数据库导出方法
* @param unknown_type $tables 数据表数据组
* @param unknown_type $sqlcompat 数据库兼容类型
* @param unknown_type $sqlcharset 数据库字符
* @param unknown_type $sizelimit 卷大小
* @param unknown_type $action 操作
* @param unknown_type $fileid 卷标
* @param unknown_type $random 随机字段
* @param unknown_type $tableid
* @param unknown_type $startfrom
* @param unknown_type $tabletype 备份数据库类型 (非phpcms数据与phpcms数据)
*/
private function export_database($tables,$sqlcompat,$sqlcharset,$sizelimit,$action,$fileid,$random,$tableid,$startfrom,$tabletype) {
$dumpcharset = $sqlcharset ? $sqlcharset : str_replace('-', '', CHARSET);
$fileid = ($fileid != '') ? $fileid : 1;
if($fileid==1 && $tables) {
if(!isset($tables) || !is_array($tables)) showmessage(L('select_tbl'));
$random = mt_rand(1000, 9999);
setcache('bakup_tables',$tables,'commons');
} else {
if(!$tables = getcache('bakup_tables','commons')) showmessage(L('select_tbl'));
}
if($this->db->version() > '4.1'){
if($sqlcharset) {
$this->db->query("SET NAMES '".$sqlcharset."';\n\n");
}
if($sqlcompat == 'MYSQL40') {
$this->db->query("SET SQL_MODE='MYSQL40'");
} elseif($sqlcompat == 'MYSQL41') {
$this->db->query("SET SQL_MODE=''");
}
}
$tabledump = '';
$tableid = ($tableid!= '') ? $tableid - 1 : 0;
$startfrom = ($startfrom != '') ? intval($startfrom) : 0;
for($i = $tableid; $i < count($tables) && strlen($tabledump) < $sizelimit * 1000; $i++) {
global $startrow;
$offset = 100;
if(!$startfrom) {
if($tables[$i]!=DB_PRE.'session') {
$tabledump .= "DROP TABLE IF EXISTS `$tables[$i]`;\n";
}
$createtable = $this->db->query("SHOW CREATE TABLE `$tables[$i]` ");
$create = $this->db->fetch_next();
$tabledump .= $create['Create Table'].";\n\n";
$this->db->free_result($createtable);
if($sqlcompat == 'MYSQL41' && $this->db->version() < '4.1') {
$tabledump = preg_replace("/TYPE\=([a-zA-Z0-9]+)/", "ENGINE=\\1 DEFAULT CHARSET=".$dumpcharset, $tabledump);
}
if($this->db->version() > '4.1' && $sqlcharset) {
$tabledump = preg_replace("/(DEFAULT)*\s*CHARSET=[a-zA-Z0-9]+/", "DEFAULT CHARSET=".$sqlcharset, $tabledump);
}
if($tables[$i]==DB_PRE.'session') {
$tabledump = str_replace("CREATE TABLE `".DB_PRE."session`", "CREATE TABLE IF NOT EXISTS `".DB_PRE."session`", $tabledump);
}
}
$numrows = $offset;
while(strlen($tabledump) < $sizelimit * 1000 && $numrows == $offset) {
if($tables[$i]==DB_PRE.'session' || $tables[$i]==DB_PRE.'member_cache') break;
$sql = "SELECT * FROM `$tables[$i]` LIMIT $startfrom, $offset";
$numfields = $this->db->num_fields($sql);
$numrows = $this->db->num_rows($sql);
$fields_name = $this->db->get_fields($tables[$i]);
$rows = $this->db->query($sql);
$name = array_keys($fields_name);
$r = array();
while ($row = $this->db->fetch_next()) {
$r[] = $row;
$comma = "";
$tabledump .= "INSERT INTO `$tables[$i]` VALUES(";
for($j = 0; $j < $numfields; $j++) {
$tabledump .= $comma."'".mysql_escape_string($row[$name[$j]])."'";
$comma = ",";
}
$tabledump .= ");\n";
}
$this->db->free_result($rows);
$startfrom += $offset;
}
$tabledump .= "\n";
$startrow = $startfrom;
$startfrom = 0;
}
if(trim($tabledump)) {
$tabledump = "# phpcms bakfile\n# version:PHPCMS V9\n# time:".date('Y-m-d H:i:s')."\n# type:phpcms\n# phpcms:http://www.phpcms.cn\n# --------------------------------------------------------\n\n\n".$tabledump;
$tableid = $i;
$filename = $tabletype.'_'.date('Ymd').'_'.$random.'_'.$fileid.'.sql';
$altid = $fileid;
$fileid++;
$bakfile_path = CACHE_PATH.'bakup'.DIRECTORY_SEPARATOR.$this->pdo_name;
if(!dir_create($bakfile_path)) {
showmessage(L('dir_not_be_created'));
}
$bakfile = $bakfile_path.DIRECTORY_SEPARATOR.$filename;
if(!is_writable(CACHE_PATH.'bakup')) showmessage(L('dir_not_be_created'));
file_put_contents($bakfile, $tabledump);
@chmod($bakfile, 0777);
if(!EXECUTION_SQL) $filename = L('bundling').$altid.'#';
showmessage(L('bakup_file')." $filename ".L('bakup_write_succ'), '?m=admin&c=database&a=export&sizelimit='.$sizelimit.'&sqlcompat='.$sqlcompat.'&sqlcharset='.$sqlcharset.'&tableid='.$tableid.'&fileid='.$fileid.'&startfrom='.$startrow.'&random='.$random.'&dosubmit=1&tabletype='.$tabletype.'&allow='.$allow.'&pdo_select='.$this->pdo_name);
} else {
$bakfile_path = CACHE_PATH.'bakup'.DIRECTORY_SEPARATOR.$this->pdo_name.DIRECTORY_SEPARATOR;
file_put_contents($bakfile_path.'index.html','');
delcache('bakup_tables','commons');
showmessage(L('bakup_succ'),'?m=admin&c=database&a=import&pdoname='.$this->pdo_name);
}
}
/**
* 数据库恢复
* @param unknown_type $filename
*/
private function import_database($filename) {
if($filename && fileext($filename)=='sql') {
$filepath = CACHE_PATH.'bakup'.DIRECTORY_SEPARATOR.$this->pdo_name.DIRECTORY_SEPARATOR.$filename;
if(!file_exists($filepath)) showmessage(L('database_sorry')." $filepath ".L('database_not_exist'));
$sql = file_get_contents($filepath);
sql_execute($sql);
showmessage("$filename ".L('data_have_load_to_database'));
} else {
$fileid = $this->fileid ? $this->fileid : 1;
$pre = $filename;
$filename = $filename.$fileid.'.sql';
$filepath = CACHE_PATH.'bakup'.DIRECTORY_SEPARATOR.$this->pdo_name.DIRECTORY_SEPARATOR.$filename;
if(file_exists($filepath)) {
$sql = file_get_contents($filepath);
$this->sql_execute($sql);
$fileid++;
showmessage(L('bakup_data_file')." $filename ".L('load_success'),"?m=admin&c=database&a=import&pdoname=".$this->pdo_name."&pre=".$pre."&fileid=".$fileid."&dosubmit=1");
} else {
showmessage(L('data_recover_succ'),'?m=admin&c=database&a=import');
}
}
}
/**
* 执行SQL
* @param unknown_type $sql
*/
private function sql_execute($sql) {
$sqls = $this->sql_split($sql);
if(is_array($sqls)) {
foreach($sqls as $sql) {
if(trim($sql) != '') {
$this->db->query($sql);
}
}
} else {
$this->db->query($sqls);
}
return true;
}
private function sql_split($sql) {
if($this->db->version() > '4.1' && $this->db_charset) {
$sql = preg_replace("/TYPE=(InnoDB|MyISAM|MEMORY)( DEFAULT CHARSET=[^; ]+)?/", "ENGINE=\\1 DEFAULT CHARSET=".$this->db_charset,$sql);
}
if($this->db_tablepre != "phpcms_") $sql = str_replace("`phpcms_", '`'.$this->db_tablepre, $sql);
$sql = str_replace("\r", "\n", $sql);
$ret = array();
$num = 0;
$queriesarray = explode(";\n", trim($sql));
unset($sql);
foreach($queriesarray as $query) {
$ret[$num] = '';
$queries = explode("\n", trim($query));
$queries = array_filter($queries);
foreach($queries as $query) {
$str1 = substr($query, 0, 1);
if($str1 != '#' && $str1 != '-') $ret[$num] .= $query;
}
$num++;
}
return($ret);
}
}
?> | PHP |
<?php
defined('IN_PHPCMS') or exit('No permission resources.');
pc_base::load_app_class('admin','admin',0);
class ipbanned extends admin {
function __construct() {
$this->db = pc_base::load_model('ipbanned_model');
pc_base::load_sys_class('form', '', 0);
parent::__construct();
}
function init () {
$page = $_GET['page'] ? $_GET['page'] : '1';
$infos = array();
$infos = $this->db->listinfo('','ipbannedid DESC',$page ,'20');
$pages = $this->db->pages;
$big_menu = array('javascript:window.top.art.dialog({id:\'add\',iframe:\'?m=admin&c=ipbanned&a=add\', title:\''.L('add_ipbanned').'\', width:\'450\', height:\'300\'}, function(){var d = window.top.art.dialog({id:\'add\'}).data.iframe;var form = d.document.getElementById(\'dosubmit\');form.click();return false;}, function(){window.top.art.dialog({id:\'add\'}).close()});void(0);', L('add_ipbanned'));
include $this->admin_tpl('ipbanned_list');
}
/**
* 验证数据有效性
*/
public function public_name() {
$ip = isset($_GET['ip']) && trim($_GET['ip']) ? (CHARSET == 'gbk' ? iconv('utf-8', 'gbk', trim($_GET['ip'])) : trim($_GET['ip'])) : exit('0');
//添加判断IP是否重复
if ($this->db->get_one(array('ip'=>$ip), 'ipbannedid')) {
exit('0');
} else {
exit('1');
}
}
/**
* IP添加
*/
function add() {
if(isset($_POST['dosubmit'])){
$_POST['info']['expires']=strtotime($_POST['info']['expires']);
$this->db->insert($_POST['info']);
$this->public_cache_file();//更新缓存
showmessage(L('operation_success'),'?m=admin&c=ipbanned&a=add','', 'add');
}else{
$show_validator = $show_scroll = $show_header = true;
include $this->admin_tpl('ipbanned_add');
}
}
/**
* IP删除
*/
function delete() {
if(is_array($_POST['ipbannedid'])){
foreach($_POST['ipbannedid'] as $ipbannedid_arr) {
$this->db->delete(array('ipbannedid'=>$ipbannedid_arr));
}
$this->public_cache_file();//更新缓存
showmessage(L('operation_success'),'?m=admin&c=ipbanned');
} else {
$ipbannedid = intval($_GET['ipbannedid']);
if($ipbannedid < 1) return false;
$result = $this->db->delete(array('ipbannedid'=>$ipbannedid));
$this->public_cache_file();//更新缓存
if($result){
showmessage(L('operation_success'),'?m=admin&c=ipbanned');
} else {
showmessage(L("operation_failure"),'?m=admin&c=ipbanned');
}
}
}
/**
* IP搜索
*/
public function search_ip() {
$where = '';
if($_GET['search']) extract($_GET['search']);
if($ip){
$where .= $where ? " AND ip LIKE '%$ip%'" : " ip LIKE '%$ip%'";
}
$page = isset($_GET['page']) && intval($_GET['page']) ? intval($_GET['page']) : 1;
$infos = $this->db->listinfo($where,$order = 'ipbannedid DESC',$page, $pages = '2');
$pages = $this->db->pages;
$big_menu = array('javascript:window.top.art.dialog({id:\'add\',iframe:\'?m=admin&c=ipbanned&a=add\', title:\''.L('add_ipbanned').'\', width:\'450\', height:\'300\'}, function(){var d = window.top.art.dialog({id:\'add\'}).data.iframe;var form = d.document.getElementById(\'dosubmit\');form.click();return false;}, function(){window.top.art.dialog({id:\'add\'}).close()});void(0);', L('add_ipbanned'));
include $this->admin_tpl('ip_search_list');
}
/**
* 生成缓存
*/
public function public_cache_file() {
$infos = $this->db->select('','ip,expires','','ipbannedid desc');
setcache('ipbanned', $infos, 'commons');
return true;
}
}
?> | PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header');?>
<div class="pad-lr-10">
<form name="downform" action="?m=admin&c=downservers&a=init" method="post" >
<table width="100%" cellspacing="0" class="search-form">
<tbody>
<tr>
<td><div class="explain-col"><?php echo L('downserver_name')?> <input type="text" value="<?php echo $sitename?>" class="input-text" name="info[sitename]"> <?php echo L('downserver_url')?> <input type="text" value="<?php echo $siteurl?>" class="input-text" name="info[siteurl]" size="50"> <?php echo L('downserver_site');?> <?php echo form::select($sitelist,self::get_siteid(),'name="info[siteid]"',$default)?> <input type="submit" value="<?php echo L('add');?>" class="button" name="dosubmit">
</div>
</td>
</tr>
</tbody>
</table>
</form>
<form name="myform" action="?m=admin&c=downservers&a=listorder" method="post">
<div class="table-list">
<table width="100%" cellspacing="0">
<thead>
<tr>
<th width="10%" align="left"><?php echo L('listorder');?></th>
<th width="10%" align="left">ID</th>
<th width="20%"><?php echo L('downserver_name')?></th>
<th width="35%"><?php echo L('downserver_url')?></th>
<th width="15%"><?php echo L('downserver_site')?></th>
<th width="15%"><?php echo L('posid_operation');?></th>
</tr>
</thead>
<tbody>
<?php
if(is_array($infos)){
foreach($infos as $info){
?>
<tr>
<td width="10%">
<input name='listorders[<?php echo $info['id']?>]' type='text' size='2' value='<?php echo $info['listorder']?>' class="input-text-c">
</td>
<td width="10%"><?php echo $info['id']?></td>
<td width="20%" align="center"><?php echo $info['sitename']?></td>
<td width="35%" align="center"><?php echo $info['siteurl']?></td>
<td width="15%" align="center"><?php echo $info['siteid'] ? $sitelist[$info['siteid']] : L('all_site')?></td>
<td width="15%" align="center">
<a href="javascript:edit(<?php echo $info['id']?>, '<?php echo new_addslashes($info['sitename'])?>')"><?php echo L('edit')?></a> |
<a href="javascript:confirmurl('?m=admin&c=downservers&a=delete&id=<?php echo $info['id']?>', '<?php echo L('downserver_del_cofirm')?>')"><?php echo L('delete')?></a>
</td>
</tr>
<?php
}
}
?>
</tbody>
</table>
<div class="btn"><input type="submit" class="button" name="dosubmit" value="<?php echo L('listorder')?>" /></div> </div>
</form>
<div id="pages"> <?php echo $pages?></div>
</div>
</div>
</body>
<a href="javascript:edit(<?php echo $v['siteid']?>, '<?php echo $v['name']?>')">
</html>
<script type="text/javascript">
<!--
function edit(id, name) {
window.top.art.dialog({title:'<?php echo L('edit')?>--'+name, id:'edit', iframe:'?m=admin&c=downservers&a=edit&id='+id ,width:'520px',height:'150px'}, function(){var d = window.top.art.dialog({id:'edit'}).data.iframe;
var form = d.document.getElementById('dosubmit');form.click();return false;}, function(){window.top.art.dialog({id:'edit'}).close()});
}
//-->
</script> | PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
$pc_hash = $_SESSION['pc_hash'];
foreach($datas as $_value) {
echo '<h3 class="f14"><span class="switchs cu on" title="'.L('expand_or_contract').'"></span>'.L($_value['name']).'</h3>';
echo '<ul>';
$sub_array = admin::admin_menu($_value['id']);
foreach($sub_array as $_key=>$_m) {
//附加参数
$data = $_m['data'] ? '&'.$_m['data'] : '';
if($menuid == 5) { //左侧菜单不显示选中状态
$classname = 'class="sub_menu"';
} else {
$classname = 'class="sub_menu"';
}
echo '<li id="_MP'.$_m['id'].'" '.$classname.'><a href="javascript:_MP('.$_m['id'].',\'?m='.$_m['m'].'&c='.$_m['c'].'&a='.$_m['a'].$data.'\');" hidefocus="true" style="outline:none;">'.L($_m['name']).'</a></li>';
}
echo '</ul>';
}
?>
<script type="text/javascript">
$(".switchs").each(function(i){
var ul = $(this).parent().next();
$(this).click(
function(){
if(ul.is(':visible')){
ul.hide();
$(this).removeClass('on');
}else{
ul.show();
$(this).addClass('on');
}
})
});
</script> | PHP |
<?php defined('IN_ADMIN') or exit('No permission resources.'); ?>
<!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=<?php echo CHARSET;?>" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<title><?php echo L('phpcms_logon')?></title>
<style type="text/css">
div{overflow:hidden; *display:inline-block;}div{*display:block;}
.login_box{background:url(<?php echo IMG_PATH?>admin_img/login_bg.jpg) no-repeat; width:602px; height:416px; overflow:hidden; position:absolute; left:50%; top:50%; margin-left:-301px; margin-top:-208px;}
.login_iptbox{bottom:90px;_bottom:72px;color:#FFFFFF;font-size:12px;height:30px;left:50%;
margin-left:-280px;position:absolute;width:560px; overflow:visible;}
.login_iptbox .ipt{height:24px; width:110px; margin-right:22px; color:#fff; background:url(<?php echo IMG_PATH?>admin_img/ipt_bg.jpg) repeat-x; *line-height:24px; border:none; color:#000; overflow:hidden;}
<?php if(SYS_STYLE=='en'){ ?>
.login_iptbox .ipt{width:100px; margin-right:12px;}
<?php }?>
.login_iptbox label{ *position:relative; *top:-6px;}
.login_iptbox .ipt_reg{margin-left:12px;width:46px; margin-right:16px; background:url(<?php echo IMG_PATH?>admin_img/ipt_bg.jpg) repeat-x; *overflow:hidden;text-align:left;padding:2px 0 2px 5px;font-size:16px;font-weight:bold;}
.login_tj_btn{ background:url(<?php echo IMG_PATH?>admin_img/login_dl_btn.jpg) no-repeat 0px 0px; width:52px; height:24px; margin-left:16px; border:none; cursor:pointer; padding:0px; float:right;}
.yzm{position:absolute; background:url(<?php echo IMG_PATH?>admin_img/login_ts140x89.gif) no-repeat; width:140px; height:89px;right:56px;top:-96px; text-align:center; font-size:12px; display:none;}
.yzm a:link,.yzm a:visited{color:#036;text-decoration:none;}
.yzm a:hover{color:#C30;}
.yzm img{cursor:pointer; margin:4px auto 7px; width:130px; height:50px; border:1px solid #fff;}
.cr{font-size:12px;font-style:inherit;text-align:center;color:#ccc;width:100%; position:absolute; bottom:58px;}
.cr a{color:#ccc;text-decoration:none;}
</style>
<script language="JavaScript">
<!--
if(top!=self)
if(self!=top) top.location=self.location;
//-->
</script>
</head>
<body onload="javascript:document.myform.username.focus();">
<div id="login_bg" class="login_box">
<div class="login_iptbox">
<form action="index.php?m=admin&c=index&a=login&dosubmit=1" method="post" name="myform"><input name="dosubmit" value="" type="submit" class="login_tj_btn" /><label><?php echo L('username')?>:</label><input name="username" type="text" class="ipt" value="" /><label><?php echo L('password')?>:</label><input name="password" type="password" class="ipt" value="" /><label><?php echo L('security_code')?>:</label><input name="code" type="text" class="ipt ipt_reg" onfocus="document.getElementById('yzm').style.display='block'" />
<div id="yzm" class="yzm"><?php echo form::checkcode('code_img')?><br /><a href="javascript:document.getElementById('code_img').src='<?php echo SITE_PROTOCOL.SITE_URL.WEB_PATH;?>api.php?op=checkcode&m=admin&c=index&a=checkcode&time='+Math.random();void(0);"><?php echo L('click_change_validate')?></a></div>
</form>
</div>
<div class="cr"><?php echo L("copyright")?></div>
</div>
</body>
</html> | PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header', 'admin');
?>
<form name="myform" action="?m=admin&c=position&a=listorder" method="post">
<div class="pad_10">
<div class="table-list">
<table width="100%" cellspacing="0">
<thead>
<tr>
<th width="35%" align="left"><?php echo L('plugin_list_name','','plugin')?></th>
<th width="10%"><?php echo L('plugin_list_version','','plugin')?></th>
<th width="15%"><?php echo L('plugin_list_copy','','plugin')?></th>
<th width="10%"><?php echo L('plugin_list_dir','','plugin')?></th>
<th width="15%"></th>
</tr>
</thead>
<tbody>
<?php
if(is_array($pluginfo)){
foreach($pluginfo as $info){
?>
<tr>
<td width="35%"><?php echo $info['name']?></td>
<td width="10%" align="center"><?php echo $info['version']?></td>
<td width="15%" align="center"><?php echo $info['copyright']?></td>
<td width="10%" align="center"><?php echo $info['dir']?>/</td>
<td width="15%" align="center"><a href="?m=admin&c=plugin&a=import&dir=<?php echo $info['dir']?>&menuid=<?php echo $_GET['menuid']?>"><?php echo L('plugin_install','','plugin')?></a></td>
</tr>
<?php
}
}
?>
</tbody>
</table>
<div class="btn"></div> </div>
<div id="pages"> <?php echo $pages?></div>
</div>
</div>
</form>
</body>
<a href="javascript:edit(<?php echo $v['siteid']?>, '<?php echo $v['name']?>')">
</html>
<script type="text/javascript">
<!--
function add(id, name) {
window.top.art.dialog({title:'<?php echo L('edit')?>--'+name, id:'add', iframe:'?m=pay&c=payment&a=add&code='+id ,width:'700',height:'500'}, function(){var d = window.top.art.dialog({id:'add'}).data.iframe;
var form = d.document.getElementById('dosubmit');form.click();return false;}, function(){window.top.art.dialog({id:'add'}).close()});
}
function edit(id, name) {
window.top.art.dialog({title:'<?php echo L('edit')?>--'+name, id:'edit', iframe:'?m=pay&c=payment&a=edit&id='+id ,width:'700',height:'500'}, function(){var d = window.top.art.dialog({id:'edit'}).data.iframe;
var form = d.document.getElementById('dosubmit');form.click();return false;}, function(){window.top.art.dialog({id:'edit'}).close()});
}
//-->
</script> | PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header');?>
<script type="text/javascript">
$(document).ready(function() {
$.formValidator.initConfig({autotip:true,formid:"myform",onerror:function(msg){}});
$("#name").formValidator({onshow:"<?php echo L('input').L('linkage_name')?>",onfocus:"<?php echo L('linkage_name').L('not_empty')?>"}).inputValidator({min:1,max:999,onerror:"<?php echo L('linkage_name').L('not_empty')?>"});
})
</script>
<div class="pad_10">
<div class="common-form">
<form name="myform" action="?m=admin&c=linkage&a=edit" method="post" id="myform">
<table width="100%" class="table_form contentWrap">
<?php
if(isset($_GET['parentid'])) { ?>
<tr>
<td><?php echo L('linkage_parent_menu')?></td>
<td>
<?php echo form::select_linkage($info['keyid'], 0, 'info[parentid]', 'parentid', L('cat_empty'), $_GET['parentid'])?>
</td>
</tr>
<?php } ?>
<tr>
<td><?php echo L('linkage_name')?></td>
<td>
<input type="text" name="info[name]" value="<?php echo $name?>" class="input-text" id="name" size="30"></input>
</td>
</tr>
<tr>
<td><?php echo L('linkage_desc')?></td>
<td>
<textarea name="info[description]" rows="2" cols="20" id="description" class="inputtext" style="height:45px;width:300px;"><?php echo $description?></textarea>
</td>
</tr>
<?php
if(isset($_GET['parentid'])) { ?>
<input type="hidden" name="info[siteid]" value="<?php echo $this->_get_belong_siteid($keyid)?>" class="input-text" id="name" size="30"></input>
<input type="hidden" name="linkageid" value="<?php echo $linkageid?>">
<input name="dosubmit" type="submit" value="<?php echo L('submit')?>" class="dialog" id="dosubmit">
<?php } else { ?>
<tr>
<td><?php echo L('linkage_menu_style')?></td>
<td>
<input name="info[style]" value="0" type="radio" <?php if($style==0) {?>checked<?php }?>> <?php echo L('linkage_option_style')?> <input name="info[style]" value="1" type="radio" <?php if($style==1) {?>checked<?php }?>> <?php echo L('linkage_pop_style')?>
</td>
</tr>
<tr>
<td><?php echo L('site_select')?></td>
<td>
<?php echo form::select($sitelist,$siteid,'name="info[siteid]"',L('all_site'))?><input type="hidden" name="linkageid" value="<?php echo $linkageid?>">
<input type="hidden" name="info[keyid]" value="<?php echo $keyid?>">
<input name="dosubmit" type="submit" value="<?php echo L('submit')?>" class="dialog" id="dosubmit">
</td>
</tr>
<?php } ?>
</table>
</form>
</div>
</div>
</body>
</html>
| PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header');
?>
<script type="text/javascript">
<!--
$(function(){
$.formValidator.initConfig({formid:"myform",autotip:true,onerror:function(msg,obj){window.top.art.dialog({content:msg,lock:true,width:'200',height:'50'}, function(){this.close();$(obj).focus();})}});
$("#sitename").formValidator({onshow:"<?php echo L('input').L('copyfrom_name');?>",onfocus:"<?php echo L('input').L('copyfrom_name');?>"}).inputValidator({min:1,onerror:"<?php echo L('input').L('copyfrom_name');?>"});
$("#siteurl").formValidator({onshow:"<?php echo L('input').L('copyfrom_url');?>",onfocus:"<?php echo L('input').L('copyfrom_url');?>",empty:false}).inputValidator({onerror:"<?php echo L('input').L('copyfrom_url');?>"}).regexValidator({regexp:"^http://",onerror:"<?php echo L('copyfrom_url_tips');?>"});
})
//-->
</script>
<div class="pad_10">
<form action="?m=admin&c=copyfrom&a=add" method="post" name="myform" id="myform" >
<table width="100%" cellpadding="2" cellspacing="1" class="table_form">
<tr>
<th width="60"><?php echo L('copyfrom_name');?> :</th>
<td><input type="text" name="info[sitename]" id="sitename" size="25"></td>
</tr>
<tr>
<th><?php echo L('copyfrom_url')?> :</th>
<td><input type="text" name="info[siteurl]" id="siteurl" size="25"></td>
</tr>
<tr>
<th><?php echo L('copyfrom_logo')?> :</th>
<td><?php echo form::images('info[thumb]', 'thumb', '', 'admin')?></td>
</tr>
<input type="submit" name="dosubmit" id="dosubmit" class="dialog" value=" <?php echo L('submit')?> ">
</table>
</form>
</div>
</body>
</html> | PHP |
<style type="text/css">
.sbs{}
.sbul{margin:10px;}
.sbul li{line-height:30px;}
.button{margin-top:20px;}
.subnav,.ifm{display:none;}
</style>
<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header','admin');?>
<div class="pad-10">
<form action="?m=admin&c=cache_all&a=init&pc_hash=<?php echo $_SESSION['pc_hash']?>" target="cache_if" method="post" id="myform" name="myform">
<input type="hidden" name="dosubmit" value="1">
<div class="col-2">
<h6><?php echo L('tip_zone')?></h6>
<div class="sbs" id="update_tips" style="height:360px; overflow:auto;">
<ul id="file" class="sbul">
</ul>
</div>
</div>
<!-- <input name="dosubmit" type="submit" class="dialog" id="dosubmit" value="<?php echo L('start_update')?>" onclick="$('#file').html('');return true;" class="button"> -->
</form>
<iframe id="cache_if" name="cache_if" class="ifm"></iframe>
<iframe id="hidden" name="hidden" width="0" height="0" frameborder=0></iframe>
</div>
<script type="text/javascript">
document.myform.submit();
function addtext(data) {
$('#file').append(data);
document.getElementById('update_tips').scrollTop = document.getElementById('update_tips').scrollHeight;
}
</script>
</body>
</html> | PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header');?>
<script type="text/javascript">
<!--
$(function(){
$.formValidator.initConfig({autotip:true,formid:"myform",onerror:function(msg){}});
$("#title").formValidator({onshow:"<?php echo L('input').L('posid_title')?>",onfocus:"<?php echo L('posid_title').L('not_empty')?>"}).inputValidator({min:1,max:999,onerror:"<?php echo L('posid_title').L('not_empty')?>"});
$("#url").formValidator({onshow:"<?php echo L('input').L('posid_url')?>",onfocus:"<?php echo L('posid_url').L('not_empty')?>"}).inputValidator({min:1,max:999,onerror:"<?php echo L('posid_url').L('not_empty')?>"});
})
//-->
</script>
<div class="pad_10">
<div class="common-form">
<form name="myform" action="?m=admin&c=position&a=public_item_manage" method="post" id="myform">
<input type="hidden" name="posid" value="<?php echo $posid?>"></input>
<input type="hidden" name="modelid" value="<?php echo $modelid?>"></input>
<input type="hidden" name="id" value="<?php echo $id?>"></input>
<table width="100%" class="table_form">
<tr>
<td width="100"><?php echo L('posid_title')?></td>
<td><input type="text" name="info[title]" class="input-text" value="<?php echo $title?>" id="title" size="40"></input></td>
</tr>
<tr>
<td><?php echo L('posid_thumb')?></td>
<td><?php echo form::images('info[thumb]','thumb',$thumb,'content')?> </td>
</tr>
<tr>
<td><?php echo L('posid_inputtime')?></td>
<td><?php echo form::date('info[inputtime]', date('Y-m-d h:i:s',$inputtime), 1)?></td>
</tr>
<tr>
<td><?php echo L('posid_desc')?></td>
<td>
<textarea name="info[description]" rows="2" cols="20" id="description" class="inputtext" style="height:100px;width:300px;"><?php echo $description?></textarea>
</td>
</tr>
<tr>
<td><?php echo L('posid_syn')?></td>
<td>
<input name="synedit" value="0" type="radio" <?php echo $synedit==0 ? 'checked="checked"' : ''?>> <?php echo L('enable')?><input name="synedit" value="1" type="radio" <?php echo $synedit==1 ? 'checked="checked"' : ''?>> <?php echo L('close')?>
</td>
</tr>
</table>
<div class="bk15"></div>
<input name="dosubmit" type="submit" value="<?php echo L('submit')?>" class="dialog" id="dosubmit">
</form>
</div>
</div>
</body>
</html>
<script type="text/javascript">
function category_load(obj)
{
var modelid = $(obj).attr('value');
$.get('?m=admin&c=position&a=public_category_load&modelid='+modelid,function(data){
$('#load_catid').html(data);
});
}
</script>
| PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header');
?>
<script type="text/javascript">
<!--
$(function(){
$.formValidator.initConfig({formid:"myform",autotip:true,onerror:function(msg,obj){window.top.art.dialog({content:msg,lock:true,width:'200',height:'50'}, function(){this.close();$(obj).focus();})}});
$("#file").formValidator({onshow:"<?php echo L('input').L('urlrule_file')?>",onfocus:"<?php echo L('input').L('urlrule_file')?>"}).regexValidator({regexp:"^([a-zA-Z0-9]|[_]){0,20}$",onerror:"<?php echo L('enter_the_correct_catname');?>"}).inputValidator({min:1,onerror:"<?php echo L('input').L('urlrule_file')?>"});
$("#example").formValidator({onshow:"<?php echo L('input').L('urlrule_example')?>",onfocus:"<?php echo L('input').L('urlrule_example')?>"}).inputValidator({min:1,onerror:"<?php echo L('input').L('urlrule_example')?>"});
$("#urlrule").formValidator({onshow:"<?php echo L('input').L('urlrule_url')?>",onfocus:"<?php echo L('input').L('urlrule_url')?>"}).inputValidator({min:1,onerror:"<?php echo L('input').L('urlrule_url')?>"});
})
//-->
</script>
<style type="text/css">
.input-botton {
border:none;
border-bottom:1px dotted #E1A035;
background:none;
}
</style>
<div class="pad_10">
<table width="100%" cellpadding="2" cellspacing="1" class="table_form">
<form action="?m=admin&c=urlrule&a=edit" method="post" name="myform" id="myform">
<tr>
<th width="20%"><?php echo L('urlrule_file')?> :</th>
<td><input type="text" name="info[file]" id="file" size="20" value="<?php echo $file;?>"></td>
</tr>
<tr>
<th width="20%"><?php echo L('urlrule_module')?> :</th>
<td><?php echo form::select($modules,$module,"name='info[module]' id='module'");?></td>
</tr>
<tr>
<th width="20%"><?php echo L('urlrule_ishtml')?> :</th>
<td>
<input type="radio" value="1" name="info[ishtml]" <?php if($ishtml) echo 'checked';?>/><?php echo L('yes');?>
<input type="radio" value="0" name="info[ishtml]" <?php if(!$ishtml) echo 'checked';?>/><?php echo L('no');?>
</td>
</tr>
<tr>
<th width="20%"><?php echo L('urlrule_example')?> :</th>
<td><input type="text" name="info[example]" id="example" size="70" value="<?php echo $example;?>"></td>
</tr>
<tr>
<th width="20%"><?php echo L('urlrule_url')?> :</th>
<td><input type="text" name="info[urlrule]" id="urlrule" value="<?php echo $urlrule;?>" size="70">
</td>
</tr>
<tr>
<th width="20%"><?php echo L('urlrule_func')?> :</th>
<td><?php echo L('complete_part_path');?>: <input type="text" name="f1" value="{$categorydir}" size="15" class="input-botton">,<?php echo L('category_path');?>:<input type="text" name="f1" value="{$catdir}" size="10" class="input-botton">
<div class="bk6"></div>
<?php echo L('year');?>:<input type="text" name="f1" value="{$year}" size="7" class="input-botton"> <?php echo L('month');?>:<input type="text" name="f1" value="{$month}" size="9" class="input-botton">,<?php echo L('day');?>:<input type="text" name="f1" value="{$day}" size="7" class="input-botton"> ID:<input type="text" name="f1" value="{$id}" size="4" class="input-botton">, <?php echo L('paging');?>:<input type="text" name="f1" value="{$page}" size="7" class="input-botton">
</td>
</tr>
<input type="hidden" name="urlruleid" id="urlruleid" value="<?php echo $urlruleid;?>">
<input type="submit" name="dosubmit" id="dosubmit" class="dialog" value=" <?php echo L('submit')?> ">
</form>
</table>
</div>
</body>
</html> | PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header');?>
<script type="text/javascript">
$(function(){
$.formValidator.initConfig({formid:"myform",autotip:true,onerror:function(msg,obj){window.top.art.dialog({content:msg,lock:true,width:'200',height:'50'}, function(){this.close();$(obj).focus();})}});
$("#badword").formValidator({onshow:"<?php echo L("input").L('badword_name')?>",onfocus:"<?php echo L("input").L('badword_name')?>"}).inputValidator({min:1,onerror:"<?php echo L("input").L('badword_name')?>"}).regexValidator({regexp:"notempty",datatype:"enum",param:'i',onerror:"<?php echo L('site_dirname_err_msg')?>"}).ajaxValidator({type : "get",url : "",data :"m=admin&c=badword&a=public_name",datatype : "html",async:'false',success : function(data){ if( data == "1" ){return true;}else{return false;}},buttons: $("#dosubmit"),onerror : "<?php echo L('badword_name').L('exists')?>",onwait : "<?php echo L('connecting')?>"});
$("#replaceword").formValidator({empty:true,onshow:"<?php echo L('badword_noreplace')?>",onfocus:"<?php echo L("input").L('badword_replacename')?>",oncorrect:"<?php echo L('format_right')?>",onempty:"<?php echo L('badword_notreplace')?>"}).inputValidator({min:1,onerror:"<?php echo L("input").L('badword_replacename')?>"});
})
</script>
<div class="pad_10">
<table cellpadding="2" cellspacing="1" class="table_form" width="100%">
<form action="?m=admin&c=badword&a=add" method="post" name="myform" id="myform">
<tr>
<th width="20%"> <?php echo L('badword_name')?> :</th>
<td>
<input type="text" name="badword" id="badword" size="20">
</td>
</tr>
<tr>
<th width="20%"> <?php echo L('badword_replacename')?> :</th>
<td><input type="text" name="replaceword" id="replaceword" size="20"></td>
</tr>
<tr>
<th width="20%"> <?php echo L('badword_level')?> :</th>
<td>
<select size="1" id="workflowid" name="info[level]">
<option selected="" value="1"><?php echo L('badword_common')?></option>
<option value="2"><?php echo L('badword_dangerous')?></option>
</select><?php echo L('badword_level_info')?>
</td>
</tr>
<input type="hidden" name="forward" value="?m=admin&c=badword&a=add">
<input type="submit" name="dosubmit" id="dosubmit" class="dialog" value=" <?php echo L('submit')?> ">
</form>
</table>
</div>
</body>
</html> | PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
$show_dialog = 1;
include $this->admin_tpl('header', 'admin');
?>
<div class="pad-lr-10">
<div class="table-list">
<table width="100%" cellspacing="0">
<thead>
<tr>
<th width="220" align="center"><?php echo L('modulename')?></th>
<th width='220' align="center"><?php echo L('modulepath')?></th>
<th width="14%" align="center"><?php echo L('versions')?></th>
<th width='10%' align="center"><?php echo L('installdate')?></th>
<th width="10%" align="center"><?php echo L('updatetime')?></th>
<th width="12%" align="center"><?php echo L('operations_manage')?></th>
</tr>
</thead>
<tbody>
<?php
if (is_array($directory)){
foreach ($directory as $d){
if (array_key_exists($d, $modules)) {
?>
<tr>
<td align="center" width="220"><?php echo $modules[$d]['name']?></td>
<td width="220" align="center"><?php echo $d?></td>
<td align="center"><?php echo $modules[$d]['version']?></td>
<td align="center"><?php echo $modules[$d]['installdate']?></td>
<td align="center"><?php echo $modules[$d]['updatedate']?></td>
<td align="center">
<?php if ($modules[$d]['iscore']) {?><span style="color: #999"><?php echo L('ban')?></span><?php } else {?><a href="javascript:void(0);" onclick="if(confirm('<?php echo L('confirm', array('message'=>$modules[$d]['name']))?>')){uninstall('<?php echo $d?>');return false;}"><font color="red"><?php echo L('unload')?></font></a><?php }?>
</td>
</tr>
<?php
} else {
$moduel = $isinstall = $modulename = '';
if (file_exists(PHPCMS_PATH.'phpcms'.DIRECTORY_SEPARATOR.'modules'.DIRECTORY_SEPARATOR.$d.DIRECTORY_SEPARATOR.'install'.DIRECTORY_SEPARATOR.'config.inc.php')) {
require PHPCMS_PATH.'phpcms'.DIRECTORY_SEPARATOR.'modules'.DIRECTORY_SEPARATOR.$d.DIRECTORY_SEPARATOR.'install'.DIRECTORY_SEPARATOR.'config.inc.php';
$isinstall = L('install');
} else {
$module = L('unknown');
$isinstall = L('no_install');
}
?>
<tr class="on">
<td align="center" width="220"><?php echo $modulename?></td>
<td width="220" align="center"><?php echo $d?></td>
<td align="center"><?php echo L('unknown')?></td>
<td align="center"><?php echo L('unknown')?></td>
<td align="center"><?php echo L('uninstall_now')?></td>
<td align="center">
<?php if ($isinstall!=L('no_install')) {?> <a href="javascript:install('<?php echo $d?>');void(0);"><font color="#009933"><?php echo $isinstall?></font><?php } else {?><font color="#009933"><?php echo $isinstall?></font><?php }?></a>
</td>
</tr>
<?php
}
}
}
?>
</tbody>
</table>
</div>
<div id="pages"><?php echo $pages?></div>
</div>
<script type="text/javascript">
<!--
function install(id) {
window.top.art.dialog({id:'install'}).close();
window.top.art.dialog({title:'<?php echo L('module_istall')?>', id:'install', iframe:'?m=admin&c=module&a=install&module='+id, width:'500px', height:'260px'}, function(){var d = window.top.art.dialog({id:'install'}).data.iframe;// 使用内置接口获取iframe对象
var form = d.document.getElementById('dosubmit');form.click();return false;}, function(){window.top.art.dialog({id:'install'}).close()});
}
function uninstall(id) {
window.top.art.dialog({id:'install'}).close();
window.top.art.dialog({title:'<?php echo L('module_unistall', '', 'admin')?>', id:'install', iframe:'?m=admin&c=module&a=uninstall&module='+id, width:'500px', height:'260px'}, function(){var d = window.top.art.dialog({id:'install'}).data.iframe;// 使用内置接口获取iframe对象
var form = d.document.getElementById('dosubmit');form.click();return false;}, function(){window.top.art.dialog({id:'install'}).close()});
}
//-->
</script>
</body>
</html> | PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header');?>
<div class="pad_10">
<form name="myform" action="?m=admin&c=role&a=listorder" method="post">
<div class="table-list">
<table width="100%" cellspacing="0">
<thead>
<tr>
<th width="10%">ID</th>
<th width="20%" align="left" ><?php echo L('linkage_name')?></th>
<th width="30%" align="left" ><?php echo L('linkage_desc')?></th>
</tr>
</thead>
<tbody>
<?php
if(is_array($infos)){
foreach($infos as $info){
?>
<tr onclick="return_id(<?php echo $info['linkageid']?>)" title="<?php echo L('click_select')?>" class="cu">
<td width="10%" align="center"><?php echo $info['linkageid']?></td>
<td width="20%" ><?php echo $info['name']?></td>
<td width="30%" ><?php echo $info['description']?></td>
</tr>
<?php
}
}
?>
</tbody>
</table>
</div>
</div>
</form>
<SCRIPT LANGUAGE="JavaScript">
<!--
function return_id(linkageid) {
window.parent.$('#linkageid').val(linkageid);window.parent.art.dialog({id:'selectid'}).close();
}
//-->
</SCRIPT>
</body>
</html> | PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header', 'admin');
?>
<link href="<?php echo CSS_PATH?>appcenter.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<?php echo JS_PATH?>jquery.switchable.min.js"></script>
<div class="pad_10">
<div class="wx980">
<div class="infoba" id="ibar">
</div>
<div class="row1">
<div id="mboxs" class="mbox">
<div>
<?php if(is_array($focus_data)) foreach ($focus_data as $f) {?>
<a <?php if($f[islink]) {?>href="<?php echo $f['url']?>" target="_blank"<?php } else {?> href="?m=admin&c=plugin&a=appcenter_detail&id=<?php echo $f['appid']?>"<?php } ?>><img src="<?php echo $f['thumb']?>"/></a>
<?php } ?>
</div>
</div>
<div id="tagers" class="sbox"></div>
</div>
<div class="rr2">
<div class="row2">
<div class="l jj"></div>
<ul class="r cola li20" id="ul0s">
<?php if(is_array($recommed_data['list'])) foreach ($recommed_data['list'] as $r) {?>
<li>
<div><a href="?m=admin&c=plugin&a=appcenter_detail&id=<?php echo $r['id']?>" title="test" rel="<?php echo $r['id']?>"><img src="<?php echo $r['thumb'] ? $r['thumb'] : IMG_PATH.'zz_bg.jpg'?>" width="55" height="55" /></a><a href="?m=admin&c=plugin&a=appcenter_detail&id=<?php echo $r['id']?>" title="test" class="mgt6"><?php echo $r['appname']?></a></div>
</li>
<?php }?>
<li style="width:100%; height:0; font-size:0; overflow:hidden;"></li>
</ul>
<div style="clear:both;"></div>
</div>
</div>
<div class="row3"> <a href="javascript:;" class="ac"><?php echo L('plugin_app_all','','plugin')?><span class="sja"></span></a></div>
<div class="rr3 cr">
<div class="row4">
<ul class="col col4 fy" id="ul1s">
<?php if(is_array($data['list'])) foreach ($data['list'] as $r) {?>
<li>
<div><a href="?m=admin&c=plugin&a=appcenter_detail&id=<?php echo $r['id']?>" title="<?php echo $r['appname']?>" rel="<?php echo $r['id']?>"><img src="<?php echo $r['thumb'] ? $r['thumb'] : IMG_PATH.'zz_bg.jpg'?>" width="55" height="55" /></a>
<h5><?php echo str_cut($r['appname'],16,'')?></h5>
<span><?php echo $r['isfree'] ? L('plugin_free','','plugin') : L('plugin_not_free','','plugin')?></span><br />
</div>
</li>
<?php }?>
</ul>
</div>
</div>
<div id="pages"><?php echo $pages?></div>
</div>
<script type="text/javascript">
$(document).ready(function(e) {
$("#ul0s > li div").bind("mouseenter",function(e){
var id = $(this).children('a').attr('rel');
get_ajx_detail(id);
var zj = $(this).offset();$("#ul0s").append($("#ibar"));$("#ibar").addClass("xs").css({"left":zj.left+92,"top":zj.top-150});$("#ibar").mouseleave(function(){$(this).removeClass("xs");});
});
$("#ul1s > li div").bind("mouseenter",function(e){
var id = $(this).children('a').attr('rel');
get_ajx_detail(id);
var zj = $(this).offset();$("#ul1s").append($("#ibar"));$("#ibar").addClass("xs").css({"left":zj.left+92,"top":zj.top-150});$("#ibar").mouseleave(function(){$(this).removeClass("xs");});
});
$('#tagers').switchable('#mboxs > div > a', {effect: 'scroll',speed: .2,vertical: true}).autoplay(6).carousel().mousewheel();
});
function get_ajx_detail(id) {
$.getJSON('?m=admin&c=plugin&a=public_appcenter_ajx_detail&jsoncallback=?&id='+id+'&pc_hash='+pc_hash,function(a){
var isfree = a.isfree == 1 ? '<?php echo L('plugin_free','','plugin')?>' : '<?php echo L('plugin_not_free','','plugin')?>'
$("#ibar").html('<div class="lsj"></div><div class="cr r1"> <img src="'+a.thumb+'" width="55" height="55" /></a><h5>'+a.appname+'</h5><span class="grayt">'+isfree+'</span></div><p class="nr">'+a.description+'</p><div class="r2"><div class="jx l"><span class="xx3"></span></div><span class="l">(3)</span><div class="zz"><?php echo L('plugin_author','','plugin')?>:'+a.username+'</div></div>');
});
}
</script>
</div>
</body>
</html> | PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header', 'admin');
?>
<form name="myform" action="?m=admin&c=plugin&a=listorder" method="post">
<div class="pad_10">
<?php if(pc_base::load_config('system','plugin_debug')) { ?>
<div class="explain-col"><?php echo L('plugin_debug_tips','','plugin')?></div>
<div class="bk10"></div>
<?php } ?>
<div class="table-list">
<table width="100%" cellspacing="0">
<thead>
<tr>
<th width="10%"><?php echo L('plugin_listorder','','plugin')?></th>
<th width="25%" align="left"><?php echo L('plugin_list_name','','plugin')?></th>
<th width="10%">URL</th>
<th width="10%"><?php echo L('plugin_list_version','','plugin')?></th>
<th width="15%"><?php echo L('plugin_list_copy','','plugin')?></th>
<th width="10%"><?php echo L('plugin_list_dir','','plugin')?></th>
<th width=""><?php echo L('operations_manage')?></th>
</tr>
</thead>
<tbody>
<?php
if(is_array($pluginfo)){
foreach($pluginfo as $info){
$iframe = '';
if($info['iframe']) $iframe = string2array($info['iframe']);
?>
<tr>
<td width="10%" align="center">
<input name='listorders[<?php echo $info['pluginid']?>]' type='text' size='2' value='<?php echo $info['listorder']?>' class="input-text-c">
</td>
<td width="25%"><?php if(!$info[appid] && pc_base::load_config('system','plugin_debug')) { ?><img src="<?php echo IMG_PATH?>admin_img/plugin_debug.png" title="Developing"><?php } ?>
<a href="?m=admin&c=plugin&a=config&pluginid=<?php echo $info['pluginid']?>&menuid=<?php echo $_GET['menuid']?>">
<?php echo intval($info['disable']) ? '<font color="green">'.$info['name'].'</font>': '<font color="grey">'.$info['name'].'</font>'?></a><?php if($iframe['url']) { ?><a href="plugin.php?id=<?php echo $info['identification']?>" target="_blank"><img src="<?php echo IMG_PATH?>admin_img/link.png" title="iframe"></a><?php } ?>
</td>
<td width="10%" align="center"><?php if($info['url']) {?><a href="<?php echo $info['url']?>" target="_blank"><?php echo L('plugin_visit')?></a><?php } elseif($iframe['url']) {?><a href="plugin.php?id=<?php echo $info['identification']?>" target="_blank"><?php echo L('plugin_visit')?></a><?php }?></td>
<td width="10%" align="center"><?php echo $info['version']?></td>
<td width="15%" align="center"><?php echo $info['copyright']?></td>
<td width="10%" align="center"><?php echo $info['dir']?></td>
<td width="" align="center">
<a href="?m=admin&c=plugin&a=config&pluginid=<?php echo $info['pluginid']?>&menuid=<?php echo $_GET['menuid']?>"><?php echo L('plugin_config')?></a>
<a href="?m=admin&c=plugin&a=status&pluginid=<?php echo $info['pluginid']?>&disable=<?php echo intval($info['disable']) ? 0 : 1?>"><?php echo intval($info['disable']) ? L('plugin_close') : L('plugin_open')?></a> <a href="?m=admin&c=plugin&a=delete&pluginid=<?php echo $info['pluginid']?>&menuid=<?php echo $_GET['menuid']?>"><?php echo L('plugin_uninstall')?></a>
</td>
</tr>
<?php
}
}
?>
</tbody>
</table>
<div class="btn"><input type="submit" class="button" name="dosubmit" value="<?php echo L('listorder')?>" /></div> </div> </div>
</div>
</div>
</form>
</body>
<a href="javascript:edit(<?php echo $v['siteid']?>, '<?php echo $v['name']?>')">
</html>
<script type="text/javascript">
<!--
function add(id, name) {
window.top.art.dialog({title:'<?php echo L('edit')?>--'+name, id:'add', iframe:'?m=pay&c=payment&a=add&code='+id ,width:'700',height:'500'}, function(){var d = window.top.art.dialog({id:'add'}).data.iframe;
var form = d.document.getElementById('dosubmit');form.click();return false;}, function(){window.top.art.dialog({id:'add'}).close()});
}
function edit(id, name) {
window.top.art.dialog({title:'<?php echo L('edit')?>--'+name, id:'edit', iframe:'?m=pay&c=payment&a=edit&id='+id ,width:'700',height:'500'}, function(){var d = window.top.art.dialog({id:'edit'}).data.iframe;
var form = d.document.getElementById('dosubmit');form.click();return false;}, function(){window.top.art.dialog({id:'edit'}).close()});
}
//-->
</script> | PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header');?>
<script type="text/javascript">
<!--
$(function(){
$.formValidator.initConfig({autotip:true,formid:"myform",onerror:function(msg){}});
$("#name").formValidator({onshow:"<?php echo L('input').L('posid_name')?>",onfocus:"<?php echo L('posid_name').L('not_empty')?>"}).inputValidator({min:1,max:999,onerror:"<?php echo L('posid_name').L('not_empty')?>"});
$("#maxnum").formValidator({onshow:"<?php echo L('input').L('maxnum')?>",onfocus:"<?php echo L('maxnum').L('not_empty')?>"}).inputValidator({min:1,onerror:"<?php echo L('maxnum').L('not_empty')?>"}).regexValidator({datatype:'enum',regexp:'intege1',onerror:'<?php echo L('maxnum').L('not_empty')?>'}).defaultPassed();;
})
//-->
</script>
<div class="pad_10">
<div class="common-form">
<form name="myform" action="?m=admin&c=position&a=edit" method="post" id="myform">
<input type="hidden" name="posid" value="<?php echo $posid?>"></input>
<table width="100%" class="table_form">
<tr>
<td width="80"><?php echo L('posid_name')?></td>
<td><input type="text" name="info[name]" class="input-text" value="<?php echo $name?>" id="name"></input></td>
</tr>
<tr>
<td><?php echo L('posid_modelid')?></td>
<td><?php echo form::select($modelinfo,$modelid,'name="info[modelid]" onchange="category_load(this);"', L('choose_model'));?></td>
</tr>
<tr>
<td><?php echo L('posid_catid')?></td>
<td id="load_catid"><?php echo form::select_category('',$catid,'name="info[catid]"',L('please_select_parent_category'));?></td>
</tr>
<tr>
<td><?php echo L('listorder')?></td>
<td><input type="text" name="info[listorder]" class="input-text" size="5" value="<?php echo $listorder?>"></input></td>
</tr>
<tr>
<td><?php echo L('maxnum')?></td>
<td><input type="text" name="info[maxnum]" id="maxnum" class="input-text" size="5" value="<?php echo $maxnum?>"></input><?php echo L('posid_num')?></td>
</tr>
<tr>
<td><?php echo L('extention_name')?></td>
<td><input type="text" name="info[extention]" id="extention" class="input-text" size="30" value="<?php echo $extention?>"></input></td>
</tr>
</table>
<div class="bk15"></div>
<input name="dosubmit" type="submit" value="<?php echo L('submit')?>" class="dialog" id="dosubmit">
</form>
<div class="explain-col">
<?php echo L('position_tips')?><br/>
<?php echo L('extention_name_tips')?>
</div>
</div>
</div>
</body>
</html>
<script type="text/javascript">
function category_load(obj)
{
var modelid = $(obj).attr('value');
$.get('?m=admin&c=position&a=public_category_load&modelid='+modelid,function(data){
$('#load_catid').html(data);
});
}
</script>
| PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
$show_validator = true;include $this->admin_tpl('header');?>
<script type="text/javascript">
$(document).ready(function() {
$.formValidator.initConfig({autotip:true,formid:"myform",onerror:function(msg){}});
$("#password").formValidator({empty:true,onshow:"<?php echo L('not_change_the_password_please_leave_a_blank')?>",onfocus:"<?php echo L('password').L('between_6_to_20')?>"}).inputValidator({min:6,max:20,onerror:"<?php echo L('password').L('between_6_to_20')?>"});
$("#pwdconfirm").formValidator({empty:true,onshow:"<?php echo L('not_change_the_password_please_leave_a_blank')?>",onfocus:"<?php echo L('input').L('passwords_not_match')?>",oncorrect:"<?php echo L('passwords_match')?>"}).compareValidator({desid:"password",operateor:"=",onerror:"<?php echo L('input').L('passwords_not_match')?>"});
$("#email").formValidator({onshow:"<?php echo L('input').L('email')?>",onfocus:"<?php echo L('email').L('format_incorrect')?>",oncorrect:"<?php echo L('email').L('format_right')?>"}).regexValidator({regexp:"email",datatype:"enum",onerror:"<?php echo L('email').L('format_incorrect')?>"});
})
</script>
<div class="pad_10">
<div class="common-form">
<form name="myform" action="?m=admin&c=admin_manage&a=edit" method="post" id="myform">
<input type="hidden" name="info[userid]" value="<?php echo $userid?>"></input>
<input type="hidden" name="info[username]" value="<?php echo $username?>"></input>
<table width="100%" class="table_form contentWrap">
<tr>
<td width="80"><?php echo L('username')?></td>
<td><?php echo $username?></td>
</tr>
<tr>
<td><?php echo L('password')?></td>
<td><input type="password" name="info[password]" id="password" class="input-text"></input></td>
</tr>
<tr>
<td><?php echo L('cofirmpwd')?></td>
<td><input type="password" name="info[pwdconfirm]" id="pwdconfirm" class="input-text"></input></td>
</tr>
<tr>
<td><?php echo L('email')?></td>
<td>
<input type="text" name="info[email]" value="<?php echo $email?>" class="input-text" id="email" size="30"></input>
</td>
</tr>
<tr>
<td><?php echo L('realname')?></td>
<td>
<input type="text" name="info[realname]" value="<?php echo $realname?>" class="input-text" id="realname"></input>
</td>
</tr>
<?php if ($_SESSION['roleid']==1) {?>
<tr>
<td><?php echo L('userinrole')?></td>
<td>
<select name="info[roleid]">
<?php
foreach($roles as $role)
{
?>
<option value="<?php echo $role['roleid']?>" <?php echo (($role['roleid']==$roleid) ? 'selected' : '')?>><?php echo $role['rolename']?></option>
<?php
}
?>
</select>
</td>
</tr>
<?php }?>
</table>
<div class="bk15"></div>
<input name="dosubmit" type="submit" value="<?php echo L('submit')?>" class="dialog" id="dosubmit">
</form>
</div>
</div>
</body>
</html>
| PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
$show_dialog = 1;
include $this->admin_tpl('header','admin');
?>
<div class="pad-lr-10">
<form name="myform" id="myform" action="?m=admin&c=keylink&a=delete" method="post" onsubmit="checkuid();return false;">
<div class="table-list">
<table width="100%" cellspacing="0">
<thead>
<tr>
<th width="35" align="center"><input type="checkbox" value="" id="check_box" onclick="selectall('keylinkid[]');"></th>
<th width="30%"><?php echo L('keyword_name')?></th>
<th ><?php echo L('link_url')?></th>
<th width="120"><?php echo L('operations_manage')?></th>
</tr>
</thead>
<tbody>
<?php
if(is_array($infos)){
foreach($infos as $info){
?>
<tr>
<td align="center">
<input type="checkbox" name="keylinkid[]" value="<?php echo $info['keylinkid']?>">
</td>
<td width="30%" align="left"><span class="<?php echo $info['style']?>"><?php echo $info['word']?></span> </td>
<td align="center"><?php echo $info['url']?></td>
<td align="center"><a href="javascript:edit(<?php echo $info['keylinkid']?>, '<?php echo new_addslashes($info['word'])?>')"><?php echo L('edit')?></a> | <a href="javascript:confirmurl('?m=admin&c=keylink&a=delete&keylinkid=<?php echo $info['keylinkid']?>', '<?php echo L('keylink_confirm_del')?>')"><?php echo L('delete')?></a> </td>
</tr>
<?php
}
}
?></tbody>
</table>
<div class="btn">
<a href="#" onClick="javascript:$('input[type=checkbox]').attr('checked', true)"><?php echo L('selected_all')?></a>/<a href="#" onClick="javascript:$('input[type=checkbox]').attr('checked', false)"><?php echo L('cancel')?></a>
<input type="submit" name="submit" class="button" value="<?php echo L('remove_all_selected')?>" onClick="return confirm('<?php echo L('badword_confom_del')?>')" />
</div>
<div id="pages"><?php echo $pages?></div>
</div>
</form>
</div>
</body>
</html>
<script type="text/javascript">
function edit(id, name) {
window.top.art.dialog({id:'edit'}).close();
window.top.art.dialog({title:'<?php echo L('keylink_edit')?> '+name+' ',id:'edit',iframe:'?m=admin&c=keylink&a=edit&keylinkid='+id,width:'450',height:'130'}, function(){var d = window.top.art.dialog({id:'edit'}).data.iframe;var form = d.document.getElementById('dosubmit');form.click();return false;}, function(){window.top.art.dialog({id:'edit'}).close()});
}
function checkuid() {
var ids='';
$("input[name='keylinkid[]']:checked").each(function(i, n){
ids += $(n).val() + ',';
});
if(ids=='') {
window.top.art.dialog({content:'<?php echo L('badword_pleasechose')?>',lock:true,width:'200',height:'50',time:1.5},function(){});
return false;
} else {
myform.submit();
}
}
</script>
| PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header');?>
<script type="text/javascript">
<!--
$(function(){
$.formValidator.initConfig({formid:"myform",autotip:true,onerror:function(msg,obj){window.top.art.dialog({content:msg,lock:true,width:'200',height:'50'}, function(){this.close();$(obj).focus();})}});
$("#catname").formValidator({onshow:"<?php echo L('input_catname');?>",onfocus:"<?php echo L('input_catname');?>",oncorrect:"<?php echo L('input_right');?>"}).inputValidator({min:1,onerror:"<?php echo L('input_catname');?>"}).defaultPassed();
$("#catdir").formValidator({onshow:"<?php echo L('input_dirname');?>",onfocus:"<?php echo L('input_dirname');?>"}).regexValidator({regexp:"^([a-zA-Z0-9]|[_-]){0,30}$",onerror:"<?php echo L('enter_the_correct_catname');?>"}).inputValidator({min:1,onerror:"<?php echo L('input_dirname');?>"}).ajaxValidator({type : "get",url : "",data :"m=admin&c=category&a=public_check_catdir&old_dir=<?php echo $catdir;?>",datatype : "html",cached:false,getdata:{parentid:'parentid'},async:'true',cached:false,success : function(data){ if( data == "1" ){return true;}else{return false;}},buttons: $("#dosubmit"),onerror : "<?php echo L('catname_have_exists');?>",onwait : "<?php echo L('connecting');?>"}).defaultPassed();
})
//-->
</script>
<form name="myform" id="myform" action="?m=admin&c=category&a=edit" method="post">
<div class="pad-10">
<div class="col-tab">
<ul class="tabBut cu-li">
<li id="tab_setting_1" class="on" onclick="SwapTab('setting','on','',5,1);"><?php echo L('catgory_basic');?></li>
<li id="tab_setting_2" onclick="SwapTab('setting','on','',5,2);"><?php echo L('catgory_createhtml');?></li>
<li id="tab_setting_3" onclick="SwapTab('setting','on','',5,3);"><?php echo L('catgory_template');?></li>
<li id="tab_setting_4" onclick="SwapTab('setting','on','',5,4);"><?php echo L('catgory_seo');?></li>
<li id="tab_setting_5" onclick="SwapTab('setting','on','',5,5);"><?php echo L('catgory_private');?></li>
</ul>
<div id="div_setting_1" class="contentList pad-10">
<table width="100%" class="table_form ">
<tr>
<th width="200"><?php echo L('parent_category')?>:</th>
<td>
<?php echo form::select_category('category_content_'.$this->siteid,$parentid,'name="info[parentid]" id="parentid"',L('please_select_parent_category'),0,-1);?>
</td>
</tr>
<tr>
<th><?php echo L('catname')?>:</th>
<td><input type="text" name="info[catname]" id="catname" class="input-text" value="<?php echo $catname;?>"></td>
</tr>
<tr>
<th><?php echo L('catdir')?>:</th>
<td><input type="text" name="info[catdir]" id="catdir" class="input-text" value="<?php echo $catdir;?>"></td>
</tr>
<tr>
<th><?php echo L('catgory_img')?>:</th>
<td><?php echo form::images('info[image]', 'image', $image, 'content');?></td>
</tr>
<tr>
<th><?php echo L('description')?>:</th>
<td>
<textarea name="info[description]" maxlength="255" style="width:300px;height:60px;"><?php echo $description;?></textarea>
</td>
</tr>
<tr>
<th><?php echo L('ismenu');?>:</th>
<td>
<input type='radio' name='info[ismenu]' value='1' <?php if($ismenu) echo 'checked';?>> <?php echo L('yes');?>
<input type='radio' name='info[ismenu]' value='0' <?php if(!$ismenu) echo 'checked';?>> <?php echo L('no');?></td>
</tr>
</table>
</div>
<div id="div_setting_2" class="contentList pad-10 hidden">
<table width="100%" class="table_form ">
<tr>
<th width="200"><?php echo L('html_category');?>:</th>
<td>
<input type='radio' name='setting[ishtml]' value='1' <?php if($setting['ishtml']) echo 'checked';?> onClick="$('#category_php_ruleid').css('display','none');$('#category_html_ruleid').css('display','')"> <?php echo L('yes');?>
<input type='radio' name='setting[ishtml]' value='0' <?php if(!$setting['ishtml']) echo 'checked';?> onClick="$('#category_php_ruleid').css('display','');$('#category_html_ruleid').css('display','none')"> <?php echo L('no');?>
</td>
</tr>
<tr>
<th><?php echo L('urlrule_url');?>:</th>
<td><div id="category_php_ruleid" style="display:<?php if($setting['ishtml']) echo 'none';?>">
<?php
echo form::urlrule('content','category',0,$setting['category_ruleid'],'name="category_php_ruleid"');
?>
</div>
<div id="category_html_ruleid" style="display:<?php if(!$setting['ishtml']) echo 'none';?>">
<?php
echo form::urlrule('content','category',1,$setting['category_ruleid'],'name="category_html_ruleid"');
?>
</div>
</td>
</tr>
</table>
</div>
<div id="div_setting_3" class="contentList pad-10 hidden">
<table width="100%" class="table_form ">
<tr>
<th width="200"><?php echo L('available_styles');?>:</th>
<td>
<?php echo form::select($template_list, $setting['template_list'], 'name="setting[template_list]" id="template_list" onchange="load_file_list(this.value)"', L('please_select'))?>
</td>
</tr>
<tr>
<th width="200"><?php echo L('page_templates')?>:</th>
<td id="page_template">
</td>
</tr>
</table>
</div>
<div id="div_setting_4" class="contentList pad-10 hidden">
<table width="100%" class="table_form ">
<tr>
<th width="200"><?php echo L('meta_title');?></th>
<td><input name='setting[meta_title]' type='text' id='meta_title' value='<?php echo $setting['meta_title'];?>' size='60' maxlength='60'></td>
</tr>
<tr>
<th ><?php echo L('meta_keywords');?></th>
<td><textarea name='setting[meta_keywords]' id='meta_keywords' style="width:90%;height:40px"><?php echo $setting['meta_keywords'];?></textarea></td>
</tr>
<tr>
<th ><strong><?php echo L('meta_description');?></th>
<td><textarea name='setting[meta_description]' id='meta_description' style="width:90%;height:50px"><?php echo $setting['meta_description'];?></textarea></td>
</tr>
</table>
</div>
<div id="div_setting_5" class="contentList pad-10 hidden">
<table width="100%" >
<tr>
<th width="200"><?php echo L('role_private')?>:</th>
<td>
<table width="100%" class="table-list">
<thead>
<tr>
<th align="left" width="200"><?php echo L('role_name');?></th><th><?php echo L('edit');?></th>
</tr>
</thead>
<tbody>
<?php
$roles = getcache('role','commons');
foreach($roles as $roleid=> $rolrname) {
$disabled = $roleid==1 ? 'disabled' : '';
?>
<tr>
<td><?php echo $rolrname?></td>
<td align="center"><input type="checkbox" name="priv_roleid[]" <?php echo $disabled;?> <?php echo $this->check_category_priv('init',$roleid);?> value="init,<?php echo $roleid;?>" ></td>
</tr>
<?php }?>
</tbody>
</table>
</td>
</tr>
<tr><td colspan=2><hr style="border:1px dotted #F2F2F2;"></td>
</tr>
<tr>
<th width="200"><?php echo L('group_private')?>:</th>
<td>
<table width="100%" class="table-list">
<thead>
<tr>
<th align="left" width="200"><?php echo L('group_name');?></th><th><?php echo L('allow_vistor');?></th>
</tr>
</thead>
<tbody>
<?php
$group_cache = getcache('grouplist','member');
foreach($group_cache as $_key=>$_value) {
if($_value['groupid']==1) continue;
?>
<tr>
<td><?php echo $_value['name'];?></td>
<td align="center"><input type="checkbox" name="priv_groupid[]" <?php echo $this->check_category_priv('visit',$_value['groupid'],0);?> value="visit,<?php echo $_value['groupid'];?>" ></td>
</tr>
<?php }?>
</tbody>
</table>
</td>
</tr>
</table>
</div>
<div class="bk15"></div>
<input name="catid" type="hidden" value="<?php echo $catid;?>">
<input name="type" type="hidden" value="<?php echo $type;?>">
<input name="dosubmit" type="submit" value="<?php echo L('submit')?>" class="button">
</form>
</div>
</div>
<!--table_form_off-->
</div>
<script language="JavaScript">
<!--
window.top.$('#display_center_id').css('display','none');
function SwapTab(name,cls_show,cls_hide,cnt,cur){
for(i=1;i<=cnt;i++){
if(i==cur){
$('#div_'+name+'_'+i).show();
$('#tab_'+name+'_'+i).attr('class',cls_show);
}else{
$('#div_'+name+'_'+i).hide();
$('#tab_'+name+'_'+i).attr('class',cls_hide);
}
}
}
function load_file_list(id) {
if(id=='') return false;
$.getJSON('?m=admin&c=category&a=public_tpl_file_list&style='+id+'&catid=<?php echo $catid?>&type=1', function(data){$('#page_template').html(data.page_template);});
}
<?php if(isset($setting['template_list']) && !empty($setting['template_list'])) echo "load_file_list('".$setting['template_list']."')"?>
//-->
</script> | PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header');
?>
<div class="pad-10">
<?php $n=1; foreach ($menu as $key=>$v):if ($v['name']=='phpsso') continue;if($n==1) {echo '<div class="map-menu lf">';}?>
<ul>
<li class="title"><?php echo L($v['name'])?></li>
<?php foreach ($v['childmenus'] as $k=>$r):?>
<li class="title2"><?php echo L($r['name'])?></li>
<?php $menus = admin::admin_menu($r['id']);foreach ($menus as $s=>$r):?>
<li><a href="javascript:go('index.php?m=<?php echo $r['m']?>&c=<?php echo $r['c']?>&a=<?php echo $r['a']?>&pc_hash=<?php echo $_SESSION['pc_hash']?>&menuid=<?php echo $r['id']?><?php echo isset($r['data']) ? $r['data'] : ''?>')"><?php echo L($r['name'])?></a></li>
<?php endforeach;endforeach;?>
</ul>
<?php if($n%2==0) {echo '</div><div class="map-menu lf">';}$n++; endforeach;?>
</div>
</div>
<script type="text/javascript">
<!--
function go(url) {
window.top.document.getElementById('rightMain').src=url;
window.top.art.dialog({id:'map'}).close();
}
//-->
</script>
</body>
</html> | PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header');?>
<script type="text/javascript">
<!--
$(function(){
$.formValidator.initConfig({formid:"myform",autotip:true,onerror:function(msg,obj){window.top.art.dialog({content:msg,lock:true,width:'200',height:'50'}, function(){this.close();$(obj).focus();})}});
$("#catname").formValidator({onshow:"<?php echo L('input_catname');?>",onfocus:"<?php echo L('input_catname');?>",oncorrect:"<?php echo L('input_right');?>"}).inputValidator({min:1,onerror:"<?php echo L('input_catname');?>"});
$("#catdir").formValidator({onshow:"<?php echo L('input_dirname');?>",onfocus:"<?php echo L('input_dirname');?>"}).regexValidator({regexp:"^([a-zA-Z0-9]|[_-]){0,30}$",onerror:"<?php echo L('enter_the_correct_catname');?>"}).inputValidator({min:1,onerror:"<?php echo L('input_dirname');?>"}).ajaxValidator({type : "get",url : "",data :"m=admin&c=category&a=public_check_catdir",datatype : "html",cached:false,getdata:{parentid:'parentid'},async:'false',success : function(data){ if( data == "1" ){return true;}else{return false;}},buttons: $("#dosubmit"),onerror : "<?php echo L('catname_have_exists');?>",onwait : "<?php echo L('connecting');?>"});
})
//-->
</script>
<form name="myform" id="myform" action="?m=admin&c=category&a=add" method="post">
<div class="pad-10">
<div class="col-tab">
<ul class="tabBut cu-li">
<li id="tab_setting_1" class="on" onclick="SwapTab('setting','on','',5,1);"><?php echo L('catgory_basic');?></li>
<li id="tab_setting_2" onclick="SwapTab('setting','on','',5,2);"><?php echo L('catgory_createhtml');?></li>
<li id="tab_setting_3" onclick="SwapTab('setting','on','',5,3);"><?php echo L('catgory_template');?></li>
<li id="tab_setting_4" onclick="SwapTab('setting','on','',5,4);"><?php echo L('catgory_seo');?></li>
<li id="tab_setting_5" onclick="SwapTab('setting','on','',5,5);"><?php echo L('catgory_private');?></li>
</ul>
<div id="div_setting_1" class="contentList pad-10">
<table width="100%" class="table_form ">
<tr>
<th><?php echo L('add_category_types');?>:</th>
<td>
<input type='radio' name='addtype' value='0' checked id="normal_addid"> <?php echo L('normal_add');?>
<input type='radio' name='addtype' value='1' onclick="$('#catdir_tr').html(' ');$('#normal_add').html(' ');$('#normal_add').css('display','none');$('#batch_add').css('display','');$('#normal_addid').attr('disabled','true');this.disabled='true'"> <?php echo L('batch_add');?></td>
</tr>
<tr>
<th width="200"><?php echo L('parent_category')?>:</th>
<td>
<?php echo form::select_category('category_content_'.$this->siteid,$parentid,'name="info[parentid]" id="parentid"',L('please_select_parent_category'),0,-1);?>
</td>
</tr>
<tr>
<th><?php echo L('catname')?>:</th>
<td>
<span id="normal_add"><input type="text" name="info[catname]" id="catname" class="input-text" value=""></span>
<span id="batch_add" style="display:none">
<table width="100%" class="sss"><tr><td width="310"><textarea name="batch_add" maxlength="255" style="width:300px;height:60px;"></textarea></td>
<td align="left">
<?php echo L('batch_add_tips');?>
</td></tr></table>
</span>
</td>
</tr>
<tr id="catdir_tr">
<th><?php echo L('catdir')?>:</th>
<td><input type="text" name="info[catdir]" id="catdir" class="input-text" value=""></td>
</tr>
<tr>
<th><?php echo L('catgory_img')?>:</th>
<td><?php echo form::images('info[image]', 'image', $image, 'content');?></td>
</tr>
<tr>
<th><?php echo L('description')?>:</th>
<td>
<textarea name="info[description]" maxlength="255" style="width:300px;height:60px;"><?php echo $description;?></textarea>
</td>
</tr>
<tr>
<th><?php echo L('ismenu');?>:</th>
<td>
<input type='radio' name='info[ismenu]' value='1' checked> <?php echo L('yes');?>
<input type='radio' name='info[ismenu]' value='0' > <?php echo L('no');?></td>
</tr>
</table>
</div>
<div id="div_setting_2" class="contentList pad-10 hidden">
<table width="100%" class="table_form ">
<tr>
<th width="200"><?php echo L('html_category');?>:</th>
<td>
<input type='radio' name='setting[ishtml]' value='1' <?php if($setting['ishtml']) echo 'checked';?> onClick="$('#category_php_ruleid').css('display','none');$('#category_html_ruleid').css('display','')"> <?php echo L('yes');?>
<input type='radio' name='setting[ishtml]' value='0' <?php if(!$setting['ishtml']) echo 'checked';?> onClick="$('#category_php_ruleid').css('display','');$('#category_html_ruleid').css('display','none')"> <?php echo L('no');?>
</td>
</tr>
<tr>
<th><?php echo L('urlrule_url');?>:</th>
<td><div id="category_php_ruleid" style="display:<?php if($setting['ishtml']) echo 'none';?>">
<?php
echo form::urlrule('content','category',0,$setting['category_ruleid'],'name="category_php_ruleid"');
?>
</div>
<div id="category_html_ruleid" style="display:<?php if(!$setting['ishtml']) echo 'none';?>">
<?php
echo form::urlrule('content','category',1,$setting['category_ruleid'],'name="category_html_ruleid"');
?>
</div>
</td>
</tr>
</table>
</div>
<div id="div_setting_3" class="contentList pad-10 hidden">
<table width="100%" class="table_form ">
<tr>
<th width="200"><?php echo L('available_styles');?>:</th>
<td>
<?php echo form::select($template_list, $setting['template_list'], 'name="setting[template_list]" id="template_list" onchange="load_file_list(this.value)"', L('please_select'))?>
</td>
</tr>
<tr>
<th width="200"><?php echo L('page_templates')?>:</th>
<td id="page_template">
</td>
</tr>
</table>
</div>
<div id="div_setting_4" class="contentList pad-10 hidden">
<table width="100%" class="table_form ">
<tr>
<th width="200"><?php echo L('meta_title');?></th>
<td><input name='setting[meta_title]' type='text' id='meta_title' value='<?php echo $setting['meta_title'];?>' size='60' maxlength='60'></td>
</tr>
<tr>
<th ><?php echo L('meta_keywords');?></th>
<td><textarea name='setting[meta_keywords]' id='meta_keywords' style="width:90%;height:40px"><?php echo $setting['meta_keywords'];?></textarea></td>
</tr>
<tr>
<th ><strong><?php echo L('meta_description');?></th>
<td><textarea name='setting[meta_description]' id='meta_description' style="width:90%;height:50px"><?php echo $setting['meta_description'];?></textarea></td>
</tr>
</table>
</div>
<div id="div_setting_5" class="contentList pad-10 hidden">
<table width="100%" >
<tr>
<th width="200"><?php echo L('role_private')?>:</th>
<td>
<table width="100%" class="table-list">
<thead>
<tr>
<th align="left" width="200"><?php echo L('role_name');?></th><th><?php echo L('edit');?></th>
</tr>
</thead>
<tbody>
<?php
$roles = getcache('role','commons');
foreach($roles as $roleid=> $rolrname) {
$disabled = $roleid==1 ? 'disabled' : '';
?>
<tr>
<td><?php echo $rolrname?></td>
<td align="center"><input type="checkbox" name="priv_roleid[]" <?php echo $disabled;?> value="init,<?php echo $roleid;?>" ></td>
</tr>
<?php }?>
</tbody>
</table>
</td>
</tr>
<tr><td colspan=2><hr style="border:1px dotted #F2F2F2;"></td>
</tr>
<tr>
<th width="200"><?php echo L('group_private')?>:</th>
<td>
<table width="100%" class="table-list">
<thead>
<tr>
<th align="left" width="200"><?php echo L('group_name');?></th><th><?php echo L('allow_vistor');?></th>
</tr>
</thead>
<tbody>
<?php
$group_cache = getcache('grouplist','member');
foreach($group_cache as $_key=>$_value) {
if($_value['groupid']==1) continue;
?>
<tr>
<td><?php echo $_value['name'];?></td>
<td align="center"><input type="checkbox" name="priv_groupid[]" value="visit,<?php echo $_value['groupid'];?>" ></td>
</tr>
<?php }?>
</tbody>
</table>
</td>
</tr>
</table>
</div>
<div class="bk15"></div>
<input name="catid" type="hidden" value="<?php echo $catid;?>">
<input name="type" type="hidden" value="<?php echo $type;?>">
<input name="dosubmit" type="submit" value="<?php echo L('submit')?>" class="button">
</form>
</div>
</div>
<!--table_form_off-->
</div>
<script language="JavaScript">
<!--
window.top.$('#display_center_id').css('display','none');
function SwapTab(name,cls_show,cls_hide,cnt,cur){
for(i=1;i<=cnt;i++){
if(i==cur){
$('#div_'+name+'_'+i).show();
$('#tab_'+name+'_'+i).attr('class',cls_show);
}else{
$('#div_'+name+'_'+i).hide();
$('#tab_'+name+'_'+i).attr('class',cls_hide);
}
}
}
function load_file_list(id) {
if(id=='') return false;
$.getJSON('?m=admin&c=category&a=public_tpl_file_list&style='+id+'&catid=<?php echo $parentid?>&type=1', function(data){$('#page_template').html(data.page_template);});
}
<?php if(isset($setting['template_list']) && !empty($setting['template_list'])) echo "load_file_list('".$setting['template_list']."')"?>
//-->
</script> | PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header', 'admin');
?>
<div class="pad_10">
<div class="bk15"></div>
<div class="explain-col">
<?php echo L('card_msg')?>
</div>
<div class="bk15"></div>
<?php
if (empty($pic_url)) {
echo '<input type="button" class="button" value="'.L('apply_for_a_password_card').'" onclick="location.href=\'?m=admin&c=admin_manage&a=creat_card&userid='.$userid.'&pc_hash='.$_SESSION['pc_hash'].'\'">';
} else {
echo '<input type="button" class="button" value="'.L('the_password_card_binding').'" onclick="location.href=\'?m=admin&c=admin_manage&a=remove_card&userid='.$userid.'&pc_hash='.$_SESSION['pc_hash'].'\'"><div class="bk15"></div><img src="'.$pic_url.'">';
}
?>
</div>
</body>
</html>
| PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header');?>
<script type="text/javascript">
$(document).ready(function() {
$.formValidator.initConfig({autotip:true,formid:"myform",onerror:function(msg){}});
$("#name").formValidator({onshow:"<?php echo L('input').L('linkage_name')?>",onfocus:"<?php echo L('linkage_name').L('not_empty')?>"}).inputValidator({min:1,max:999,onerror:"<?php echo L('linkage_name').L('not_empty')?>"});
})
</script>
<div class="pad_10">
<div class="common-form">
<form name="myform" action="?m=admin&c=linkage&a=add" method="post" id="myform">
<table width="100%" class="table_form contentWrap">
<tr>
<td><?php echo L('linkage_name')?></td>
<td>
<input type="text" name="info[name]" value="<?php echo $name?>" class="input-text" id="name" size="30"></input>
</td>
</tr>
<tr>
<td><?php echo L('menu_description')?></td>
<td>
<textarea name="info[description]" rows="2" cols="20" id="description" class="inputtext" style="height:45px;width:300px;"><?php echo $description?></textarea>
</td>
</tr>
<tr>
<td><?php echo L('menu_style')?></td>
<td>
<input name="info[style]" value="0" checked="checked" type="radio"> <?php echo L('drop_down_style')?> <input name="info[style]" value="1" type="radio"> <?php echo L('pop_style')?>
</td>
</tr>
<tr>
<td><?php echo L('sites')?></td>
<td>
<?php echo form::select($sitelist,'','name="info[siteid]"',L('all_sites'))?>
</td>
</tr>
</table>
<div class="bk15"></div>
<input name="dosubmit" type="submit" value="<?php echo L('submit')?>" class="dialog" id="dosubmit">
</form>
</div>
</div>
</body>
</html>
| PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header');?>
<form action="?m=admin&c=plugin&a=config" method="post" id="myform">
<div class="pad-10">
<div class="col-tab">
<ul class="tabBut cu-li">
<?php foreach($plugin_menus as $_num => $menu) {?>
<li <?php if($menu['status']) {?>class="on"<?php }?> <?php if($menu['extend']) {?>onclick="loadfile('<?php echo$menu['url'] ?>')"<?php }?> ><?php echo $menu['name']?></li>
<?php }?>
</ul>
<div id="tab-content">
<div class="contentList pad-10">
<h3><?php echo $name?></h3>
<?php echo $description?><br/>
</div>
<?php if($form) {?>
<div class="contentList pad-10 hidden">
<table width="100%" class="table_form">
<?php echo $form?>
</table>
<div class="bk15"></div>
<input name="pluginid" type="hidden" value="<?php echo $pluginid?>">
<input name="dosubmit" type="submit" value="<?php echo L('submit')?>" class="button">
</div>
<?php }?>
<?php if(is_array($mods)) { foreach ($mods as $m) {?>
<div class="contentList pad-10 hidden" id="<?php echo $m?>">
</div>
<?php } }?>
</div>
</div>
</div>
</form>
</body>
<script type="text/javascript">
function SwapTab(name,title,content,Sub,cur){
$(name+' '+title).click(function(){
$(this).addClass(cur).siblings().removeClass(cur);
$(content+" > "+Sub).eq($(name+' '+title).index(this)).show().siblings().hide();
});
}
function loadfile(data) {
$("#"+data).load('?m=admin&c=plugin&a=config&pluginid=<?php echo $pluginid?>&module='+data
+'&pc_hash=<?php echo $_SESSION['pc_hash']?>');
}
new SwapTab(".tabBut","li","#tab-content",".contentList","on");//排行TAB
</script>
</html> | PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header');?>
<div class="pad_10">
<div class="table-list">
<table width="100%" cellspacing="0" >
<thead>
<tr>
<th width="60">ID</th>
<th><?php echo L('respective_modules');?></th>
<th><?php echo L('rulename');?></th>
<th><?php echo L('urlrule_ishtml');?></th>
<th><?php echo L('urlrule_example');?></th>
<th><?php echo L('urlrule_url');?></th>
<th width="100"><?php echo L('operations_manage');?></th>
</tr>
</thead>
<tbody>
<?php foreach($infos as $r) { ?>
<tr>
<td align='center'><?php echo $r['urlruleid'];?></td>
<td align="center"><?php echo $r['module'];?></td>
<td align="center"><?php echo $r['file'];?></td>
<td align="center"><?php echo $r['ishtml'] ? L('icon_unlock') : L('icon_locked');?></td>
<td><?php echo $r['example'];?></td>
<td><?php echo $r['urlrule'];?></td>
<td align='center' ><a href="javascript:edit('<?php echo $r['urlruleid']?>')"><?php echo L('edit');?></a> | <a href="javascript:confirmurl('?m=admin&c=urlrule&a=delete&urlruleid=<?php echo $r['urlruleid'];?>&menuid=<?php echo $_GET['menuid'];?>','<?php echo L('confirm',array('message'=>$r['urlruleid']));?>')"><?php echo L('delete');?></a> </td>
</tr>
<?php } ?>
</tbody>
</table>
<div id="pages"><?php echo $pages;?></div>
</div>
</div>
<script type="text/javascript">
<!--
function edit(id) {
window.top.art.dialog({id:'edit'}).close();
window.top.art.dialog({title:'<?php echo L('edit_urlrule');?>《'+id+'》',id:'edit',iframe:'?m=admin&c=urlrule&a=edit&urlruleid='+id,width:'750',height:'300'}, function(){var d = window.top.art.dialog({id:'edit'}).data.iframe;d.document.getElementById('dosubmit').click();return false;}, function(){window.top.art.dialog({id:'edit'}).close()});
}
//-->
</script>
</body>
</html>
| PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header');
?>
<script type="text/javascript">
<!--
$(function(){
$.formValidator.initConfig({formid:"myform",autotip:true,onerror:function(msg,obj){window.top.art.dialog({content:msg,lock:true,width:'200',height:'50'}, function(){this.close();$(obj).focus();})}});
$("#name").formValidator({onshow:"<?php echo L("input").L('site_name')?>",onfocus:"<?php echo L("input").L('site_name')?>"}).inputValidator({min:1,onerror:"<?php echo L("input").L('site_name')?>"}).ajaxValidator({type : "get",url : "",data :"m=admin&c=site&a=public_name&siteid=<?php echo $data['siteid']?>",datatype : "html",async:'true',success : function(data){ if( data == "1" ){return true;}else{return false;}},buttons: $("#dosubmit"),onerror : "<?php echo L('site_name').L('exists')?>",onwait : "<?php echo L('connecting')?>"}).defaultPassed();
$("#dirname").formValidator({onshow:"<?php echo L("input").L('site_dirname')?>",onfocus:"<?php echo L("input").L('site_dirname')?>"}).inputValidator({min:1,onerror:"<?php echo L("input").L('site_dirname')?>"}).regexValidator({regexp:"username",datatype:"enum",param:'i',onerror:"<?php echo L('site_dirname_err_msg')?>"}).ajaxValidator({type : "get",url : "",data :"m=admin&c=site&a=public_dirname&siteid=<?php echo $data['siteid']?>",datatype : "html",async:'false',success : function(data){ if( data == "1" ){return true;}else{return false;}},buttons: $("#dosubmit"),onerror : "<?php echo L('site_dirname').L('exists')?>",onwait : "<?php echo L('connecting')?>"}).defaultPassed();
$("#domain").formValidator({onshow:"<?php echo L('site_domain_ex')?>",onfocus:"<?php echo L('site_domain_ex')?>",tipcss:{width:'300px'},empty:false}).inputValidator({onerror:"<?php echo L('site_domain_ex')?>"}).regexValidator({regexp:"http:\/\/(.+)\/$",onerror:"<?php echo L('site_domain_ex2')?>"});
$("#template").formValidator({onshow:"<?php echo L('style_name_point')?>",onfocus:"<?php echo L('select_at_least_1')?>"}).inputValidator({min:1,onerror:"<?php echo L('select_at_least_1')?>"});
$('#release_point').formValidator({onshow:"<?php echo L('publishing_sites_to_other_servers')?>",onfocus:"<?php echo L('choose_release_point')?>"}).inputValidator({max:4,onerror:"<?php echo L('most_choose_four')?>"});
$('#default_style_input').formValidator({tipid:"default_style_msg",onshow:"<?php echo L('please_select_a_style_and_select_the_template')?>",onfocus:"<?php echo L('please_select_a_style_and_select_the_template')?>"}).inputValidator({min:1,onerror:"<?php echo L('please_choose_the_default_style')?>"});
})
//-->
</script>
<style type="text/css">
.radio-label{ border-top:1px solid #e4e2e2; border-left:1px solid #e4e2e2}
.radio-label td{ border-right:1px solid #e4e2e2; border-bottom:1px solid #e4e2e2;background:#f6f9fd}
</style>
<div class="pad-10">
<form action="?m=admin&c=site&a=edit&siteid=<?php echo $siteid?>" method="post" id="myform">
<fieldset>
<legend><?php echo L('basic_configuration')?></legend>
<table width="100%" class="table_form">
<tr>
<th width="80"><?php echo L('site_name')?>:</th>
<td class="y-bg"><input type="text" class="input-text" name="name" id="name" size="30" value="<?php echo $data['name']?>" /></td>
</tr>
<tr>
<th><?php echo L('site_dirname')?>:</th>
<td class="y-bg"><?php if ($siteid == 1) { echo $data['dirname'];} else {?><input type="text" class="input-text" name="dirname" id="dirname" size="30" value="<?php echo $data['dirname']?>" /><?php }?></td>
</tr>
<tr>
<th><?php echo L('site_domain')?>:</th>
<td class="y-bg"><input type="text" class="input-text" name="domain" id="domain" size="30" value="<?php echo $data['domain']?>" /></td>
</tr>
</table>
</fieldset>
<div class="bk10"></div>
<fieldset>
<legend><?php echo L('seo_configuration')?></legend>
<table width="100%" class="table_form">
<tr>
<th width="80"><?php echo L('site_title')?>:</th>
<td class="y-bg"><input type="text" class="input-text" name="site_title" id="site_title" size="30" value="<?php echo $data['site_title']?>" /></td>
</tr>
<tr>
<th><?php echo L('keyword_name')?>:</th>
<td class="y-bg"><input type="text" class="input-text" name="keywords" id="keywords" size="30" value="<?php echo $data['keywords']?>" /></td>
</tr>
<tr>
<th><?php echo L('description')?>:</th>
<td class="y-bg"><input type="text" class="input-text" name="description" id="description" size="30" value="<?php echo $data['description']?>" /></td>
</tr>
</table>
</fieldset>
<div class="bk10"></div>
<fieldset>
<legend><?php echo L('release_point_configuration')?></legend>
<table width="100%" class="table_form">
<tr>
<th width="80" valign="top"><?php echo L('release_point')?>:</th>
<td> <select name="release_point[]" size="3" id="release_point" multiple title="<?php echo L('ctrl_more_selected')?>">
<option value='' <?php if(!$data['release_point']) echo 'selected';?>><?php echo L('not_use_the_publishers_some')?></option>
<?php if(is_array($release_point_list) && !empty($release_point_list)): foreach($release_point_list as $v):?>
<option value="<?php echo $v['id']?>"<?php if(in_array($v['id'], explode(',',$data['release_point']))){echo ' selected';}?>><?php echo $v['name']?></option>
<?php endforeach;endif;?>
</select></td>
</tr>
</table>
</fieldset>
<div class="bk10"></div>
<fieldset>
<legend><?php echo L('template_style_configuration')?></legend>
<table width="100%" class="table_form">
<tr>
<th width="80" valign="top"><?php echo L('style_name')?>:</th>
<td class="y-bg"> <select name="template[]" size="3" id="template" multiple title="<?php echo L('ctrl_more_selected')?>" onchange="default_list()">
<?php
$default_template_list = array();
if (isset($data['template'])) {
$dirname = explode(',',$data['template']);
} else {
$dirname = array();
}
if(is_array($template_list)):
foreach ($template_list as $key=>$val):
$default_template_list[$val['dirname']] = $val['name'];
?>
<option value="<?php echo $val['dirname']?>" <?php if(in_array($val['dirname'], $dirname)){echo 'selected';}?>><?php echo $val['name']?></option>
<?php endforeach;endif;?>
</select></td>
</tr>
<tr>
<th width="80" valign="top"><?php echo L('default_style')?>:<input type="hidden" name="default_style" id="default_style_input" value="<?php echo $data['default_style']?>"></th>
<td class="y-bg"><span id="default_style">
<?php
if(is_array($dirname) && !empty($dirname)) foreach ($dirname as $v) {
echo '<label><input type="radio" name="default_style_radio" value="'.$v.'" onclick="$(\'#default_style_input\').val(this.value);" '.($data['default_style']==$v ? 'checked' : '').'>'.$default_template_list[$v].'</label>';
}
?>
</span><span id="default_style_msg"></span></td>
</tr>
</table>
<script type="text/javascript">
function default_list() {
var html = '';
var old = $('#default_style_input').val();
var checked = '';
$('#template option:selected').each(function(i,n){
if (old == $(n).val()) {
checked = 'checked';
}
html += '<label><input type="radio" name="default_style_radio" value="'+$(n).val()+'" onclick="$(\'#default_style_input\').val(this.value);" '+checked+'> '+$(n).text()+'</label>';
});
if(!checked) $('#default_style_input').val('0');
$('#default_style').html(html);
}
</script>
</fieldset>
<div class="bk10"></div>
<fieldset>
<legend><?php echo L('site_att_config')?></legend>
<table width="100%" class="table_form">
<tr>
<th width="130" valign="top"><?php echo L('site_att_upload_maxsize')?></th>
<td class="y-bg"><input type="text" class="input-text" name="setting[upload_maxsize]" id="upload_maxsize" size="10" value="<?php echo $setting['upload_maxsize'] ? $setting['upload_maxsize'] : '2000' ?>"/> KB </td>
</tr>
<tr>
<th width="130" valign="top"><?php echo L('site_att_allow_ext')?></th>
<td class="y-bg"><input type="text" class="input-text" name="setting[upload_allowext]" id="upload_allowext" size="50" value="<?php echo $setting['upload_allowext']?>"/></td>
</tr>
<tr>
<th><?php echo L('site_att_gb_check')?></th>
<td class="y-bg"><?php echo $this->check_gd()?></td>
<tr>
<th><?php echo L('site_att_watermark_enable')?></th>
<td class="y-bg">
<input class="radio_style" name="setting[watermark_enable]" value="1" <?php echo $setting['watermark_enable']==1 ? 'checked="checked"' : ''?> type="radio"> <?php echo L('site_att_watermark_open')?>
<input class="radio_style" name="setting[watermark_enable]" value="0" <?php echo $setting['watermark_enable']==0 ? 'checked="checked"' : ''?> type="radio"> <?php echo L('site_att_watermark_close')?>
</td>
</tr>
<tr>
<th><?php echo L('site_att_watermark_condition')?></th>
<td class="y-bg"><?php echo L('site_att_watermark_minwidth')?>
<input type="text" class="input-text" name="setting[watermark_minwidth]" id="watermark_minwidth" size="10" value="<?php echo $setting['watermark_minwidth'] ? $setting['watermark_minwidth'] : '300' ?>" /> X <?php echo L('site_att_watermark_minheight')?><input type="text" class="input-text" name="setting[watermark_minheight]" id="watermark_minheight" size="10" value="<?php echo $setting['watermark_minheight'] ? $setting['watermark_minheight'] : '300' ?>" /> PX
</td>
</tr>
<tr>
<th width="130" valign="top"><?php echo L('site_att_watermark_img')?></th>
<td class="y-bg"><input type="text" name="setting[watermark_img]" id="watermark_img" size="30" value="<?php echo $setting['watermark_img'] ? $setting['watermark_img'] : 'mark.gif' ?>"/><?php echo L('site_att_watermark_img_desc')?></td>
</tr>
<tr>
<th width="130" valign="top"><?php echo L('site_att_watermark_pct')?></th>
<td class="y-bg"><input type="text" class="input-text" name="setting[watermark_pct]" id="watermark_pct" size="10" value="<?php echo $setting['watermark_pct'] ? $setting['watermark_pct'] : '100' ?>" /> <?php echo L('site_att_watermark_pct_desc')?></td>
</tr>
<tr>
<th width="130" valign="top"><?php echo L('site_att_watermark_quality')?></th>
<td class="y-bg"><input type="text" class="input-text" name="setting[watermark_quality]" id="watermark_quality" size="10" value="<?php echo $setting['watermark_quality'] ? $setting['watermark_quality'] : '80' ?>" /> <?php echo L('site_att_watermark_quality_desc')?></td>
</tr>
<tr>
<th width="130" valign="top"><?php echo L('site_att_watermark_pos')?></th>
<td>
<table width="100%" class="radio-label">
<tr>
<td rowspan="3"><input class="radio_style" name="setting[watermark_pos]" value="10" type="radio" <?php echo ($setting['watermark_pos']==10) ? 'checked':''?>> <?php echo L('site_att_watermark_pos_10')?></td>
<td><input class="radio_style" name="setting[watermark_pos]" value="1" type="radio" <?php echo ($setting['watermark_pos']==1) ? 'checked':''?>> <?php echo L('site_att_watermark_pos_1')?></td>
<td><input class="radio_style" name="setting[watermark_pos]" value="2" type="radio" <?php echo ($setting['watermark_pos']==2) ? 'checked':'' ?>> <?php echo L('site_att_watermark_pos_2')?></td>
<td><input class="radio_style" name="setting[watermark_pos]" value="3" type="radio" <?php echo ($setting['watermark_pos']==3) ? 'checked':''?>> <?php echo L('site_att_watermark_pos_3')?></td>
</tr>
<tr>
<td><input class="radio_style" name="setting[watermark_pos]" value="4" type="radio" <?php echo ($setting['watermark_pos']==4) ? 'checked':''?>> <?php echo L('site_att_watermark_pos_4')?></td>
<td><input class="radio_style" name="setting[watermark_pos]" value="5" type="radio" <?php echo ($setting['watermark_pos']==5) ? 'checked':''?>> <?php echo L('site_att_watermark_pos_5')?></td>
<td><input class="radio_style" name="setting[watermark_pos]" value="6" type="radio" <?php echo ($setting['watermark_pos']==6) ? 'checked':''?>> <?php echo L('site_att_watermark_pos_6')?></td>
</tr>
<tr>
<td><input class="radio_style" name="setting[watermark_pos]" value="7" type="radio" <?php echo ($setting['watermark_pos']==7) ? 'checked':''?>> <?php echo L('site_att_watermark_pos_7')?></td>
<td><input class="radio_style" name="setting[watermark_pos]" value="8" type="radio" <?php echo ($setting['watermark_pos']==8) ? 'checked':''?>> <?php echo L('site_att_watermark_pos_8')?></td>
<td><input class="radio_style" name="setting[watermark_pos]" value="9" type="radio" <?php echo ($setting['watermark_pos']==9) ? 'checked':''?>> <?php echo L('site_att_watermark_pos_9')?></td>
</tr>
</table>
</td></tr>
</table>
</fieldset>
<div class="bk15"></div>
<input type="submit" class="dialog" id="dosubmit" name="dosubmit" value="<?php echo L('submit')?>" />
</div>
</form>
</div>
</body>
</html> | PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header');?>
<div class="pad_10">
<form name="myform" action="?m=admin&c=linkage&a=public_listorder" method="post">
<input type="hidden" name="keyid" value="<?php echo $keyid?>">
<div class="table-list">
<table width="100%" cellspacing="0">
<thead>
<tr>
<th width="10%"><?php echo L('listorder')?></th>
<th width="10%">ID</th>
<th width="10%" align="left" ><?php echo L('linkage_name')?></th>
<th width="20%"><?php echo L('linkage_desc')?></th>
<th width="15%"><?php echo L('operations_manage')?></th>
</tr>
</thead>
<tbody>
<?php echo $submenu?>
</tbody>
</table>
<div class="btn"><input type="submit" class="button" name="dosubmit" value="<?php echo L('listorder')?>" /></div> </div>
</div>
</div>
</form>
<script type="text/javascript">
<!--
function add(id, name,linkageid) {
window.top.art.dialog({id:'add'}).close();
window.top.art.dialog({title:name,id:'add',iframe:'?m=admin&c=linkage&a=public_sub_add&keyid='+id+'&linkageid='+linkageid,width:'500',height:'320'}, function(){var d = window.top.art.dialog({id:'add'}).data.iframe;d.document.getElementById('dosubmit').click();return false;}, function(){window.top.art.dialog({id:'add'}).close()});
}
function edit(id, name,parentid) {
window.top.art.dialog({id:'edit'}).close();
window.top.art.dialog({title:name,id:'edit',iframe:'?m=admin&c=linkage&a=edit&linkageid='+id+'&parentid='+parentid,width:'500',height:'200'}, function(){var d = window.top.art.dialog({id:'edit'}).data.iframe;d.document.getElementById('dosubmit').click();return false;}, function(){window.top.art.dialog({id:'edit'}).close()});
}
//-->
</script>
</body>
</html> | PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
$show_validator = true;include $this->admin_tpl('header');?>
<script type="text/javascript">
<!--
$(function(){
$.formValidator.initConfig({autotip:true,formid:"myform",onerror:function(msg){}});
$("#rolename").formValidator({onshow:"<?php echo L('input').L('role_name')?>",onfocus:"<?php echo L('role_name').L('not_empty')?>"}).inputValidator({min:1,max:999,onerror:"<?php echo L('role_name').L('not_empty')?>"});
})
//-->
</script>
<div class="pad_10">
<div class="common-form">
<form name="myform" action="?m=admin&c=role&a=edit" method="post" id="myform">
<input type="hidden" name="roleid" value="<?php echo $roleid?>"></input>
<table width="100%" class="table_form contentWrap">
<tr>
<td><?php echo L('role_name')?></td>
<td><input type="text" name="info[rolename]" value="<?php echo $rolename?>" class="input-text" id="rolename"></input></td>
</tr>
<tr>
<td><?php echo L('role_description')?></td>
<td><textarea name="info[description]" rows="2" cols="20" id="description" class="inputtext" style="height:100px;width:500px;"><?php echo $description?></textarea></td>
</tr>
<tr>
<td><?php echo L('enabled')?></td>
<td><input type="radio" name="info[disabled]" value="0" <?php echo ($disabled=='0')?' checked':''?>> <?php echo L('enable')?> <label><input type="radio" name="info[disabled]" value="1" <?php echo ($disabled=='1')?' checked':''?>><?php echo L('ban')?></td>
</tr>
<tr>
<td><?php echo L('listorder')?></td>
<td><input type="text" name="info[listorder]" size="3" value="<?php echo $listorder?>" class="input-text"></input></td>
</tr>
</table>
<div class="bk15"></div>
<input name="dosubmit" type="submit" value="<?php echo L('submit')?>" class="button">
</form>
</div>
</div>
</body>
</html>
| PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header');?>
<div class="pad_10">
<table cellpadding="2" cellspacing="1" class="table_form" width="100%">
<form action="?m=admin&c=badword&a=import" method="post" name="myform">
<tr>
<th width="10%"> <?php echo L('badword_name')?> </th>
<td width="200"><textarea name="info" cols="50" rows="6" require="true" datatype="limit" ></textarea> </td>
</tr>
<tr>
<th> <?php echo L('badword_name')?> <?php echo L('badword_require')?>: </th>
<td>
<?php echo L('badword_import_infos')?>
</td>
</tr>
<tr>
<th></th>
<td>
<input type="hidden" name="forward" value="?m=admin&c=badword&a=import">
<input type="submit" name="dosubmit" value=" <?php echo L('submit')?> " class="button">
<input type="reset" name="reset" value=" <?php echo L('clear')?> " class="button">
</td>
</tr>
</form>
</table>
</div>
</body>
</html> | PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header');
?>
<script type="text/javascript">
$(function(){
$.formValidator.initConfig({formid:"myform",autotip:true,onerror:function(msg,obj){window.top.art.dialog({content:msg,lock:true,width:'200',height:'50'}, function(){this.close();$(obj).focus();})}});
$("#word").formValidator({onshow:"<?php echo L('input').L('keylink');?>",onfocus:"<?php echo L('input').L('keylink');?>"}).inputValidator({min:1,onerror:"<?php echo L('input').L('keylink');?>"}).regexValidator({regexp:"notempty",datatype:"enum",param:'i',onerror:"<?php echo L('en_tips_type');?>"}).ajaxValidator({type : "get",url : "",data :"m=admin&c=keylink&a=public_name",datatype : "html",async:'false',success : function(data){ if( data == "1" ){return true;}else{return false;}},buttons: $("#dosubmit"),onerror : "<?php echo L('keylink').L('exists');?>",onwait : "<?php echo L('connecting');?>"});
$("#url").formValidator({onshow:"<?php echo L('input_siteurl');?>",onfocus:"<?php echo L('input_siteurl');?>"}).inputValidator({min:1,onerror:"<?php echo L('input_siteurl');?>"}).regexValidator({regexp:"^http:",onerror:"<?php echo L('copyfrom_url_tips');?>"});
})
</script>
<div class="pad_10">
<table cellpadding="2" cellspacing="1" class="table_form" width="100%">
<form action="?m=admin&c=keylink&a=edit&keylinkid=<?php echo $keylinkid?>" method="post" name="myform" id="myform">
<tr>
<th width="25%"><?php echo L('keylink_name');?> :</th>
<td><input type="text" name="info[word]" id="word" size="20" value="<?php echo $word?>"></td>
</tr>
<tr>
<th><?php echo L('keylink_url');?> :</th>
<td><input type="text" name="info[url]" id="url" size="30" value="<?php echo $url ?>" ></td>
</tr>
<input type="submit" name="dosubmit" id="dosubmit" value=" <?php echo L('submit')?> " class="dialog">
</form>
</table>
</div>
</body>
</html> | PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
$show_header = true;
$show_scroll = true;
include $this->admin_tpl('header');
?>
<body scroll="no">
<div style="padding:6px 3px">
<div class="col-2 col-left mr6" style="width:140px">
<h6><img src="<?php echo IMG_PATH?>icon/sitemap-application-blue.png" width="16" height="16" /> <?php echo L('site_select');?></h6>
<ul class="content role-memu" id="site_list">
<?php foreach($sites_list as $n=>$r) {?>
<?php $green = $this->op->is_setting($r['siteid'],$roleid) ? '_green' : '';?>
<li><a href="?m=admin&c=role&a=role_priv&siteid=<?php echo $r['siteid']?>&roleid=<?php echo $roleid?>" target="role"><span><img src="<?php echo IMG_PATH?>icon/gear_disable<?php echo $green?>.png" width="16" height="16" /><?php echo L('sys_setting');?></span><em><?php echo $r['name']?></em></a></li>
<?php } ?>
</ul>
</div>
<div class="col-2 col-auto">
<div class="content" style="padding:1px">
<iframe name="role" id="role" src="?m=admin&c=role&a=role_priv&pc_hash=<?php echo $_SESSION['pc_hash']?>" frameborder="false" scrolling="auto" style="overflow-x:hidden;border:none" width="100%" height="483" allowtransparency="true"></iframe>
</div>
</div>
</div>
</body>
</html>
<script type="text/javascript">
$("#site_list li").click(
function(){$(this).addClass("on").siblings().removeClass('on')}
);
</script> | PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header');
?>
<script type="text/javascript">
<!--
$(function(){
$.formValidator.initConfig({formid:"myform",autotip:true,onerror:function(msg,obj){window.top.art.dialog({content:msg,lock:true,width:'200',height:'50'}, function(){this.close();$(obj).focus();})}});
$("#word").formValidator({onshow:"<?php echo L('input').L('keylink');?>",onfocus:"<?php echo L('input').L('keylink');?>"}).inputValidator({min:1,onerror:"<?php echo L('input').L('keylink');?>"}).regexValidator({regexp:"notempty",datatype:"enum",param:'i',onerror:"<?php echo L('en_tips_type');?>"}).ajaxValidator({type : "get",url : "",data :"m=admin&c=keylink&a=public_name",datatype : "html",async:'false',success : function(data){ if( data == "1" ){return true;}else{return false;}},buttons: $("#dosubmit"),onerror : "<?php echo L('keylink').L('exists');?>",onwait : "<?php echo L('connecting');?>"});
$("#url").formValidator({onshow:"<?php echo L('input_siteurl');?>",onfocus:"<?php echo L('input_siteurl');?>"}).inputValidator({min:1,onerror:"<?php echo L('input_siteurl');?>"}).regexValidator({regexp:"^http:",onerror:"<?php echo L('copyfrom_url_tips');?>"});
})
//-->
</script>
<div class="pad_10">
<table width="100%" cellpadding="2" cellspacing="1" class="table_form">
<form action="?m=admin&c=keylink&a=add" method="post" name="myform" id="myform">
<tr>
<th width="25%"><?php echo L('keylink_name');?> :</th>
<td><input type="text" name="info[word]" id="word" size="20"></td>
</tr>
<tr>
<th><?php echo L('keylink_url');?> :</th>
<td><input type="text" name="info[url]" value="http://www." size="30" id="url"></td>
</tr>
<input type="submit" name="dosubmit" id="dosubmit" class="dialog" value=" <?php echo L('submit')?> ">
</form>
</table>
</div>
</body>
</html> | PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header');
?>
<script type="text/javascript">
<!--
$(function(){
$.formValidator.initConfig({formid:"myform",autotip:true,onerror:function(msg,obj){window.top.art.dialog({content:msg,lock:true,width:'200',height:'50'}, function(){this.close();$(obj).focus();})}});
$("#name").formValidator({onshow:"<?php echo L("input").L('site_name')?>",onfocus:"<?php echo L("input").L('site_name')?>"}).inputValidator({min:1,onerror:"<?php echo L("input").L('site_name')?>"}).ajaxValidator({type : "get",url : "",data :"m=admin&c=site&a=public_name",datatype : "html",async:'false',success : function(data){ if( data == "1" ){return true;}else{return false;}},buttons: $("#dosubmit"),onerror : "<?php echo L('site_name').L('exists')?>",onwait : "<?php echo L('connecting')?>"});
$("#dirname").formValidator({onshow:"<?php echo L("input").L('site_dirname')?>",onfocus:"<?php echo L("input").L('site_dirname')?>"}).inputValidator({min:1,onerror:"<?php echo L("input").L('site_dirname')?>"}).regexValidator({regexp:"username",datatype:"enum",param:'i',onerror:"<?php echo L('site_dirname_err_msg')?>"}).ajaxValidator({type : "get",url : "",data :"m=admin&c=site&a=public_dirname",datatype : "html",async:'false',success : function(data){ if( data == "1" ){return true;}else{return false;}},buttons: $("#dosubmit"),onerror : "<?php echo L('site_dirname').L('exists')?>",onwait : "<?php echo L('connecting')?>"});
$("#domain").formValidator({onshow:"<?php echo L('site_domain_ex')?>",onfocus:"<?php echo L('site_domain_ex')?>",tipcss:{width:'300px'},empty:false}).inputValidator({onerror:"<?php echo L('site_domain_ex')?>"}).regexValidator({regexp:"http:\/\/(.+)\/$",onerror:"<?php echo L('site_domain_ex2')?>"});
$("#template").formValidator({onshow:"<?php echo L('style_name_point')?>",onfocus:"<?php echo L('select_at_least_1')?>"}).inputValidator({min:1,onerror:"<?php echo L('select_at_least_1')?>"});
$('#release_point').formValidator({onshow:"<?php echo L('publishing_sites_to_other_servers')?>",onfocus:"<?php echo L('choose_release_point')?>",empty:true}).inputValidator({max:4,onerror:"<?php echo L('most_choose_four')?>"});
$('#default_style_input').formValidator({tipid:"default_style_msg",onshow:"<?php echo L('please_select_a_style_and_select_the_template')?>",onfocus:"<?php echo L('please_select_a_style_and_select_the_template')?>"}).inputValidator({min:1,onerror:"<?php echo L('please_choose_the_default_style')?>"});
})
//-->
</script>
<style type="text/css">
.radio-label{ border-top:1px solid #e4e2e2; border-left:1px solid #e4e2e2;}
.radio-label td{ border-right:1px solid #e4e2e2; border-bottom:1px solid #e4e2e2;}
</style>
<div class="pad-10">
<form action="?m=admin&c=site&a=add" method="post" id="myform">
<div>
<fieldset>
<legend><?php echo L('basic_configuration')?></legend>
<table width="100%" class="table_form">
<tr>
<th width="80"><?php echo L('site_name')?>:</th>
<td class="y-bg"><input type="text" class="input-text" name="name" id="name" size="30" /></td>
</tr>
<tr>
<th><?php echo L('site_dirname')?>:</th>
<td class="y-bg"><input type="text" class="input-text" name="dirname" id="dirname" size="30" /></td>
</tr>
<tr>
<th><?php echo L('site_domain')?>:</th>
<td class="y-bg"><input type="text" class="input-text" name="domain" id="domain" size="30"/></td>
</tr>
</table>
</fieldset>
<div class="bk15"></div>
<fieldset>
<legend><?php echo L('seo_configuration')?></legend>
<table width="100%" class="table_form">
<tr>
<th width="80"><?php echo L('site_title')?>:</th>
<td class="y-bg"><input type="text" class="input-text" name="site_title" id="site_title" size="30" /></td>
</tr>
<tr>
<th><?php echo L('keyword_name')?>:</th>
<td class="y-bg"><input type="text" class="input-text" name="keywords" id="keywords" size="30" /></td>
</tr>
<tr>
<th><?php echo L('description')?>:</th>
<td class="y-bg"><input type="text" class="input-text" name="description" id="description" size="30" /></td>
</tr>
</table>
</fieldset>
<div class="bk15"></div>
<fieldset>
<legend><?php echo L('release_point_configuration')?></legend>
<table width="100%" class="table_form">
<tr>
<th width="80" valign="top"><?php echo L('release_point')?>:</th>
<td> <select name="release_point[]" size="3" id="release_point" multiple title="<?php echo L('ctrl_more_selected')?>">
<option value='' selected><?php echo L('not_use_the_publishers_some')?></option>
<?php if(is_array($release_point_list) && !empty($release_point_list)): foreach($release_point_list as $v):?>
<option value="<?php echo $v['id']?>"><?php echo $v['name']?></option>
<?php endforeach;endif;?>
</select> </td>
</tr>
</table>
</fieldset>
<div class="bk15"></div>
<fieldset>
<legend><?php echo L('template_style_configuration')?></legend>
<table width="100%" class="table_form">
<tr>
<th width="80" valign="top"><?php echo L('style_name')?>:</th>
<td class="y-bg"> <select name="template[]" size="3" id="template" multiple title="<?php echo L('ctrl_more_selected')?>" onchange="default_list()">
<?php if(is_array($template_list)):
foreach ($template_list as $key=>$val):
?>
<option value="<?php echo $val['dirname']?>"><?php echo $val['name']?></option>
<?php endforeach;endif;?>
</select></td>
</tr>
</tr>
<tr>
<th width="80" valign="top"><?php echo L('default_style')?>:<input type="hidden" name="default_style" id="default_style_input" value="0"></th>
<td class="y-bg"><span id="default_style"><input type="radio" name="default_style_radio" disabled></span><span id="default_style_msg"></span></td>
</tr>
</table>
<script type="text/javascript">
function default_list() {
var html = '';
var old = $('#default_style_input').val();
var checked = '';
$('#template option:selected').each(function(i,n){
if (old == $(n).val()) {
checked = 'checked';
}
html += '<label><input type="radio" name="default_style_radio" value="'+$(n).val()+'" onclick="$(\'#default_style_input\').val(this.value);" '+checked+'> '+$(n).text()+'</label>';
});
if(!checked) $('#default_style_input').val('0');
$('#default_style').html(html);
}
</script>
</fieldset>
<div class="bk15"></div>
<fieldset>
<legend><?php echo L('site_att_config')?></legend>
<table width="100%" class="table_form">
<tr>
<th width="130" valign="top"><?php echo L('site_att_upload_maxsize')?></th>
<td class="y-bg"><input type="text" class="input-text" name="setting[upload_maxsize]" id="upload_maxsize" size="10" value="2000"/> KB </td>
</tr>
<tr>
<th width="130" valign="top"><?php echo L('site_att_allow_ext')?></th>
<td class="y-bg"><input type="text" class="input-text" name="setting[upload_allowext]" id="upload_allowext" size="50" value="jpg|jpeg|gif|bmp|png|doc|docx|xls|xlsx|ppt|pptx|pdf|txt|rar|zip|swf"/></td>
</tr>
<tr>
<th><?php echo L('site_att_upload_maxsize')?> </th>
<td class="y-bg"><?php echo $this->check_gd()?></td>
<tr>
<th><?php echo L('site_att_watermark_enable')?></th>
<td class="y-bg">
<input class="radio_style" name="setting[watermark_enable]" value="1" type="radio"> <?php echo L('site_att_watermark_open')?>
<input class="radio_style" name="setting[watermark_enable]" value="0" checked="checked" type="radio"><?php echo L('site_att_watermark_close')?>
</td>
</tr>
<tr>
<th><?php echo L('site_att_watermark_condition')?></th>
<td class="y-bg"><?php echo L('site_att_watermark_minwidth')?>
<input type="text" class="input-text" name="setting[watermark_minwidth]" id="watermark_minwidth" size="10" value="300" /> X <?php echo L('site_att_watermark_minheight')?><input type="text" class="input-text" name="setting[watermark_minheight]" id="watermark_minheight" size="10" value="300" /> PX
</td>
</tr>
<tr>
<th width="130" valign="top"><?php echo L('site_att_watermark_img')?></th>
<td class="y-bg"><input type="text" class="input-text" name="setting[watermark_img]" id="watermark_img" size="30" value="mark.gif" /> <?php echo L('site_att_watermark_img_desc')?></td>
</tr>
<tr>
<th width="130" valign="top"><?php echo L('site_att_watermark_pct')?></th>
<td class="y-bg"><input type="text" class="input-text" name="setting[watermark_pct]" id="watermark_pct" size="10" value="100" /> <?php echo L('site_att_watermark_pct_desc')?></td>
</tr>
<tr>
<th width="130" valign="top"><?php echo L('site_att_watermark_quality')?></th>
<td class="y-bg"><input type="text" class="input-text" name="setting[watermark_quality]" id="watermark_quality" size="10" value="80" /> <?php echo L('site_att_watermark_quality_desc')?></td>
</tr>
<tr>
<th width="130" valign="top"><?php echo L('site_att_watermark_pos')?></th>
<td class="y-bg">
<table width="100%" class="radio-label">
<tr>
<td rowspan="3"><input class="radio_style" name="setting[watermark_pos]" value="10" type="radio" > <?php echo L('site_att_watermark_pos_10')?></td>
<td><input class="radio_style" name="setting[watermark_pos]" value="1" type="radio" > <?php echo L('site_att_watermark_pos_1')?></td>
<td><input class="radio_style" name="setting[watermark_pos]" value="2" type="radio"> <?php echo L('site_att_watermark_pos_2')?></td>
<td><input class="radio_style" name="setting[watermark_pos]" value="3" type="radio"> <?php echo L('site_att_watermark_pos_3')?></td>
</tr>
<tr>
<td><input class="radio_style" name="setting[watermark_pos]" value="4" type="radio"> <?php echo L('site_att_watermark_pos_4')?></td>
<td><input class="radio_style" name="setting[watermark_pos]" value="5" type="radio"> <?php echo L('site_att_watermark_pos_5')?></td>
<td><input class="radio_style" name="setting[watermark_pos]" value="6" type="radio" > <?php echo L('site_att_watermark_pos_6')?></td>
</tr>
<tr>
<td><input class="radio_style" name="setting[watermark_pos]" value="7" type="radio"> <?php echo L('site_att_watermark_pos_7')?></td>
<td><input class="radio_style" name="setting[watermark_pos]" value="8" type="radio"> <?php echo L('site_att_watermark_pos_8')?></td>
<td><input class="radio_style" name="setting[watermark_pos]" value="9" type="radio" checked> <?php echo L('site_att_watermark_pos_9')?></td>
</tr>
</table>
</td></tr>
</table>
</fieldset>
</div>
<div class="bk15"></div>
<input type="submit" class="dialog" id="dosubmit" name="dosubmit" value="<?php echo L('submit')?>" />
</div>
</div>
</form>
</body>
</html> | PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header');?>
<script type="text/javascript">
$(function(){
$.formValidator.initConfig({formid:"myform",autotip:true,onerror:function(msg,obj){window.top.art.dialog({content:msg,lock:true,width:'200',height:'50'}, function(){this.close();$(obj).focus();})}});
$("#badword").formValidator({onshow:"<?php echo L("input").L('badword_name')?>",onfocus:"<?php echo L("input").L('badword_name')?>"}).inputValidator({min:1,onerror:"<?php echo L("input").L('badword_name')?>"}).regexValidator({regexp:"notempty",datatype:"enum",param:'i',onerror:"<?php echo L('input_not_space')?>"}).ajaxValidator({type : "get",url : "",data :"m=admin&c=badword&a=public_name&badid=<?php echo $badid;?>",datatype : "html",async:'false',success : function(data){ if( data == "1" ){return true;}else{return false;}},buttons: $("#dosubmit"),onerror : "<?php echo L('badword_name').L('exists')?>",onwait : "<?php echo L('connecting')?>"}).defaultPassed();
$("#replaceword").formValidator({empty:true,onshow:"<?php echo L('badword_noreplace')?>",onfocus:"<?php echo L("input").L('badword_replacename')?>",oncorrect:"<?php echo L('format_right')?>",onempty:"<?php echo L('badword_notreplace')?>"}).inputValidator({min:1,onerror:"<?php echo L("input").L('badword_replacename')?>"});
})
</script>
<div class="pad_10">
<table cellpadding="2" cellspacing="1" class="table_form" width="100%">
<form action="?m=admin&c=badword&a=edit&badid=<?php echo $badid?>" method="post" name="myform" id="myform">
<tr>
<th width="20%"><?php echo L('badword_name')?></th>
<td><input type="text" name="badword" id="badword" value="<?php echo $badword?>"></td>
</tr>
<tr>
<th width="20%"><?php echo L('badword_replacename')?></th>
<td><input type="text" name="replaceword" id="replaceword" value="<?php echo $replaceword ?>" ></td>
</tr>
<tr>
<th width="20%"><?php echo L('badword_level')?></th>
<td>
<select size="1" id="info[level]" name="info[level]">
<?php
if($level=='1'){
$level1 = "selected";
}else{
$level2 = "selected";
}
?>
<option <?php echo $level1;?> value="1"><?php echo L('badword_common')?></option>
<option <?php echo $level2;?> value="2"><?php echo L('badword_dangerous')?></option>
</select>
<?php echo L('badword_level_info')?>
</td>
</tr>
<input type="submit" name="dosubmit" id="dosubmit" value=" <?php echo L('submit')?> " class="dialog">
</form>
</table>
</div>
</body>
</html> | PHP |
<?php defined('IN_ADMIN') or exit('No permission resources.'); ?>
<script language="javascript" type="text/javascript" src="<?php echo JS_PATH?>jquery.min.js"></script>
<div id="leftMain">
<h3 class="f14">phpsso<?php echo L('manage')?></h3>
<ul>
<li class="sub_menu">
<a style="outline: medium none;" hidefocus="true" href="<?php echo $setting['phpsso_api_url']?>/index.php?m=admin&c=member&a=manage&forward=<?php echo urlencode($setting['phpsso_api_url'].'/index.php?m=admin&c=member&a=manage')?>" target="right"><?php echo L('member_manage')?></a>
</li>
<li class="sub_menu">
<a style="outline: medium none;" hidefocus="true" href="<?php echo $setting['phpsso_api_url']?>/index.php?m=admin&c=applications&a=init&forward=<?php echo urlencode($setting['phpsso_api_url'].'/index.php?m=admin&c=applications&a=init')?>" target="right"><?php echo L('application')?></a>
</li>
<li class="sub_menu">
<a style="outline: medium none;" hidefocus="true" href="<?php echo $setting['phpsso_api_url']?>/index.php?m=admin&c=messagequeue&a=manage&forward=<?php echo urlencode($setting['phpsso_api_url'].'/index.php?m=admin&c=messagequeue&a=manage')?>" target="right"><?php echo L('communication')?></a>
</li>
<li class="sub_menu">
<a style="outline: medium none;" hidefocus="true" href="<?php echo $setting['phpsso_api_url']?>/index.php?m=admin&c=credit&a=manage&forward=<?php echo urlencode($setting['phpsso_api_url'].'/index.php?m=admin&c=credit&a=manage')?>" target="right"><?php echo L('redeem')?></a>
</li>
<li class="sub_menu">
<a style="outline: medium none;" hidefocus="true" href="<?php echo $setting['phpsso_api_url']?>/index.php?m=admin&c=administrator&a=init&forward=<?php echo urlencode($setting['phpsso_api_url'].'/index.php?m=admin&c=administrator&a=init')?>" target="right"><?php echo L('administrator')?></a>
</li>
<li class="sub_menu">
<a style="outline: medium none;" hidefocus="true" href="<?php echo $setting['phpsso_api_url']?>/index.php?m=admin&c=system&a=init&forward=<?php echo urlencode($setting['phpsso_api_url'].'/index.php?m=admin&c=system&a=init')?>" target="right"><?php echo L('system_setting')?></a>
</li>
<li class="sub_menu">
<a style="outline: medium none;" hidefocus="true" href="<?php echo $setting['phpsso_api_url']?>/index.php?m=admin&c=cache&a=init&forward=<?php echo urlencode($setting['phpsso_api_url'].'/index.php?m=admin&c=cache&a=init')?>" target="right"><?php echo L('update_phpsso_cache')?></a>
</li>
<li class="sub_menu">
<a style="outline: medium none;" hidefocus="true" href="<?php echo $setting['phpsso_api_url']?>/index.php?m=admin&c=password&a=init&forward=<?php echo urlencode($setting['phpsso_api_url'].'/index.php?m=admin&c=password&a=init')?>" target="right"><?php echo L('change_password')?></a>
</li>
<li class="sub_menu">
<a style="outline: medium none;" hidefocus="true" href="<?php echo $setting['phpsso_api_url']?>/index.php?m=admin&c=login&a=logout&forward=<?php echo urlencode($setting['phpsso_api_url'].'/index.php?m=admin&c=member&a=manage')?>" target="right"><?php echo L('exit')?>phpsso</a>
</li>
</ul>
</div>
<script type="text/javascript">
$("#leftMain li").click(function() {
var i =$(this).index() + 1;
$("#leftMain li").removeClass();
$("#leftMain li:nth-child("+i+")").addClass("on fb blue");
});
</script> | PHP |
<?php defined('IN_ADMIN') or exit('No permission resources.'); ?>
<!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=<?php echo CHARSET?>" />
<meta http-equiv="X-UA-Compatible" content="IE=7" />
<title><?php echo L('message_tips');?></title>
<style type="text/css">
<!--
*{ padding:0; margin:0; font-size:12px}
a:link,a:visited{text-decoration:none;color:#0068a6}
a:hover,a:active{color:#ff6600;text-decoration: underline}
.showMsg{border: 1px solid #1e64c8; zoom:1; width:450px; height:172px;position:absolute;top:44%;left:50%;margin:-87px 0 0 -225px}
.showMsg h5{background-image: url(<?php echo IMG_PATH?>msg_img/msg.png);background-repeat: no-repeat; color:#fff; padding-left:35px; height:25px; line-height:26px;*line-height:28px; overflow:hidden; font-size:14px; text-align:left}
.showMsg .content{ padding:46px 12px 10px 45px; font-size:14px; height:64px; text-align:left}
.showMsg .bottom{ background:#e4ecf7; margin: 0 1px 1px 1px;line-height:26px; *line-height:30px; height:26px; text-align:center}
.showMsg .ok,.showMsg .guery{background: url(<?php echo IMG_PATH?>msg_img/msg_bg.png) no-repeat 0px -560px;}
.showMsg .guery{background-position: left -460px;}
-->
</style>
<script type="text/javaScript" src="<?php echo JS_PATH?>jquery.min.js"></script>
<script language="JavaScript" src="<?php echo JS_PATH?>admin_common.js"></script>
</head>
<body>
<div class="showMsg" style="text-align:center">
<h5><?php echo L('message_tips');?></h5>
<div class="content guery" style="display:inline-block;display:-moz-inline-stack;zoom:1;*display:inline;max-width:330px"><?php echo $msg?></div>
<div class="bottom">
<?php if($url_forward=='goback' || $url_forward=='') {?>
<a href="javascript:history.back();" >[<?php echo L('return_previous');?>]</a>
<?php } elseif($url_forward=="close") {?>
<input type="button" name="close" value="<?php echo L('close');?> " onClick="window.close();">
<?php } elseif($url_forward=="blank") {?>
<?php } elseif($url_forward) {
if(strpos($url_forward,'&pc_hash')===false) $url_forward .= '&pc_hash='.$_SESSION['pc_hash'];
?>
<a href="<?php echo $url_forward?>"><?php echo L('click_here');?></a>
<script language="javascript">setTimeout("redirect('<?php echo $url_forward?>');",<?php echo $ms?>);</script>
<?php }?>
<?php if($returnjs) { ?> <script style="text/javascript"><?php echo $returnjs;?></script><?php } ?>
<?php if ($dialog):?><script style="text/javascript">window.top.right.location.reload();window.top.art.dialog({id:"<?php echo $dialog?>"}).close();</script><?php endif;?>
</div>
</div>
<script style="text/javascript">
function close_dialog() {
window.top.right.location.reload();window.top.art.dialog({id:"<?php echo $dialog?>"}).close();
}
</script>
</body>
</html> | PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header');?>
<script type="text/javascript">
<!--
$(function(){
$.formValidator.initConfig({formid:"myform",autotip:true,onerror:function(msg,obj){window.top.art.dialog({content:msg,lock:true,width:'200',height:'50'}, function(){this.close();$(obj).focus();})}});
$("#modelid").formValidator({onshow:"<?php echo L('select_model');?>",onfocus:"<?php echo L('select_model');?>",oncorrect:"<?php echo L('input_right');?>"}).inputValidator({min:1,onerror:"<?php echo L('select_model');?>"}).defaultPassed();
$("#catname").formValidator({onshow:"<?php echo L('input_catname');?>",onfocus:"<?php echo L('input_catname');?>",oncorrect:"<?php echo L('input_right');?>"}).inputValidator({min:1,onerror:"<?php echo L('input_catname');?>"}).defaultPassed();
$("#catdir").formValidator({onshow:"<?php echo L('input_dirname');?>",onfocus:"<?php echo L('input_dirname');?>"}).regexValidator({regexp:"^([a-zA-Z0-9、-]|[_]){0,30}$",onerror:"<?php echo L('enter_the_correct_catname');?>"}).inputValidator({min:1,onerror:"<?php echo L('input_dirname');?>"}).ajaxValidator({type : "get",url : "",data :"m=admin&c=category&a=public_check_catdir&old_dir=<?php echo $catdir;?>",datatype : "html",cached:false,getdata:{parentid:'parentid'},async:'false',success : function(data){ if( data == "1" ){return true;}else{return false;}},buttons: $("#dosubmit"),onerror : "<?php echo L('catname_have_exists');?>",onwait : "<?php echo L('connecting');?>"}).defaultPassed();
$("#url").formValidator({onshow:" ",onfocus:"<?php echo L('domain_name_format');?>",tipcss:{width:'300px'},empty:true}).inputValidator({onerror:"<?php echo L('domain_name_format');?>"}).regexValidator({regexp:"http:\/\/(.+)\/$",onerror:"<?php echo L('domain_end_string');?>"});
$("#template_list").formValidator({onshow:"<?php echo L('template_setting');?>",onfocus:"<?php echo L('template_setting');?>",oncorrect:"<?php echo L('input_right');?>"}).inputValidator({min:1,onerror:"<?php echo L('template_setting');?>"}).defaultPassed();
})
//-->
</script>
<form name="myform" id="myform" action="?m=admin&c=category&a=edit" method="post">
<div class="pad-10">
<div class="col-tab">
<ul class="tabBut cu-li">
<li id="tab_setting_1" class="on" onclick="SwapTab('setting','on','',6,1);"><?php echo L('catgory_basic');?></li>
<li id="tab_setting_2" onclick="SwapTab('setting','on','',6,2);"><?php echo L('catgory_createhtml');?></li>
<li id="tab_setting_3" onclick="SwapTab('setting','on','',6,3);"><?php echo L('catgory_template');?></li>
<li id="tab_setting_4" onclick="SwapTab('setting','on','',6,4);"><?php echo L('catgory_seo');?></li>
<li id="tab_setting_5" onclick="SwapTab('setting','on','',6,5);"><?php echo L('catgory_private');?></li>
<li id="tab_setting_6" onclick="SwapTab('setting','on','',6,6);"><?php echo L('catgory_readpoint');?></li>
</ul>
<div id="div_setting_1" class="contentList pad-10">
<table width="100%" class="table_form ">
<tr>
<th width="200"><?php echo L('select_model')?>:</th>
<td>
<?php
$category_items = getcache('category_items_'.$modelid,'commons');
$disabled = $category_items[$catid] ? 'disabled' : '';
$models = getcache('model','commons');
$model_datas = array();
foreach($models as $_k=>$_v) {
if($_v['siteid']!=$this->siteid) continue;
$model_datas[$_v['modelid']] = $_v['name'];
}
echo form::select($model_datas,$modelid,'name="info[modelid]" id="modelid" '.$disabled,L('select_model'));
echo L('modelid_edit_tips');
?>
</td>
</tr>
<tr>
<th width="200"><?php echo L('parent_category')?>:</th>
<td>
<?php echo form::select_category('category_content_'.$this->siteid,$parentid,'name="info[parentid]" id="parentid"',L('please_select_parent_category'),0,-1);?>
</td>
</tr>
<tr>
<th><?php echo L('catname')?>:</th>
<td><input type="text" name="info[catname]" id="catname" class="input-text" value="<?php echo $catname;?>"></td>
</tr>
<tr>
<th><?php echo L('catdir')?>:</th>
<td><input type="text" name="info[catdir]" id="catdir" class="input-text" value="<?php echo $catdir;?>"></td>
</tr>
<tr>
<th><?php echo L('catgory_img')?>:</th>
<td><?php echo form::images('info[image]', 'image', $image, 'content');?></td>
</tr>
<tr>
<th><?php echo L('description')?>:</th>
<td>
<textarea name="info[description]" maxlength="255" style="width:300px;height:60px;"><?php echo $description;?></textarea>
</td>
</tr>
<tr>
<th><?php echo L('workflow');?>:</th>
<td>
<?php
$workflows = getcache('workflow_'.$this->siteid,'commons');
if($workflows) {
$workflows_datas = array();
foreach($workflows as $_k=>$_v) {
$workflows_datas[$_v['workflowid']] = $_v['workname'];
}
echo form::select($workflows_datas,$setting['workflowid'],'name="setting[workflowid]"',L('catgory_not_need_check'));
} else {
echo '<input type="hidden" name="setting[workflowid]" value="">';
echo L('add_workflow_tips');
}
?>
</td>
</tr>
<tr>
<th><?php echo L('ismenu');?>:</th>
<td>
<input type='radio' name='info[ismenu]' value='1' <?php if($ismenu) echo 'checked';?>> <?php echo L('yes');?>
<input type='radio' name='info[ismenu]' value='0' <?php if(!$ismenu) echo 'checked';?>> <?php echo L('no');?></td>
</tr>
</table>
</div>
<div id="div_setting_2" class="contentList pad-10 hidden">
<table width="100%" class="table_form">
<tr>
<th width="200"><?php echo L('html_category');?>:</th>
<td>
<input type='radio' name='setting[ishtml]' value='1' <?php if($setting['ishtml']) echo 'checked';?> onClick="$('#category_php_ruleid').css('display','none');$('#category_html_ruleid').css('display','');$('#tr_domain').css('display','');"> <?php echo L('yes');?>
<input type='radio' name='setting[ishtml]' value='0' <?php if(!$setting['ishtml']) echo 'checked';?> onClick="$('#category_php_ruleid').css('display','');$('#category_html_ruleid').css('display','none');$('#tr_domain').css('display','none');"> <?php echo L('no');?>
</td>
</tr>
<tr>
<th><?php echo L('html_show');?>:</th>
<td>
<input type='radio' name='setting[content_ishtml]' value='1' <?php if($setting['content_ishtml']) echo 'checked';?> onClick="$('#show_php_ruleid').css('display','none');$('#show_html_ruleid').css('display','')"> <?php echo L('yes');?>
<input type='radio' name='setting[content_ishtml]' value='0' <?php if(!$setting['content_ishtml']) echo 'checked';?> onClick="$('#show_php_ruleid').css('display','');$('#show_html_ruleid').css('display','none')"> <?php echo L('no');?>
</td>
</tr>
<tr>
<th><?php echo L('category_urlrules');?>:</th>
<td><div id="category_php_ruleid" style="display:<?php if($setting['ishtml']) echo 'none';?>">
<?php
echo form::urlrule('content','category',0,$setting['category_ruleid'],'name="category_php_ruleid"');
?>
</div>
<div id="category_html_ruleid" style="display:<?php if(!$setting['ishtml']) echo 'none';?>">
<?php
echo form::urlrule('content','category',1,$setting['category_ruleid'],'name="category_html_ruleid"');
?>
</div>
</td>
</tr>
<tr>
<th><?php echo L('show_urlrules');?>:</th>
<td><div id="show_php_ruleid" style="display:<?php if($setting['content_ishtml']) echo 'none';?>">
<?php
echo form::urlrule('content','show',0,$setting['show_ruleid'],'name="show_php_ruleid"');
?>
</div>
<div id="show_html_ruleid" style="display:<?php if(!$setting['content_ishtml']) echo 'none';?>">
<?php
echo form::urlrule('content','show',1,$setting['show_ruleid'],'name="show_html_ruleid"');
?>
</div>
</td>
</tr>
<tr>
<th><?php echo L('create_to_rootdir');?>:</th>
<td>
<input type='radio' name='setting[create_to_html_root]' value='1' <?php if($setting['create_to_html_root']) echo 'checked';?> > <?php echo L('yes');?>
<input type='radio' name='setting[create_to_html_root]' value='0' <?php if(!$setting['create_to_html_root']) echo 'checked';?> > <?php echo L('no');?>
(<?php echo L('create_to_rootdir_tips');?>)</td>
</tr>
<tr id="tr_domain" style="display:<?php if(!$setting['ishtml']) echo 'none';?>">
<th><?php echo L('domain')?>:</th>
<td><input type="text" name="info[url]" id="url" class="input-text" size="50" value="<?php if(preg_match('/^http:\/\/([a-z0-9\-\.]+)\/$/i',$url)) echo $url;?>"></td>
</tr>
</table>
</div>
<div id="div_setting_3" class="contentList pad-10 hidden">
<table width="100%" class="table_form ">
<tr>
<th width="200"><?php echo L('available_styles');?>:</th>
<td>
<?php echo form::select($template_list, $setting['template_list'], 'name="setting[template_list]" id="template_list" onchange="load_file_list(this.value)"', L('please_select'))?>
</td>
</tr>
<tr>
<th width="200"><?php echo L('category_index_tpl')?>:</th>
<td id="category_template">
</td> </tr>
<tr>
<th width="200"><?php echo L('category_list_tpl')?>:</th>
<td id="list_template">
</td>
</tr>
<tr>
<th width="200"><?php echo L('content_tpl')?>:</th>
<td id="show_template">
</td>
</tr>
</table>
</div>
<div id="div_setting_4" class="contentList pad-10 hidden">
<table width="100%" class="table_form ">
<tr>
<th width="200"><?php echo L('meta_title');?></th>
<td><input name='setting[meta_title]' type='text' id='meta_title' value='<?php echo $setting['meta_title'];?>' size='60' maxlength='60'></td>
</tr>
<tr>
<th ><?php echo L('meta_keywords');?></th>
<td><textarea name='setting[meta_keywords]' id='meta_keywords' style="width:90%;height:40px"><?php echo $setting['meta_keywords'];?></textarea></td>
</tr>
<tr>
<th ><strong><?php echo L('meta_description');?></th>
<td><textarea name='setting[meta_description]' id='meta_description' style="width:90%;height:50px"><?php echo $setting['meta_description'];?></textarea></td>
</tr>
</table>
</div>
<div id="div_setting_5" class="contentList pad-10 hidden">
<table width="100%" >
<tr>
<th width="200"><?php echo L('role_private')?>:</th>
<td>
<table width="100%" class="table-list">
<thead>
<tr>
<th align="left"><?php echo L('role_name');?></th><th><?php echo L('view');?></th><th><?php echo L('add');?></th><th><?php echo L('edit');?></th><th><?php echo L('delete');?></th><th><?php echo L('listorder');?></th><th><?php echo L('push');?></th><th><?php echo L('move');?></th>
</tr>
</thead>
<tbody>
<?php
$roles = getcache('role','commons');
foreach($roles as $roleid=> $rolrname) {
$disabled = $roleid==1 ? 'disabled' : '';
?>
<tr>
<td><?php echo $rolrname?></td>
<td align="center"><input type="checkbox" name="priv_roleid[]" <?php echo $disabled;?> <?php echo $this->check_category_priv('init',$roleid);?> value="init,<?php echo $roleid;?>" ></td>
<td align="center"><input type="checkbox" name="priv_roleid[]" <?php echo $disabled;?> <?php echo $this->check_category_priv('add',$roleid);?> value="add,<?php echo $roleid;?>" ></td>
<td align="center"><input type="checkbox" name="priv_roleid[]" <?php echo $disabled;?> <?php echo $this->check_category_priv('edit',$roleid);?> value="edit,<?php echo $roleid;?>" ></td>
<td align="center"><input type="checkbox" name="priv_roleid[]" <?php echo $disabled;?> <?php echo $this->check_category_priv('delete',$roleid);?> value="delete,<?php echo $roleid;?>" ></td>
<td align="center"><input type="checkbox" name="priv_roleid[]" <?php echo $disabled;?> <?php echo $this->check_category_priv('listorder',$roleid);?> value="listorder,<?php echo $roleid;?>" ></td>
<td align="center"><input type="checkbox" name="priv_roleid[]" <?php echo $disabled;?> <?php echo $this->check_category_priv('push',$roleid);?> value="push,<?php echo $roleid;?>" ></td>
<td align="center"><input type="checkbox" name="priv_roleid[]" <?php echo $disabled;?> <?php echo $this->check_category_priv('move',$roleid);?> value="move,<?php echo $roleid;?>" ></td>
</tr>
<?php }?>
</tbody>
</table>
</td>
</tr>
<tr><td colspan=2><hr style="border:1px dotted #F2F2F2;"></td>
</tr>
<tr>
<th width="200"><?php echo L('group_private')?>:</th>
<td>
<table width="100%" class="table-list">
<thead>
<tr>
<th align="left"><?php echo L('group_name');?></th><th><?php echo L('allow_vistor');?></th><th><?php echo L('allow_contribute');?></th>
</tr>
</thead>
<tbody>
<?php
$group_cache = getcache('grouplist','member');
foreach($group_cache as $_key=>$_value) {
if($_value['groupid']==1) continue;
?>
<tr>
<td><?php echo $_value['name'];?></td>
<td align="center"><input type="checkbox" name="priv_groupid[]" <?php echo $this->check_category_priv('visit',$_value['groupid'],0);?> value="visit,<?php echo $_value['groupid'];?>" ></td>
<td align="center"><input type="checkbox" name="priv_groupid[]" <?php echo $this->check_category_priv('add',$_value['groupid'],0);?> value="add,<?php echo $_value['groupid'];?>" ></td>
</tr>
<?php }?>
</tbody>
</table>
</td>
</tr>
<tr>
<th width="200"><?php echo L('apply_to_child');?></th>
<td><input type='radio' name='priv_child' value='1'> <?php echo L('yes');?>
<input type='radio' name='priv_child' value='0' checked> <?php echo L('no');?></td></td>
</tr>
</table>
</div>
<div id="div_setting_6" class="contentList pad-10 hidden">
<table width="100%" class="table_form">
<tr>
<th width="200"><?php echo L('contribute_add_point');?></th>
<td><input name='setting[presentpoint]' type='text' value='<?php echo $setting['presentpoint'];?>' size='5' maxlength='5' style='text-align:center'> <?php echo L('contribute_add_point_tips');?></td>
</tr>
<tr>
<th ><?php echo L('default_readpoint');?></th>
<td><input name='setting[defaultchargepoint]' type='text' value='<?php echo $setting['defaultchargepoint'];?>' size='4' maxlength='4' style='text-align:center'> <select name="setting[paytype]"><option value="0" <?php if(!$setting['paytype']) echo 'selected';?>><?php echo L('readpoint');?></option><option value="1" <?php if($setting['paytype']) echo 'selected';?>><?php echo L('money');?></option></select> <?php echo L('readpoint_tips');?></td>
</tr>
<tr>
<th><?php echo L('repeatchargedays');?></th>
<td>
<input name='setting[repeatchargedays]' type='text' value='1' size='4' maxlength='4' style='text-align:center'> <?php echo L('repeat_tips');?>
<font color="red"><?php echo L('repeat_tips2');?></font></td>
</tr>
</table>
</div>
<div class="bk15"></div>
<input name="catid" type="hidden" value="<?php echo $catid;?>">
<input name="dosubmit" type="submit" value="<?php echo L('submit')?>" class="button">
</form>
</div>
</div>
<!--table_form_off-->
</div>
<script language="JavaScript">
<!--
window.top.$('#display_center_id').css('display','none');
$(function(){
var url = $('#url').val();
if(!url.match(/^http:\/\//)) $('#url').val('');
})
function SwapTab(name,cls_show,cls_hide,cnt,cur){
for(i=1;i<=cnt;i++){
if(i==cur){
$('#div_'+name+'_'+i).show();
$('#tab_'+name+'_'+i).attr('class',cls_show);
}else{
$('#div_'+name+'_'+i).hide();
$('#tab_'+name+'_'+i).attr('class',cls_hide);
}
}
}
function load_file_list(id) {
if(id=='') return false;
$.getJSON('?m=admin&c=category&a=public_tpl_file_list&style='+id+'&catid=<?php echo $catid?>', function(data){$('#category_template').html(data.category_template);$('#list_template').html(data.list_template);$('#show_template').html(data.show_template);});
}
<?php if(isset($setting['template_list']) && !empty($setting['template_list'])) echo "load_file_list('".$setting['template_list']."')"?>
//-->
</script> | PHP |
<?php defined('IN_ADMIN') or exit('No permission resources.'); ?>
<!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" class="off">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET?>" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<title><?php echo L('admin_site_title')?></title>
<link href="<?php echo CSS_PATH?>reset.css" rel="stylesheet" type="text/css" />
<link href="<?php echo CSS_PATH.SYS_STYLE;?>-system.css" rel="stylesheet" type="text/css" />
<link href="<?php echo CSS_PATH?>dialog.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="<?php echo CSS_PATH?>style/<?php echo SYS_STYLE;?>-styles1.css" title="styles1" media="screen" />
<link rel="alternate stylesheet" type="text/css" href="<?php echo CSS_PATH?>style/<?php echo SYS_STYLE;?>-styles2.css" title="styles2" media="screen" />
<link rel="alternate stylesheet" type="text/css" href="<?php echo CSS_PATH?>style/<?php echo SYS_STYLE;?>-styles3.css" title="styles3" media="screen" />
<link rel="alternate stylesheet" type="text/css" href="<?php echo CSS_PATH?>style/<?php echo SYS_STYLE;?>-styles4.css" title="styles4" media="screen" />
<script language="javascript" type="text/javascript" src="<?php echo JS_PATH?>jquery.min.js"></script>
<script language="javascript" type="text/javascript" src="<?php echo JS_PATH?>styleswitch.js"></script>
<script language="javascript" type="text/javascript" src="<?php echo JS_PATH?>dialog.js"></script>
<script language="javascript" type="text/javascript" src="<?php echo JS_PATH?>hotkeys.js"></script>
<script language="javascript" type="text/javascript" src="<?php echo JS_PATH?>jquery.sgallery.js"></script>
<script type="text/javascript">
var pc_hash = '<?php echo $_SESSION['pc_hash']?>'
</script>
<style type="text/css">
.objbody{overflow:hidden}
</style>
</head>
<body scroll="no" class="objbody">
<div id="dvLockScreen" class="ScreenLock" style="display:<?php if(isset($_SESSION['lock_screen']) && $_SESSION['lock_screen']==0) echo 'none';?>">
<div id="dvLockScreenWin" class="inputpwd">
<h5><b class="ico ico-info"></b><span id="lock_tips"><?php echo L('lockscreen_status');?></span></h5>
<div class="input">
<label class="lb"><?php echo L('password')?>:</label><input type="password" id="lock_password" class="input-text" size="24">
<input type="submit" class="submit" value=" " name="dosubmit" onclick="check_screenlock();return false;">
</div></div>
</div>
<div class="header">
<div class="logo lf"><a href="<?php echo $currentsite['domain']?>" target="_blank"><span class="invisible"><?php echo L('phpcms_title')?></span></a></div>
<div class="rt-col">
<div class="tab_style white cut_line text-r"><a href="javascript:;" onclick="lock_screen()"><img src="<?php echo IMG_PATH.'icon/lockscreen.png'?>"> <?php echo L('lockscreen')?></a><span>|</span><a href="http://www.phpcms.cn" target="_blank"><?php echo L('official_site')?></a><span>|</span><a href="http://www.phpcms.cn/license/license.php" target="_blank"><?php echo L('authorization')?></a><span>|</span><a href="http://bbs.phpcms.cn" target="_blank"><?php echo L('igenus_for_postfix')?></a><span>|</span><a href="http://v9.help.phpcms.cn" target="_blank"><?php echo L('help')?></a>
<ul id="Skin">
<li class="s1 styleswitch" rel="styles1"></li>
<li class="s2 styleswitch" rel="styles2"></li>
<li class="s3 styleswitch" rel="styles3"></li>
<li class="s4 styleswitch" rel="styles4"></li>
</ul>
</div>
</div>
<div class="col-auto">
<div class="log white cut_line"><?php echo L('hello'),$admin_username?> [<?php echo $rolename?>]<span>|</span><a href="?m=admin&c=index&a=public_logout">[<?php echo L('exit')?>]</a><span>|</span>
<a href="<?php echo $currentsite['domain']?>" target="_blank" id="site_homepage"><?php echo L('site_homepage')?></a><span>|</span>
<a href="?m=member" target="_blank"><?php echo L('member_center')?></a><span>|</span>
<a href="?m=search" target="_blank" id="site_search"><?php echo L('search')?></a>
</div>
<ul class="nav white" id="top_menu">
<?php
$array = admin::admin_menu(0);
foreach($array as $_value) {
if($_value['id']==10) {
echo '<li id="_M'.$_value['id'].'" class="on top_menu"><a href="javascript:_M('.$_value['id'].',\'?m='.$_value['m'].'&c='.$_value['c'].'&a='.$_value['a'].'\')" hidefocus="true" style="outline:none;">'.L($_value['name']).'</a></li>';
} else {
echo '<li id="_M'.$_value['id'].'" class="top_menu"><a href="javascript:_M('.$_value['id'].',\'?m='.$_value['m'].'&c='.$_value['c'].'&a='.$_value['a'].'\')" hidefocus="true" style="outline:none;">'.L($_value['name']).'</a></li>';
}
}
?>
<li class="tab_web"><a href="javascript:;"><span><?php echo $currentsite['name']?></span></a></li>
</ul>
</div>
</div>
<div id="content">
<div class="col-left left_menu">
<div id="Scroll"><div id="leftMain"></div></div>
<a href="javascript:;" id="openClose" style="outline-style: none; outline-color: invert; outline-width: medium;" hideFocus="hidefocus" class="open" title="<?php echo L('spread_or_closed')?>"><span class="hidden"><?php echo L('expand')?></span></a>
</div>
<div class="col-1 lf cat-menu" id="display_center_id" style="display:none" height="100%">
<div class="content">
<iframe name="center_frame" id="center_frame" src="" frameborder="false" scrolling="auto" style="border:none" width="100%" height="auto" allowtransparency="true"></iframe>
</div>
</div>
<div class="col-auto mr8">
<div class="crumbs">
<div class="shortcut cu-span"><a href="?m=content&c=create_html&a=public_index&pc_hash=<?php echo $_SESSION['pc_hash'];?>" target="right"><span><?php echo L('create_index')?></span></a><a href="?m=admin&c=cache_all&a=init&pc_hash=<?php echo $_SESSION['pc_hash'];?>" target="right"><span><?php echo L('update_backup')?></span></a><a href="javascript:art.dialog({id:'map',iframe:'?m=admin&c=index&a=public_map', title:'<?php echo L('background_map')?>', width:'700', height:'500', lock:true});void(0);"><span><?php echo L('background_map')?></span></a><?php echo runhook('admin_top_left_menu')?></div>
<?php echo L('current_position')?><span id="current_pos"></span></div>
<div class="col-1">
<div class="content" style="position:relative; overflow:hidden">
<iframe name="right" id="rightMain" src="?m=admin&c=index&a=public_main" frameborder="false" scrolling="auto" style="border:none; margin-bottom:30px" width="100%" height="auto" allowtransparency="true"></iframe>
<div class="fav-nav">
<div id="panellist">
<?php foreach($adminpanel as $v) {?>
<span>
<a onclick="paneladdclass(this);" target="right" href="<?php echo $v['url'].'menuid='.$v['menuid'].'&pc_hash='.$_SESSION['pc_hash'];?>"><?php echo L($v['name'])?></a>
<a class="panel-delete" href="javascript:delete_panel(<?php echo $v['menuid']?>, this);"></a></span>
<?php }?>
</div>
<div id="paneladd"></div>
<input type="hidden" id="menuid" value="">
<input type="hidden" id="bigid" value="" />
<div id="help" class="fav-help"></div>
</div>
</div>
</div>
</div>
</div>
<ul class="tab-web-panel hidden" style="position:absolute; z-index:999; background:#fff">
<?php foreach ($sitelist as $key=>$v):?>
<li style="margin:0"><a href="javascript:site_select(<?php echo $v['siteid']?>, '<?php echo new_addslashes($v['name'])?>', '<?php echo $v['domain']?>', '<?php echo $v['siteid']?>')"><?php echo $v['name']?></a></li>
<?php endforeach;?>
</ul>
<div class="scroll"><a href="javascript:;" class="per" title="使用鼠标滚轴滚动侧栏" onclick="menuScroll(1);"></a><a href="javascript:;" class="next" title="使用鼠标滚轴滚动侧栏" onclick="menuScroll(2);"></a></div>
<script type="text/javascript">
if(!Array.prototype.map)
Array.prototype.map = function(fn,scope) {
var result = [],ri = 0;
for (var i = 0,n = this.length; i < n; i++){
if(i in this){
result[ri++] = fn.call(scope ,this[i],i,this);
}
}
return result;
};
var getWindowSize = function(){
return ["Height","Width"].map(function(name){
return window["inner"+name] ||
document.compatMode === "CSS1Compat" && document.documentElement[ "client" + name ] || document.body[ "client" + name ]
});
}
window.onload = function (){
if(!+"\v1" && !document.querySelector) { // for IE6 IE7
document.body.onresize = resize;
} else {
window.onresize = resize;
}
function resize() {
wSize();
return false;
}
}
function wSize(){
//这是一字符串
var str=getWindowSize();
var strs= new Array(); //定义一数组
strs=str.toString().split(","); //字符分割
var heights = strs[0]-150,Body = $('body');$('#rightMain').height(heights);
//iframe.height = strs[0]-46;
if(strs[1]<980){
$('.header').css('width',980+'px');
$('#content').css('width',980+'px');
Body.attr('scroll','');
Body.removeClass('objbody');
}else{
$('.header').css('width','auto');
$('#content').css('width','auto');
Body.attr('scroll','no');
Body.addClass('objbody');
}
var openClose = $("#rightMain").height()+39;
$('#center_frame').height(openClose+9);
$("#openClose").height(openClose+30);
$("#Scroll").height(openClose-20);
windowW();
}
wSize();
function windowW(){
if($('#Scroll').height()<$("#leftMain").height()){
$(".scroll").show();
}else{
$(".scroll").hide();
}
}
windowW();
//站点下拉菜单
$(function(){
var offset = $(".tab_web").offset();
$(".tab_web").mouseover(function(){
$(".tab-web-panel").css({ "left": +offset.left+4, "top": +offset.top+$('.tab_web').height()+2});
$(".tab-web-panel").show();
});
$(".tab_web span").mouseout(function(){hidden_site_list_1()});
$(".tab-web-panel").mouseover(function(){clearh();$('.tab_web a').addClass('on')}).mouseout(function(){hidden_site_list_1();$('.tab_web a').removeClass('on')});
//默认载入左侧菜单
$("#leftMain").load("?m=admin&c=index&a=public_menu_left&menuid=10");
})
//站点选择
function site_select(id,name, domain, siteid) {
$(".tab_web span").html(name);
$.get("?m=admin&c=index&a=public_set_siteid&siteid="+id,function(data){
if (data==1){
window.top.right.location.reload();
window.top.center_frame.location.reload();
$.get("?m=admin&c=index&a=public_menu_left&menuid=0&parentid="+$("#bigid").val(), function(data){$('.top_menu').remove();$('#top_menu').prepend(data)});
}
});
$('#site_homepage').attr('href', domain);
$('#site_search').attr('href', 'index.php?m=search&siteid='+siteid);
}
//隐藏站点下拉。
var s = 0;
var h;
function hidden_site_list() {
s++;
if(s>=3) {
$('.tab-web-panel').hide();
clearInterval(h);
s = 0;
}
}
function clearh(){
if(h)clearInterval(h);
}
function hidden_site_list_1() {
h = setInterval("hidden_site_list()", 1);
}
//左侧开关
$("#openClose").click(function(){
if($(this).data('clicknum')==1) {
$("html").removeClass("on");
$(".left_menu").removeClass("left_menu_on");
$(this).removeClass("close");
$(this).data('clicknum', 0);
$(".scroll").show();
} else {
$(".left_menu").addClass("left_menu_on");
$(this).addClass("close");
$("html").addClass("on");
$(this).data('clicknum', 1);
$(".scroll").hide();
}
return false;
});
function _M(menuid,targetUrl) {
$("#menuid").val(menuid);
$("#bigid").val(menuid);
$("#paneladd").html('<a class="panel-add" href="javascript:add_panel();"><em><?php echo L('add')?></em></a>');
if(menuid!=8) {
$("#leftMain").load("?m=admin&c=index&a=public_menu_left&menuid="+menuid, {limit: 25}, function(){
windowW();
});
} else {
$("#leftMain").load("?m=admin&c=phpsso&a=public_menu_left&menuid="+menuid, {limit: 25}, function(){
windowW();
});
}
//$("#rightMain").attr('src', targetUrl);
$('.top_menu').removeClass("on");
$('#_M'+menuid).addClass("on");
$.get("?m=admin&c=index&a=public_current_pos&menuid="+menuid, function(data){
$("#current_pos").html(data);
});
//当点击顶部菜单后,隐藏中间的框架
$('#display_center_id').css('display','none');
//显示左侧菜单,当点击顶部时,展开左侧
$(".left_menu").removeClass("left_menu_on");
$("#openClose").removeClass("close");
$("html").removeClass("on");
$("#openClose").data('clicknum', 0);
$("#current_pos").data('clicknum', 1);
}
function _MP(menuid,targetUrl) {
$("#menuid").val(menuid);
$("#paneladd").html('<a class="panel-add" href="javascript:add_panel();"><em><?php echo L('add')?></em></a>');
$("#rightMain").attr('src', targetUrl+'&menuid='+menuid+'&pc_hash='+pc_hash);
$('.sub_menu').removeClass("on fb blue");
$('#_MP'+menuid).addClass("on fb blue");
$.get("?m=admin&c=index&a=public_current_pos&menuid="+menuid, function(data){
$("#current_pos").html(data+'<span id="current_pos_attr"></span>');
});
$("#current_pos").data('clicknum', 1);
show_help(targetUrl);
}
function show_help(targetUrl) {
$("#help").slideUp("slow");
var str = '';
$.getJSON("http://v9.help.phpcms.cn/api.php?jsoncallback=?",{op:'help',targetUrl: targetUrl},
function(data){
if(data!=null) {
$("#help").slideDown("slow");
$.each(data, function(i,item){
str += '<a href="'+item.url+'" target="_blank">'+item.title+'</a>';
});
str += '<a class="panel-delete" href="javascript:;" onclick="$(\'#help\').slideUp(\'slow\')"></a>';
$('#help').html(str);
}
});
$("#help").data('time', 1);
}
setInterval("hidden_help()", 10000);
function hidden_help() {
var htime = $("#help").data('time')+1;
$("#help").data('time', htime);
if(htime>2) $("#help").slideUp("slow");
}
function add_panel() {
var menuid = $("#menuid").val();
$.ajax({
type: "POST",
url: "?m=admin&c=index&a=public_ajax_add_panel",
data: "menuid=" + menuid,
success: function(data){
if(data) {
$("#panellist").html(data);
}
}
});
}
function delete_panel(menuid, id) {
$.ajax({
type: "POST",
url: "?m=admin&c=index&a=public_ajax_delete_panel",
data: "menuid=" + menuid,
success: function(data){
$("#panellist").html(data);
}
});
}
function paneladdclass(id) {
$("#panellist span a[class='on']").removeClass();
$(id).addClass('on')
}
setInterval("session_life()", 160000);
function session_life() {
$.get("?m=admin&c=index&a=public_session_life");
}
function lock_screen() {
$.get("?m=admin&c=index&a=public_lock_screen");
$('#dvLockScreen').css('display','');
}
function check_screenlock() {
var lock_password = $('#lock_password').val();
if(lock_password=='') {
$('#lock_tips').html('<font color="red"><?php echo L('password_can_not_be_empty');?></font>');
return false;
}
$.get("?m=admin&c=index&a=public_login_screenlock", { lock_password: lock_password},function(data){
if(data==1) {
$('#dvLockScreen').css('display','none');
$('#lock_password').val('');
$('#lock_tips').html('<?php echo L('lockscreen_status');?>');
} else if(data==3) {
$('#lock_tips').html('<font color="red"><?php echo L('wait_1_hour_lock');?></font>');
} else {
strings = data.split('|');
$('#lock_tips').html('<font color="red"><?php echo L('password_error_lock');?>'+strings[1]+'<?php echo L('password_error_lock2');?></font>');
}
});
}
$(document).bind('keydown', 'return', function(evt){check_screenlock();return false;});
(function(){
var addEvent = (function(){
if (window.addEventListener) {
return function(el, sType, fn, capture) {
el.addEventListener(sType, fn, (capture));
};
} else if (window.attachEvent) {
return function(el, sType, fn, capture) {
el.attachEvent("on" + sType, fn);
};
} else {
return function(){};
}
})(),
Scroll = document.getElementById('Scroll');
// IE6/IE7/IE8/Opera 10+/Safari5+
addEvent(Scroll, 'mousewheel', function(event){
event = window.event || event ;
if(event.wheelDelta <= 0 || event.detail > 0) {
Scroll.scrollTop = Scroll.scrollTop + 29;
} else {
Scroll.scrollTop = Scroll.scrollTop - 29;
}
}, false);
// Firefox 3.5+
addEvent(Scroll, 'DOMMouseScroll', function(event){
event = window.event || event ;
if(event.wheelDelta <= 0 || event.detail > 0) {
Scroll.scrollTop = Scroll.scrollTop + 29;
} else {
Scroll.scrollTop = Scroll.scrollTop - 29;
}
}, false);
})();
function menuScroll(num){
var Scroll = document.getElementById('Scroll');
if(num==1){
Scroll.scrollTop = Scroll.scrollTop - 60;
}else{
Scroll.scrollTop = Scroll.scrollTop + 60;
}
}
</script>
</body>
</html> | PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header');
?>
<div class="pad_10">
<div class="table-list">
<form method="post" name="myform" id="myform" action="?m=admin&c=googlesitemap&a=set">
<input type="hidden" name="tabletype" value="phpcmstables" id="phpcmstables">
<table width="100%" cellspacing="0">
<thead>
<tr>
<th class="tablerowhighlight" colspan=2><?php echo L('google_info')?></th>
</tr>
</thead>
<tr>
<td align="right" width="100"><?php echo L('explain')?>: </td>
<td>
<?php echo L('google_infos')?>
</td>
</tr>
</table>
<table width="100%" cellspacing="0">
<thead>
<tr>
<th class="tablerowhighlight" colspan=2><?php echo L('google_sitemaps')?></th>
</tr>
</thead>
<tr>
<td align="right" width="100"> <?php echo L('google_rate')?> : </td>
<td colspan=1>
<select name="content_priority">
<option value="1">1</option><option value="0.9">0.9</option>
<option value="0.8">0.8</option><option selected="" value="0.7">0.7</option>
<option value="0.6">0.6</option><option value="0.5">0.5</option>
<option value="0.4">0.4</option><option value="0.3">0.3</option>
<option value="0.2">0.2</option><option value="0.1">0.1</option>
</select>
<select name="content_changefreq">
<option value="always"><?php echo L('google_update')?></option><option value="hourly"><?php echo L('google_hour')?></option>
<option value="daily"><?php echo L('google_day')?></option><option selected="" value="weekly"><?php echo L('google_week')?></option>
<option value="monthly"><?php echo L('google_month')?></option><option value="yearly"><?php echo L('google_year')?></option>
<option value="never"><?php echo L('google_noupdate')?></option>
</select>
</td>
</tr>
<tr>
<td align="right"><?php echo L('google_nums')?> : </td>
<td colspan=3>
<input type=text name="num" value="20" size=5>
</td>
</tr>
</table>
<table width="100%" cellspacing="0">
<thead>
<tr>
<th class="tablerowhighlight" colspan=2><?php echo L('google_baidunews')?></th>
</tr>
</thead>
<tr>
<td align="right"><?php echo L('google_ismake')?> : </td>
<td colspan=1><input type="radio" name="mark" value="1" checked> <?php echo L('setting_yes')?> <input type="radio" name="mark" value="0"> <?php echo L('setting_no')?> </td>
</tr>
<tr>
<td align="right" width="100"> <?php echo L('google_select_db')?> : </td>
<td colspan=1>
<select name='catids[]' id='catids' multiple="multiple" style="height:200px;" title="<?php echo L('push_ctrl_to_select','','content');?>">
<?php echo $string;?>
</select>
</td>
</tr>
<tr>
<td align="right" width="100"> <?php echo L('google_period')?> : </td>
<td colspan=1><input type=text name="time" value="40" size=20> </td>
</tr>
<tr>
<td align="right" width="100"> Email : </td>
<td colspan=3><input type=text name="email" value="phpcms@phpcms.cn" size=20></td>
</tr>
<tr>
<td align="right" width="100"> <?php echo L('google_nums')?> : </td>
<td colspan=3><input type=text name="baidunum" value="20" size=5> </td>
</tr>
<tr>
<th class="tablerowhighlight" colspan=2>
<br>
<input type="submit" name="dosubmit" value=" <?php echo L('google_startmake')?> " class="button">
<br>
</th>
</tr>
</table>
</form>
</div>
</div>
</body>
</html>
| PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header');?>
<div class="pad_10">
<div class="explain-col">
<?php echo L('linkage_tips');?>
</div>
<div class="bk10"></div>
<form name="myform" action="?m=admin&c=role&a=listorder" method="post">
<div class="table-list">
<table width="100%" cellspacing="0">
<thead>
<tr>
<th width="10%">ID</th>
<th width="20%" align="left" ><?php echo L('linkage_name')?></th>
<th width="30%" align="left" ><?php echo L('linkage_desc')?></th>
<th width="20%" ><?php echo L('linkage_calling_code')?></th>
<th width="20%" ><?php echo L('operations_manage')?></th>
</tr>
</thead>
<tbody>
<?php
if(is_array($infos)){
foreach($infos as $info){
?>
<tr>
<td width="10%" align="center"><?php echo $info['linkageid']?></td>
<td width="20%" ><?php echo $info['name']?></td>
<td width="30%" ><?php echo $info['description']?></td>
<td width="20%" class="text-c"><input type="text" value="{menu_linkage(<?php echo $info['linkageid']?>,'L_<?php echo $info['linkageid']?>')}" style="width:200px;"></td>
<td width="20%" class="text-c"><a href="?m=admin&c=linkage&a=public_manage_submenu&keyid=<?php echo $info['linkageid']?>"><?php echo L('linkage_manage_submenu')?></a> | <a href="javascript:void(0);" onclick="edit('<?php echo $info['linkageid']?>','<?php echo new_addslashes($info['name'])?>')"><?php echo L('edit')?></a> | <a href="javascript:confirmurl('?m=admin&c=linkage&a=delete&linkageid=<?php echo $info['linkageid']?>', '<?php echo L('linkage_is_del')?>')"><?php echo L('delete')?></a> | <a href="?m=admin&c=linkage&a=public_cache&linkageid=<?php echo $info['linkageid']?>"><?php echo L('update_backup')?></a></td>
</tr>
<?php
}
}
?>
</tbody>
</table>
</div>
</div>
</form>
<script type="text/javascript">
<!--
function edit(id, name) {
window.top.art.dialog({id:'edit'}).close();
window.top.art.dialog({title:name,id:'edit',iframe:'?m=admin&c=linkage&a=edit&linkageid='+id,width:'500',height:'200'}, function(){var d = window.top.art.dialog({id:'edit'}).data.iframe;d.document.getElementById('dosubmit').click();return false;}, function(){window.top.art.dialog({id:'edit'}).close()});
}
//-->
</script>
</body>
</html> | PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header', 'admin');
?>
<link href="<?php echo CSS_PATH?>open_admin.css" rel="stylesheet" type="text/css" />
<div class="pad_10">
<div class="table-list">
<?php if($license && $_GET['license']) {?>
<div class="nr"><p><?php echo $plugin_data['license']?></p></div>
<div class="btn ibtn txtc">
<input type="button" onclick="location.href='<?php echo $submit_url?>'" value="<?php echo L('plugin_agree','','plugin')?>" class="button" name="install">
<input type="button" onclick="history.go(-1);" value="<?php echo L('plugin_disagree','','plugin')?>" class="button" name="cancel">
</div>
<?php } else { ?>
<div class="fs14"><?php echo L('install_plugin','','plugin')?></div>
<div class="btn ibtn ibtns">
<div class="fs14 txtc"><?php echo L('install_plugin','','plugin')?></div>
<input type="button" onclick="location.href='<?php echo $submit_url?>'" value="<?php echo L('plugin_install_app','','plugin')?>" class="button" name="install"> <input type="button" onclick="history.go(-1);" value="<?php echo L('plugin_uninstall_cancel','','plugin')?>" class="button" name="cancel">
</div>
<?php } ?>
</div>
</div>
</div>
</body>
<a href="javascript:edit(<?php echo $v['siteid']?>, '<?php echo $v['name']?>')">
</html>
| PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header','admin');?>
<div class="pad-10">
<div class="bk10"></div>
<div class="table-list">
<table width="100%" cellspacing="0">
<form action="?m=admin&c=category&a=batch_edit" method="post" name="myform">
<tbody height="200" class="nHover td-line">
<tr>
<td align="left" rowspan="6">
<?php echo L('category_batch_edit');?> <font color="red"><?php echo L('category_manage');?></font>
<input type="radio" name="type" value="0" <?php if($type==0) echo 'checked';?>><BR><BR>
<?php echo L('category_batch_edit');?> <?php echo L('category_type_page');?><input type="radio" name="type" value="1" <?php if($type==1) echo 'checked';?>>
</td>
</tr>
<tr>
<td align="center" rowspan="6">
<select name='catids[]' id='catids' multiple="multiple" style="height:300px;width:400px" title="<?php echo L('push_ctrl_to_select','','content');?>">
<?php echo $string;?>
</select></td>
<td>
<input type="hidden" value="<?php echo $type;?>">
<input type="submit" value="<?php echo L('submit');?>">
</td>
</tr>
</tbody>
</form>
</table>
</div>
</div>
<script language="JavaScript">
<!--
window.top.$('#display_center_id').css('display','none');
//-->
</script> | PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header');?>
<script type="text/javascript">
<!--
$(function(){
$.formValidator.initConfig({formid:"myform",autotip:true,onerror:function(msg,obj){window.top.art.dialog({content:msg,lock:true,width:'200',height:'50'}, function(){this.close();$(obj).focus();})}});
$("#catname").formValidator({onshow:"<?php echo L('input_catname');?>",onfocus:"<?php echo L('input_catname');?>",oncorrect:"<?php echo L('input_right');?>"}).inputValidator({min:1,onerror:"<?php echo L('input_catname');?>"})<?php if(ROUTE_A=='edit') echo '.defaultPassed()';?>;
$("#url").formValidator({onshow:"<?php echo L('input_linkurl');?>",onfocus:"<?php echo L('input_linkurl');?>",oncorrect:"<?php echo L('input_right');?>"}).inputValidator({min:1,onerror:"<?php echo L('input_linkurl');?>"})<?php if(ROUTE_A=='edit') echo '.defaultPassed()';?>;
})
//-->
</script>
<form name="myform" id="myform" action="?m=admin&c=category&a=<?php echo ROUTE_A;?>" method="post">
<div class="pad-10">
<div class="col-tab">
<ul class="tabBut cu-li">
<li id="tab_setting_1" class="on" onclick="SwapTab('setting','on','',1,1);"><?php echo L('catgory_basic');?></li>
</ul>
<div id="div_setting_1" class="contentList pad-10">
<table width="100%" class="table_form ">
<tr>
<th width="200"><?php echo L('parent_category')?>:</th>
<td>
<?php echo form::select_category('category_content_'.$this->siteid,$parentid,'name="info[parentid]"',L('please_select_parent_category'),0,-1);?>
</td>
</tr>
<tr>
<th><?php echo L('catname')?>:</th>
<td><input type="text" name="info[catname]" id="catname" class="input-text" value="<?php echo $catname;?>"></td>
</tr>
<tr>
<th><?php echo L('catgory_img')?>:</th>
<td><?php echo form::images('info[image]', 'image', $image, 'content');?></td>
</tr>
<tr>
<th><?php echo L('link_url')?>:</th>
<td><input type="text" name="info[url]" id="url" size="50" class="input-text" value="<?php echo $url;?>"></td>
</tr>
</table>
</div>
<div class="bk15"></div>
<input name="catid" type="hidden" value="<?php echo $catid;?>">
<input name="type" type="hidden" value="<?php echo $type;?>">
<input name="dosubmit" type="submit" value="<?php echo L('submit')?>" class="button">
</form>
</div>
</div>
<!--table_form_off-->
</div>
<script language="JavaScript">
<!--
window.top.$('#display_center_id').css('display','none');
function SwapTab(name,cls_show,cls_hide,cnt,cur){
for(i=1;i<=cnt;i++){
if(i==cur){
$('#div_'+name+'_'+i).show();
$('#tab_'+name+'_'+i).attr('class',cls_show);
}else{
$('#div_'+name+'_'+i).hide();
$('#tab_'+name+'_'+i).attr('class',cls_hide);
}
}
}
//-->
</script> | PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header');
?>
<div class="pad_10">
<div class="table-list">
<table width="100%" cellspacing="0">
<thead>
<tr>
<th width="80">Siteid</th>
<th><?php echo L('site_name')?></th>
<th><?php echo L('site_dirname')?></th>
<th><?php echo L('site_domain')?></th>
<th align="center"><?php echo L('godaddy')?></th>
<th width="150"><?php echo L('operations_manage')?></th>
</tr>
</thead>
<tbody>
<?php
if(is_array($list)):
foreach($list as $v):
?>
<tr>
<td width="80" align="center"><?php echo $v['siteid']?></td>
<td align="center"><?php echo $v['name']?></td>
<td align="center"><?php echo $v['dirname']?></td>
<td align="center"><?php echo $v['domain']?></td>
<td align="center"><?php if ($v['siteid']!=1){?><?php echo pc_base::load_config('system', 'html_root')?>/<?php echo $v['dirname'];} else{echo '/';}?></td>
<td align="center"><a href="javascript:edit(<?php echo $v['siteid']?>, '<?php echo new_addslashes(htmlspecialchars($v['name']))?>')"><?php echo L('edit')?></a> |
<?php if($v['siteid']!=1) { ?><a href="?m=admin&c=site&a=del&siteid=<?php echo $v['siteid']?>" onclick="return confirm('<?php echo new_addslashes(htmlspecialchars(L('confirm', array('message'=>$v['name']))))?>')"><?php echo L('delete')?></a><?php } else { ?><font color="#cccccc"><?php echo L('delete')?></font><?php } ?></td>
</tr>
<?php
endforeach;
endif;
?>
</tbody>
</table>
</div>
</div>
<div id="pages"><?php echo $pages?></div>
<script type="text/javascript">
<!--
function edit(id, name) {
window.top.art.dialog({id:'edit'}).close();
window.top.art.dialog({title:'<?php echo L('edit_site')?>《'+name+'》',id:'edit',iframe:'?m=admin&c=site&a=edit&siteid='+id,width:'700',height:'500'}, function(){var d = window.top.art.dialog({id:'edit'}).data.iframe;d.document.getElementById('dosubmit').click();return false;}, function(){window.top.art.dialog({id:'edit'}).close()});
}
//-->
</script>
</body>
</html> | PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header');
?>
<link href="<?php echo CSS_PATH?>jquery.treeTable.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<?php echo JS_PATH?>jquery.treetable.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#dnd-example").treeTable({
indent: 20
});
});
function checknode(obj)
{
var chk = $("input[type='checkbox']");
var count = chk.length;
var num = chk.index(obj);
var level_top = level_bottom = chk.eq(num).attr('level')
for (var i=num; i>=0; i--)
{
var le = chk.eq(i).attr('level');
if(eval(le) < eval(level_top))
{
chk.eq(i).attr("checked",true);
var level_top = level_top-1;
}
}
for (var j=num+1; j<count; j++)
{
var le = chk.eq(j).attr('level');
if(chk.eq(num).attr("checked")==true) {
if(eval(le) > eval(level_bottom)) chk.eq(j).attr("checked",true);
else if(eval(le) == eval(level_bottom)) break;
}
else {
if(eval(le) > eval(level_bottom)) chk.eq(j).attr("checked",false);
else if(eval(le) == eval(level_bottom)) break;
}
}
}
</script>
<?php if($siteid) {?>
<div class="table-list" id="load_priv">
<table width="100%" cellspacing="0">
<thead>
<tr>
<th class="text-l cu-span" style='padding-left:30px;'><span onClick="javascript:$('input[name=menuid[]]').attr('checked', true)"><?php echo L('selected_all');?></span>/<span onClick="javascript:$('input[name=menuid[]]').attr('checked', false)"><?php echo L('cancel');?></span></th>
</tr>
</thead>
</table>
<form name="myform" action="?m=admin&c=role&a=role_priv" method="post">
<input type="hidden" name="roleid" value="<?php echo $roleid?>"></input>
<input type="hidden" name="siteid" value="<?php echo $siteid?>"></input>
<table width="100%" cellspacing="0" id="dnd-example">
<tbody>
<?php echo $categorys;?>
</tbody>
</table>
<div class="btn"><input type="submit" class="button" name="dosubmit" id="dosubmit" value="<?php echo L('submit');?>" /></div>
</form>
</div>
<?php } else {?>
<style type="text/css">
.guery{background: url(<?php echo IMG_PATH?>msg_img/msg_bg.png) no-repeat 0px -560px;padding:10px 12px 10px 45px; font-size:14px; height:100px; line-height:96px}
.guery{background-position: left -460px;}
</style>
<center>
<div class="guery" style="display:inline-block;display:-moz-inline-stack;zoom:1;*display:inline;">
<?php echo L('select_site');?>
</div>
</center>
<?php }?>
</body>
</html>
| PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
$show_header = 1;
include $this->admin_tpl('header');
?>
<div class="pad-10">
<form action="?m=admin&c=module&a=install" method="post" id="myform">
<div>
<table width="100%" class="table_form">
<tr>
<th width="80"><?php echo L('modulename')?>:</th>
<td class="y-bg"><?php echo $modulename?></td>
</tr>
<tr>
<th width="80"><?php echo L('introduce')?>:</th>
<td class="y-bg"><?php echo $introduce?></td>
</tr>
<tr>
<th width="80"><?php echo L('moduleauthor')?>:</th>
<td class="y-bg"><?php echo $author?></td>
</tr>
<tr>
<th width="80">E-mail:</th>
<td class="y-bg"><?php echo $authoremail?></td>
</tr>
<tr>
<th width="80"><?php echo L('homepage')?>:</th>
<td class="y-bg"><?php echo $authorsite?></td>
</tr>
</table>
</div>
<div class="bk15"></div><input type="hidden" name="module" value="<?php echo $_GET['module']?>">
<input type="submit" class="dialog" id="dosubmit" name="dosubmit" value="<?php echo L('submit')?>" />
</div>
</div>
</form>
</body>
</html> | PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header');?>
<?php if(ROUTE_A=='init') {?>
<form name="myform" action="?m=admin&c=menu&a=listorder" method="post">
<div class="pad-lr-10">
<div class="table-list">
<table width="100%" cellspacing="0">
<thead>
<tr>
<th width="80"><?php echo L('listorder');?></th>
<th width="100">id</th>
<th><?php echo L('menu_name');?></th>
<th><?php echo L('operations_manage');?></th>
</tr>
</thead>
<tbody>
<?php echo $categorys;?>
</tbody>
</table>
<div class="btn"><input type="submit" class="button" name="dosubmit" value="<?php echo L('listorder')?>" /></div> </div>
</div>
</div>
</form>
</body>
</html>
<?php } elseif(ROUTE_A=='add') {?>
<script type="text/javascript">
<!--
$(function(){
$.formValidator.initConfig({formid:"myform",autotip:true,onerror:function(msg,obj){window.top.art.dialog({content:msg,lock:true,width:'200',height:'50'}, function(){this.close();$(obj).focus();})}});
$("#language").formValidator({onshow:"<?php echo L("input").L('chinese_name')?>",onfocus:"<?php echo L("input").L('chinese_name')?>",oncorrect:"<?php echo L('input_right');?>"}).inputValidator({min:1,onerror:"<?php echo L("input").L('chinese_name')?>"});
$("#name").formValidator({onshow:"<?php echo L("input").L('menu_name')?>",onfocus:"<?php echo L("input").L('menu_name')?>",oncorrect:"<?php echo L('input_right');?>"}).inputValidator({min:1,onerror:"<?php echo L("input").L('menu_name')?>"});
$("#m").formValidator({onshow:"<?php echo L("input").L('module_name')?>",onfocus:"<?php echo L("input").L('module_name')?>",oncorrect:"<?php echo L('input_right');?>"}).inputValidator({min:1,onerror:"<?php echo L("input").L('module_name')?>"});
$("#c").formValidator({onshow:"<?php echo L("input").L('file_name')?>",onfocus:"<?php echo L("input").L('file_name')?>",oncorrect:"<?php echo L('input_right');?>"}).inputValidator({min:1,onerror:"<?php echo L("input").L('file_name')?>"});
$("#a").formValidator({tipid:'a_tip',onshow:"<?php echo L("input").L('action_name')?>",onfocus:"<?php echo L("input").L('action_name')?>",oncorrect:"<?php echo L('input_right');?>"}).inputValidator({min:1,onerror:"<?php echo L("input").L('action_name')?>"});
})
//-->
</script>
<div class="common-form">
<form name="myform" id="myform" action="?m=admin&c=menu&a=add" method="post">
<table width="100%" class="table_form contentWrap">
<tr>
<th width="200"><?php echo L('menu_parentid')?>:</th>
<td><select name="info[parentid]" >
<option value="0"><?php echo L('no_parent_menu')?></option>
<?php echo $select_categorys;?>
</select></td>
</tr>
<tr>
<th > <?php echo L('chinese_name')?>:</th>
<td><input type="text" name="language" id="language" class="input-text" ></td>
</tr>
<tr>
<th><?php echo L('menu_name')?>:</th>
<td><input type="text" name="info[name]" id="name" class="input-text" ></td>
</tr>
<tr>
<th><?php echo L('module_name')?>:</th>
<td><input type="text" name="info[m]" id="m" class="input-text" ></td>
</tr>
<tr>
<th><?php echo L('file_name')?>:</th>
<td><input type="text" name="info[c]" id="c" class="input-text" ></td>
</tr>
<tr>
<th><?php echo L('action_name')?>:</th>
<td><input type="text" name="info[a]" id="a" class="input-text" > <span id="a_tip"></span><?php echo L('ajax_tip')?></td>
</tr>
<tr>
<th><?php echo L('att_data')?>:</th>
<td><input type="text" name="info[data]" class="input-text" ></td>
</tr>
<tr>
<th><?php echo L('menu_display')?>:</th>
<td><input type="radio" name="info[display]" value="1" checked> <?php echo L('yes')?><input type="radio" name="info[display]" value="0"> <?php echo L('no')?></td>
</tr>
</table>
<!--table_form_off-->
</div>
<div class="bk15"></div>
<div class="btn"><input type="submit" id="dosubmit" class="button" name="dosubmit" value="<?php echo L('submit')?>"/></div>
</div>
</form>
<?php } elseif(ROUTE_A=='edit') {?>
<script type="text/javascript">
<!--
$(function(){
$.formValidator.initConfig({formid:"myform",autotip:true,onerror:function(msg,obj){window.top.art.dialog({content:msg,lock:true,width:'200',height:'50'}, function(){this.close();$(obj).focus();})}});
$("#language").formValidator({onshow:"<?php echo L("input").L('chinese_name')?>",onfocus:"<?php echo L("input").L('chinese_name')?>",oncorrect:"<?php echo L('input_right');?>"}).inputValidator({min:1,onerror:"<?php echo L("input").L('chinese_name')?>"});
$("#name").formValidator({onshow:"<?php echo L("input").L('menu_name')?>",onfocus:"<?php echo L("input").L('menu_name')?>",oncorrect:"<?php echo L('input_right');?>"}).inputValidator({min:1,onerror:"<?php echo L("input").L('menu_name')?>"});
$("#m").formValidator({onshow:"<?php echo L("input").L('module_name')?>",onfocus:"<?php echo L("input").L('module_name')?>",oncorrect:"<?php echo L('input_right');?>"}).inputValidator({min:1,onerror:"<?php echo L("input").L('module_name')?>"});
$("#c").formValidator({onshow:"<?php echo L("input").L('file_name')?>",onfocus:"<?php echo L("input").L('file_name')?>",oncorrect:"<?php echo L('input_right');?>"}).inputValidator({min:1,onerror:"<?php echo L("input").L('file_name')?>"});
$("#a").formValidator({tipid:'a_tip',onshow:"<?php echo L("input").L('action_name')?>",onfocus:"<?php echo L("input").L('action_name')?>",oncorrect:"<?php echo L('input_right');?>"}).inputValidator({min:1,onerror:"<?php echo L("input").L('action_name')?>"});
})
//-->
</script>
<div class="common-form">
<form name="myform" id="myform" action="?m=admin&c=menu&a=edit" method="post">
<table width="100%" class="table_form contentWrap">
<tr>
<th width="200"><?php echo L('menu_parentid')?>:</th>
<td><select name="info[parentid]" style="width:200px;">
<option value="0"><?php echo L('no_parent_menu')?></option>
<?php echo $select_categorys;?>
</select></td>
</tr>
<tr>
<th> <?php echo L('for_chinese_lan')?>:</th>
<td><input type="text" name="language" id="language" class="input-text" value="<?php echo L($name,'','',1)?>"></td>
</tr>
<tr>
<th><?php echo L('menu_name')?>:</th>
<td><input type="text" name="info[name]" id="name" class="input-text" value="<?php echo $name?>"></td>
</tr>
<tr>
<th><?php echo L('module_name')?>:</th>
<td><input type="text" name="info[m]" id="m" class="input-text" value="<?php echo $m?>"></td>
</tr>
<tr>
<th><?php echo L('file_name')?>:</th>
<td><input type="text" name="info[c]" id="c" class="input-text" value="<?php echo $c?>"></td>
</tr>
<tr>
<th><?php echo L('action_name')?>:</th>
<td><input type="text" name="info[a]" id="a" class="input-text" value="<?php echo $a?>"> <span id="a_tip"></span><?php echo L('ajax_tip')?></td>
</tr>
<tr>
<th><?php echo L('att_data')?>:</th>
<td><input type="text" name="info[data]" class="input-text" value="<?php echo $data?>"></td>
</tr>
<tr>
<th><?php echo L('menu_display')?>:</th>
<td><input type="radio" name="info[display]" value="1" <?php if($display) echo 'checked';?>> <?php echo L('yes')?><input type="radio" name="info[display]" value="0" <?php if(!$display) echo 'checked';?>> <?php echo L('no')?></td>
</tr>
</table>
<!--table_form_off-->
</div>
<div class="bk15"></div>
<input name="id" type="hidden" value="<?php echo $id?>">
<div class="btn"><input type="submit" id="dosubmit" class="button" name="dosubmit" value="<?php echo L('submit')?>"/></div>
</div>
</form>
<?php }?>
</body>
</html> | PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header');?>
<style type="text/css">
.table-list td b{color:#666}
.tpl_style{background-color:#FBFAE3}
</style>
<form name="myform" action="?m=admin&c=category&a=batch_edit" method="post">
<div class="pad_10">
<div class="explain-col">
<?php echo L('category_batch_tips');?></a>
</div>
<div class="bk10"></div>
<div id="table-lists" class="table-list" >
<table height="auto" cellspacing="0" >
<thead >
<?php
foreach($batch_array as $catid=>$cat) {
$batch_array[$catid]['setting'] = string2array($cat['setting']);
echo "<th width='260' align='left' ><strong>{$cat[catname]} (catid: <font color='red'>{$catid}</font>)</strong></th>";
}
?>
</thead>
<tbody>
<tr>
<?php
foreach($batch_array as $catid=>$cat) {
?>
<td><b><?php echo L('catname')?>:</b><br><input type='text' name='info[<?php echo $catid;?>][catname]' id='catname' class='input-text' value='<?php echo $cat['catname']?>' style='width:250px'></td>
<?php
}
?>
</tr>
<tr>
<?php
foreach($batch_array as $catid=>$cat) {
?>
<td><b><?php echo L('catdir')?>:</b><br><input type='text' name='info[<?php echo $catid;?>][catdir]' id='catname' class='input-text' value='<?php echo $cat['catdir']?>' style='width:250px'></td>
<?php
}
?>
</tr>
<tr>
<?php
foreach($batch_array as $catid=>$cat) {
?>
<td><b><?php echo L('catgory_img')?>:</b><br><?php echo form::images('info['.$catid.'][image]', 'image'.$catid, $cat['image'], 'content','',23);?></td>
<?php
}
?>
</tr>
<tr>
<?php
foreach($batch_array as $catid=>$cat) {
?>
<td><b><?php echo L('description')?>:</b><br><textarea name="info[<?php echo $catid;?>][description]" maxlength="255" style="width:240px;height:40px;"><?php echo $cat['description'];?></textarea></td>
<?php
}
?>
</tr>
<tr>
<?php
foreach($batch_array as $catid=>$cat) {
?>
<td class="tpl_style"><b><?php echo L('available_styles')?>:</b><br>
<?php echo form::select($template_list, $cat['setting']['template_list'], 'name="setting['.$catid.'][template_list]" id="template_list" onchange="load_file_list(this.value,'.$catid.')"', L('please_select'))?>
</td>
<?php
}
?>
</tr>
<tr>
<?php
foreach($batch_array as $catid=>$cat) {
?>
<td class="tpl_style"><b><?php echo L('category_index_tpl')?>:</b><br>
<div id="category_template<?php echo $catid;?>">
<?php echo form::select_template($cat['setting']['template_list'], 'content',$cat['setting']['category_template'],'name="setting['.$catid.'][category_template]" style="width:250px"','category');?>
</div>
</td>
<?php
}
?>
</tr>
<tr>
<?php
foreach($batch_array as $catid=>$cat) {
?>
<td class="tpl_style"><b><?php echo L('category_list_tpl')?>:</b><br>
<div id="list_template<?php echo $catid;?>">
<?php echo form::select_template($cat['setting']['template_list'], 'content',$cat['setting']['list_template'],'name="setting['.$catid.'][list_template]" style="width:250px"','list');?>
</div>
</td>
<?php
}
?>
</tr>
<tr>
<?php
foreach($batch_array as $catid=>$cat) {
?>
<td class="tpl_style"><b><?php echo L('content_tpl')?>:</b><br>
<div id="show_template<?php echo $catid;?>">
<?php echo form::select_template($cat['setting']['template_list'], 'content',$cat['setting']['show_template'],'name="setting['.$catid.'][show_template]" style="width:250px"','show');?>
</div>
</td>
<?php
}
?>
</tr>
<tr>
<?php
foreach($batch_array as $catid=>$cat) {
?>
<td><b><?php echo L('workflow')?>:</b><br><?php echo form::select($workflows_datas,$cat['setting']['workflowid'],'name="setting['.$catid.'][workflowid]"',L('catgory_not_need_check'));?></td>
<?php
}
?>
</tr>
<tr>
<?php
foreach($batch_array as $catid=>$cat) {
?>
<td><b><?php echo L('ismenu')?>:</b><br>
<input boxid="ismenu" type='radio' name='info[<?php echo $catid;?>][ismenu]' value='1' <?php if($cat['ismenu']) echo 'checked';?> onclick="change_radio(event,'ismenu',1)"> <?php echo L('yes');?>
<input boxid="ismenu" type='radio' name='info[<?php echo $catid;?>][ismenu]' value='0' <?php if(!$cat['ismenu']) echo 'checked';?> onclick="change_radio(event,'ismenu',0)"> <?php echo L('no');?>
</td>
<?php
}
?>
</tr>
<tr>
<?php
foreach($batch_array as $catid=>$cat) {
?>
<td><b><?php echo L('html_category')?>:</b><br>
<input boxid="ishtml" catid="<?php echo $catid;?>" type='radio' name='setting[<?php echo $catid;?>][ishtml]' value='1' <?php if($cat['setting']['ishtml']) echo 'checked';?> onClick="change_radio(event,'ishtml',1,'category');urlrule('category',1,<?php echo $catid;?>)"> <?php echo L('yes');?>
<input boxid="ishtml" catid="<?php echo $catid;?>" type='radio' name='setting[<?php echo $catid;?>][ishtml]' value='0' <?php if(!$cat['setting']['ishtml']) echo 'checked';?> onClick="change_radio(event,'ishtml',0,'category');urlrule('category',0,<?php echo $catid;?>)"> <?php echo L('no');?>
</td>
<?php
}
?>
</tr>
<tr>
<?php
foreach($batch_array as $catid=>$cat) {
?>
<td><b><?php echo L('html_show')?>:</b><br>
<input boxid="content_ishtml" catid="<?php echo $catid;?>" type='radio' name='setting[<?php echo $catid;?>][content_ishtml]' value='1' <?php if($cat['setting']['content_ishtml']) echo 'checked';?> onClick="change_radio(event,'content_ishtml',1,'show');urlrule('show',1,<?php echo $catid;?>)"> <?php echo L('yes');?>
<input boxid="content_ishtml" catid="<?php echo $catid;?>" type='radio' name='setting[<?php echo $catid;?>][content_ishtml]' value='0' <?php if(!$cat['setting']['content_ishtml']) echo 'checked';?> onClick="change_radio(event,'content_ishtml',0,'show');urlrule('show',0,<?php echo $catid;?>)"> <?php echo L('no');?>
</td>
<?php
}
?>
</tr>
<tr>
<?php
foreach($batch_array as $catid=>$cat) {
?>
<td><b><?php echo L('category_urlrules')?>:</b><br>
<div id="category_php_ruleid<?php echo $catid;?>" style="display:<?php if($cat['setting']['ishtml']) echo 'none';?>">
<?php
echo form::urlrule('content','category',0,$cat['setting']['category_ruleid'],'name="category_php_ruleid['.$catid.']" style="width:250px;"');
?>
</div>
<div id="category_html_ruleid<?php echo $catid;?>" style="display:<?php if(!$cat['setting']['ishtml']) echo 'none';?>">
<?php
echo form::urlrule('content','category',1,$cat['setting']['category_ruleid'],'name="category_html_ruleid['.$catid.']" style="width:250px;"');
?>
</div>
</td>
<?php
}
?>
</tr>
<tr>
<?php
foreach($batch_array as $catid=>$cat) {
?>
<td><b><?php echo L('show_urlrules')?>:</b><br>
<div id="show_php_ruleid<?php echo $catid;?>" style="display:<?php if($cat['setting']['content_ishtml']) echo 'none';?>">
<?php
echo form::urlrule('content','show',0,$cat['setting']['show_ruleid'],'name="show_php_ruleid['.$catid.']" style="width:250px;"');
?>
</div>
<div id="show_html_ruleid<?php echo $catid;?>" style="display:<?php if(!$cat['setting']['content_ishtml']) echo 'none';?>">
<?php
echo form::urlrule('content','show',1,$cat['setting']['show_ruleid'],'name="show_html_ruleid['.$catid.']" style="width:250px;"');
?>
</div>
</td>
<?php
}
?>
</tr>
<tr>
<?php
foreach($batch_array as $catid=>$cat) {
?>
<td><b><?php echo L('create_to_rootdir')?>:</b><br>
<input boxid="create_to_html_root" onclick="change_radio(event,'create_to_html_root',1)" type='radio' name='setting[<?php echo $catid;?>][create_to_html_root]' value='1' <?php if($cat['setting']['create_to_html_root']) echo 'checked';?> > <?php echo L('yes');?>
<input boxid="create_to_html_root" onclick="change_radio(event,'create_to_html_root',0)" type='radio' name='setting[<?php echo $catid;?>][create_to_html_root]' value='0' <?php if(!$cat['setting']['create_to_html_root']) echo 'checked';?> > <?php echo L('no');?>
</td>
<?php
}
?>
</tr>
<tr>
<?php
foreach($batch_array as $catid=>$cat) {
?>
<td><b><?php echo L('meta_title')?>:</b><br>
<input name='setting[<?php echo $catid;?>][meta_title]' type='text' value='<?php echo $cat['setting']['meta_title'];?>' style='width:250px'>
</td>
<?php
}
?>
</tr>
<tr>
<?php
foreach($batch_array as $catid=>$cat) {
?>
<td><b><?php echo L('meta_keywords')?>:</b><br>
<input name='setting[<?php echo $catid;?>][meta_keywords]' type='text' value='<?php echo $cat['setting']['meta_keywords'];?>' style='width:250px'>
</td>
<?php
}
?>
</tr>
<tr>
<?php
foreach($batch_array as $catid=>$cat) {
?>
<td><b><?php echo L('meta_description')?>:</b><br>
<input name='setting[<?php echo $catid;?>][meta_description]' type='text' value='<?php echo $cat['setting']['meta_description'];?>' style='width:250px'>
</td>
<?php
}
?>
</tr>
<tr>
<?php
foreach($batch_array as $catid=>$cat) {
?>
<td><b><?php echo L('contribute_add_point')?>:</b><br>
<input name='setting[<?php echo $catid;?>][presentpoint]' type='text' value='<?php echo $cat['setting']['presentpoint'];?>' style='width:100px' maxlength='60'>
<?php echo L('point');?> </td>
<?php
}
?>
</tr>
<tr>
<?php
foreach($batch_array as $catid=>$cat) {
?>
<td><b><?php echo L('default_readpoint')?>:</b><br>
<input name='setting[<?php echo $catid;?>][defaultchargepoint]' type='text' value='<?php echo $cat['setting']['defaultchargepoint'];?>' style='width:100px' maxlength='60'>
<select name="setting[<?php echo $catid;?>][paytype]"><option value="0" <?php if(!$cat['setting']['paytype']) echo 'selected';?>><?php echo L('readpoint');?></option><option value="1" <?php if($cat['setting']['paytype']) echo 'selected';?>><?php echo L('money');?></option></select> </td>
<?php
}
?>
</tr>
<tr>
<?php
foreach($batch_array as $catid=>$cat) {
?>
<td><b><?php echo L('repeatchargedays')?>:</b><br>
<input name='setting[<?php echo $catid;?>][repeatchargedays]' type='text' value='<?php echo $cat['setting']['repeatchargedays'];?>' style='width:100px' maxlength='60'><?php echo L('repeat_tips');?>
</td>
<?php
}
?>
</tr>
</tbody>
</table>
<div class="btn">
<input type="hidden" name="pc_hash" value="<?php echo $_SESSION['pc_hash'];?>" />
<input type="hidden" name="type" value="<?php echo $type;?>" />
<input type="submit" class="button" name="dosubmit" value="<?php echo L('submit')?>" /></div>
<BR><BR>
</div>
</div>
</div>
</form>
<script language="JavaScript">
<!--
$(document).keydown(function(event) {
if(event.keyCode==37) {
window.scrollBy(-100,0);
} else if(event.keyCode==39) {
window.scrollBy(100,0);
}
});
function change_radio(oEvent,boxid,value,type) {
altKey = oEvent.altKey;
if(altKey) {
var obj = $("input[boxid="+boxid+"][value="+value+"]");
obj.attr('checked',true);
if(type){
obj.each(function(){
urlrule(type,value,$(this).attr('catid'));
})
}
}
}
window.top.$('#display_center_id').css('display','none');
function urlrule(type,html,catid) {
if(type=='category') {
if(html) {
$('#category_php_ruleid'+catid).css('display','none');$('#category_html_ruleid'+catid).css('display','');
} else {
$('#category_php_ruleid'+catid).css('display','');$('#category_html_ruleid'+catid).css('display','none');;
}
} else {
if(html) {
$('#show_php_ruleid'+catid).css('display','none');$('#show_html_ruleid'+catid).css('display','');
} else {
$('#show_php_ruleid'+catid).css('display','');$('#show_html_ruleid'+catid).css('display','none');;
}
}
}
function load_file_list(id,catid) {
if(id=='') return false;
$.getJSON('?m=admin&c=category&a=public_tpl_file_list&batch_str=1&style='+id+'&catid='+catid, function(data){
if(data==null) return false;
$('#category_template'+catid).html(data.category_template);$('#list_template'+catid).html(data.list_template);$('#show_template'+catid).html(data.show_template);});
}
//-->
</script>
</body>
</html>
| PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
$show_dialog = 1;
include $this->admin_tpl('header','admin');
?>
<div class="pad-lr-10">
<form name="searchform" action="?m=admin&c=ipbanned&a=search_ip&menuid=<?php echo $_GET['menuid'];?>" method="get" >
<input type="hidden" value="admin" name="m">
<input type="hidden" value="ipbanned" name="c">
<input type="hidden" value="search_ip" name="a">
<table width="100%" cellspacing="0" class="search-form">
<tbody>
<tr>
<td><div class="explain-col">IP: <input type="text" value="" class="input-text" name="search[ip]"> <input type="submit" value="<?php echo L('search')?>" class="button" name="dosubmit">
</div>
</td>
</tr>
</tbody>
</table>
</form>
<form name="myform" id="myform" action="?m=admin&c=ipbanned&a=delete" method="post" onsubmit="checkuid();return false;">
<div class="table-list">
<table width="100%" cellspacing="0">
<thead>
<tr>
<th width="35" align="center"><input type="checkbox" value="" id="check_box" onclick="selectall('ipbannedid[]');"></th>
<th width="30%">IP</th>
<th ><?php echo L('deblocking_time')?></th>
<th width="120"><?php echo L('operations_manage')?></th>
</tr>
</thead>
<tbody>
<?php
if(is_array($infos)){
foreach($infos as $info){
?>
<tr>
<td align="center">
<input type="checkbox" name="ipbannedid[]" value="<?php echo $info['ipbannedid']?>">
</td>
<td width="30%" align="left"><span class="<?php echo $info['style']?>"><?php echo $info['ip']?></span> </td>
<td align="center"><?php echo date('Y-m-d H:i', $info['expires']);?></td>
<td align="center"><a href="javascript:confirmurl('?m=admin&c=ipbanned&a=delete&ipbannedid=<?php echo $info['ipbannedid']?>', "<?php echo L('confirm_del_ip')?>")"><?php echo L('delete')?></a> </td>
</tr>
<?php
}
}
?></tbody>
</table>
<div class="btn">
<a href="#" onClick="javascript:$('input[type=checkbox]').attr('checked', true)"><?php echo L('selected_all')?></a>/<a href="#" onClick="javascript:$('input[type=checkbox]').attr('checked', false)"><?php echo L('cancel')?></a>
<input type="submit" name="submit" class="button" value="<?php echo L('remove_all_selected')?>" onClick="return confirm('<?php echo L('confirm', array('message' => L('selected')))?>')" />
</div>
<div id="pages"><?php echo $pages?></div>
</div>
</form></div>
</body>
</html>
<script type="text/javascript">
function checkuid() {
var ids='';
$("input[name='ipbannedid[]']:checked").each(function(i, n){
ids += $(n).val() + ',';
});
if(ids=='') {
window.top.art.dialog({content:"<?php echo L('before_select_operation')?>",lock:true,width:'200',height:'50',time:1.5},function(){});
return false;
} else {
myform.submit();
}
}
</script>
| PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header');
?>
<script type="text/javascript">
<!--
$(function(){
$.formValidator.initConfig({formid:"myform",autotip:true,onerror:function(msg,obj){window.top.art.dialog({content:msg,lock:true,width:'200',height:'50'}, function(){this.close();$(obj).focus();})}});
$("#ip").formValidator({onshow:"<?php echo L('input').L('ipbanned')?>",onfocus:"<?php echo L('input').L('ipbanned')?>"}).inputValidator({min:1,onerror:"<?php echo L('input').L('ipbanned')?>"}).regexValidator({regexp:"notempty",datatype:"enum",param:'i',onerror:"<?php echo L('three_types')?>"}).ajaxValidator({type : "get",url : "",data :"m=admin&c=ipbanned&a=public_name",datatype : "html",async:'false',success : function(data){ if( data == "1" ){return true;}else{return false;}},buttons: $("#dosubmit"),onerror : "<?php echo L('ip_exit')?>",onwait : "<?php echo L('connecting')?>"});
$("#expires").formValidator({onshow:"<?php echo L('input').L('deblocking_time')?>",onfocus:"<?php echo L('input').L('deblocking_time')?>",oncorrect:"<?php echo L('time_isok')?>"}).inputValidator({min:1,onerror:"<?php echo L('time_ismust')?>"});
})
//-->
</script>
<div class="pad_10">
<form action="?m=admin&c=ipbanned&a=add" method="post" name="myform" id="myform" >
<table width="100%" cellpadding="2" cellspacing="1" class="table_form">
<tr>
<th width="60">IP :</th>
<td><input type="text" name="info[ip]" id="ip" size="25"></td>
</tr>
<tr>
<th><?php echo L('deblocking_time')?> :</th>
<td><?php echo form::date('info[expires]', '', '')?></td>
</tr>
<input type="submit" name="dosubmit" id="dosubmit" class="dialog" value=" <?php echo L('submit')?> ">
</table>
</form>
</div>
</body>
</html> | PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header');
?>
<script type="text/javascript">
<!--
$(function(){
$.formValidator.initConfig({formid:"myform",autotip:true,onerror:function(msg,obj){window.top.art.dialog({content:msg,lock:true,width:'200',height:'50'}, function(){this.close();$(obj).focus();})}});
$("#name").formValidator({onshow:"<?php echo L('input').L('release_point_name')?>",onfocus:"<?php echo L('input').L('release_point_name')?>"}).inputValidator({min:1,onerror:"<?php echo L('input').L('release_point_name')?>"}).ajaxValidator({type : "get",url : "",data :"m=admin&c=release_point&a=public_name",datatype : "html",async:'false',success : function(data){ if( data == "1" ){return true;}else{return false;}},buttons: $("#dosubmit"),onerror : "<?php echo L('release_point_name').L('exists')?>",onwait : "<?php echo L('connecting')?>"});
$("#host").formValidator({onshow:"<?php echo L('input').L('server_address')?>",onfocus:"<?php echo L('input').L('server_address')?>"}).inputValidator({min:1,onerror:"<?php echo L('input').L('server_address')?>"});
$("#port").formValidator({onshow:"<?php echo L('input').L('server_port')?>",onfocus:"<?php echo L('input').L('server_port')?>",defaultvalue:'21'}).inputValidator({min:1,onerror:"<?php echo L('input').L('server_port')?>"}).regexValidator({datatype:'enum',regexp:'intege1',onerror:'<?php echo L('server_ports_must_be_integers')?>'}).defaultPassed();
$("#username").formValidator({onshow:"<?php echo L('input').L('username')?>",onfocus:"<?php echo L('input').L('username')?>"}).inputValidator({min:1,onerror:"<?php echo L('input').L('username')?>"});
$("#password").formValidator({onshow:"<?php echo L('input').L('password')?>",onfocus:"<?php echo L('input').L('password')?>"}).inputValidator({min:1,onerror:"<?php echo L('input').L('password')?>"});
})
//-->
</script>
<div class="pad-10">
<form action="?m=admin&c=release_point&a=add" method="post" id="myform">
<fieldset>
<legend><?php echo L('basic_configuration')?></legend>
<table width="100%" class="table_form">
<tr>
<th width="80"><?php echo L('release_point_name')?>:</th>
<td class="y-bg"><input type="text" class="input-text" name="name" id="name" size="30" /></td>
</tr>
</table>
</fieldset>
<div class="bk15"></div>
<fieldset>
<legend><?php echo L('ftp_server')?></legend>
<table width="100%" class="table_form">
<tr>
<th width="80"><?php echo L('server_address')?>:</th>
<td class="y-bg"><input type="text" class="input-text" name="host" id="host" size="30" /></td>
</tr>
<tr>
<th width="80"><?php echo L("server_port")?>:</th>
<td class="y-bg"><input type="text" class="input-text" name="port" id="port" size="30" /></td>
</tr>
<tr>
<th><?php echo L('username')?>:</th>
<td class="y-bg"><input type="text" class="input-text" name="username" id="username" size="30" /></td>
</tr>
<tr>
<th><?php echo L('password')?>:</th>
<td class="y-bg"><input type="password" class="input-text" name="password" id="password" size="30" /></td>
</tr>
<tr>
<th><?php echo L('path')?>:</th>
<td class="y-bg"><input type="text" class="input-text" name="path" id="path" size="30" value="/" /></td>
</tr>
<tr>
<th><?php echo L('passive_mode')?>:</th>
<td class="y-bg"><label><input type="checkbox" class="inputcheckbox" name="pasv" value="1" id="pasv" size="30" /><?php echo L('yes')?></label></td>
</tr>
<tr>
<th><?php echo L('ssl_connection')?>:</th>
<td class="y-bg"><label><input type="checkbox" class="inputcheckbox" name="ssl" value="1" id="ssl" size="30" <?php if(!$this->ssl){ echo 'disabled';}?> /><?php echo L('yes')?></label> <?php if(!$this->ssl){ echo '<span style="color:red">'.L('your_server_will_not_support_the_ssl_connection').'</a>';}?></td>
</tr>
</tr>
<tr>
<th><?php echo L('test_connections')?>:</th>
<td class="y-bg"><input type="button" class="button" onclick="ftp_test()" value="<?php echo L('test_connections')?>" /></td>
</tr>
</table>
</fieldset>
<div class="bk15"></div>
<input type="submit" class="dialog" id="dosubmit" name="dosubmit" value="<?php echo L('submit')?>" />
</div>
</div>
<script type="text/javascript">
<!--
function ftp_test() {
if(!$.formValidator.isOneValid('host')) {
$('#host').focus();
return false;
}
if(!$.formValidator.isOneValid('port')) {
$('#port').focus();
return false;
}
if(!$.formValidator.isOneValid('username')) {
$('#username').focus();return false;
}
if(!$.formValidator.isOneValid('password')) {
$('#password').focus();return false;
}
var host = $('#host').val();
var port = $('#port').val();
var username = $('#username').val();
var password = $('#password').val();
var pasv = $("input[type='checkbox'][name='pasv']:checked").val();
var ssl = $("input[type='checkbox'][name='ssl']:checked").val();
$.get("?",{m:'admin',c:'release_point',a:'public_test_ftp', host:host,port:port,username:username,password:password,pasv:pasv,ssl:ssl}, function(data){
if (data==1){
alert('<?php echo L('ftp_server_connections_success')?>');
} else {
alert(data);
}
})
}
//-->
</script>
</form>
</body>
</html> | PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header', 'admin');
?>
<link href="<?php echo CSS_PATH?>appcenter.css" rel="stylesheet" type="text/css" />
<div class="pad_10">
<table width="90%" cellspacing="0" cellpadding="0" border="0" class="tb4col">
<thead>
<tr>
<td colspan="4" align="left" bgcolor="#F2F9FF" class="thd"><?php if($recommed) {?><div class="r"><img src="<?php echo IMG_PATH?>zt.jpg" width="50" height="40"/> </div><?php }?>
<img src="<?php echo $thumb ? $thumb : IMG_PATH.'zz_bg.jpg'?>" width="40" height="40" class="imgbh"/>
<h5><?php echo $appname?></h5>
<p><?php echo $description?></p></td>
</tr>
</thead>
<tbody>
<tr>
<td align="left" width="50%" class="clj"><h6><?php echo L('plugin_pub','','plugin')?></h6>
<?php if(empty($iframe)) {?>
<a href="<?php echo $downurl?>" title="<?php echo $appname?>"><?php echo L('plugin_click_download','','plugin')?></a>
<?php }?>
<a href="index.php?m=admin&c=plugin&a=install_online&id=<?php echo $id?>"><?php echo L('install_online','','plugin')?></a></td>
<td align="left" width="50%"><strong><?php echo L('plugin_reg_time','','plugin')?></strong><?php echo date('Y-m-d H:i:s',$inputtime)?><br />
<strong><?php echo L('plugin_copyright','','plugin')?></strong><?php echo $username?> </td>
</tr>
<tr>
<td colspan="2" align="left"><?php echo L('plugin_copyright_info','','plugin')?></td>
</tr>
</tbody>
</table>
</body>
<a href="javascript:edit(<?php echo $v['siteid']?>, '<?php echo $v['name']?>')">
</html>
<script type="text/javascript">
<!--
function add(id, name) {
window.top.art.dialog({title:'<?php echo L('edit')?>--'+name, id:'add', iframe:'?m=pay&c=payment&a=add&code='+id ,width:'700',height:'500'}, function(){var d = window.top.art.dialog({id:'add'}).data.iframe;
var form = d.document.getElementById('dosubmit');form.click();return false;}, function(){window.top.art.dialog({id:'add'}).close()});
}
function edit(id, name) {
window.top.art.dialog({title:'<?php echo L('edit')?>--'+name, id:'edit', iframe:'?m=pay&c=payment&a=edit&id='+id ,width:'700',height:'500'}, function(){var d = window.top.art.dialog({id:'edit'}).data.iframe;
var form = d.document.getElementById('dosubmit');form.click();return false;}, function(){window.top.art.dialog({id:'edit'}).close()});
}
//-->
</script> | PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header', 'admin');
?>
<link href="<?php echo CSS_PATH?>open_admin.css" rel="stylesheet" type="text/css" />
<div class="pad_10">
<div class="table-list">
<div class="fs14"><?php echo L('uninstall_plugin','','plugin')?> - <?php echo $plugin_data['name']?></div>
<div class="btn ibtn ibtns">
<div class="fs14 txtc"><?php echo L('uninstall_plugin','','plugin')?></div>
<form name="myform" action="?m=admin&c=plugin&a=delete" method="post">
<input type="submit" class="button" name="dosubmit" value="<?php echo L('plugin_uninstall_confirm','','plugin')?>">
<input type="hidden" value="<?php echo $pluginid?>" name="pluginid">
<input type="hidden" value="<?php echo $_SESSION['pc_hash']?>" name="pc_hash">
</form>
<input type="button" onclick="history.go(-1);" value="<?php echo L('plugin_uninstall_cancel','','plugin')?>" class="button" name="cancel">
</div>
</div>
</div>
</div>
</body>
<a href="javascript:edit(<?php echo $v['siteid']?>, '<?php echo $v['name']?>')">
</html>
| PHP |
<?php defined('IN_ADMIN') or exit('No permission resources.'); ?>
<!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=<?php echo CHARSET?>" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<title><?php echo L('phpcms_logon')?></title>
<style type="text/css">
div{overflow:hidden; *display:inline-block;}div{*display:block;}
.login_box{background:url(<?php echo IMG_PATH?>admin_img/login_bg.jpg) no-repeat; width:602px; height:416px; overflow:hidden; position:absolute; left:50%; top:50%; margin-left:-301px; margin-top:-208px;}
.login_iptbox{bottom:90px;_bottom:72px;color:#FFFFFF;font-size:12px;height:30px;left:50%;margin-left:-150px;position:absolute;width:300px; overflow:visible;}
.login_iptbox .ipt{height:24px; width:110px; margin-right:22px; color:#fff; background:url(<?php echo IMG_PATH?>admin_img/ipt_bg.jpg) repeat-x; *line-height:24px; border:none; color:#000; overflow:hidden;}
.login_iptbox label{ *position:relative; *top:-6px;}
.login_iptbox .ipt_reg{margin-left:12px;width:46px; margin-right:16px; background:url(<?php echo IMG_PATH?>admin_img/ipt_bg.jpg) repeat-x; *overflow:hidden;text-align:center;}
.login_tj_btn{ background:url(<?php echo IMG_PATH?>admin_img/login_dl_btn.jpg) no-repeat 0px 0px; width:52px; height:24px; margin-left:16px; border:none; cursor:pointer; padding:0px; float:right;}
.yzm{position:absolute; background:url(<?php echo IMG_PATH?>admin_img/login_ts140x89.gif) no-repeat; width:140px; height:89px;right:56px;top:-96px; text-align:center; font-size:12px; display:none;color:red; padding-top:8px; line-height:24px; left:0px;}
.yzm a:link,.yzm a:visited{color:#036;text-decoration:none;}
.yzm a:hover{color:#C30;}
.yzm img{cursor:pointer; margin:4px auto 7px; width:130px; height:50px; border:1px solid #fff;}
.cr{font-size:12px;font-style:inherit;text-align:center;color:#ccc;width:100%; position:absolute; bottom:58px;}
.cr a{color:#ccc;text-decoration:none;}
.img_boxs{position:absolute;}
</style>
<script language="JavaScript">
<!--
if(top!=self)
if(self!=top) top.location=self.location;
//-->
</script>
</head>
<body onload="javascript:document.myform.code.focus();">
<div id="login_bg" class="login_box">
<div class="login_iptbox">
<form action="index.php?m=admin&c=index&a=public_card&card=1&dosubmit=1" method="post" name="myform"><input name="dosubmit" value="" type="submit" class="login_tj_btn" />
<input type="hidden" name="rand" value="<?php echo $rand['rand']?>" />
<input type="text" name="code" id="code" class="ipt" /> <img src="<?php echo $rand['url']?>" height="24" class="img_boxs" />
<div id="yzm" class="yzm" style="display:block"><?php echo L('please_input_your_password_the_picture_corresponding_location_6_digits')?></div>
</form>
</div>
<div class="cr"><?php echo L("copyright")?></div>
</div>
</body>
</html> | PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
$show_validator = true;
include $this->admin_tpl('header');
?>
<script type="text/javascript">
<!--
$(function(){
$.formValidator.initConfig({autotip:true,formid:"myform",onerror:function(msg){}});
$("#rolename").formValidator({onshow:"<?php echo L('input').L('role_name')?>",onfocus:"<?php echo L('role_name').L('not_empty')?>"}).inputValidator({min:1,max:999,onerror:"<?php echo L('role_name').L('not_empty')?>"});
})
//-->
</script>
<div class="pad_10">
<div class="common-form">
<form name="myform" action="?m=admin&c=role&a=add" method="post" id="myform">
<table width="100%" class="table_form contentWrap">
<tr>
<td><?php echo L('role_name')?></td>
<td><input type="text" name="info[rolename]" value="" class="input-text" id="rolename"></input></td>
</tr>
<tr>
<td><?php echo L('role_description')?></td>
<td><textarea name="info[description]" rows="2" cols="20" id="description" class="inputtext" style="height:100px;width:500px;"></textarea></td>
</tr>
<tr>
<td><?php echo L('enabled')?></td>
<td><input type="radio" name="info[disabled]" value="0" checked> <?php echo L('enable')?> <label><input type="radio" name="info[disabled]" value="1"><?php echo L('ban')?></td>
</tr>
<tr>
<td><?php echo L('listorder')?></td>
<td><input type="text" name="info[listorder]" size="3" class="input-text"></td>
</tr>
</table>
<div class="bk15"></div>
<input name="dosubmit" type="submit" value="<?php echo L('submit')?>" class="button">
</form>
</div>
</div>
</body>
</html>
| PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
$show_validator = true;include $this->admin_tpl('header');?>
<script type="text/javascript">
$(document).ready(function() {
$.formValidator.initConfig({autotip:true,formid:"myform",onerror:function(msg){}});
$("#old_password").formValidator({empty:true,onshow:"<?php echo L('not_change_the_password_please_leave_a_blank')?>",onfocus:"<?php echo L('password').L('between_6_to_20')?>",oncorrect:"<?php echo L('old_password_right')?>"}).inputValidator({min:6,max:20,onerror:"<?php echo L('password').L('between_6_to_20')?>"}).ajaxValidator({
type : "get",
url : "",
data :"m=admin&c=admin_manage&a=public_password_ajx",
datatype : "html",
async:'false',
success : function(data){
if( data == "1" )
{
return true;
}
else
{
return false;
}
},
buttons: $("#dosubmit"),
onerror : "<?php echo L('old_password_wrong')?>",
onwait : "<?php echo L('connecting_please_wait')?>"
});
$("#new_password").formValidator({empty:true,onshow:"<?php echo L('not_change_the_password_please_leave_a_blank')?>",onfocus:"<?php echo L('password').L('between_6_to_20')?>"}).inputValidator({min:6,max:20,onerror:"<?php echo L('password').L('between_6_to_20')?>"});
$("#new_pwdconfirm").formValidator({empty:true,onshow:"<?php echo L('not_change_the_password_please_leave_a_blank')?>",onfocus:"<?php echo L('input').L('passwords_not_match')?>",oncorrect:"<?php echo L('passwords_match')?>"}).compareValidator({desid:"new_password",operateor:"=",onerror:"<?php echo L('input').L('passwords_not_match')?>"});
})
</script>
<div class="pad_10">
<div class="common-form">
<form name="myform" action="?m=admin&c=admin_manage&a=public_edit_pwd" method="post" id="myform">
<input type="hidden" name="info[userid]" value="<?php echo $userid?>"></input>
<input type="hidden" name="info[username]" value="<?php echo $username?>"></input>
<table width="100%" class="table_form contentWrap">
<tr>
<td width="80"><?php echo L('username')?></td>
<td><?php echo $username?> (<?php echo L('realname')?> <?php echo $realname?>)</td>
</tr>
<tr>
<td><?php echo L('email')?></td>
<td>
<?php echo $email?>
</td>
</tr>
<tr>
<td><?php echo L('old_password')?></td>
<td><input type="password" name="old_password" id="old_password" class="input-text"></input></td>
</tr>
<tr>
<td><?php echo L('new_password')?></td>
<td><input type="password" name="new_password" id="new_password" class="input-text"></input></td>
</tr>
<tr>
<td><?php echo L('new_pwdconfirm')?></td>
<td><input type="password" name="new_pwdconfirm" id="new_pwdconfirm" class="input-text"></input></td>
</tr>
</table>
<div class="bk15"></div>
<input name="dosubmit" type="submit" value="<?php echo L('submit')?>" class="button" id="dosubmit">
</form>
</div>
</div>
</body>
</html>
| PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
$show_dialog = 1;
include $this->admin_tpl('header','admin');
?>
<div class="pad-lr-10">
<form name="searchform" action="?m=admin&c=log&a=search_log&menuid=<?php echo $_GET['menuid'];?>" method="get" >
<input type="hidden" value="admin" name="m">
<input type="hidden" value="log" name="c">
<input type="hidden" value="search_log" name="a">
<table width="100%" cellspacing="0" class="search-form">
<tbody>
<tr>
<td><div class="explain-col"><?php echo L('module')?>: <?php echo form::select($module_arr,'','name="search[module]"',$default)?> <?php echo L('username')?> <input type="text" value="phpcms" class="input-text" name="search[username]" size='10'> <?php echo L('times')?> <?php echo form::date('search[start_time]','','1')?> <?php echo L('to')?> <?php echo form::date('search[end_time]','','1')?> <input type="submit" value="<?php echo L('determine_search')?>" class="button" name="dosubmit"> <input type="button" class="button" name="del_log_4" value="<?php echo L('removed_data')?>" onclick="location='?m=admin&c=log&a=delete&week=4&menuid=<?php echo $_GET['menuid'];?>&pc_hash=<?php echo $_SESSION['pc_hash'];?>'" />
</div>
</td>
</tr>
</tbody>
</table>
</form>
<form name="myform" id="myform" action="?m=admin&c=log&a=delete" method="post" onsubmit="checkuid();return false;">
<div class="table-list">
<table width="100%" cellspacing="0">
<thead>
<tr>
<th width="80"><?php echo L('username')?></th>
<th ><?php echo L('module')?></th>
<th ><?php echo L('file')?></th>
<th width="120"><?php echo L('time')?></th>
<th width="120">IP</th>
</tr>
</thead>
<tbody>
<?php
if(is_array($infos)){
foreach($infos as $info){
?>
<tr>
<td align="center"><?php echo $info['username']?></td>
<td align="center"><?php echo $info['module']?></td>
<td align="left" title="<?php echo $info['querystring']?>"><?php echo str_cut($info['querystring'], 40);?></td>
<td align="center"><?php echo $info['time'];//echo $info['lastusetime'] ? date('Y-m-d H:i', $info['lastusetime']):''?></td>
<td align="center"><?php echo $info['ip']?> </td>
</tr>
<?php
}
}
?></tbody>
</table>
<div class="btn">
</div>
<div id="pages"><?php echo $pages?></div>
</div>
</form>
</div>
</body>
</html>
<script type="text/javascript">
function checkuid() {
var ids='';
$("input[name='logid[]']:checked").each(function(i, n){
ids += $(n).val() + ',';
});
if(ids=='') {
window.top.art.dialog({content:'<?php echo L('select_operations')?>',lock:true,width:'200',height:'50',time:1.5},function(){});
return false;
} else {
myform.submit();
}
}
</script>
| PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header');
?>
<script type="text/javascript">
<!--
$(function(){
$.formValidator.initConfig({formid:"myform",autotip:true,onerror:function(msg,obj){window.top.art.dialog({content:msg,lock:true,width:'200',height:'50'}, function(){this.close();$(obj).focus();})}});
$("#sitename").formValidator({onshow:"<?php echo L('input').L('copyfrom_name');?>",onfocus:"<?php echo L('input').L('copyfrom_name');?>"}).inputValidator({min:1,onerror:"<?php echo L('input').L('copyfrom_name');?>"}).defaultPassed();
$("#siteurl").formValidator({onshow:"<?php echo L('input').L('copyfrom_url');?>",onfocus:"<?php echo L('input').L('copyfrom_url');?>",empty:false}).inputValidator({onerror:"<?php echo L('input').L('copyfrom_url');?>"}).regexValidator({regexp:"^http://",onerror:"<?php echo L('copyfrom_url_tips');?>"}).defaultPassed();
})
//-->
</script>
<div class="pad_10">
<form action="?m=admin&c=copyfrom&a=edit" method="post" name="myform" id="myform" >
<table width="100%" cellpadding="2" cellspacing="1" class="table_form">
<tr>
<th width="60"><?php echo L('copyfrom_name');?> :</th>
<td><input type="text" name="info[sitename]" id="sitename" size="25" value="<?php echo $sitename;?>"></td>
</tr>
<tr>
<th><?php echo L('copyfrom_url')?> :</th>
<td><input type="text" name="info[siteurl]" id="siteurl" size="25" value="<?php echo $siteurl;?>"></td>
</tr>
<tr>
<th><?php echo L('copyfrom_logo')?> :</th>
<td><?php echo form::images('info[thumb]', 'thumb', $thumb, 'admin')?></td>
</tr>
<input type="hidden" name="id" value="<?php echo $id?>">
<input type="submit" name="dosubmit" id="dosubmit" class="dialog" value=" <?php echo L('submit')?> ">
</table>
</form>
</div>
</body>
</html> | PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header');?>
<script type="text/javascript">
$(document).ready(function() {
$.formValidator.initConfig({autotip:true,formid:"myform",onerror:function(msg){}});
$("#name").formValidator({onshow:"<?php echo L('input').L('linkage_name').L('linkage_name_desc')?>",onfocus:"<?php echo L('linkage_name').L('not_empty')?>"}).inputValidator({min:1,max:999,onerror:"<?php echo L('linkage_name').L('not_empty')?>"});
})
</script>
<div class="pad_10">
<div class="common-form">
<form name="myform" action="?m=admin&c=linkage&a=public_sub_add" method="post" id="myform">
<table width="100%" class="table_form contentWrap">
<tr>
<td><?php echo L('level_menu')?></td>
<td>
<?php echo $list?>
</td>
</tr>
<tr>
<td><?php echo L('linkage_name')?></td>
<td>
<textarea name="info[name]" rows="2" cols="20" id="name" class="inputtext" style="height:90px;width:150px;"><?php echo $name?></textarea>
</td>
</tr>
<tr>
<td><?php echo L('menu_description')?></td>
<td>
<textarea name="info[description]" rows="2" cols="20" id="description" class="inputtext" style="height:45px;width:300px;"><?php echo $description?></textarea>
</td>
</tr>
</table>
<div class="bk15"></div>
<input type="hidden" name="keyid" value="<?php echo $keyid?>">
<input name="dosubmit" type="submit" value="<?php echo L('submit')?>" class="dialog" id="dosubmit">
</form>
</div>
</div>
</body>
</html>
| PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header');
?>
<script type="text/javascript">
<!--
$(function(){
$.formValidator.initConfig({formid:"myform",autotip:true,onerror:function(msg,obj){window.top.art.dialog({content:msg,lock:true,width:'200',height:'50'}, function(){this.close();$(obj).focus();})}});
$("#name").formValidator({onshow:"<?php echo L('input').L('release_point_name')?>",onfocus:"<?php echo L('input').L('release_point_name')?>"}).inputValidator({min:1,onerror:"<?php echo L('input').L('release_point_name')?>"}).ajaxValidator({type : "get",url : "",data :"m=admin&c=release_point&a=public_name&id=<?php echo $id?>",datatype : "html",async:'false',success : function(data){ if( data == "1" ){return true;}else{return false;}},buttons: $("#dosubmit"),onerror : "<?php echo L('release_point_name').L('exists')?>",onwait : "<?php echo L('connecting')?>"}).defaultPassed();
$("#host").formValidator({onshow:"<?php echo L('input').L('server_address')?>",onfocus:"<?php echo L('input').L('server_address')?>"}).inputValidator({min:1,onerror:"<?php echo L('input').L('server_address')?>"});
$("#port").formValidator({onshow:"<?php echo L('input').L('server_port')?>",onfocus:"<?php echo L('input').L('server_port')?>"}).inputValidator({min:1,onerror:"<?php echo L('input').L('server_port')?>"}).regexValidator({datatype:'enum',regexp:'intege1',onerror:'<?php echo L('server_ports_must_be_integers')?>'});
$("#username").formValidator({onshow:"<?php echo L('input').L('username')?>",onfocus:"<?php echo L('input').L('username')?>"}).inputValidator({min:1,onerror:"<?php echo L('input').L('username')?>"});
$("#password").formValidator({onshow:"<?php echo L('input').L('password')?>",onfocus:"<?php echo L('input').L('password')?>"}).inputValidator({min:1,onerror:"<?php echo L('input').L('password')?>"});
})
//-->
</script>
<div class="pad-10">
<form action="?m=admin&c=release_point&a=edit&id=<?php echo $id?>" method="post" id="myform">
<fieldset>
<legend><?php echo L('basic_configuration')?></legend>
<table width="100%" class="table_form">
<tr>
<th width="80"><?php echo L('release_point_name')?>:</th>
<td class="y-bg"><input type="text" class="input-text" name="name" id="name" size="30" value="<?php echo $data['name']?>" /></td>
</tr>
</table>
</fieldset>
<div class="bk15"></div>
<fieldset>
<legend><?php echo L('ftp_server')?></legend>
<table width="100%" class="table_form">
<tr>
<th width="80"><?php echo L('server_address')?>:</th>
<td class="y-bg"><input type="text" class="input-text" name="host" id="host" size="30" value="<?php echo $data['host']?>" /></td>
</tr>
<tr>
<th width="80"><?php echo L("server_port")?>:</th>
<td class="y-bg"><input type="text" class="input-text" name="port" id="port" size="30" value="<?php echo $data['port']?>" /></td>
</tr>
<tr>
<th><?php echo L('username')?>:</th>
<td class="y-bg"><input type="text" class="input-text" name="username" id="username" size="30" value="<?php echo $data['username']?>" /></td>
</tr>
<tr>
<th><?php echo L('password')?>:</th>
<td class="y-bg"><input type="password" class="input-text" name="password" id="password" size="30" value="<?php echo $data['password']?> "/></td>
</tr>
<tr>
<th><?php echo L('path')?>:</th>
<td class="y-bg"><input type="text" class="input-text" name="path" id="path" size="30" value="<?php echo $data['path']?>" /></td>
</tr>
<tr>
<th><?php echo L('passive_mode')?>:</th>
<td class="y-bg"><label><input type="checkbox" class="inputcheckbox" name="pasv" id="pasv" value="1" size="30"<?php if ($data['pasv']){echo ' checked';}?> /><?php echo L('yes')?></label></td>
</tr>
<tr>
<th><?php echo L('ssl_connection')?>:</th>
<td class="y-bg"><label><input type="checkbox" class="inputcheckbox" name="ssl" id="ssl" value="1" size="30"<?php if ($data['ssl']){echo ' checked';}?> <?php if(!$this->ssl){ echo 'disabled';}?> /><?php echo L('yes')?></label> <?php if(!$this->ssl){ echo '<span style="color:red">'.L('your_server_will_not_support_the_ssl_connection').'</a>';}?></td>
</tr>
</tr>
<tr>
<th><?php echo L('test_connections')?>:</th>
<td class="y-bg"><input type="button" class="button" onclick="ftp_test()" value="<?php echo L('test_connections')?>" /></td>
</tr>
</table>
</fieldset>
<div class="bk15"></div>
<input type="submit" class="dialog" id="dosubmit" name="dosubmit" value="<?php echo L('submit')?>" />
</div>
</div>
<script type="text/javascript">
<!--
function ftp_test() {
if(!$.formValidator.isOneValid('host')) {
$('#host').focus();
return false;
}
if(!$.formValidator.isOneValid('port')) {
$('#port').focus();
return false;
}
if(!$.formValidator.isOneValid('username')) {
$('#username').focus();return false;
}
if(!$.formValidator.isOneValid('password')) {
$('#password').focus();return false;
}
var host = $('#host').val();
var port = $('#port').val();
var username = $('#username').val();
var password = $('#password').val();
var pasv = $("input[type='checkbox'][name='pasv']:checked").val();
var ssl = $("input[type='checkbox'][name='ssl']:checked").val();
$.get("?",{m:'admin',c:'release_point',a:'public_test_ftp', host:host,port:port,username:username,password:password,pasv:pasv,ssl:ssl}, function(data){
if (data==1){
alert('<?php echo L('ftp_server_connections_success')?>');
} else {
alert(data);
}
})
}
//-->
</script>
</form>
</body>
</html> | PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header');
?>
<script type="text/javascript">
<!--
$(function(){
$.formValidator.initConfig({formid:"myform",autotip:true,onerror:function(msg,obj){window.top.art.dialog({content:msg,lock:true,width:'200',height:'50'}, function(){this.close();$(obj).focus();})}});
$("#file").formValidator({onshow:"<?php echo L('input').L('urlrule_file')?>",onfocus:"<?php echo L('input').L('urlrule_file')?>"}).regexValidator({regexp:"^([a-zA-Z0-9]|[_]){0,20}$",onerror:"<?php echo L('enter_the_correct_catname');?>"}).inputValidator({min:1,onerror:"<?php echo L('input').L('urlrule_file')?>"});
$("#example").formValidator({onshow:"<?php echo L('input').L('urlrule_example')?>",onfocus:"<?php echo L('input').L('urlrule_example')?>"}).inputValidator({min:1,onerror:"<?php echo L('input').L('urlrule_example')?>"});
$("#urlrule").formValidator({onshow:"<?php echo L('input').L('urlrule_url')?>",onfocus:"<?php echo L('input').L('urlrule_url')?>"}).inputValidator({min:1,onerror:"<?php echo L('input').L('urlrule_url')?>"});
})
//-->
</script>
<style type="text/css">
.input-botton {
border:none;
border-bottom:1px dotted #E1A035;
background:none;
}
</style>
<div class="pad_10">
<table width="100%" cellpadding="2" cellspacing="1" class="table_form">
<form action="?m=admin&c=urlrule&a=add" method="post" name="myform" id="myform">
<tr>
<th width="20%"><?php echo L('urlrule_file')?> :</th>
<td><input type="text" name="info[file]" id="file" size="20"></td>
</tr>
<tr>
<th width="20%"><?php echo L('urlrule_module')?> :</th>
<td><?php echo form::select($modules,'content',"name='info[module]' id='module'");?></td>
</tr>
<tr>
<th width="20%"><?php echo L('urlrule_ishtml')?> :</th>
<td>
<input type="radio" value="1" name="info[ishtml]" /><?php echo L('yes');?>
<input type="radio" value="0" name="info[ishtml]" checked="checked" /><?php echo L('no');?>
</td>
</tr>
<tr>
<th width="20%"><?php echo L('urlrule_example')?> :</th>
<td><input type="text" name="info[example]" id="example" size="70"></td>
</tr>
<tr>
<th width="20%"><?php echo L('urlrule_url')?> :</th>
<td><input type="text" name="info[urlrule]" id="urlrule" size="70">
</td>
</tr>
<tr>
<th width="20%"><?php echo L('urlrule_func')?> :</th>
<td><?php echo L('complete_part_path');?>: <input type="text" name="f1" value="{$categorydir}" size="15" class="input-botton">,<?php echo L('category_path');?>:<input type="text" name="f1" value="{$catdir}" size="10" class="input-botton">
<div class="bk6"></div>
<?php echo L('year');?>:<input type="text" name="f1" value="{$year}" size="7" class="input-botton"> <?php echo L('month');?>:<input type="text" name="f1" value="{$month}" size="9" class="input-botton">,<?php echo L('day');?>:<input type="text" name="f1" value="{$day}" size="7" class="input-botton"> ID:<input type="text" name="f1" value="{$id}" size="4" class="input-botton">, <?php echo L('paging');?>:<input type="text" name="f1" value="{$page}" size="7" class="input-botton">
</td>
</tr>
<input type="submit" name="dosubmit" id="dosubmit" class="dialog" value=" <?php echo L('submit')?> ">
</form>
</table>
</div>
</body>
</html> | PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header');
?>
<form action="?m=admin&c=role&a=setting_cat_priv&roleid=<?php echo $roleid?>&siteid=<?php echo $siteid?>&op=2" method="post">
<div class="table-list" id="load_priv">
<table width="100%" class="table-list">
<thead>
<tr>
<th width="25"><?php echo L('select_all')?></th><th align="left"><?php echo L('title_varchar')?></th><th width="25"><?php echo L('view')?></th><th width="25"><?php echo L('add')?></th><th width="25"><?php echo L('edit')?></th><th width="25"><?php echo L('delete')?></th><th width="25"><?php echo L('sort')?></th><th width="25"><?php echo L('push')?></th><th width="25"><?php echo L('move')?></th>
</tr>
</thead>
<tbody>
<?php echo $categorys?>
</tbody>
</table>
<div class="btn">
<input type="submit" value="<?php echo L('submit')?>" class="button">
</div>
</div>
</form>
<script type="text/javascript">
<!--
function select_all(name, obj) {
if (obj.checked) {
$("input[type='checkbox'][name='priv["+name+"][]']").attr('checked', 'checked');
} else {
$("input[type='checkbox'][name='priv["+name+"][]']").attr('checked', '');
}
}
//-->
</script>
</body>
</html>
| PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
include PC_PATH.'modules'.DIRECTORY_SEPARATOR.'admin'.DIRECTORY_SEPARATOR.'templates'.DIRECTORY_SEPARATOR.'header.tpl.php';
?>
<div id="main_frameid" class="pad-10 display" style="_margin-right:-12px;_width:98.9%;">
<script type="text/javascript">
$(function(){if ($.browser.msie && parseInt($.browser.version) < 7) $('#browserVersionAlert').show();});
</script>
<div class="explain-col mb10" style="display:none" id="browserVersionAlert">
<?php echo L('ie8_tip')?></div>
<div class="col-2 lf mr10" style="width:48%">
<h6><?php echo L('personal_information')?></h6>
<div class="content">
<?php echo L('main_hello')?><?php echo $admin_username?><br />
<?php echo L('main_role')?><?php echo $rolename?> <br />
<div class="bk20 hr"><hr /></div>
<?php echo L('main_last_logintime')?><?php echo date('Y-m-d H:i:s',$logintime)?><br />
<?php echo L('main_last_loginip')?><?php echo $loginip?> <br />
</div>
</div>
<div class="col-2 col-auto">
<h6><?php echo L('main_safety_tips')?></h6>
<div class="content" style="color:#ff0000;">
<?php if($pc_writeable) {?>
<?php echo L('main_safety_permissions')?><br />
<?php } ?>
<?php if(pc_base::load_config('system','debug')) {?>
<?php echo L('main_safety_debug')?><br />
<?php } ?>
<?php if(!pc_base::load_config('system','errorlog')) {?>
<?php echo L('main_safety_errlog')?><br />
<?php } ?>
<div class="bk20 hr"><hr /></div>
<?php if(pc_base::load_config('system','execution_sql')) {?>
<?php echo L('main_safety_sql')?> <br />
<?php } ?>
<?php if($logsize_warning) {?>
<?php echo L('main_safety_log',array('size'=>$common_cache['errorlog_size'].'MB'))?>
<br />
<?php } ?>
</div>
</div>
<div class="bk10"></div>
<div class="col-2 lf mr10" style="width:48%">
<?php
$ccache = getcache('category_content_1','commons');
if(module_exists('member') && is_array($ccache)) { ?>
<h6><?php echo L('main_shortcut')?></h6>
<div class="content" id="admin_panel">
<?php foreach($adminpanel as $v) {?>
<span>
[<a target="right" href="<?php echo $v['url'].'&menuid='.$v['menuid'];?>&pc_hash=<?php echo $_SESSION['pc_hash'];?>"><?php echo L($v['name'])?></a>]
</span>
<?php }?>
</div>
<?php } else { ?>
<h6>Update Caches</h6>
<div class="content" id="update_tips" style="height:90px; overflow:auto;"><ul id="file" class="sbul">
<div class="pad-10">
<form action="?m=admin&c=cache_all&a=init&pc_hash=<?php echo $_SESSION['pc_hash'];?>" target="cache_if" method="post" id="myform" name="myform">
<input type="hidden" name="dosubmit" value="1">
</form>
<iframe id="cache_if" name="cache_if" class="ifm" width="0" height="0"></iframe>
</div>
<script type="text/javascript">
document.myform.submit();
function addtext(data) {
$('#file').append(data);
document.getElementById('update_tips').scrollTop = document.getElementById('update_tips').scrollHeight;
}
</script>
</div>
<?php }?>
</div>
<div class="col-2 col-auto">
<h6><?php echo L('main_sysinfo')?></h6>
<div class="content">
<?php echo L('main_version')?>Phpcms <?php echo PC_VERSION?> Release <?php echo PC_RELEASE?> [<a href="http://download.phpcms.cn" target="_blank"><?php echo L('main_latest_version')?></a>]<br />
<?php echo L('main_os')?><?php echo $sysinfo['os']?> <br />
<?php echo L('main_web_server')?><?php echo $sysinfo['web_server']?> <br />
<?php echo L('main_sql_version')?><?php echo $sysinfo['mysqlv']?><br />
<?php echo L('main_upload_limit')?><?php echo $sysinfo['fileupload']?><br />
</div>
</div>
<div class="bk10"></div>
<div class="col-2 lf mr10" style="width:48%">
<h6><?php echo L('main_product_team')?></h6>
<div class="content">
<?php echo L('main_copyright')?><?php echo $product_copyright?><br />
<?php echo L('main_product_planning')?><?php echo $architecture?><br />
<?php echo L('main_product_dev')?><?php echo $programmer;?><br />
<?php echo L('main_product_ui')?><?php echo $designer;?><br />
<?php echo L('main_product_site')?><a href="http://www.phpcms.cn/" target="_blank">http://www.phpcms.cn/</a> <br />
<?php echo L('main_product_bbs')?><a href="http://bbs.phpcms.cn/" target="_blank">http://bbs.phpcms.cn/</a>
</div>
</div>
<div class="col-2 col-auto">
<h6><?php echo L('main_license')?></h6>
<div class="content">
<?php echo L('main_version')?>Phpcms <?php echo PC_VERSION?> Release <?php echo PC_RELEASE?> [<a href="http://buy.phpcms.cn" target="_blank"><?php echo L('main_support')?></a>]<br />
<?php echo L('main_license_type')?><span id="phpcms_license"></span> <br />
<?php echo L('main_serial_number')?><span id="phpcms_sn"></span> <br />
</div>
</div>
<div class="bk10"></div>
</div>
</body></html> | PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
$show_dialog = 1;
include $this->admin_tpl('header','admin');
?>
<div class="pad-lr-10">
<form name="searchform" action="?m=admin&c=log&a=search_log&menuid=<?php echo $_GET['menuid'];?>" method="get" >
<input type="hidden" value="admin" name="m">
<input type="hidden" value="log" name="c">
<input type="hidden" value="search_log" name="a">
<table width="100%" cellspacing="0" class="search-form">
<tbody>
<tr>
<td><div class="explain-col"><?php echo L('module')?>: <?php echo form::select($module_arr,'','name="search[module]"',$default)?> 用户名: <input type="text" value=<?php echo $_GET['search']['username'];?> class="input-text" name="search[username]" size='10'> 时 间: <?php echo form::date('search[start_time]',$_GET['search']['start_time'],'1')?> 至 <?php echo form::date('search[end_time]',$_GET['search']['end_time'],'1')?> <input type="submit" value="确定搜索" class="button" name="dosubmit">
</div>
</td>
</tr>
</tbody>
</table>
</form>
<form name="myform" id="myform" action="?m=admin&c=log&a=delete" method="post" onsubmit="checkuid();return false;">
<div class="table-list">
<table width="100%" cellspacing="0">
<thead>
<tr>
<th width="35" align="center"><input type="checkbox" value="" id="check_box" onclick="selectall('logid[]');"></th>
<th width="80"><?php echo L('username')?></th>
<th ><?php echo L('module')?></th>
<th ><?php echo L('file')?></th>
<th width="120"><?php echo L('time')?></th>
<th width="120">IP</th>
</tr>
</thead>
<tbody>
<?php
if(is_array($infos)){
foreach($infos as $info){
?>
<tr>
<td align="center">
<input type="checkbox" name="logid[]" value="<?php echo $info['logid']?>">
</td>
<td align="center"><?php echo $info['username']?></td>
<td align="center"><?php echo $info['module']?></td>
<td align="left" title="<?php echo $info['querystring']?>"><?php echo str_cut($info['querystring'], 40);?></td>
<td align="center"><?php echo $info['time'];//echo $info['lastusetime'] ? date('Y-m-d H:i', $info['lastusetime']):''?></td>
<td align="center"><?php echo $info['ip']?> </td>
</tr>
<?php
}
}
?></tbody>
</table>
<div class="btn">
</div>
<div id="pages"><?php echo $pages?></div>
</div>
</form></div>
</body>
</html>
<script type="text/javascript">
function checkuid() {
var ids='';
$("input[name='logid[]']:checked").each(function(i, n){
ids += $(n).val() + ',';
});
if(ids=='') {
window.top.art.dialog({content:'<?php echo L('select_operations')?>',lock:true,width:'200',height:'50',time:1.5},function(){});
return false;
} else {
myform.submit();
}
}
</script>
| PHP |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.