📄 ads_place.inc.php
字号:
<?php
defined('IN_PHPCMS') or exit('Access Denied');
require MOD_ROOT.'include/ads_place.class.php';
$submenu = array
(
array('<font color="red">'.$LANG['add_advertisement'].'</font>', '?mod='.$mod.'&file='.$file.'&action=add'),
array($LANG['manage_advertisement'], '?mod='.$mod.'&file='.$file.'&action=manage'),
array($LANG['manage_the_order_of_advertisement'], '?mod='.$mod.'&file=ads&action=manage'),
array($LANG['update_html_and_js'], '?mod='.$mod.'&file=ads_place&action=createhtml'),
);
$menu = admin_menu($LANG['manage_advertisement'], $submenu);
$action = $action ? $action : 'manage';
$adsplace = new ads_place();
switch($action)
{
case 'manage':
$condition = array();
if($passed >=0 && isset($passed)) $condition[] = "`passed` = '$passed' " ;
if(trim($field))
{
$field = trim($field);
$q = trim($q);
if(in_array($field,array('introduce','placename')) )
{
$condition[] = "`$field` LIKE '%$q%' " ;//骞垮憡浠嬬粛/鍚嶇О
}
else
{
$condition[] = "`$field` = '$q' " ;//骞垮憡ID
}
}
$places = array();
$page = isset($page) ? intval($page) : 1;
$infos = $adsplace->get_list($condition, $page, $pagesize);
$passed = isset($passed) ?$passed:-1;
$places = $infos['info'];
$pages = $infos['pages'];
include admin_tpl('ads_place_manage');
break;
case 'add':
if($dosubmit)
{
$id = $adsplace->add($place);
if(!$id) showmessage($adsplace->msg(), 'goback');
$priv_group->update('p_adsid', $id, $priv_groupid);
$priv_role->update('p_adsid', $id, $priv_roleid);
showmessage($LANG['opration_completed'], '?mod=ads&file=ads_place&action=manage');
}
else
{
$groups = $GROUP;
$roles = $ROLE;
unset($GROUP, $ROLE);
include admin_tpl('ads_place_add');
}
break;
case 'edit':
if($dosubmit)
{
$placeid = intval($placeid);
if(!$placeid) showmessage($LANG['illegal_move_parameters']);
$where = ' `placeid`='.$placeid;
if(!$adsplace->edit($place, $where)) showmessage($adsplace->msg(), '?mod=ads&file=ads_place');
$priv_group->update('p_adsid', $placeid, $priv_groupid);
$priv_role->update('p_adsid', $placeid, $priv_roleid);
showmessage($LANG['opration_successd_advertising_content_has_been_modified'], '?mod=ads&file=ads_place');
}
else
{
$placeid = intval($placeid);
if(!$placeid) showmessage($LANG['illegal_move_parameters']);
$groups = $GROUP;
$roles = $ROLE;
$place = $adsplace->get($placeid);
unset($GROUP, $ROLE);
include admin_tpl('ads_place_edit');
}
break;
case 'lock':
if(empty($placeid)) showmessage('璇烽
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -