code
stringlengths
1
2.01M
repo_name
stringlengths
3
62
path
stringlengths
1
267
language
stringclasses
231 values
license
stringclasses
13 values
size
int64
1
2.01M
<?php defined('IN_PHPCMS') or exit('No permission resources.'); class index { function __construct() { $this->db = pc_base::load_model('poster_model'); $this->s_db = pc_base::load_model('poster_stat_model'); } public function init() { } /** * 统计广告点击次数 * */ public function poster_click() { $id = isset($_GET['id']) ? intval($_GET['id']) : 0; $r = $this->db->get_one(array('id'=>$id)); if (!is_array($r) && empty($r)) return false; $ip_area = pc_base::load_sys_class('ip_area'); $ip = ip(); $area = $ip_area->get($ip); $username = param::get_cookie('username') ? param::get_cookie('username') : ''; if($id) { $siteid = isset($_GET['siteid']) ? intval($_GET['siteid']) : get_siteid(); $this->s_db->insert(array('siteid'=>$siteid, 'pid'=>$id, 'username'=>$username, 'area'=>$area, 'ip'=>$ip, 'referer'=>HTTP_REFERER, 'clicktime'=>SYS_TIME, 'type'=> 1)); } $this->db->update(array('clicks'=>'+=1'), array('id'=>$id)); $setting = string2array($r['setting']); if (count($setting)==1) { $url = $setting['1']['linkurl']; } else { $url = isset($_GET['url']) ? $_GET['url'] : $setting['1']['linkurl']; } header('Location: '.$url); } /** * php方式展示广告 */ public function show_poster() { if(!$_GET['id']) exit(); $id = intval($_GET['id']); $sdb = pc_base::load_model('poster_space_model'); $now = SYS_TIME; $siteid = get_siteid(); $r = $sdb->get_one(array('siteid'=>$siteid, 'spaceid'=>$id)); if($r['setting']) $r['setting'] = string2array($r['setting']); $poster_template = getcache('poster_template_'.$siteid, 'commons'); if ($poster_template[$r['type']]['option']) { $where = "`spaceid`='".$id."' AND `disabled`=0 AND `startdate`<='".$now."' AND (`enddate`>='".$now."' OR `enddate`=0) "; $pinfo = $this->db->select($where, '*', '', '`listorder` ASC, `id` DESC'); if (is_array($pinfo) && !empty($pinfo)) { foreach ($pinfo as $k => $rs) { if ($rs['setting']) { $rs['setting'] = string2array($rs['setting']); $pinfo[$k] = $rs; } else { unset($pinfo[$k]); } } extract($r); } else { return true; } } else { $where = " `spaceid`='".$id."' AND `disabled`=0 AND `startdate`<='".$now."' AND (`enddate`>='".$now."' OR `enddate`=0)"; $pinfo = $this->db->get_one($where, '*', '`listorder` ASC, `id` DESC'); if (is_array($pinfo) && $pinfo['setting']) { $pinfo['setting'] = string2array($pinfo['setting']); } extract($r); if (!is_array($pinfo) || empty($pinfo)) return true; extract($pinfo, EXTR_PREFIX_SAME , 'p'); } include template('poster', $type); } /** * js传值,统计展示次数 */ public function show() { $siteid = $_GET['siteid'] ? intval($_GET['siteid']) : get_siteid(); $spaceid = $_GET['spaceid'] ? intval($_GET['spaceid']) : 0; $id = $_GET['id'] ? intval($_GET['id']) : 0; if (!$spaceid || !$id) { exit(0); } else { $this->show_stat($siteid, $spaceid, $id); } } /** * 统计广告展示次数 * @param intval $siteid 站点ID * @param intval $spaceid 广告版位ID * @param intval $id 广告ID * @return boolen */ protected function show_stat($siteid = 0, $spaceid = 0, $id = 0) { $M = new_html_special_chars(getcache('poster', 'commons')); if($M['enablehits']==0) return true; //$siteid = intval($siteid); $spaceid = intval($spaceid); $id = intval($id); if(!$id) return false; if(!$siteid || !$spaceid) { $r = $this->db->get_one(array('id'=>$id), 'siteid, spaceid'); $siteid = $r['id']; $spaceid = $r['spaceid']; } $ip = ip(); $ip_area = pc_base::load_sys_class('ip_area'); $area = $ip_area->get($ip); $username = param::get_cookie('username') ? param::get_cookie('username') : ''; $this->db->update(array('hits'=>'+=1'), array('id'=>$id)); $this->s_db->insert(array('pid'=>$id, 'siteid'=>$siteid, 'spaceid'=>$spaceid, 'username'=>$username, 'area'=>$area, 'ip'=>$ip, 'referer'=>HTTP_REFERER, 'clicktime'=>SYS_TIME, 'type'=>0)); return true; } } ?>
108wo
phpcms/modules/poster/index.php
PHP
asf20
4,168
<?php /** * * @param 广告生成js类 */ defined('IN_PHPCMS') or exit('No permission resources.'); class html { private $db, $s_db, $queue; public function __construct() { $this->s_db = pc_base::load_model('poster_space_model'); $this->db = pc_base::load_model('poster_model'); $this->queue = pc_base::load_model('queue_model'); } /** * 生成广告js文件 * @param intval $id 广告版位ID * @return boolen 成功返回true */ public function create_js($id = 0) { $id = intval($id); if (!$id) { $this->msg = L('no_create_js'); return false; } $siteid = get_siteid(); $r = $this->s_db->get_one(array('siteid'=>$siteid, 'spaceid'=>$id)); $now = SYS_TIME; if ($r['setting']) $space_setting = string2array($r['setting']); if ($r['type']=='code') return true; $poster_template = getcache('poster_template_'.$siteid, 'commons'); if ($poster_template[$r['type']]['option']) { $where = "`spaceid`='".$id."' AND `siteid`='".$siteid."' AND `disabled`=0 AND `startdate`<='".$now."' AND (`enddate`>='".$now."' OR `enddate`=0) "; $pinfo = $this->db->select($where, '*', '', '`listorder` ASC, `id` DESC'); if (is_array($pinfo) && !empty($pinfo)) { foreach ($pinfo as $k => $rs) { if ($rs['setting']) { $rs['setting'] = string2array($rs['setting']); $pinfo[$k] = $rs; } else { unset($pinfo[$k]); } } extract($r); } else { return true; } } else { $where = " `spaceid`='".$id."' AND `siteid`='".$siteid."' AND `disabled`=0 AND `startdate`<='".$now."' AND (`enddate`>='".$now."' OR `enddate`=0)"; $pinfo = $this->db->get_one($where, '*', '`listorder` ASC, `id` DESC'); if (is_array($pinfo) && $pinfo['setting']) { $pinfo['setting'] = string2array($pinfo['setting']); } extract($r); if (!is_array($pinfo) || empty($pinfo)) return true; extract($pinfo, EXTR_PREFIX_SAME , 'p'); } $file = CACHE_PATH.$path; ob_start(); include template('poster', $type); $data = ob_get_contents(); ob_end_clean(); $strlen = pc_base::load_config('system','lock_ex') ? file_put_contents($file, $data, LOCK_EX) : file_put_contents($file, $data); @chmod($file,0777); return true; } } ?>
108wo
phpcms/modules/poster/classes/html.class.php
PHP
asf20
2,288
<?php defined('IN_PHPCMS') or exit('No permission resources.'); pc_base::load_app_class('admin','admin',0); pc_base::load_sys_class('form', '', 0); class space extends admin { private $M, $db; function __construct() { parent::__construct(); $setting = new_html_special_chars(getcache('poster', 'commons')); $this->M = $setting[$this->get_siteid()]; $this->db = pc_base::load_model('poster_space_model'); } public function init() { $TYPES = $this->template_type(); $page = max(intval($_GET['page']), 1); $infos = $this->db->listinfo(array('siteid'=>$this->get_siteid()), '`spaceid`', $page); $pages = $this->db->pages; $big_menu = array('javascript:window.top.art.dialog({id:\'add\',iframe:\'?m=poster&c=space&a=add\', title:\''.L('add_space').'\', width:\'540\', height:\'320\'}, 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_space')); include $this->admin_tpl('space_list'); } /** * 添加广告版块 */ public function add() { if (isset($_POST['dosubmit'])) { $space = $this->check($_POST['space']); $space['setting'] = array2string($_POST['setting']); $space['siteid'] = $this->get_siteid(); $spaceid = $this->db->insert($space, true); if ($spaceid) { if ($space['type']=='code') { $path = '{show_ad('.$space['siteid'].', '.$spaceid.')}'; } else { $path = 'poster_js/'.$spaceid.'.js'; } $this->db->update(array('path'=>$path), array('siteid'=>$this->get_siteid(), 'spaceid'=>$spaceid)); showmessage(L('added_successful'), '?m=poster&c=space', '', 'add'); } } else { $TYPES = $this->template_type(); $poster_template = getcache('poster_template_'.$this->get_siteid(), 'commons'); $show_header = $show_validator = true; include $this->admin_tpl('space_add'); } } /** * 编辑广告版位 */ public function edit() { $_GET['spaceid'] = intval($_GET['spaceid']); if (!$_GET['spaceid']) showmessage(L('illegal_operation'), HTTP_REFERER); if (isset($_POST['dosubmit'])) { $space = $this->check($_POST['space']); $space['setting'] = array2string($_POST['setting']); if ($space['type']=='code') { $space['path'] = '{show_ad('.$this->get_siteid().', '.$_GET['spaceid'].')}'; } else { $space['path'] = 'poster_js/'.$_GET['spaceid'].'.js'; } if (isset($_POST['old_type']) && $_POST['old_type']!=$space['type']) { $poster_db = pc_base::load_model('poster_model'); $poster_db->delete(array('spaceid'=>$_GET['spaceid'])); $space['items'] = 0; } if ($this->db->update($space, array('spaceid'=>$_GET['spaceid']))) showmessage(L('edited_successful'), '?m=poster&c=space', '', 'testIframe'.$_GET['spaceid']); } else { $info = $this->db->get_one(array('spaceid' => $_GET['spaceid'])); $setting = string2array($info['setting']); $TYPES = $this->template_type(); $poster_template = getcache('poster_template_'.$this->get_siteid(), 'commons'); $show_header = $show_validator = true; include $this->admin_tpl('space_edit'); } } /** * 广告版位调用代码 */ public function public_call() { $_GET['sid'] = intval($_GET['sid']); if (!$_GET['sid']) showmessage(L('illegal_action'), HTTP_REFERER, '', 'call'); $r = $this->db->get_one(array('spaceid'=>$_GET['sid'], 'siteid'=>$this->get_siteid())); include $this->admin_tpl('space_call'); } /** * 广告预览 */ public function public_preview() { if (is_numeric($_GET['spaceid'])) { $_GET['spaceid'] = intval($_GET['spaceid']); $r = $this->db->get_one(array('spaceid'=>$_GET['spaceid'], 'siteid'=>$this->get_siteid())); $scheme = $_SERVER['SERVER_PORT'] == '443' ? 'https://' : 'http://'; if ($r['type']=='code') { $db = pc_base::load_model('poster_model'); $rs = $db->get_one(array('spaceid'=>$r['spaceid'], 'siteid'=>$this->get_siteid()), 'setting', '`id` ASC'); if ($rs['setting']) { $d = string2array($rs['setting']); $data = $d['code']; } } else { $path = APP_PATH.'caches/'.$r['path']; } include $this->admin_tpl('space_preview'); } } private function template_type() { pc_base::load_app_func('global','poster'); return get_types(); } /** * 删除广告版位 * @param intval $sid 广告版位的ID,当批量删除时系统会递归删除 */ public function delete() { if ((!isset($_GET['spaceid']) || empty($_GET['spaceid'])) && (!isset($_POST['spaceid']) || empty($_POST['spaceid']))) { showmessage(L('illegal_parameters'), HTTP_REFERER); } else { if (is_array($_POST['spaceid'])) { array_map(array($this, _del), $_POST['spaceid']); //如果是批量操作,则递归数组 } elseif($_GET['spaceid']) { $_GET['spaceid'] = intval($_GET['spaceid']); $db = pc_base::load_model('poster_model'); $db->delete(array('siteid'=>$this->get_siteid(), 'spaceid'=>$_GET['spaceid'])); $this->db->delete(array('siteid'=>$this->get_siteid(), 'spaceid' => $_GET['spaceid'])); } showmessage(L('operation_success'), HTTP_REFERER); } } /** * 广告位删除 * @param intval $spaceid 专题ID */ private function _del($spaceid = 0) { $spaceid = intval($spaceid); if (!$spaceid) return false; $db = pc_base::load_model('poster_model'); $db->delete(array('siteid'=>$this->get_siteid(), 'spaceid'=>$spaceid)); $this->db->delete(array('siteid'=>$this->get_siteid(), 'spaceid' => $spaceid)); return true; } /** * 广告模块配置 */ public function setting() { if (isset($_POST['dosubmit'])) { $setting = getcache('poster', 'commons'); $setting[$this->get_siteid()] = $_POST['setting']; setcache('poster', $setting, 'commons'); //设置缓存 $m_db = pc_base::load_model('module_model'); //调用模块数据模型 $setting = array2string($_POST['setting']); $m_db->update(array('setting'=>$setting), array('module'=>ROUTE_M)); //将配置信息存入数据表中 showmessage(L('setting_updates_successful'), HTTP_REFERER, '', 'setting'); } else { @extract($this->M); include $this->admin_tpl('setting'); } } /** * 配置模板 */ public function poster_template() { $tpl_root = pc_base::load_config('system', 'tpl_root'); $templatedir = PC_PATH.$tpl_root.pc_base::load_config('system', 'tpl_name').DIRECTORY_SEPARATOR.'poster'.DIRECTORY_SEPARATOR; $poster_template = getcache('poster_template_'.get_siteid(), 'commons'); $templates = glob($templatedir.'*.html'); if (is_array($templates) && !empty($templates)) { foreach ($templates as $k => $tem) { $templates[$k] = basename($tem, ".html"); } } $big_menu = array('javascript:window.top.art.dialog({id:\'add\',iframe:\'?m=poster&c=space&a=add\', title:\''.L('add_space').'\', width:\'540\', height:\'320\'}, 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_space')); include $this->admin_tpl('poster_template'); } /** * 删除模板配置 */ public function public_tempate_del() { if (!isset($_GET['id'])) showmessage(L('illegal_parameters'), HTTP_REFERER); $siteid = $this->get_siteid(); $poster_template = getcache('poster_template_'.$siteid, 'commons'); if ($poster_template[$_GET['id']]) { unset($poster_template[$_GET['id']]); } setcache('poster_template_'.$siteid, $poster_template, 'commons'); showmessage(L('operation_success'), HTTP_REFERER); } /** * 配置模板 */ public function public_tempate_setting() { $siteid = $this->get_siteid(); $poster_template = getcache('poster_template_'.$siteid, 'commons'); if (isset($_POST['dosubmit'])) { if (is_array($_POST['info']['type']) && !empty($_POST['info']['type'])) { $type2name = array('images'=>L('photo'), 'flash'=>L('flash'), 'text'=>L('title')); $type = array(); foreach ($_POST['info']['type'] as $t) { if (in_array($t, array('images', 'flash', 'text'))) { $type[$t] = $type2name[$t]; } else { continue; } } } unset($_POST['info']['type']); $_POST['info']['type'] = $type; $poster_template[$_POST['template']] = $_POST['info']; setcache('poster_template_'.$siteid, $poster_template, 'commons'); showmessage(L('setting_success'), '', '', 'testIframe'); } else { if (!isset($_GET['template'])) { showmessage(L('illegal_parameters')); } else { $template = $_GET['template']; } if ($poster_template[$template]) { $info = $poster_template[$template]; if (is_array($info['type']) && !empty($info['type'])) { $type = array(); $type = array_keys($info['type']); unset($info['type']); $info['type'] = $type; } } include $this->admin_tpl('template_setting'); } } /** * 更新js */ public function create_js($page = 0) { $page = max(intval($_GET['page']), 1); if ($page==1) { $result = $this->db->get_one(array('disabled'=>0, 'siteid'=>get_siteid()), 'COUNT(*) AS num'); if ($result['num']) { $total = $result['num']; $pages = ceil($total/20); } } else { $pages = $_GET['pages'] ? intval($_GET['pages']) : 0; } $offset = ($page-1)*20; $data = $this->db->listinfo(array('disabled'=>0, 'siteid'=>get_siteid()), 'spaceid ASC', $page); $html = pc_base::load_app_class('html'); foreach ($data as $d) { if ($d['type']!='code') { $html->create_js($d['spaceid']); } else { continue; } } $page++; if ($page>$pages) { showmessage(L('update_js_success'), '?m=poster&c=space&a=init'); } else { showmessage(L('update_js').'<font style="color:red">'.($page-1).'/'.$pages.'</font>', '?m=poster&c=space&a=create_js&page='.$page.'&pages='.$pages); } } /** * 检测版位名称是否存在 */ public function public_check_space() { if (!$_GET['name']) exit(0); if (pc_base::load_config('system', 'charset')=='gbk') { $_GET['name'] = iconv('UTF-8', 'GBK', $_GET['name']); } $name = $_GET['name']; if ($_GET['spaceid']) { $spaceid = intval($_GET['spaceid']); $r = $this->db->get_one(array('spaceid' => $spaceid, 'siteid'=>$this->get_siteid())); if ($r['name'] == $name) { exit('1'); } } $r = $this->db->get_one(array('siteid' => $this->get_siteid(), 'name' => $name), 'spaceid'); if ($r['spaceid']) { exit('0'); } else { exit('1'); } } /** * 检查表单数据 * @param Array $data 表单传递过来的数组 * @return Array 检查后的数组 */ private function check($data = array()) { if ($data['name'] == '') showmessage(L('name_plates_not_empty')); $info = $this->db->get_one(array('name'=>$data['name'], 'siteid'=>$this->get_siteid()), 'spaceid'); if (($info['spaceid'] && $info['spaceid']!=$_GET['spaceid']) || ($info['spaceid'] && !isset($_GET['spaceid']))) { showmessage(L('space_exist'), HTTP_REFERER); } if ((!isset($data['width']) || $data['width']==0) && in_array($data['type'], array('banner', 'fixure', 'float', 'couplet', 'imagechange', 'imagelist'))) { showmessage(L('plate_width_not_empty'), HTTP_REFERER); } else { $data['width'] = intval($data['width']); } if ((!isset($data['height']) || $data['height']==0) && in_array($data['type'], array('banner', 'fixure', 'float', 'couplet', 'imagechange', 'imagelist'))) { showmessage(L('plate_height_not_empty'), HTTP_REFERER); } else { $data['height'] = intval($data['height']); } $TYPES = $this->template_type(); return $data; } } ?>
108wo
phpcms/modules/poster/space.php
PHP
asf20
11,965
<?php defined('IN_PHPCMS') or exit('Access Denied'); defined('INSTALL') or exit('Access Denied'); return array('poster', 'poster_space'); ?>
108wo
phpcms/modules/poster/install/model.php
PHP
asf20
147
function PCMSAD(PID) { this.ID = PID; this.PosID = 0; this.ADID = 0; this.ADType = ""; this.ADName = ""; this.ADContent = ""; this.PaddingLeft = 0; this.PaddingTop = 0; this.Wspaceidth = 0; this.Height = 0; this.IsHitCount = "N"; this.UploadFilePath = ""; this.URL = ""; this.SiteID = 0; this.ShowAD = showADContent; this.Stat = statAD; } function statAD() { var new_element = document.createElement("script"); new_element.type = "text/javascript"; new_element.src="{APP_PATH}index.php?m=poster&c=index&a=show&siteid="+this.SiteID+"&spaceid="+this.ADID+"&id="+this.PosID; document.body.appendChild(new_element); } function showADContent() { var content = this.ADContent; var str = ""; var AD = eval('('+content+')'); if (this.ADType == "images") { str += "<a href='"+this.URL+'&a=poster_click&sitespaceid='+this.SiteID+"&id="+this.ADID+"&url="+AD.Images[0].imgADLinkUrl+"' target='_blank'>"; str += "<img title='"+AD.Images[0].imgADAlt+"' src='"+this.UploadFilePath+AD.Images[0].ImgPath+"' width='"+this.Width+"' height='"+this.Height+"' style='border:0px;'>"; str += "</a>"; }else if(this.ADType == "flash"){ str += "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' width='"+this.Width+"' height='"+this.Height+"' id='FlashAD_"+this.ADID+"' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0'>"; str += "<param name='movie' value='"+this.UploadFilePath+AD.Images[0].ImgPath+"' />"; str += "<param name='quality' value='autohigh' />"; str += "<param name='wmode' value='opaque'/>"; str += "<embed src='"+this.UploadFilePath+AD.Images[0].ImgPath+"' quality='autohigh' wmode='opaque' name='flashad' swliveconnect='TRUE' pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='"+this.Width+"' height='"+this.Height+"'></embed>"; str += "</object>"; } str += ""; document.write(str); } var cmsAD_{$spaceid} = new PCMSAD('cmsAD_{$spaceid}'); cmsAD_{$spaceid}.PosID = {$spaceid}; cmsAD_{$spaceid}.ADID = {$p_id}; cmsAD_{$spaceid}.ADType = "{$p_type}"; cmsAD_{$spaceid}.ADName = "{$p_name}"; cmsAD_{$spaceid}.ADContent = "{'Images':[{'imgADLinkUrl':'{urlencode($p_setting[1]['linkurl'])}','imgADAlt':'{$p_setting[1]['alt']}','ImgPath':'<?php echo $p_type=='images' ? $p_setting[1]['imageurl'] : $p_setting[1]['flashurl'];?>'}],'imgADLinkTarget':'New','Count':'1','showAlt':'Y'}"; cmsAD_{$spaceid}.URL = "{APP_PATH}index.php?m=poster&c=index"; cmsAD_{$spaceid}.SiteID = {$siteid}; cmsAD_{$spaceid}.Width = {$width}; cmsAD_{$spaceid}.Height = {$height}; cmsAD_{$spaceid}.UploadFilePath = ''; cmsAD_{$spaceid}.ShowAD(); var isIE=!!window.ActiveXObject; if (isIE){ if (document.readyState=="complete"){ cmsAD_{$spaceid}.Stat(); } else { document.onreadystatechange=function(){ if(document.readyState=="complete") cmsAD_{$spaceid}.Stat(); } } } else { cmsAD_{$spaceid}.Stat(); }
108wo
phpcms/modules/poster/install/templates/banner.html
HTML
asf20
3,111
function PCMSAD(PID) { this.ID = PID; this.PosID = 0; this.ADID = 0; this.ADType = ""; this.ADName = ""; this.ADContent = ""; this.PaddingLeft = 0; this.PaddingTop = 0; this.Width = 0; this.Height = 0; this.IsHitCount = "N"; this.UploadFilePath = ""; this.URL = ""; this.SiteID = 0; this.ShowAD = showADContent; this.Stat = statAD; } function statAD(id) { var sp = document.createElement("SCRIPT"); sp.type = "text/javascript"; sp.src = "{APP_PATH}index.php?m=poster&c=index&a=show&siteid="+this.SiteID+"&id="+id+"&spaceid="+this.PosID; document.body.appendChild(sp); } function showADContent() { var content = this.ADContent; var isIE=!!window.ActiveXObject; var str = "<div id='PCMSAD_"+this.PosID+"'>"; var AD = eval('('+content+')'); var count = 0; if(AD.ADImage.length){ count = AD.ADImage.length; } for(var i=0;i<count;i++){ if (isIE){ if (document.readyState=="complete"){ this.Stat(AD.ADImage[i].imgID); } else { document.onreadystatechange=function(){ if(document.readyState=="complete") this.Stat(AD.ADImage[i].imgID); } } } else { this.Stat(AD.ADImage[i].imgID); } str += "<li><a href='"+this.URL+"&siteid="+this.SiteID+"&id="+AD.ADImage[i].imgID+"&url="+AD.ADImage[i].imgADLinkUrl+"' target='_blank'><img alt='"+AD.ADImage[i].imgADAlt+"' title='"+AD.ADImage[i].imgADAlt+"' src='"+this.UploadFilePath+AD.ADImage[i].ImgPath+"' "; var sizeStr = ""; if(this.Width==0&&this.Height>0){ sizeStr = " height='"+this.Height+"' "; }else if(this.Width>0&&this.Height==0){ sizeStr = " width='"+this.Width+"' "; }else{ sizeStr = (this.Width < this.Height) ? " width='"+this.Width+"' " : " height='"+this.Height+"' "; } str += sizeStr; str += " style='border:0px;'/></a></li>"; } str += "</div>"; document.write(str); } var cmsAD_{$pinfo[0]['id']} = new PCMSAD('cmsAD_{$pinfo[0]['id']}'); cmsAD_{$pinfo[0]['id']}.PosID = {$spaceid}; cmsAD_{$pinfo[0]['id']}.ADID = {$pinfo[0]['id']}; cmsAD_{$pinfo[0]['id']}.ADType = "{$pinfo[0]['type']}"; cmsAD_{$pinfo[0]['id']}.ADName = "{$pinfo[0]['name']}"; cmsAD_{$pinfo[0]['id']}.ADContent = "{'ADImage':[{loop $pinfo $p} {if $n!=1},{/if} {'imgID':'{$p['id']}','imgADLinkUrl':'{urlencode($p['setting'][1]['linkurl'])}','imgADAlt':'{$p['setting'][1]['alt']}','ImgPath':'{$p['setting'][1]['imageurl']}','imgADLinkTarget':'New','showAlt':'Y'} {/loop}]}"; cmsAD_{$pinfo[0]['id']}.URL = "{APP_PATH}index.php?m=poster&c=index&a=poster_click"; cmsAD_{$pinfo[0]['id']}.SiteID = {$siteid}; cmsAD_{$pinfo[0]['id']}.Width = {$width}; cmsAD_{$pinfo[0]['id']}.Height = {$height}; cmsAD_{$pinfo[0]['id']}.UploadFilePath = ""; cmsAD_{$pinfo[0]['id']}.ShowAD();
108wo
phpcms/modules/poster/install/templates/imagelist.html
HTML
asf20
2,799
function PCMSAD(PID) { this.ID = PID; this.PosID = 0; this.ADID = 0; this.ADType = ""; this.ADName = ""; this.ADContent = ""; this.PaddingLeft = 0; this.PaddingTop = 0; this.Width = 0; this.Height = 0; this.IsHitCount = "N"; this.UploadFilePath = ""; this.Step = 1; this.Delay= 20; this.WindowHeight = 0; this.WindowWidth = 0; this.Yon = 0; this.Xon = 0; this.Pause = true; this.Interval = null; this.URL = ""; this.SiteID = 0; this.ShowAD = showADContent; this.Start = doStart; this.Stat = statAD; } function statAD() { var new_element = document.createElement("script"); new_element.type = "text/javascript"; new_element.src="{APP_PATH}index.php?m=poster&c=index&a=show&siteid="+this.SiteID+"&spaceid="+this.ADID+"&id="+this.PosID; document.body.appendChild(new_element); } function showADContent() { var content = this.ADContent; var str = "<div id='PCMSAD_"+this.PosID+"' style='left:"+this.PaddingLeft+"px;top:"+this.PaddingTop+"px;width:"+this.Width+"px; height:"+this.Height+"px; position: absolute;visibility: visible;z-index:999999;' onMouseOver='"+this.ID+"_pause_resume();' onMouseOut='"+this.ID+"_pause_resume();'>"; var AD = eval('('+content+')'); if (this.ADType == "images") { str += "<a href='"+this.URL+"?m=poster&c=index&a=poster_click&siteid="+this.SiteID+"&id="+this.ADID+"&url="+AD.Images[0].imgADLinkUrl+"' target='_blank'>"; str += "<img title='"+AD.Images[0].imgADAlt+"' src='"+this.UploadFilePath+AD.Images[0].ImgPath+"' width='"+this.Width+"' height='"+this.Height+"' style='border:0px;'>"; str += "</a>"; }else if(this.ADType == "flash"){ str += "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' width='"+this.Width+"' height='"+this.Height+"' id='FlashAD_"+this.PosID+"' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0'>"; str += "<param name='movie' value='"+this.UploadFilePath+AD.Images[0].ImgPath+"' />"; str += "<param name='quality' value='autohigh' />"; str += "<param name='wmode' value='opaque'/>"; str += "<embed wmode='opaque' src='"+this.UploadFilePath+AD.Images[0].ImgPath+"' quality='autohigh' name='flashad' swliveconnect='TRUE' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+this.Width+"' height='"+this.Height+"'></embed>"; str += "</object>"; } str += "<div style='text-align:right;'><a href='#;' onclick='javascript:document.getElementById(\"ZCMSAD_"+this.PosID+"\").style.display=\"none\"'>关闭</a></div>"; str += "</div>"; document.write(str); } function changePos(float) { float.WindowWidth = document.compatMode == "BackCompat" ? document.body.clientWidth : document.documentElement.clientWidth; float.WindowHeight = document.compatMode == "BackCompat" ? document.body.clientHeight : document.documentElement.clientHeight; document.getElementById("PCMSAD_"+float.PosID).style.left = (float.PaddingLeft + (Math.max(document.documentElement.scrollLeft, document.body.scrollLeft)))+"px"; document.getElementById("PCMSAD_"+float.PosID).style.top = (float.PaddingTop + (Math.max(document.documentElement.scrollTop, document.body.scrollTop)))+"px"; if (float.Yon){ float.PaddingTop = float.PaddingTop + float.Step; }else{ float.PaddingTop = float.PaddingTop - float.Step; } if (float.PaddingTop < 0){ float.Yon = 1; float.PaddingTop = 0; } if (float.PaddingTop >= (float.WindowHeight - float.Height)){ float.Yon = 0;float.PaddingTop = (float.WindowHeight - float.Height); } if (float.Xon){ float.PaddingLeft = float.PaddingLeft + float.Step; }else{ float.PaddingLeft = float.PaddingLeft - float.Step; } if (float.PaddingLeft < 0){ float.Xon = 1; float.PaddingLeft = 0; } if (float.PaddingLeft >= (float.WindowWidth - float.Width)){ float.Xon = 0; float.PaddingLeft = (float.WindowWidth - float.Width); } } function doStart(float){ return function(){ changePos(float); } } function cmsAD_{$spaceid}_pause_resume(){if(cmsAD_{$spaceid}.Pause){clearInterval(cmsAD_{$spaceid}.Interval);cmsAD_{$spaceid}.Pause = false;}else {cmsAD_{$spaceid}.Interval = setInterval(cmsAD_{$spaceid}.Start(cmsAD_{$spaceid}),cmsAD_{$spaceid}.Delay);cmsAD_{$spaceid}.Pause = true;}} var cmsAD_{$spaceid} = new PCMSAD('cmsAD_{$spaceid}'); cmsAD_{$spaceid}.PosID = {$spaceid}; cmsAD_{$spaceid}.ADID = {$p_id}; cmsAD_{$spaceid}.ADType = "{$p_type}"; cmsAD_{$spaceid}.ADName = "{$p_name}"; cmsAD_{$spaceid}.ADContent = "{'Images':[{'imgADLinkUrl':'{urlencode($p_setting[1]['linkurl'])}','imgADAlt':'{$p_setting[1]['alt']}','ImgPath':'<?php echo $p_type=='images' ? $p_setting[1]['imageurl'] : $p_setting[1]['flashurl'];?>'}],'imgADLinkTarget':'New','Count':'1','showAlt':'Y'}"; cmsAD_{$spaceid}.URL = "{APP_PATH}index.php?m=poster&c=index"; cmsAD_{$spaceid}.SiteID = {$siteid}; cmsAD_{$spaceid}.PaddingLeft = {if $space_setting['paddleft']} {$space_setting['paddleft']} {else}0{/if}; cmsAD_{$spaceid}.PaddingTop = {if $space_setting['paddtop']} {$space_setting['paddtop']} {else}0{/if}; cmsAD_{$spaceid}.Width = {$width}; cmsAD_{$spaceid}.Height = {$height}; cmsAD_{$spaceid}.UploadFilePath = ""; cmsAD_{$spaceid}.ShowAD(); var isIE=!!window.ActiveXObject; if (isIE){ if (document.readyState=="complete"){ cmsAD_{$spaceid}.Stat(); } else { document.onreadystatechange=function(){ if(document.readyState=="complete") cmsAD_{$spaceid}.Stat(); } } } else { cmsAD_{$spaceid}.Stat(); } document.getElementById('PCMSAD_{$spaceid}').visibility = 'visible'; cmsAD_{$spaceid}.Interval = setInterval(cmsAD_{$spaceid}.Start(cmsAD_{$spaceid}),cmsAD_{$spaceid}.Delay);
108wo
phpcms/modules/poster/install/templates/float.html
HTML
asf20
5,830
{show_ad(1, 15)}
108wo
phpcms/modules/poster/install/templates/test.html
HTML
asf20
16
function PCMSAD(PID) { this.ID = PID; this.PosID = 0; this.ADID = 0; this.ADType = ""; this.ADName = ""; this.ADContent = ""; this.PaddingLeft = 0; this.PaddingTop = 0; this.Width = 0; this.Height = 0; this.IsHitCount = "N"; this.UploadFilePath = ""; this.URL = ""; this.SiteID = 0; this.ShowAD = showADContent; this.Stat = statAD; } function statAD(id) { var sp = document.createElement("SCRIPT"); sp.type = "text/javascript"; sp.src = "{APP_PATH}index.php?m=poster&c=index&a=show&siteid="+this.SiteID+"&id="+id+"&spaceid="+this.PosID; document.body.appendChild(sp); } function showADContent() { var content = this.ADContent; var isIE=!!window.ActiveXObject; var str = "<div id='PCMSAD_"+this.PosID+"'>"; var AD = eval('('+content+')'); var count = 0; if(AD.ADText.length){ count = AD.ADText.length; } for(var i=0;i<count;i++){ if (isIE){ if (document.readyState=="complete"){ this.Stat(AD.ADText[i].textID); } else { document.onreadystatechange=function(){ if(document.readyState=="complete") this.Stat(AD.ADText[i].textID); } } } else { this.Stat(AD.ADText[i].textID); } str += "<li><a href="+this.URL+"&a=poster_click&siteid="+this.SiteID+"&id="+AD.ADText[i].textID+"&url="+AD.ADText[i].textLinkUrl+" target='_blank' title='"+AD.ADText[i].textContent+"'>"+AD.ADText[i].textContent+"</a></li>"; } str += "</div>"; document.write(str); } var cmsAD_{$pinfo[0]['id']} = new PCMSAD('cmsAD_{$pinfo[0]['id']}'); cmsAD_{$pinfo[0]['id']}.PosID = {$spaceid}; cmsAD_{$pinfo[0]['id']}.ADID = {$pinfo[0]['id']}; cmsAD_{$pinfo[0]['id']}.ADType = "{$pinfo[0]['type']}"; cmsAD_{$pinfo[0]['id']}.ADName = "{$pinfo[0]['name']}"; cmsAD_{$pinfo[0]['id']}.ADContent = "{'ADText':[{loop $pinfo $p} {if $n!=1},{/if} {'textID':'{$p['id']}','textContent':'{$p['setting'][1]['title']}','textLinkUrl':'{urlencode($p['setting'][1]['linkurl'])}'} {/loop}]}"; cmsAD_{$pinfo[0]['id']}.URL = "{APP_PATH}index.php?m=poster&c=index"; cmsAD_{$pinfo[0]['id']}.SiteID = {$siteid}; cmsAD_{$pinfo[0]['id']}.Width = {$width}; cmsAD_{$pinfo[0]['id']}.Height = {$height}; cmsAD_{$pinfo[0]['id']}.UploadFilePath = ""; cmsAD_{$pinfo[0]['id']}.ShowAD();
108wo
phpcms/modules/poster/install/templates/text.html
HTML
asf20
2,287
function PCMSAD(PID) { this.ID = PID; this.PosID = 0; this.ADID = 0; this.ADType = ""; this.ADName = ""; this.ADContent = ""; this.PaddingLeft = 0; this.PaddingTop = 0; this.Width = 0; this.Height = 0; this.IsHitCount = "Y"; this.Scroll = "N"; this.UploadFilePath = ""; this.URL = ""; this.SiteID = 0; this.ShowAD = showADContent; this.Start = doStart; this.Stat = statAD; } function statAD() { var new_element = document.createElement("script"); new_element.type = "text/javascript"; new_element.src="{APP_PATH}index.php?m=poster&c=index&a=show&siteid="+this.SiteID+"&spaceid="+this.ADID+"&id="+this.PosID; document.body.appendChild(new_element); } function showADContent() { var content = this.ADContent; var str = ""; var align = ""; var x = ""; var y = ""; var AD = eval('('+content+')'); if (this.ADType == "images") { for(var i=0;i<AD.Count;i++) { str = ""; align = ""; if(i%2==0){ x = this.PaddingLeft; align_b = "right"; align = "left"; }else{ x = this.PaddingLeft; align_b = "left"; align = "right"; } y = this.PaddingTop; str += "<div id='PCMSAD_"+this.PosID+"_"+i+"' style='"+align_b+":"+x+"px;top:"+y+"px;width:"+this.Width+"px; height:"+this.Height+"px; position: absolute;z-index:888888;'>"; str += "<a href='"+this.URL+"&a=poster_click&siteid="+this.SiteID+"&id="+this.ADID+"&url="+AD.Images[i].imgADLinkUrl+"' target='_blank'>"; str += "<img title='"+AD.Images[i].imgADAlt+"' src='"+this.UploadFilePath+AD.Images[i].ImgPath+"' width='"+this.Width+"' height='"+this.Height+"' style='border:0px;'>"; str += "</a>"; str += "<div style='text-align:"+align+"'><a href='#;' onclick='javascript:document.getElementById(\"PCMSAD_"+this.PosID+"_"+i+"\").style.display=\"none\"'>关闭</a></div>"; str += "</div>"; document.write(str); } }else if(this.ADType == "flash"){ for(var i=0;i<AD.Count;i++) { str = ""; align = ""; if(i%2==0){ x = this.PaddingLeft; align_b = "right"; align = "left"; }else{ x = this.PaddingLeft; align_b = "left"; align = "right"; } y = this.PaddingTop; str += "<div id='PCMSAD_"+this.PosID+"_"+i+"' style='"+align_b+":"+x+"px;top:"+y+"px;width:"+this.Width+"px; height:"+this.Height+"px; position: absolute;z-index:888888;'>"; str += "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' width='"+this.Width+"' height='"+this.Height+"' id='FlashAD_"+this.PosID+"' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0'>"; str += "<param name='movie' value='"+this.UploadFilePath+AD.Images[i].ImgPath+"' />"; str += "<param name='quality' value='autohigh' />"; str += "<param name='wmode' value='opaque'/>"; str += "<embed wmode='opaque' src='"+this.UploadFilePath+AD.Images[i].ImgPath+"' quality='autohigh' pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='"+this.Width+"' height='"+this.Height+"'></embed>"; str += "</object>"; str += "<div style='text-align:"+align+"'><a href='#;' onclick='javascript:document.getElementById(\"PCMSAD_"+this.PosID+"_"+i+"\").style.display=\"none\"'>关闭</a></div>"; str += "</div>"; document.write(str); } } } var lastScrollY=0; function heartBeat(Scroll){ var diffY; if (document.documentElement && document.documentElement.scrollTop) diffY = document.documentElement.scrollTop; else if (document.body) diffY = document.body.scrollTop; else {/*Netscape stuff*/} percent=.1*(diffY-lastScrollY); if (percent>0) percent = Math.ceil(percent); else percent = Math.floor(percent); document.getElementById("PCMSAD_"+Scroll+"_0").style.top=parseInt(document.getElementById ("PCMSAD_"+Scroll+"_0").style.top)+percent+"px"; document.getElementById("PCMSAD_"+Scroll+"_1").style.top=parseInt(document.getElementById ("PCMSAD_"+Scroll+"_1").style.top)+percent+"px"; lastScrollY=lastScrollY+percent; } function doStart() { if (cmsAD_{$spaceid}.Scroll=='Y') { setInterval("heartBeat(\""+cmsAD_{$spaceid}.PosID+"\")",10); } } var cmsAD_{$spaceid} = new PCMSAD('cmsAD_{$spaceid}'); cmsAD_{$spaceid}.PosID = {$spaceid}; cmsAD_{$spaceid}.ADID = {$p_id}; cmsAD_{$spaceid}.ADType = "{$p_type}"; cmsAD_{$spaceid}.ADName = "{$p_name}"; cmsAD_{$spaceid}.ADContent = "{'Images':[{loop $p_setting $img} {'imgADLinkUrl':'{urlencode($img['linkurl'])}','imgADAlt':'{$img['alt']}','ImgPath':'<?php echo $p_type=='images' ? $img['imageurl'] : $img['flashurl'];?>'},{/loop}],'imgADLinkTarget':'New','Count':'<?php echo count($p_setting)?>','showAlt':'Y'}"; cmsAD_{$spaceid}.URL = "{APP_PATH}index.php?m=poster&c=index"; cmsAD_{$spaceid}.SiteID = {$siteid}; cmsAD_{$spaceid}.PaddingLeft = {if $space_setting['paddleft']} {$space_setting['paddleft']} {else}0{/if}; cmsAD_{$spaceid}.PaddingTop = {if $space_setting['paddtop']} {$space_setting['paddtop']} {else}0{/if}; cmsAD_{$spaceid}.Scroll = '{if $setting['scroll']}Y{else}N{/if}'; cmsAD_{$spaceid}.Width = {$width}; cmsAD_{$spaceid}.Height = {$height}; cmsAD_{$spaceid}.UploadFilePath = ""; cmsAD_{$spaceid}.ShowAD(); var isIE=!!window.ActiveXObject; if (isIE){ if (document.readyState=="complete"){ cmsAD_{$spaceid}.Stat(); } else { document.onreadystatechange=function(){ if(document.readyState=="complete") cmsAD_{$spaceid}.Stat(); } } } else { cmsAD_{$spaceid}.Stat(); } cmsAD_{$spaceid}.Start();
108wo
phpcms/modules/poster/install/templates/couplet.html
HTML
asf20
5,698
function PCMSAD(PID) { this.ID = PID; this.PosID = 0; this.ADID = 0; this.ADType = ""; this.ADName = ""; this.ADContent = ""; this.PaddingLeft = 0; this.PaddingTop = 0; this.Width = 0; this.Height = 0; this.IsHitCount = "Y"; this.Scroll = "N"; this.Align = "N"; this.UploadFilePath = ""; this.URL = ""; this.SiteID = 0; this.ShowAD = showADContent; this.Stat = statAD; } function statAD() { var new_element = document.createElement("script"); new_element.type = "text/javascript"; new_element.src="{APP_PATH}index.php?m=poster&c=index&a=show&siteid="+this.SiteID+"&spaceid="+this.ADID+"&id="+this.PosID; document.body.appendChild(new_element); } var delta=0.08 function showADContent() { var content = this.ADContent; var str = "<div id='PCMSAD_"+this.PosID+"' style='left:"+this.PaddingLeft+"px;top:"+this.PaddingTop+"px;width:"+this.Width+"px; height:"+this.Height+"px; position: absolute;visibility: visible;z-index:999998;'>"; var AD = eval('('+content+')'); if (this.ADType == "images") { str += "<a href='"+this.URL+"?m=poster&c=index&a=poster_click&siteid="+this.SiteID+"&id="+this.ADID+"&url="+AD.Images[0].imgADLinkUrl+"' target='_blank'>"; str += "<img title='"+AD.Images[0].imgADAlt+"' src='"+this.UploadFilePath+AD.Images[0].ImgPath+"' width='"+this.Width+"' height='"+this.Height+"' style='border:0px;'>"; str += "</a>"; }else if(this.ADType == "flash"){ str += "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' width='"+this.Width+"' height='"+this.Height+"' id='FlashAD_"+this.PosID+"' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0'>"; str += "<param name='movie' value='"+this.UploadFilePath+AD.Images[0].ImgPath+"' />"; str += "<param name='quality' value='autohigh' />"; str += "<param name='wmode' value='opaque'/>"; str += "<embed wmode='opaque' src='"+this.UploadFilePath+AD.Images[0].ImgPath+"' quality='autohigh' name='flashad' swliveconnect='TRUE' pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='"+this.Width+"' height='"+this.Height+"'></embed>"; str += "</object>"; } str += "<div style='text-align:right;'><a href='#;' onclick='javascript:document.getElementById(\"PCMSAD_"+this.PosID+"\").style.display=\"none\"'>关闭</a></div>"; str += "</div>"; document.write(str); setInterval("playFixureAD(\""+this.Align+"\",\"PCMSAD_"+this.PosID+"\")",10); } function playFixureAD(Align,ADID){ var followObj = document.getElementById(ADID); var followObj_x = 0; var followObj_y = 0; var Cwidth = document.compatMode == "BackCompat" ? document.body.clientWidth : document.documentElement.clientWidth; var CHeight = document.compatMode == "BackCompat" ? document.body.clientHeight : document.documentElement.clientHeight; if(Align=="Y"){ followObj_x = parseInt((Cwidth/2)-(followObj.clientWidth/2)); followObj_y = parseInt((CHeight/2)-(followObj.clientHeight/2)); if(followObj.offsetLeft!=(document.documentElement.scrollLeft+followObj_x)) { var dx=(document.documentElement.scrollLeft+followObj_x-followObj.offsetLeft)*delta; dx=(dx>0?1:-1)*Math.ceil(Math.abs(dx)); followObj.style.left=(followObj.offsetLeft+dx)+"px"; } if(followObj.offsetTop!=(document.documentElement.scrollTop+followObj_y)) { var dy=(document.documentElement.scrollTop+followObj_y-followObj.offsetTop)*delta; dy=(dy>0?1:-1)*Math.ceil(Math.abs(dy)); followObj.style.top=(followObj.offsetTop+dy)+"px"; } } } var cmsAD_{$spaceid} = new PCMSAD('cmsAD_{$spaceid}'); cmsAD_{$spaceid}.PosID = {$spaceid}; cmsAD_{$spaceid}.ADID = {$p_id}; cmsAD_{$spaceid}.ADType = "{$p_type}"; cmsAD_{$spaceid}.ADName = "{$p_name}"; cmsAD_{$spaceid}.ADContent = "{'Images':[{'imgADLinkUrl':'{urlencode($p_setting[1]['linkurl'])}','imgADAlt':'{$p_setting[1]['alt']}','ImgPath':'<?php echo $p_type=='images' ? $p_setting[1]['imageurl'] : $p_setting[1]['flashurl'];?>'}],'imgADLinkTarget':'New','Count':'1','showAlt':'Y'}"; cmsAD_{$spaceid}.URL = "{APP_PATH}index.php?m=poster&c=index"; cmsAD_{$spaceid}.SiteID = {$siteid}; cmsAD_{$spaceid}.PaddingLeft = {if $space_setting['paddleft']} {$space_setting['paddleft']} {else}0{/if}; cmsAD_{$spaceid}.PaddingTop = {if $space_setting['paddtop']} {$space_setting['paddtop']} {else}0{/if}; cmsAD_{$spaceid}.Scroll = '{if $space_setting['align']}Y{else}N{/if}'; cmsAD_{$spaceid}.Align = '{if $space_setting['align']}Y{else}N{/if}'; cmsAD_{$spaceid}.Width = {$width}; cmsAD_{$spaceid}.Height = {$height}; cmsAD_{$spaceid}.UploadFilePath = ""; cmsAD_{$spaceid}.ShowAD(); var isIE=!!window.ActiveXObject; if (isIE){ if (document.readyState=="complete"){ cmsAD_{$spaceid}.Stat(); } else { document.onreadystatechange=function(){ if(document.readyState=="complete") cmsAD_{$spaceid}.Stat(); } } } else { cmsAD_{$spaceid}.Stat(); }
108wo
phpcms/modules/poster/install/templates/fixure.html
HTML
asf20
5,069
var links = new Array(); var isIE=!!window.ActiveXObject; {loop $pinfo $k $p} links[{intval($k+1)}] = "{APP_PATH}index.php?m=poster&c=index&a=poster_click&siteid={$siteid}&id={$p['id']}"; if (isIE){ if (document.readyState=="complete"){ statAD('{$siteid}', '{$p['id']}', '{$p['spaceid']}'); } else { document.onreadystatechange=function(){ if(document.readyState=="complete") statAD('{$siteid}', '{$p['id']}', '{$p['spaceid']}'); } } } else { statAD('{$siteid}', '{$p['id']}', '{$p['spaceid']}'); } {/loop} var imgs = new Array(); for(var n = 1; n <= 5; n++) imgs[n] = new Image(); {loop $pinfo $k $p} imgs[{intval($k+1)}].src = "{$p['setting']['1']['imageurl']}"; {/loop} var tits = new Array(); {loop $pinfo $k $p} tits[{intval($k+1)}] ="{$p['setting']['1']['alt']}"; {/loop} var imgwidth = {$width};//图片宽度 var imgheight = {$height};//图片宽度 var str = ""; str += "<span style='position:relative'>"; str += "<span><a id='dlink' href='" + links[1] + "' target='_blank'><img id='dimg' src='" + imgs[1].src + "' border='0' width='" + imgwidth + "' height='"+imgheight+"' style='filter:Alpha(opacity=100)' onmouseover='Pause(true)' onmouseout='Pause(false)'></a></span>"; //修改点1:循环添加内层div内容以增加个数 str += "</span>"; document.write(str); var oi = document.getElementById("dimg"); var pause = false; var curid = 1; var lastid = 1; var sw = 1; var opacity = 100; var speed = 15; var delay = (document.all)? 400:700; function SetAlpha(){ if(document.all){ if(oi.filters && oi.filters.Alpha) oi.filters.Alpha.opacity = opacity; } else { oi.style.MozOpacity = ((opacity >= 100)? 99:opacity) / 100; } } function statAD(siteid, id, pid) { var sp = document.createElement("SCRIPT"); sp.src = "{APP_PATH}index.php?m=poster&c=index&a=show&siteid="+siteid+"&id="+id+"&spaceid="+pid; document.body.appendChild(sp); } function ImgSwitch(id, p){ if(p){ pause = true; opacity = 100; SetAlpha(); } oi.src = imgs[id].src; document.getElementById("dlink").href = links[id]; //document.getElementById("it" + lastid).className = "off"; //document.getElementById("it" + id).className = "on"; //document.getElementById("titnv").innerHTML = "<b>" + tits[id] + "</b>"; curid = lastid = id; } function ScrollImg(){ if(pause && opacity >= 100) return; if(sw == 0){ opacity += 2; if(opacity > delay){ opacity = 100; sw = 1; } } if(sw == 1){ opacity -= 3; if(opacity < 10){ opacity = 10; sw = 3; } } SetAlpha(); if(sw != 3) return; sw = 0; curid++; if(curid > {php echo count($pinfo)}) curid = 1; ImgSwitch(curid, false); } function Pause(s){ pause = s; } function StartScroll(){ setInterval(ScrollImg, speed); } function CheckLoad(){ if (imgs[1].complete == true && imgs[2].complete == true) { clearInterval(checkid); setTimeout(StartScroll, 2000); } } var checkid = setInterval(CheckLoad, 10);
108wo
phpcms/modules/poster/install/templates/imagechange.html
HTML
asf20
2,986
<?php error_reporting(E_ALL); defined('IN_PHPCMS') or exit('Access Denied'); defined('INSTALL') or exit('Access Denied'); $parentid = $menu_db->insert(array('name'=>'poster', 'parentid'=>29, 'm'=>'poster', 'c'=>'space', 'a'=>'init', 'data'=>'', 'listorder'=>0, 'display'=>'1'), true); $menu_db->insert(array('name'=>'add_space', 'parentid'=>$parentid, 'm'=>'poster', 'c'=>'space', 'a'=>'add', 'data'=>'', 'listorder'=>0, 'display'=>'0')); $menu_db->insert(array('name'=>'edit_space', 'parentid'=>$parentid, 'm'=>'poster', 'c'=>'space', 'a'=>'edit', 'data'=>'', 'listorder'=>0, 'display'=>'0')); $menu_db->insert(array('name'=>'del_space', 'parentid'=>$parentid, 'm'=>'poster', 'c'=>'space', 'a'=>'delete', 'data'=>'', 'listorder'=>0, 'display'=>'0')); $menu_db->insert(array('name'=>'poster_list', 'parentid'=>$parentid, 'm'=>'poster', 'c'=>'poster', 'a'=>'init', 'data'=>'', 'listorder'=>0, 'display'=>'0')); $menu_db->insert(array('name'=>'add_poster', 'parentid'=>$parentid, 'm'=>'poster', 'c'=>'poster', 'a'=>'add', 'data'=>'', 'listorder'=>0, 'display'=>'0')); $menu_db->insert(array('name'=>'edit_poster', 'parentid'=>$parentid, 'm'=>'poster', 'c'=>'poster', 'a'=>'edit', 'data'=>'', 'listorder'=>0, 'display'=>'0')); $menu_db->insert(array('name'=>'del_poster', 'parentid'=>$parentid, 'm'=>'poster', 'c'=>'poster', 'a'=>'delete', 'data'=>'', 'listorder'=>0, 'display'=>'0')); $menu_db->insert(array('name'=>'poster_stat', 'parentid'=>$parentid, 'm'=>'poster', 'c'=>'poster', 'a'=>'stat', 'data'=>'', 'listorder'=>0, 'display'=>'0')); $menu_db->insert(array('name'=>'poster_setting', 'parentid'=>$parentid, 'm'=>'poster', 'c'=>'space', 'a'=>'setting', 'data'=>'', 'listorder'=>0, 'display'=>'0')); $menu_db->insert(array('name'=>'create_poster_js', 'parentid'=>$parentid, 'm'=>'poster', 'c'=>'space', 'a'=>'create_js', 'data'=>'', 'listorder'=>0, 'display'=>'1')); $menu_db->insert(array('name'=>'poster_template', 'parentid'=>$parentid, 'm'=>'poster', 'c'=>'space', 'a'=>'poster_template', 'data'=>'', 'listorder'=>0, 'display'=>'1')); $pdb = pc_base::load_model('poster_model'); $sql = "INSERT INTO `phpcms_poster` (`siteid`, `id`, `name`, `spaceid`, `type`, `setting`, `startdate`, `enddate`, `addtime`, `hits`, `clicks`, `listorder`, `disabled`) VALUES (1, 1, 'banner', 1, 'images', 'array (\n 1 => \n array (\n ''linkurl'' => ''http://www.phpcms.cn'',\n ''imageurl'' => ''./uploadfile/poster/2.png'',\n ''alt'' => '''',\n ),\n)', 1285813808, 1446249600, 1285813833, 0, 1, 0, 0); INSERT INTO `phpcms_poster` (`siteid`, `id`, `name`, `spaceid`, `type`, `setting`, `startdate`, `enddate`, `addtime`, `hits`, `clicks`, `listorder`, `disabled`) VALUES (1, 2, 'phpcmsv9', 2, 'images', 'array (\n 1 => \n array (\n ''linkurl'' => ''http://www.phpcms.cn'',\n ''imageurl'' => ''./statics/images/v9/ad_login.jpg'',\n ''alt'' => ''phpcms专业建站系统'',\n ),\n)', 1285816298, 1446249600, 1285816310, 0, 1, 0, 0); INSERT INTO `phpcms_poster` (`siteid`, `id`, `name`, `spaceid`, `type`, `setting`, `startdate`, `enddate`, `addtime`, `hits`, `clicks`, `listorder`, `disabled`) VALUES (1, 3, 'phpcms下载推荐', 3, 'images', 'array (\n 1 => \n array (\n ''linkurl'' => ''http://www.phpcms.cn'',\n ''imageurl'' => ''./uploadfile/poster/3.png'',\n ''alt'' => ''phpcms官方'',\n ),\n)', 1286504815, 1446249600, 1286504865, 0, 1, 0, 0); INSERT INTO `phpcms_poster` (`siteid`, `id`, `name`, `spaceid`, `type`, `setting`, `startdate`, `enddate`, `addtime`, `hits`, `clicks`, `listorder`, `disabled`) VALUES (1, 4, 'phpcms广告', 4, 'images', 'array (\n 1 => \n array (\n ''linkurl'' => ''http://www.phpcms.cn'',\n ''imageurl'' => ''./uploadfile/poster/4.gif'',\n ''alt'' => ''phpcms官方'',\n ),\n)', 1286505141, 1446249600, 1286505178, 0, 0, 0, 0); INSERT INTO `phpcms_poster` (`siteid`, `id`, `name`, `spaceid`, `type`, `setting`, `startdate`, `enddate`, `addtime`, `hits`, `clicks`, `listorder`, `disabled`) VALUES (1, 5, 'phpcms下载', 5, 'images', 'array (\n 1 => \n array (\n ''linkurl'' => ''http://www.phpcms.cn'',\n ''imageurl'' => ''./uploadfile/poster/5.gif'',\n ''alt'' => ''官方'',\n ),\n)', 1286509363, 1446249600, 1286509401, 0, 0, 0, 0); INSERT INTO `phpcms_poster` (`siteid`, `id`, `name`, `spaceid`, `type`, `setting`, `startdate`, `enddate`, `addtime`, `hits`, `clicks`, `listorder`, `disabled`) VALUES (1, 6, 'phpcms下载推荐1', 6, 'images', 'array (\n 1 => \n array (\n ''linkurl'' => ''http://www.phpcms.cn'',\n ''imageurl'' => ''./uploadfile/poster/5.gif'',\n ''alt'' => ''官方'',\n ),\n)', 1286510183, 1446249600, 1286510227, 0, 0, 0, 0); INSERT INTO `phpcms_poster` (`siteid`, `id`, `name`, `spaceid`, `type`, `setting`, `startdate`, `enddate`, `addtime`, `hits`, `clicks`, `listorder`, `disabled`) VALUES (1, 7, 'phpcms下载详情', 7, 'images', 'array (\n 1 => \n array (\n ''linkurl'' => ''http://www.phpcms.cn'',\n ''imageurl'' => ''./uploadfile/poster/5.gif'',\n ''alt'' => ''官方'',\n ),\n)', 1286510314, 1446249600, 1286510341, 0, 0, 0, 0); INSERT INTO `phpcms_poster` (`siteid`, `id`, `name`, `spaceid`, `type`, `setting`, `startdate`, `enddate`, `addtime`, `hits`, `clicks`, `listorder`, `disabled`) VALUES (1, 8, 'phpcms下载页', 8, 'images', 'array (\n 1 => \n array (\n ''linkurl'' => ''http://www.phpcms.cn'',\n ''imageurl'' => ''./uploadfile/poster/1.jpg'',\n ''alt'' => ''官方站'',\n ),\n)', 1286522084, 1446249600, 1286522125, 0, 0, 0, 0); INSERT INTO `phpcms_poster` (`siteid`, `id`, `name`, `spaceid`, `type`, `setting`, `startdate`, `enddate`, `addtime`, `hits`, `clicks`, `listorder`, `disabled`) VALUES (1, 9, 'phpcms v9广告', 9, 'images', 'array (\n 1 => \n array (\n ''linkurl'' => ''http://www.phpcms.cn'',\n ''imageurl'' => ''./uploadfile/poster/4.gif'',\n ''alt'' => '''',\n ),\n)', 1287041759, 1446249600, 1287041804, 0, 0, 0, 0); INSERT INTO `phpcms_poster` (`siteid`, `id`, `name`, `spaceid`, `type`, `setting`, `startdate`, `enddate`, `addtime`, `hits`, `clicks`, `listorder`, `disabled`) VALUES (1, 10, 'phpcms', 10, 'images', 'array (\n 1 => \n array (\n ''linkurl'' => ''http://www.phpcms.cn'',\n ''imageurl'' => ''./uploadfile/poster/6.jpg'',\n ''alt'' => ''phpcms官方'',\n ),\n)', 1289270509, 1446249600, 1289270541, 1, 0, 0, 0);"; $sql = str_replace(array("phpcms_", './uploadfile/poster/', './statics/images'), array($pdb->db_tablepre, pc_base::load_config('system','upload_url').'poster/', APP_PATH.'statics/images'), $sql); $sqls = explode(";", trim($sql)); unset($sql); $sqls = array_filter($sqls); if (is_array($sqls)) { foreach($sqls as $s) { $pdb->query($s); } } unset($pdb); $language = array('poster'=>'广告', 'add_space'=>'添加版位', 'edit_space'=>'编辑版位', 'del_space'=>'删除版位', 'poster_list'=>'广告列表', 'add_poster'=>'添加广告', 'edit_poster'=>'编辑广告', 'del_poster'=>'删除广告', 'poster_stat'=>'广告统计', 'poster_setting'=>'模块配置', 'create_poster_js'=>'重新生成js', 'poster_template'=>'广告模板设置'); ?>
108wo
phpcms/modules/poster/install/extention.inc.php
PHP
asf20
7,136
<?php defined('IN_PHPCMS') or exit('Access Denied'); defined('INSTALL') or exit('Access Denied'); $module = 'poster'; $modulename = '广告模块'; $introduce = '独立模块'; $author = 'phpcms Team'; $authorsite = 'http://www.phpcms.cn'; $authoremail = ''; ?>
108wo
phpcms/modules/poster/install/config.inc.php
PHP
asf20
273
<?php /*Language Format: Add a new file(.lang.php) with your module name at /phpcms/languages/ translation save at the array:$LANG */ $LANG['poster'] = '广告'; $LANG['setting_updates_successful'] = '配置更新完成!'; $LANG['name_plates_not_empty'] = '版位名称不能为空'; $LANG['plate_width_not_empty'] = '版位的宽度不能为空'; $LANG['plate_height_not_empty'] = '版位的宽度不能为空'; $LANG['added_successful'] = '版位添加成功'; $LANG['edited_successful'] = '版位修改成功'; $LANG['boardtype'] = '版位名称'; $LANG['size_format'] = '版位尺寸'; $LANG['plate_width'] = '宽:'; $LANG['plate_height'] = '高:'; $LANG['ad_list'] = '广告列表'; $LANG['random_one'] = '随机列出一个'; $LANG['random_all'] = '全部列出'; $LANG['description'] = '版位描述'; $LANG['js_path'] = 'JS路径'; $LANG['ads_num'] = '广告数'; $LANG['banner'] = '矩形横幅'; $LANG['fixure'] = '固定位置'; $LANG['float'] = '漂浮移动'; $LANG['couplet'] = '对联广告'; $LANG['imagechange'] = '图片轮换广告'; $LANG['imagelist'] = '图片列表广告'; $LANG['text'] = '文字广告'; $LANG['code'] = '代码调用'; $LANG['position'] = '版位位置'; $LANG['left_margin'] = '左边距'; $LANG['top_margin'] = '上边距'; $LANG['lightbox'] = '全屏居中'; $LANG['rolling'] = '随屏滚动'; $LANG['ads_type'] = '版位类型'; $LANG['remove_all_selected'] = '删除选定的版位'; $LANG['poster_title'] = '广告标题'; $LANG['for_postion'] = '所属版位'; $LANG['poster_type'] = '广告类型'; $LANG['line_time'] = '上线时间'; $LANG['down_time'] = '下线时间'; $LANG['photo_setting'] = '图片设置'; $LANG['linkurl'] = '链接地址'; $LANG['flash_url'] = '动画地址'; $LANG['upload_photo'] = '图片上传'; $LANG['flash_setting'] = '动画设置'; $LANG['alt'] = '文字提示'; $LANG['flash_upload'] = '动画上传'; $LANG['word_link'] = '文字链接'; $LANG['code_setting'] = '代码设置'; $LANG['word_content'] = '文字内容'; $LANG['code_content'] = '代码内容'; $LANG['add_space'] = '添加版位'; $LANG['flash'] = '动画'; $LANG['photo'] = '图片'; $LANG['title'] = '文字'; $LANG['add_ads'] = '添加广告'; $LANG['add_ads_success'] = '广告添加成功!'; $LANG['no_create_js'] = '没有版位ID,不能生成js'; $LANG['space_exist'] = '版位已存在'; $LANG['adsname_no_empty'] = '广告名称不能为空'; $LANG['no_ads_type'] = '广告类型没有选择'; $LANG['no_setting_photo'] = '没有设置图片'; $LANG['no_flash_path'] = '没有设置动画路径'; $LANG['no_title_info'] = '没有设置文字信息'; $LANG['please_input_name'] = '请输入广告名称!'; $LANG['name_three_length'] = '广告名称至少3个汉字以上'; $LANG['correct'] = '输入正确!'; $LANG['server_busy'] = '服务器没有返回数据,可能服务器忙,请重试'; $LANG['ads_exist'] = '该广告已存在'; $LANG['checking'] = '正进行合法性校验...'; $LANG['choose_ads_type'] = '请选择广告类型'; $LANG['type_selected'] = '必须类型选择'; $LANG['online_time'] = '请选择上线时间'; $LANG['one_month_no_select'] = '默认为一个月'; $LANG['down_time'] = '请选择下线时间'; $LANG['link_content'] = '输入文字链接内容'; $LANG['no_link_content'] = '没有输入内容!'; $LANG['input_code'] = '输入代码'; $LANG['space_list'] = '版位列表'; $LANG['status'] = '状态'; $LANG['hits'] = '点击数'; $LANG['addtime'] = '添加时间'; $LANG['stop'] = '停用'; $LANG['past'] = '过期'; $LANG['start'] = '启用'; $LANG['stat'] = '统计'; $LANG['edit_ads'] = '编辑广告'; $LANG['ads_module'] = '广告模块'; //广告统计 $LANG['hits_stat'] = '点击统计'; $LANG['show_stat'] = '展示统计'; $LANG['listorder_f_area'] = '按地区排序'; $LANG['listorder_f_ip'] = '按IP排序'; $LANG['all'] = '全部'; $LANG['today'] = '今日'; $LANG['yesterday'] = '昨日'; $LANG['one_week'] = '一周'; $LANG['two_week'] = '两周'; $LANG['one_month'] = '一月'; $LANG['history_select'] = '历史数据查询'; $LANG['browse_ip'] = '浏览IP'; $LANG['for_area'] = '所属地域'; $LANG['show_times'] = '展示次数'; $LANG['come_from'] = '来源'; $LANG['visit_time'] = '访问时间'; $LANG['operate'] = '操作'; $LANG['click'] = '点击'; $LANG['show'] = '展示'; //setting $LANG['ads_setting'] = '广告模块配置'; $LANG['ads_show_time'] = '统计广告展示次数?'; $LANG['upload_file_ext'] = '上传文件类型'; $LANG['file_size'] = '文件大小'; //space_add\space_edit $LANG['please_input_space_name'] = '请输入版位名称!'; $LANG['spacename_three_length'] = '版位名称至少3个汉字以上'; $LANG['spacename_illegality'] = '你输入的版位名称非法,请确认'; $LANG['space_exist'] = '该版位已存在,请更换版位名'; $LANG['choose_space_type'] = '选择版位类型'; $LANG['input_width_height'] = '输入宽度、高度'; $LANG['three_numeric'] = '3位以下数字'; $LANG['get_code_space'] = '广告版位调用'; //调用代码 $LANG['explain'] = '调用说明'; $LANG['notice'] = '1、调用方式一对服务器环境无特殊要求,可统计广告展示次数和自动判断广告是否过期,但是消耗服务器资源,访问速度慢,不支持Google等JS类代码广告;<br /> 2、调用方式二对服务器环境无特殊要求,消耗服务器资源少,访问速度快,但是不能自动判断广告有效期,要时常更新js。不支持Google等JS类代码广告;<br /> 3、调用google、baidu等代码广告,只能使用唯一的一种方式。当网站使用静态页面时,修改广告代码后请更新广告所在的静态页;<br /> 4、根据自身情况选择一种调用方式,然后把调用代码复制粘贴到需要显示广告的模板再更新相关网页即可。'; $LANG['one_way'] = '调用方式一'; $LANG['js_code'] = 'JS调用代码(PHP动态调用)'; $LANG['this_way_stat_show'] = '此方式可以统计展示次数。'; $LANG['copy_code'] = '复制代码至剪贴板'; $LANG['second_code'] = '调用方式二'; $LANG['js_code_html'] = 'JS调用代码(JS静态调用)'; //space_list $LANG['preview'] = '预览'; $LANG['get_code'] = '调用代码'; $LANG['edit_space'] = '编辑版位'; $LANG['module_setting'] = '模块配置'; $LANG['update_js_success'] = '更新js完成!'; $LANG['update_js'] = '更新js完成'; //模板设置 $LANG['template_name'] = '模板名称'; $LANG['setting_success'] = '设置完成!'; $LANG['check_template'] = '查看'; $LANG['setting_template'] = '设置'; $LANG['template_file_name'] = '模板文件名'; $LANG['name_cn'] = '中文名'; $LANG['show_this_param'] = '是否出现以下属性'; $LANG['this_param_selected'] = '上述属性是否被选中'; $LANG['is_set_space'] = '是否设置版位位置'; $LANG['is_set_size'] = '是否设置版位尺寸'; $LANG['space_poster'] = '版位下的广告'; $LANG['all_list'] = '全部列出'; $LANG['only_one'] = '按排序列出一个'; $LANG['is_used_type'] = '可用广告类型'; $LANG['max_add_param'] = '一次最多添加的图片等元素数量'; ?>
108wo
phpcms/modules/poster/install/languages/zh-cn/poster.lang.php
PHP
asf20
7,907
<?php /** * 广告模板配置函数 */ function get_types() { $poster_template = getcache('poster_template_'.get_siteid(), 'commons'); $TYPES = array(); if (is_array($poster_template) && !empty($poster_template)){ foreach ($poster_template as $k => $template) { $TYPES[$k] = $template['name']; } } else { $TYPES = array('banner'=>L('banner', '', 'poster'), 'fixure'=>L('fixure'), 'float'=>L('float'), 'couplet'=>L('couplet'), 'imagechange'=>L('imagechange'), 'imagelist'=>L('imagelist'), 'text'=>L('text'), 'code'=>L('code'),); } return $TYPES; } ?>
108wo
phpcms/modules/poster/functions/global.func.php
PHP
asf20
584
<?php defined('IN_PHPCMS') or exit('Access Denied'); defined('UNINSTALL') or exit('Access Denied'); return array('tag'); ?>
108wo
phpcms/modules/tag/uninstall/model.php
PHP
asf20
130
<?php defined('IN_PHPCMS') or exit('Access Denied'); defined('UNINSTALL') or exit('Access Denied'); ?>
108wo
phpcms/modules/tag/uninstall/extention.inc.php
PHP
asf20
108
<?php defined('IN_ADMIN') or exit('No permission resources.'); include $this->admin_tpl('header', 'admin'); ?> <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('name')?>",onfocus:"<?php echo L('input').L('name')?>"}).inputValidator({min:1,onerror:"<?php echo L('input').L('name')?>"}).ajaxValidator({type : "get",url : "",data :"m=tag&c=tag&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('name').L('exists')?>",onwait : "<?php echo L('connecting')?>"}).defaultPassed(); $("#cache").formValidator({onshow:"<?php echo L("enter_the_cache_input_will_not_be_cached")?>",onfocus:"<?php echo L("enter_the_cache_input_will_not_be_cached")?>",empty:true}).regexValidator({regexp:"num1",datatype:'enum',param:'i',onerror:"<?php echo L("cache_time_can_only_be_positive")?>"}).defaultPassed(); $("#num").formValidator({onshow:"<?php echo L('input').L("num")?>",onfocus:"<?php echo L('input').L("num")?>",empty:true}).regexValidator({regexp:"num1",datatype:'enum',param:'i',onerror:"<?php echo L('that_shows_only_positive_numbers')?>"}).defaultPassed(); $("#return").formValidator({onshow:"<?php echo L('return_value')?>",onfocus:"<?php echo L('return_value')?>",empty:true}); show_action('position'); }) function show_action(obj) { $('.pc_action_list').hide(); $('#action_'+obj).show(); } //--> </script> <div class="pad-10"> <form action="?m=tag&c=tag&a=edit&id=<?php echo $id?>" method="post" id="myform"> <div> <fieldset> <legend><?php echo L('tag_call_setting')?></legend> <table width="100%" class="table_form"> <tr> <th width="80"><?php echo L('stdcall')?>:</th> <td class="y-bg"><?php echo form::radio(array('0'=>L('model_configuration'), '1'=>L('custom_sql'), '2'=> L('block')), $type ? $type : 0, 'name="type" onclick="location.href=\''.get_url().'&type=\'+this.value"')?></td> </tr> <?php if ($type==0) :?> <tr> <th><?php echo L('select_model')?>:</th> <td class="y-bg"><?php echo form::select($modules, $module, 'name="module" id="module" onchange="location.href=\''.get_url().'&module=\'+this.value"')?><script type="text/javascript">$(function(){$("#module").formValidator({onshow:"<?php echo L('please_select_model')?>",onfocus:"<?php echo L('please_select_model')?>"}).inputValidator({min:1, onerror:'<?php echo L('please_select_model')?>'});});</script></td> </tr> <?php if ($module):?> <tr> <th><?php echo L('selectingoperation')?>:</th> <td class="y-bg"><?php echo form::radio($html['action'], $action, 'name="action" onclick="location.href=\''.get_url().'&action=\'+this.value"')?></td> </tr> <?php endif;?> <?php if(isset($html[$action]) && is_array($html[$action]) && $action)foreach($html[$action] as $k=>$v):?> <tr> <th><?php echo $v['name']?>:</th> <td class="y-bg"><?php echo creat_form($k, $v, $form_data[$k], $module)?></td> </tr> <?php if(isset($v['ajax']['name']) && !empty($v['ajax']['name'])) {?> <tr> <th width="80"><?php echo $v['ajax']['name']?>:<?php if(isset($_GET[$v['ajax']['id']]) && !empty($_GET[$v['ajax']['id']])) echo '<script type="text/javascript">$.get(\'?m=template&c=file&a=public_ajax_get\', { html: \''.$_GET[$k].'\', id:\''.$v['ajax']['id'].'\', value:\''.$_GET[$v['ajax']['id']].'\', action: \''.$v['ajax']['action'].'\', op: \''.$module.'\', style: \'default\'}, function(data) {$(\'#'.$k.'_td\').html(data)});</script>'?></th> <td class="y-bg"><input type="text" size="20" value="<?php echo $_GET[$v['ajax']['id']]?>" id="<?php echo $v['ajax']['id']?>" name="<?php echo $v['ajax']['id']?>" class="input-text"><span id="<?php echo $k?>_td"></span></td> </tr> <?php }?> <?php endforeach;?> <?php elseif ($type==1) :?> <tr> <th valign="top"><?php echo L('custom_sql')?>:</th> <td class="y-bg"><textarea name="data" id="data" style="width:386px;height:178px;"><?php echo $form_data['sql']?></textarea><script type="text/javascript">$(function(){$("#data").formValidator({onshow:"<?php echo L('please_enter_a_sql')?>",onfocus:"<?php echo L('please_enter_a_sql')?>"}).inputValidator({min:1, onerror:'<?php echo L('please_enter_a_sql')?>'});});</script></td> </tr> <tr> <th valign="top"><?php echo L('over_dbsource')?>:</th> <td class="y-bg"><?php echo form::select($dbsource, $form_data['dbsource'], 'name="dbsource" id="dbsource" ')?><script type="text/javascript">$(function(){$("#dbsource").formValidator({onshow:"<?php echo L('please_select_dbsource')?>",onfocus:"<?php echo L('please_select_dbsource')?>"}).inputValidator({min:1, onerror:'<?php echo L('please_select_dbsource')?>'});});</script></td> </tr> <?php else :?> <tr> <th valign="top"><?php echo L('block').L('name')?>:</th> <td class="y-bg"><input type="text" name="block" size="25" value="<?php echo $edit_data['data']?>" id="block"><script type="text/javascript">$(function(){$("#block").formValidator({onshow:"<?php echo L('please_input_block_name')?>",onfocus:"<?php echo L('please_input_block_name')?>"}).inputValidator({min:1, onerror:'<?php echo L('please_input_block_name')?>'});});</script></td> </tr> <?php endif;?> </table> </fieldset> <div class="bk15"></div> <fieldset> <legend><?php echo L('vlan')?></legend> <table width="100%" class="table_form"> <tr> <th width="80"><?php echo L('name')?>:</th> <td class="y-bg"><input type="text" class="input-text" name="name" id="name" size="30" value="<?php echo $edit_data['name']?>" /></td> </tr> <tr> <th width="80"><?php echo L('ispage')?>:</th> <td class="y-bg"><input type="text" name="page" id='page' value="<?php echo $edit_data['page']?>"/> <?php echo L('common_variables')?>:<a href="javascript:void(0);" onclick="javascript:$('#page').val('$_GET[page]');"><font color="red">$_GET[page]</font></a>、<a href="javascript:void(0);" onclick="javascript:$('#page').val('$page');"><font color="red">$page</font></a>,<?php echo L('no_input_no_page')?></td> </tr> <tr> <th width="80"><?php echo L('num')?>:</th> <td class="y-bg"><input type="text" name="num" id="num" size="30" value="<?php echo $edit_data['num']?>" /></td> </tr> <tr> <th width="80"><?php echo L('data_return')?>:</th> <td class="y-bg"><input type="text" name="return" id="return" size="30" value="<?php echo $edit_data['return']?>" /> </td> </tr> <tr> <th width="80"><?php echo L('cache_times')?>:</th> <td class="y-bg"><input type="text" name="cache" id="cache" size="30" value="<?php echo $edit_data['cache']?>" /> </td> </tr> </table> </fieldset> <div class="bk15"></div> <input type="submit" class="dialog" id="dosubmit" name="dosubmit" value="" /> </div> </div> </form> <script type="text/javascript"> <!-- function showcode(obj) { if (obj==3){ $('#template_code').show(); } else { $('#template_code').hide(); } } //--> </script> </body> </html>
108wo
phpcms/modules/tag/templates/tag_edit.tpl.php
PHP
asf20
7,310
<?php defined('IN_ADMIN') or exit('No permission resources.'); include $this->admin_tpl('header', 'admin'); ?> <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('name')?>",onfocus:"<?php echo L('input').L('name')?>"}).inputValidator({min:1,onerror:"<?php echo L('input').L('name')?>"}).ajaxValidator({type : "get",url : "",data :"m=tag&c=tag&a=public_name",datatype : "html",async:'false',success : function(data){ if( data == "1" ){return true;}else{return false;}},buttons: $("#dosubmit"),onerror : "<?php echo L('name').L('exists')?>",onwait : "<?php echo L('connecting')?>"}); $("#cache").formValidator({onshow:"<?php echo L("enter_the_cache_input_will_not_be_cached")?>",onfocus:"<?php echo L("enter_the_cache_input_will_not_be_cached")?>",empty:true}).regexValidator({regexp:"num1",datatype:'enum',param:'i',onerror:"<?php echo L("cache_time_can_only_be_positive")?>"}); $("#num").formValidator({onshow:"<?php echo L('input').L("num")?>",onfocus:"<?php echo L('input').L("num")?>",empty:true}).regexValidator({regexp:"num1",datatype:'enum',param:'i',onerror:"<?php echo L('that_shows_only_positive_numbers')?>"}); $("#return").formValidator({onshow:"<?php echo L('return_value')?>",onfocus:"<?php echo L('return_value')?>",empty:true}); show_action('position'); }) function show_action(obj) { $('.pc_action_list').hide(); $('#action_'+obj).show(); } //--> </script> <div class="pad-10"> <form action="?m=tag&c=tag&a=add&ac=<?php echo $ac?>" method="post" id="myform"> <div> <fieldset> <legend><?php echo L('tag_call_setting')?></legend> <table width="100%" class="table_form"> <tr> <th width="80"><?php echo L('stdcall')?>:</th> <td class="y-bg"><?php echo form::radio(array('0'=>L('model_configuration'), '1'=>L('custom_sql'), '2'=> L('block')), $type ? $type : 0, 'name="type" onclick="location.href=\''.get_url().'&type=\'+this.value"')?></td> </tr> <?php if ($type==0) :?> <tr> <th><?php echo L('select_model')?>:</th> <td class="y-bg"><?php echo form::select($modules, $module, 'name="module" id="module" onchange="location.href=\''.get_url().'&module=\'+this.value"')?><script type="text/javascript">$(function(){$("#module").formValidator({onshow:"<?php echo L('please_select_model')?>",onfocus:"<?php echo L('please_select_model')?>"}).inputValidator({min:1, onerror:'<?php echo L('please_select_model')?>'});});</script></td> </tr> <?php if ($module):?> <tr> <th><?php echo L('selectingoperation')?>:</th> <td class="y-bg"><?php echo form::radio($html['action'], $action, 'name="action" onclick="location.href=\''.get_url().'&action=\'+this.value"')?></td> </tr> <?php endif;?> <?php if(isset($html[$action]) && is_array($html[$action]) && $action)foreach($html[$action] as $k=>$v):?> <tr> <th><?php echo $v['name']?>:</th> <td class="y-bg"><?php echo creat_form($k, $v, '', $module)?></td> </tr> <?php if(isset($v['ajax']['name']) && !empty($v['ajax']['name'])) {?> <tr> <th width="80"><?php echo $v['ajax']['name']?>:<?php if(isset($_GET[$v['ajax']['id']]) && !empty($_GET[$v['ajax']['id']])) echo '<script type="text/javascript">$.get(\'?m=template&c=file&a=public_ajax_get\', { html: \''.$_GET[$k].'\', id:\''.$v['ajax']['id'].'\', value:\''.$_GET[$v['ajax']['id']].'\', action: \''.$v['ajax']['action'].'\', op: \''.$module.'\', style: \'default\'}, function(data) {$(\'#'.$k.'_td\').html(data)});</script>'?></th> <td class="y-bg"><input type="text" size="20" value="<?php echo $_GET[$v['ajax']['id']]?>" id="<?php echo $v['ajax']['id']?>" name="<?php echo $v['ajax']['id']?>" class="input-text"><span id="<?php echo $k?>_td"></span></td> </tr> <?php }?> <?php endforeach;?> <?php elseif ($type==1) :?> <tr> <th valign="top"><?php echo L('custom_sql')?>:</th> <td class="y-bg"><textarea name="data" id="data" style="width:386px;height:178px;"></textarea><script type="text/javascript">$(function(){$("#data").formValidator({onshow:"<?php echo L('please_enter_a_sql')?>",onfocus:"<?php echo L('please_enter_a_sql')?>"}).inputValidator({min:1, onerror:'<?php echo L('please_enter_a_sql')?>'});});</script></td> </tr> <tr> <th valign="top"><?php echo L('over_dbsource')?>:</th> <td class="y-bg"><?php echo form::select($dbsource, $db_source, 'name="dbsource" id="dbsource" ')?><script type="text/javascript">$(function(){$("#dbsource").formValidator({onshow:"<?php echo L('please_select_dbsource')?>",onfocus:"<?php echo L('please_select_dbsource')?>"}).inputValidator({min:1, onerror:'<?php echo L('please_select_dbsource')?>'});});</script></td> </tr> <?php else :?> <tr> <th valign="top"><?php echo L('block').L('name')?>:</th> <td class="y-bg"><input type="text" name="block" size="25" id="block"><script type="text/javascript">$(function(){$("#block").formValidator({onshow:"<?php echo L('please_input_block_name')?>",onfocus:"<?php echo L('please_input_block_name')?>"}).inputValidator({min:1, onerror:'<?php echo L('please_input_block_name')?>'});});</script></td> </tr> <?php endif;?> </table> </fieldset> <div class="bk15"></div> <fieldset> <legend><?php echo L('vlan')?></legend> <table width="100%" class="table_form"> <tr> <th width="80"><?php echo L('name')?>:</th> <td class="y-bg"><input type="text" class="input-text" name="name" id="name" size="30" /></td> </tr> <tr> <th width="80"><?php echo L('ispage')?>:</th> <td class="y-bg"><input type="text" name="page" value="" id='page'/> <?php echo L('common_variables')?>:<a href="javascript:void(0);" onclick="javascript:$('#page').val('$_GET[page]');"><font color="red">$_GET[page]</font></a>、<a href="javascript:void(0);" onclick="javascript:$('#page').val('$page');"><font color="red">$page</font></a>,<?php echo L('no_input_no_page')?></td> </tr> <tr> <th width="80"><?php echo L('num')?>:</th> <td class="y-bg"><input type="text" name="num" id="num" size="30" /></td> </tr> <tr> <th width="80"><?php echo L('data_return')?>:</th> <td class="y-bg"><input type="text" name="return" id="return" size="30" value="" /> </td> </tr> <tr> <th width="80"><?php echo L('cache_times')?>:</th> <td class="y-bg"><input type="text" name="cache" id="cache" size="30" value="" /> </td> </tr> </table> </fieldset> <div class="bk15"></div> <input type="submit" class="dialog" id="dosubmit" name="dosubmit" value="" /> </div> </div> </form> <script type="text/javascript"> <!-- function showcode(obj) { if (obj==3){ $('#template_code').show(); } else { $('#template_code').hide(); } } //--> </script> </body> </html>
108wo
phpcms/modules/tag/templates/tag_add.tpl.php
PHP
asf20
6,972
<?php defined('IN_ADMIN') or exit('No permission resources.'); include $this->admin_tpl('header', 'admin'); ?> <div class="pad_10"> <div class="table-list"> <form action="" method="get"> <input type="hidden" name="m" value="tag" /> <input type="hidden" name="c" value="tag" /> <input type="hidden" name="a" value="del" /> <table width="100%" cellspacing="0"> <thead> <tr> <th><?php echo L('name')?></th> <th><?php echo L('stdcall')?></th> <th><?php echo L('stdcode')?></th> </tr> </thead> <tbody> <?php if(is_array($list)): foreach($list as $v): ?> <tr> <td align="center"><?php echo $v['name']?></td> <td align="center"><?php switch($v['type']){case 0:echo L('model_configuration');break;case 1:echo L('custom_sql');break;case 2:echo L('block');}?></td> <td align="center"><textarea ondblclick="copy_text(this)" style="width: 400px;height:30px" /><?php echo htmlspecialchars($v['tag'])?></textarea></td> </tr> <?php endforeach; endif; ?> </tbody> </table> </from> </div> </div> <div id="pages"><?php echo $pages?></div> <script type="text/javascript"> <!-- function copy_text(matter){ //var d = window.top.art.dialog({id:'edit_file'}).data.iframe; //d.call(matter); //window.top.art.dialog({id:'list'}).close(); matter.select(); js1=matter.createTextRange(); js1.execCommand("Copy"); alert('<?php echo L('copy_code');?>'); } //--> </script> </body> </html>
108wo
phpcms/modules/tag/templates/tag_lists.tpl.php
PHP
asf20
1,466
<?php defined('IN_ADMIN') or exit('No permission resources.'); include $this->admin_tpl('header', 'admin'); ?> <div class="pad_10"> <div class="table-list"> <form action="" method="get"> <input type="hidden" name="m" value="tag" /> <input type="hidden" name="c" value="tag" /> <input type="hidden" name="a" value="del" /> <table width="100%" cellspacing="0"> <thead> <tr> <th width="80"><input type="checkbox" value="" id="check_box" onclick="selectall('id[]');"></th> <th><?php echo L('name')?></th> <th><?php echo L('stdcall')?></th> <th><?php echo L('stdcode')?></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"><input type="checkbox" value="<?php echo $v['id']?>" name="id[]"></td> <td align="center"><?php echo $v['name']?></td> <td align="center"><?php switch($v['type']){case 0:echo L('model_configuration');break;case 1:echo L('custom_sql');break;case 2:echo L('block');}?></td> <td align="center"><textarea ondblclick="copy_text(this)" style="width: 400px;height:30px" /><?php echo htmlspecialchars($v['tag'])?></textarea></td> <td align="center"><a href="javascript:edit(<?php echo $v['id']?>, '<?php echo htmlspecialchars(new_addslashes($v['name']))?>')"><?php echo L('edit')?></a> | <a href="?m=tag&c=tag&a=del&id=<?php echo $v['id']?>" onclick="return confirm('<?php echo htmlspecialchars(new_addslashes(L('confirm', array('message'=>$v['name']))))?>')"><?php echo L('delete')?></a></td> </tr> <?php endforeach; endif; ?> </tbody> </table> <div class="btn"> <label for="check_box"><?php echo L('select_all')?>/<?php echo L('cancel')?></label> <input type="submit" class="button" name="dosubmit" value="<?php echo L('delete')?>" onclick="return confirm('<?php echo L('sure_deleted')?>')"/> </div> </from> </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('editing_data_sources_call')?>《'+name+'》',id:'edit',iframe:'?m=tag&c=tag&a=edit&id='+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()}); } function copy_text(matter){ matter.select(); js1=matter.createTextRange(); js1.execCommand("Copy"); alert('<?php echo L('copy_code');?>'); } //--> </script> </body> </html>
108wo
phpcms/modules/tag/templates/tag_list.tpl.php
PHP
asf20
2,651
<?php defined('IN_ADMIN') or exit('No permission resources.'); include $this->admin_tpl('header', 'admin'); ?> <div style="padding: 200px 0px 0px 100px;"><?php echo L('click_copy_code')?>:<textarea ondblclick="copy_text(this)" style="width: 400px;height:30px" /><?php echo htmlspecialchars($tag)?></textarea><div> <script type="text/javascript"> <!-- function copy_text(matter){ //alert(matter); //window.top.art.dialog({id:'edit_file'}).call(matter); //parent.add.call(matter); matter.select(); js1=matter.createTextRange(); js1.execCommand("Copy"); alert('<?php echo L('copy_code');?>'); } //--> </script>
108wo
phpcms/modules/tag/templates/tag_show.tpl.php
PHP
asf20
645
<?php defined('IN_PHPCMS') or exit('Access Denied'); defined('INSTALL') or exit('Access Denied'); return array('tag'); ?>
108wo
phpcms/modules/tag/install/model.php
PHP
asf20
128
<?php defined('IN_PHPCMS') or exit('Access Denied'); defined('INSTALL') or exit('Access Denied'); $parentid = $menu_db->insert(array('name'=>'tag', 'parentid'=>826, 'm'=>'tag', 'c'=>'tag', 'a'=>'init', 'data'=>'', 'listorder'=>0, 'display'=>'1'), true); $menu_db->insert(array('name'=>'add_tag', 'parentid'=>$parentid, 'm'=>'tag', 'c'=>'tag', 'a'=>'add', 'data'=>'', 'listorder'=>0, 'display'=>'0')); $menu_db->insert(array('name'=>'edit_tag', 'parentid'=>$parentid, 'm'=>'tag', 'c'=>'tag', 'a'=>'edit', 'data'=>'', 'listorder'=>0, 'display'=>'0')); $menu_db->insert(array('name'=>'delete_tag', 'parentid'=>$parentid, 'm'=>'tag', 'c'=>'tag', 'a'=>'del', 'data'=>'', 'listorder'=>0, 'display'=>'0')); $menu_db->insert(array('name'=>'tag_lists', 'parentid'=>$parentid, 'm'=>'tag', 'c'=>'tag', 'a'=>'lists', 'data'=>'', 'listorder'=>0, 'display'=>'0')); $language = array('tag'=>'标签向导', 'add_tag'=>'添加标签向导', 'edit_tag'=>'修改标签向导', 'delete_tag'=>'删除标签向导', 'tag_lists'=>'标签向导列表'); ?>
108wo
phpcms/modules/tag/install/extention.inc.php
PHP
asf20
1,046
<?php defined('IN_PHPCMS') or exit('Access Denied'); defined('INSTALL') or exit('Access Denied'); $module = 'tag'; $modulename = '标签向导'; $introduce = '独立模块'; $author = 'phpcms Team'; $authorsite = 'http://www.phpcms.cn'; $authoremail = ''; ?>
108wo
phpcms/modules/tag/install/config.inc.php
PHP
asf20
270
<?php $LANG['enter_the_cache_input_will_not_be_cached'] = '请输入缓存时间,不输入则不进行缓存。'; $LANG['cache_time_can_only_be_positive'] = '缓存时间只能正数。'; $LANG['that_shows_only_positive_numbers'] = '显示条数只能正数。'; $LANG['num'] = '调用数量'; $LANG['name'] = '名称'; $LANG['should'] = '应该'; $LANG['is_greater_than'] = '大于'; $LANG['less_than'] = '小于'; $LANG['lambda'] = '位'; $LANG['sure_deleted'] = '您确定删除所有选中的项目吗?'; $LANG['stdcall'] = '调用方式'; $LANG['model_configuration'] = '模型配置'; $LANG['custom_sql'] = '自定义SQL'; $LANG['select_model'] = '选择模型'; $LANG['please_select_model'] = '请选择模型。'; $LANG['selectingoperation'] = '选择操作'; $LANG['please_select_action'] = '请选择操作'; $LANG['please_enter_a_sql'] = '请输入SQL。'; $LANG['vlan'] = '公共配置'; $LANG['output_mode'] = '输出方式'; $LANG['template'] = '模板'; $LANG['buffer_time'] = '缓存时间'; $LANG['editing_data_sources_call'] = '编辑数据源调用'; $LANG['valgrind'] = '你的代码'; $LANG['data_call'] = '调用代码'; $LANG['copy_code'] = '复制成功!'; $LANG['add_tag'] = '添加标签向导'; $LANG['create_tag_success'] = '标签向导生成完成'; $LANG['block_name_not_empty'] = '碎片名称不能为空'; $LANG['edit_tag_success'] = '标签向导修改完成'; $LANG['stdcode'] = '调用代码'; $LANG['block'] = '碎片'; $LANG['tag_call_setting'] = '标签调用配置'; $LANG['over_dbsource'] = '外部数据源'; $LANG['please_select_dbsource'] = '请选择外部数据源。'; $LANG['please_input_block_name'] = '请输入碎片名称,以字母数字下划线组成;可以写入变量'; $LANG['ispage'] = '是否分页'; $LANG['common_variables'] = '常用变量'; $LANG['no_input_no_page'] = '不填写则不分页'; $LANG['data_return'] = '数据返回值'; $LANG['cache_times'] = '缓存时间'; $LANG['click_copy_code'] = '双击复制文本框中的代码'; $LANG['return_value'] = '请输入数据返回值,默认为:data。'; ?>
108wo
phpcms/modules/tag/install/languages/zh-cn/tag.lang.php
PHP
asf20
2,420
<?php defined('IN_PHPCMS') or exit('No permission resources.'); pc_base::load_app_class('admin', 'admin', 0); class tag extends admin { private $db, $dbsource; public function __construct() { $this->db = pc_base::load_model('tag_model'); $this->dbsource = pc_base::load_model('dbsource_model'); parent::__construct(); } /** * 标签向导列表 */ public function init() { $big_menu = array('javascript:window.top.art.dialog({id:\'add\',iframe:\'?m=tag&c=tag&a=add\', title:\''.L('add_tag').'\', width:\'700\', height:\'500\', lock:true}, 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_tag')); $page = isset($_POST['page']) && intval($_POST['page']) ? intval($_POST['page']) : 1; $list = $this->db->listinfo('','id desc', $page, 20); $pages = $this->db->pages; include $this->admin_tpl('tag_list'); } /** * 添加标签向导 */ public function add() { pc_base::load_app_func('global', 'dbsource'); if (isset($_POST['dosubmit'])) { $name = isset($_POST['name']) && trim($_POST['name']) ? trim($_POST['name']) : showmessage(L('name').L('empty')); $cache = isset($_POST['cache']) && intval($_POST['cache']) ? intval($_POST['cache']) : 0; $num = isset($_POST['num']) && intval($_POST['num']) ? intval($_POST['num']) : 0; $type = isset($_POST['type']) && intval($_POST['type']) ? intval($_POST['type']) : 0; $ac = isset($_GET['ac']) && !empty($_GET['ac']) ? trim($_GET['ac']) : ''; //检查名称是否已经存在 if ($this->db->get_one(array('name'=>$name))) { showmessage(L('name').L('exists')); } $siteid = $this->get_siteid(); if ($type == '1') { //自定义SQL $sql = isset($_POST['data']) && trim($_POST['data']) ? trim($_POST['data']) : showmessage(L('custom_sql').L('empty')); $data['sql'] = $sql; $tag = '{pc:get sql="'.$sql.'" '; if ($cache) { $tag .= 'cache="'.$cache.'" '; } if ($_POST['page']) { $tag .= 'page="'.$_POST['page'].'" '; } if ($_POST['dbsource']) { $data['dbsource'] = $_POST['dbsource']; $tag .= 'dbsource= "'.$_POST['dbsource'].'" '; } if ($_POST['return']) { $tag .= 'return="'.$_POST['return'].'"'; } $tag .= '}'; } elseif ($type == 0) { //模型配置 $module = isset($_POST['module']) && trim($_POST['module']) ? trim($_POST['module']) : showmessage(L('please_select_model')); $action = isset($_POST['action']) && trim($_POST['action']) ? trim($_POST['action']) : showmessage(L('please_select_action')); $html = pc_tag_class($module); $data = array(); $tag = '{pc:'.$module.' action="'.$action.'" '; if (isset($html[$action]) && is_array($html[$action])) { foreach ($html[$action] as $key=>$val) { $val['validator']['reg_msg'] = $val['validator']['reg_msg'] ? $val['validator']['reg_msg'] : $val['name'].L('inputerror'); $$key = isset($_POST[$key]) && trim($_POST[$key]) ? trim($_POST[$key]) : ''; if (!empty($val['validator'])) { if (isset($val['validator']['min']) && strlen($$key) < $val['validator']['min']) { showmessage($val['name'].L('should').L('is_greater_than').$val['validator']['min'].L('lambda')); } if (isset($val['validator']['max']) && strlen($$key) > $val['validator']['max']) { showmessage($val['name'].L('should').L('less_than').$val['validator']['max'].L('lambda')); } if (!preg_match('/'.$val['validator']['reg'].'/'.$val['validator']['reg_param'], $$key)) { showmessage($val['name'].$val['validator']['reg_msg']); } } $tag .= $key.'="'.$$key.'" '; $data[$key] = $$key; } } if ($_POST['page']) { $tag .= 'page="'.$_POST['page'].'" '; } if ($num) { $tag .= ' num="'.$num.'" '; } if ($_POST['return']) { $tag .= ' return="'.$_POST['return'].'" '; } if ($cache) { $tag .= ' cache="'.$cache.'" '; } $tag .= '}'; } else { //碎片 $data = isset($_POST['block']) && trim($_POST['block']) ? trim($_POST['block']) : showmessage(L('block_name_not_empty')); $tag = '{pc:block pos="'.$data.'"}'; } $tag .= "\n".'{loop $data $n $r}'."\n".'<li><a href="{$r[\'url\']}" title="{$r[\'title\']}">{$r[\'title\']}</a></li>'."\n".'{/loop}'."\n".'{/pc}'; $tag = new_addslashes($tag); $data = is_array($data) ? array2string($data) : $data; $this->db->insert(array('siteid'=>$siteid, 'tag'=>$tag, 'name'=>$name, 'type'=>$type, 'module'=>$module, 'action'=>$action, 'data'=>$data, 'page'=>$_POST['page'], 'return'=>$_POST['return'], 'cache'=>$cache, 'num'=>$num)); if ($ac=='js') { include $this->admin_tpl('tag_show'); } else { showmessage('', '', '', 'add'); } } else { pc_base::load_sys_class('form','',0); $modules = array_merge(array(''=>L('please_select')),pc_base::load_config('modules')); $show_header = $show_validator = true; $type = isset($_GET['type']) && intval($_GET['type']) ? intval($_GET['type']) : 0; $siteid = $this->get_siteid(); $dbsource_data = $dbsource = array(); $dbsource[] = L('please_select'); $dbsource_data = $this->dbsource->select(array('siteid'=>$siteid), 'name'); foreach ($dbsource_data as $dbs) { $dbsource[$dbs['name']] = $dbs['name']; } $ac = isset($_GET['ac']) && !empty($_GET['ac']) ? trim($_GET['ac']) : ''; $module = isset($_GET['module']) && trim($_GET['module']) ? trim($_GET['module']) : ''; $action = isset($_GET['action']) && trim($_GET['action']) ? trim($_GET['action']) : ''; if ($module) $html = pc_tag_class($module); pc_base::load_app_func('global','template'); include $this->admin_tpl('tag_add'); } } /** * 修改标签向导 */ public function edit() { $id = isset($_GET['id']) && intval($_GET['id']) ? intval($_GET['id']) : showmessage(L('illegal_parameters'), HTTP_REFERER); if (!$edit_data = $this->db->get_one(array('id'=>$id))) { showmessage(L('notfound')); } pc_base::load_app_func('global', 'dbsource'); if (isset($_POST['dosubmit'])) { $name = isset($_POST['name']) && trim($_POST['name']) ? trim($_POST['name']) : showmessage(L('name').L('empty')); $cache = isset($_POST['cache']) && intval($_POST['cache']) ? intval($_POST['cache']) : 0; $num = isset($_POST['num']) && intval($_POST['num']) ? intval($_POST['num']) : 0; $type = isset($_POST['type']) && intval($_POST['type']) ? intval($_POST['type']) : 0; //检查名称是否已经存在 if ($edit_data['name'] != $name) { if ($this->db->get_one(array('name'=>$name), 'id')) { showmessage(L('name').L('exists')); } } $siteid = $this->get_siteid(); if ($type == '1') { //自定义SQL $sql = isset($_POST['data']) && trim($_POST['data']) ? trim($_POST['data']) : showmessage(L('custom_sql').L('empty')); $data['sql'] = $sql; $tag = '{pc:get sql="'.$sql.'" '; if ($cache) { $tag .= 'cache="'.$cache.'" '; } if ($_POST['page']) { $tag .= 'page="'.$_POST['page'].'" '; } if ($_POST['dbsource']) { $data['dbsource'] = $_POST['dbsource']; $tag .= 'dbsource= "'.$_POST['dbsource'].'" '; } if ($_POST['return']) { $tag .= 'return="'.$_POST['return'].'"'; } $tag .= '}'; } elseif ($type == 0) { //模型配置 $module = isset($_POST['module']) && trim($_POST['module']) ? trim($_POST['module']) : showmessage(L('please_select_model')); $action = isset($_POST['action']) && trim($_POST['action']) ? trim($_POST['action']) : showmessage(L('please_select_action')); $html = pc_tag_class($module); $data = array(); $tag = '{pc:'.$module.' action="'.$action.'" '; if (isset($html[$action]) && is_array($html[$action])) { foreach ($html[$action] as $key=>$val) { $val['validator']['reg_msg'] = $val['validator']['reg_msg'] ? $val['validator']['reg_msg'] : $val['name'].L('inputerror'); $$key = isset($_POST[$key]) && trim($_POST[$key]) ? trim($_POST[$key]) : ''; if (!empty($val['validator'])) { if (isset($val['validator']['min']) && strlen($$key) < $val['validator']['min']) { showmessage($val['name'].L('should').L('is_greater_than').$val['validator']['min'].L('lambda')); } if (isset($val['validator']['max']) && strlen($$key) > $val['validator']['max']) { showmessage($val['name'].L('should').L('less_than').$val['validator']['max'].L('lambda')); } if (!preg_match('/'.$val['validator']['reg'].'/'.$val['validator']['reg_param'], $$key)) { showmessage($val['name'].$val['validator']['reg_msg']); } } $tag .= $key.'="'.$$key.'" '; $data[$key] = $$key; } } if ($_POST['page']) { $tag .= 'page="'.$_POST['page'].'" '; } if ($num) { $tag .= ' num="'.$num.'" '; } if ($_POST['return']) { $tag .= ' return="'.$_POST['return'].'" '; } if ($cache) { $tag .= ' cache="'.$cache.'" '; } $tag .= '}'; } else { //碎片 $data = isset($_POST['block']) && trim($_POST['block']) ? trim($_POST['block']) : showmessage(L('block_name_not_empty')); $tag = '{pc:block pos="'.$data.'"}'; } $tag .= "\n".'{loop $data $n $r}'."\n".'<li><a href="{$r[\'url\']}" title="{$r[\'title\']}">{$r[\'title\']}</a></li>'."\n".'{/loop}'."\n".'{/pc}'; $tag = new_addslashes($tag); $data = is_array($data) ? array2string($data) : $data; $this->db->update(array('siteid'=>$siteid, 'tag'=>$tag, 'name'=>$name, 'type'=>$type, 'module'=>$module, 'action'=>$action, 'data'=>$data, 'page'=>$_POST['page'], 'return'=>$_POST['return'], 'cache'=>$cache, 'num'=>$num), array('id'=>$id)); showmessage('', '', '', 'edit'); } else { pc_base::load_sys_class('form','',0); $modules = array_merge(array(''=>L('please_select')),pc_base::load_config('modules')); $show_header = $show_validator = true; $type = isset($_GET['type']) && intval($_GET['type']) ? intval($_GET['type']) : $edit_data['type']; $siteid = $this->get_siteid(); $dbsource_data = $dbsource = array(); $dbsource[] = L('please_select'); $dbsource_data = $this->dbsource->select(array('siteid'=>$siteid), 'name'); foreach ($dbsource_data as $dbs) { $dbsource[$dbs['name']] = $dbs['name']; } $module = isset($_GET['module']) && trim($_GET['module']) ? trim($_GET['module']) : $edit_data['module']; $action = isset($_GET['action']) && trim($_GET['action']) ? trim($_GET['action']) : $edit_data['action']; if ($edit_data['type'] == 0 || $edit_data['type'] == 1) $form_data = string2array($edit_data['data']); if ($module) $html = pc_tag_class($module); pc_base::load_app_func('global','template'); include $this->admin_tpl('tag_edit'); } } /** * 标签向导列表 */ public function lists() { $page = isset($_POST['page']) && intval($_POST['page']) ? intval($_POST['page']) : 1; $list = $this->db->listinfo('','id desc', $page, 20); $pages = $this->db->pages; include $this->admin_tpl('tag_lists'); } /** * 删除标签向导 */ public function del() { $id = isset($_GET['id']) ? $_GET['id'] : ''; if (is_array($id)) { foreach ($id as $key => $v) { if (intval($v)) { $id[$key] = intval($v); } else { unset($id[$key]); } } $sql = implode('\',\'', $id); $this->db->delete("id in ('$sql')"); showmessage(L('operation_success'), HTTP_REFERER); } else { $id = intval($id); if(empty($id)) showmessage(L('illegal_parameters'), HTTP_REFERER); if ($this->db->delete(array('id'=>$id))) { showmessage(L('operation_success'), HTTP_REFERER); } else { showmessage(L('operation_failure'), HTTP_REFERER); } } } /** * 检验是否重名 */ public function public_name() { $name = isset($_GET['name']) && trim($_GET['name']) ? (pc_base::load_config('system', 'charset') == 'gbk' ? iconv('utf-8', 'gbk', trim($_GET['name'])) : trim($_GET['name'])) : exit('0'); $id = isset($_GET['id']) && intval($_GET['id']) ? intval($_GET['id']) : ''; $data = array(); if ($id) { $data = $this->db->get_one(array('id'=>$id), 'name'); if (!empty($data) && $data['name'] == $name) { exit('1'); } } if ($this->db->get_one(array('name'=>$name), 'id')) { exit('0'); } else { exit('1'); } } } ?>
108wo
phpcms/modules/tag/tag.php
PHP
asf20
12,671
<?php defined('IN_PHPCMS') or exit('Access Denied'); defined('UNINSTALL') or exit('Access Denied'); return array('comment', 'comment_check', 'comment_setting', 'comment_table'); ?>
108wo
phpcms/modules/comment/uninstall/model.php
PHP
asf20
185
<?php defined('IN_PHPCMS') or exit('Access Denied'); defined('UNINSTALL') or exit('Access Denied'); $comment_table_db = pc_base::load_model('comment_table_model'); $tablelist = $comment_table_db->select('', 'tableid'); foreach($tablelist as $k=>$v) { $comment_table_db->query("DROP TABLE IF EXISTS `".$comment_table_db->db_tablepre."comment_data_".$v['tableid']."`;"); } ?>
108wo
phpcms/modules/comment/uninstall/extention.inc.php
PHP
asf20
390
<?php defined('IN_PHPCMS') or exit('No permission resources.'); pc_base::load_app_class('admin', 'admin', 0); class check extends admin { //数据库连接 private $comment_check_db,$comment_db,$comment; function __construct() { $this->comment_data_db = pc_base::load_model('comment_data_model'); $this->comment_check_db = pc_base::load_model('comment_check_model'); $this->comment = pc_base::load_app_class('comment'); } public function checks() { $total = $this->comment_check_db->count(array('siteid'=>$this->get_siteid())); $comment_check_data = $this->comment_check_db->select(array('siteid'=>$this->get_siteid()), '*', '20', 'id desc'); if (empty($comment_check_data)) showmessage(L('no_check_comments').'<script>window.top.$("#display_center_id").css("display","none");</script>'); pc_base::load_sys_class('format','', 0); $show_header = true; include $this->admin_tpl('comment_check'); } public function ajax_checks() { $id = isset($_GET['id']) && $_GET['id'] ? $_GET['id'] : (isset($_GET['form']) ? showmessage(L('please_chose_comment'), HTTP_REFERER) : exit('0')); $type = isset($_GET['type']) && intval($_GET['type']) ? intval($_GET['type']) : exit('0'); $commentid = isset($_GET['commentid']) && trim($_GET['commentid']) ? trim($_GET['commentid']) : exit('0'); if (is_array($id)) { foreach ($id as $v) { if (!$v = intval($v)) { continue; } $this->comment->status($commentid, $v, $type); } showmessage(L('operation_success'), HTTP_REFERER); } else { $id = intval($id) ? intval($id) : exit('0'); $this->comment->status($commentid, $id, $type); } if ($comment->msg_code != 0) { exit($comment->get_error()); } else { exit('1'); } } public function public_get_one() { $total = $this->comment_check_db->count(array('siteid'=>$this->get_siteid())); $comment_check_data = $this->comment_check_db->select(array('siteid'=>$this->get_siteid()), '*', '19,1', 'id desc'); $comment_check_data = $comment_check_data[0]; $r = array(); if (is_array($comment_check_data) && !empty($comment_check_data)) { $this->comment_data_db->table_name($comment_check_data['tableid']); $r = $this->comment_data_db->get_one(array('id'=>$comment_check_data['comment_data_id'], 'siteid'=>$this->get_siteid())); pc_base::load_sys_class('format','', 0); $r['creat_at'] = format::date($r['creat_at'], 1); if (pc_base::load_config('system','charset')=='gbk') { foreach ($r as $k=>$v) { $r[$k] = iconv('gbk', 'utf-8', $v); } } } echo json_encode(array('total'=>$total, 'data'=>$r)); } }
108wo
phpcms/modules/comment/check.php
PHP
asf20
2,660
<?php defined('IN_PHPCMS') or exit('No permission resources.'); pc_base::load_app_class('admin', 'admin', 0); class comment_admin extends admin { private $comment_setting_db,$comment_data_db,$comment_db,$siteid; function __construct() { parent::__construct(); $this->comment_setting_db = pc_base::load_model('comment_setting_model'); $this->comment_data_db = pc_base::load_model('comment_data_model'); $this->comment_db = pc_base::load_model('comment_model'); $this->siteid = $this->get_siteid(); } public function init() { $data = $this->comment_setting_db->get_one(array('siteid'=>$this->siteid)); if (isset($_POST['dosubmit'])) { $guest = isset($_POST['guest']) && intval($_POST['guest']) ? intval($_POST['guest']) : 0; $check = isset($_POST['check']) && intval($_POST['check']) ? intval($_POST['check']) : 0; $code = isset($_POST['code']) && intval($_POST['code']) ? intval($_POST['code']) : 0; $add_point = isset($_POST['add_point']) && abs(intval($_POST['add_point'])) ? intval($_POST['add_point']) : 0; $del_point = isset($_POST['del_point']) && abs(intval($_POST['del_point'])) ? intval($_POST['del_point']) : 0; $sql = array('guest'=>$guest, 'check'=>$check, 'code'=>$code, 'add_point'=>$add_point, 'del_point'=>$del_point); if ($data) { $this->comment_setting_db->update($sql, array('siteid'=>$this->siteid)); } else { $sql['siteid'] = $this->siteid; $this->comment_setting_db->insert($sql); } showmessage(L('operation_success'), HTTP_REFERER); } else { $show_header = true; include $this->admin_tpl('comment_setting'); } } public function lists() { $show_header = true; $commentid = isset($_GET['commentid']) && trim($_GET['commentid']) ? trim($_GET['commentid']) : showmessage(L('illegal_parameters'), HTTP_REFERER); $hot = isset($_GET['hot']) && intval($_GET['hot']) ? intval($_GET['hot']) : 0; $comment = $this->comment_db->get_one(array('commentid'=>$commentid, 'siteid'=>$this->siteid)); if (empty($comment)) { $forward = isset($_GET['show_center_id']) ? 'blank' : HTTP_REFERER; showmessage(L('no_comment'), $forward); } pc_base::load_app_func('global'); pc_base::load_sys_class('format','', 0); $page = isset($_GET['page']) && intval($_GET['page']) ? intval($_GET['page']) : 1; $pagesize = 20; $offset = ($page-1)*$pagesize; $this->comment_data_db->table_name($comment['tableid']); $desc = 'id desc'; if (!empty($hot)) { $desc = 'support desc, id desc'; } $list = $this->comment_data_db->select(array('commentid'=>$commentid, 'siteid'=>$this->siteid, 'status'=>1), '*', $offset.','.$pagesize, $desc); $pages = pages($comment['total'], $page, $pagesize); include $this->admin_tpl('comment_data_list'); } public function listinfo() { $r = $max_table = ''; $max_table = isset($_GET['max_table']) ? intval($_GET['max_table']) : 0; if (!$max_table) { $r = $this->comment_db->get_one(array(), 'MAX(tableid) AS tableid'); if (!$r['tableid']) { showmessage(L('no_comment')); } $max_table = $r['tableid']; } $page = max(intval($_GET['page']), 1); $tableid = isset($_GET['tableid']) ? intval($_GET['tableid']) : $max_table; if ($tableid > $max_table) { $tableid = $max_table; } if (isset($_GET['search'])) { $where = $sql = $t = $comment_id = $order = ''; $keywords = safe_replace($_GET['keyword']); $searchtype = intval($_GET['searchtype']); switch ($searchtype) { case '0': $sql = "SELECT `commentid` FROM `phpcms_comment` WHERE `siteid` = '$this->siteid' AND `title` LIKE '%$keywords%' AND `tableid` = '$tableid' "; $this->comment_db->query($sql); $data = $this->comment_db->fetch_array(); if (!empty($data)) { foreach ($data as $d) { $comment_id .= $t.'\''.$d['commentid'].'\''; $t = ','; } $where = "`commentid` IN ($comment_id)"; } break; case '1': $keywords = intval($keywords); $sql = "SELECT `commentid` FROM `phpcms_comment` WHERE `commentid` LIKE 'content_%-$keywords-%' "; $this->comment_db->query($sql); $data = $this->comment_db->fetch_array(); foreach ($data as $d) { $comment_id .= $t.'\''.$d['commentid'].'\''; $t = ','; } $where = "`commentid` IN ($comment_id)"; break; case '2': $where = "`username` = '$keywords'"; break; } } //exit($where); $data = array(); if (!isset($where)) { $where = 'siteid='.$this->siteid; } else { $where .= ' AND siteid='.$this->siteid; } $order = '`id` DESC'; pc_base::load_sys_class('format','', 0); $this->comment_data_db->table_name($tableid); $data = $this->comment_data_db->listinfo($where, $order, $page, 10); $pages = $this->comment_data_db->pages; include $this->admin_tpl('comment_listinfo'); } public function del() { if (isset($_GET['dosubmit']) && $_GET['dosubmit']) { $ids = $_GET['ids']; $tableid = isset($_GET['tableid']) ? intval($_GET['tableid']) : 0; $r = $this->comment_db->get_one(array(), 'MAX(tableid) AS tableid'); $max_table = $r['tableid']; if (!$tableid || $max_table<$tableid) showmessage(L('illegal_operation')); $this->comment_data_db->table_name($tableid); $site = $this->comment_setting_db->site($this->siteid); if (is_array($ids)) { foreach ($ids as $id) { $comment_info = $this->comment_data_db->get_one(array('id'=>$id), 'commentid, userid, username'); $this->comment_db->update(array('total'=>'-=1'), array('commentid'=>$comment_info['commentid'])); $this->comment_data_db->delete(array('id'=>$id)); //当评论ID不为空,站点配置了删除的点数,支付模块存在的时候,删除用户的点数。 if (!empty($comment_info['userid']) && !empty($site['del_point']) && module_exists('pay')) { pc_base::load_app_class('receipts', '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_info['userid'], $comment_info['username'], $op_userid, $op_username); } } $ids = implode(',', $ids); } elseif (is_numeric($ids)) { $id = intval($ids); $comment_info = $this->comment_data_db->get_one(array('id'=>$id), 'commentid, userid, username'); $this->comment_db->update(array('total'=>'-=1'), array('commentid'=>$comment_info['commentid'])); $this->comment_data_db->delete(array('id'=>$id)); //当评论ID不为空,站点配置了删除的点数,支付模块存在的时候,删除用户的点数。 if (!empty($comment_info['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_info['userid'], $comment_info['username'], $op_userid, $op_username); } } else { showmessage(L('illegal_operation')); } showmessage(L('operation_success'), HTTP_REFERER); } } }
108wo
phpcms/modules/comment/comment_admin.php
PHP
asf20
7,295
<?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>
108wo
phpcms/modules/comment/templates/comment_listinfo.tpl.php
PHP
asf20
4,729
<?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>
108wo
phpcms/modules/comment/templates/comment_setting.tpl.php
PHP
asf20
1,686
<?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>
108wo
phpcms/modules/comment/templates/comment_data_list.tpl.php
PHP
asf20
2,740
<?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>
108wo
phpcms/modules/comment/templates/comment_check.tpl.php
PHP
asf20
2,630
<?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; } } }
108wo
phpcms/modules/comment/index.php
PHP
asf20
6,987
<?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')), ); } }
108wo
phpcms/modules/comment/classes/comment_tag.class.php
PHP
asf20
4,924
<?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]; } }
108wo
phpcms/modules/comment/classes/comment.class.php
PHP
asf20
10,530
<?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'); ?>
108wo
phpcms/modules/comment/install/model.php
PHP
asf20
200
<!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={CHARSET}" /> <meta http-equiv="X-UA-Compatible" content="IE=7" /> <title>{if isset($SEO['title']) && !empty($SEO['title'])}{$SEO['title']}{/if}{$SEO['site_title']}</title> <meta name="keywords" content="{$SEO['keyword']}"> <meta name="description" content="{$SEO['description']}"> <link href="{CSS_PATH}reset.css" rel="stylesheet" type="text/css" /> <link href="{CSS_PATH}default_blue.css" rel="stylesheet" type="text/css" /> <script language="javascript" type="text/javascript" src="{JS_PATH}jquery.min.js"></script> <script language="javascript" type="text/javascript" src="{JS_PATH}jquery.sgallery.js"></script> <style> body{background:none;} </style> </head> <body onload="iframe_height()"> {pc:comment action="get_comment" commentid="$commentid"} {php $comment = $data;} {/pc} <div id="bodyheight"> <form action="{APP_PATH}index.php?m=comment&c=index&a=post&commentid={$commentid}" method="post" onsubmit="return on_submit()"> <input type="hidden" name="title" value="{urlencode(($comment[title] ? $comment[title] : $title))}"> <input type="hidden" name="url" value="{urlencode(($comment[url] ? $comment[url] : $url))}"> <div class="comment-form"> <h5><strong>我来说两句</strong><span class="fn rt blue">已有<font color="#FF0000">{if $comment[total]}{$comment[total]}{else}0{/if}</font>条评论,<a href="{APP_PATH}index.php?m=comment&c=index&a=init&commentid={$commentid}" target="_blank">点击全部查看</a></span></h5> <div class="posn">我的态度:<input type="radio" name="direction" value="1" /> <img src="{IMG_PATH}icon/zheng.png" /> <input type="radio" name="direction" value="2" /> <img src="{IMG_PATH}icon/fan.png" /> <input type="radio" name="direction" value="3" /> <img src="{IMG_PATH}icon/zhong.png" /> </div> <textarea rows="8" cols="80" name="content"></textarea><br> {if $setting[code]} <label>验证码:<input type="text" name="code" class="input-text" id="yzmText" onfocus="var offset = $(this).offset();$('#yzm').css({'left': +offset.left-8, 'top': +offset.top-$('#yzm').height()});$('#yzm').show();$('#yzmText').data('hide', 1)" onblur='$("#yzmText").data("hide", 0);setTimeout("hide_code()", 3000)' /></label> <div id="yzm" class="yzm">{form::checkcode()}<br />点击图片更换</a></div> <div class="bk10"></div> {/if} <div class="btn"><input type="submit" value="发表评论" /></div>&nbsp;&nbsp;&nbsp;&nbsp;{if $userid}{get_nickname()} <a href="{APP_PATH}index.php?m=member&c=index&a=logout&forward={urlencode(($comment[url] ? $comment[url] : $url))}" target="_top">退出</a>{else}<a href="{APP_PATH}index.php?m=member&c=index&a=login&forward={urlencode(($comment[url] ? $comment[url] : $url))}" target="_top" class="blue">登录</a><span> | </span><a href="{APP_PATH}index.php?m=member&c=index&a=register" class="blue" target="_top">注册</a> {if !$setting[guest]}<span style="color:red">需要登陆才可发布评论</span>{/if}{/if} </div> </form> {pc:comment action="lists" commentid="$commentid" siteid="$siteid" page="$_GET[page]" hot="$hot" num="20"} {if !empty($data)} <div class="comment_button"><a href="{APP_PATH}index.php?m=comment&c=index&a=init&commentid={$commentid}&title={urlencode(($comment[title] ? $comment[title] : $title))}&url={urlencode(($comment[url] ? $comment[url] : $url))}&hot=0&iframe=1"{if empty($hot)} class="on"{/if}>最新</a> <a href="{APP_PATH}index.php?m=comment&c=index&a=init&commentid={$commentid}&title={urlencode(($comment[title] ? $comment[title] : $title))}&url={urlencode(($comment[url] ? $comment[url] : $url))}&hot=1&iframe=1"{if $hot} class="on"{/if}>最热</a></div> <div class="comment"> {loop $data $r} <h5 class="title fn">{direction($r[direction])} <font color="#FF0000">{format::date($r[creat_at], 1)}</font> {if $r[userid]}{get_nickname($r[userid])}{else}{$r[username]}{/if} </h5> <div class="content">{$r[content]} <div class="rt"><a href="javascript:void(0)" onclick="reply({$r[id]}, '{$commentid}')">回复</a> <a href="javascript:void(0)" onclick="support({$r[id]}, '{$commentid}')">支持</a>(<font id="support_{$r[id]}">{$r[support]}</font>) </div> <div id="reply_{$r[id]}" style="display:none"></div> </div> <div class="bk30 hr mb8"></div> {/loop} </div> <div id="pages" class="text-r">{$pages}</div> {/if} {/pc} <div class="bk10"></div> <script type="text/javascript"> function support(id, commentid) { $.getJSON('{APP_PATH}index.php?m=comment&c=index&a=support&format=jsonp&commentid='+commentid+'&id='+id+'&callback=?', function(data){ if(data.status == 1) { $('#support_'+id).html(parseInt($('#support_'+id).html())+1); } else { alert(data.msg); } }); } function reply(id,commentid) { var str = '<form action="{APP_PATH}index.php?m=comment&c=index&a=post&commentid='+commentid+'&id='+id+'" method="post" onsubmit="return on_submit()"><textarea rows="10" style="width:100%" name="content"></textarea>{if $setting[code]}<label>验证码:<input type="text" name="code" class="input-text" onfocus="var offset = $(this).offset();$(\'#yzm\').css({\'left\': +offset.left-8, \'top\': +offset.top-$(\'#yzm\').height()});$(\'#yzm\').show();$(\'#yzmText\').data(\'hide\', 1)" onblur=\'$("#yzmText").data("hide", 0);setTimeout("hide_code()", 3000)\' /></label>{/if} <div class="btn"><input type="submit" value="发表评论" /></div>&nbsp;&nbsp;&nbsp;&nbsp;{if $userid}{get_nickname()} <a href="{APP_PATH}index.php?m=member&c=index&a=logout&forward={urlencode(($comment[url] ? $comment[url] : $url))}" target="_top">退出</a>{else}<a href="{APP_PATH}index.php?m=member&c=index&a=login&forward={urlencode(($comment[url] ? $comment[url] : $url))}" class="blue" target="_top">登录</a> | <a href="{APP_PATH}index.php?m=member&c=index&a=register" class="blue" target="_top">注册</a> {if !$setting[guest]}<span style="color:red">需要登陆才可发布评论</span>{/if}{/if}</form>'; $('#reply_'+id).html(str).toggle(); iframe_height(); } function hide_code() { if ($('#yzmText').data('hide')==0) { $('#yzm').hide(); } } function on_submit() { iframe_height(200); $('#bodyheight').hide(); $('#loading').show(); return true; } function iframe_height(height) { if (!height) { var height = document.getElementById('bodyheight').scrollHeight; } $('#top_src').attr('src', "{$domain}js.html?"+height+'|'+{if $comment['total']}{$comment['total']}{else}0{/if}); } </script> </div> <iframe width='0' id='top_src' height='0' src=''></iframe> <div class="hidden text-c" id="loading"> <img src="{IMG_PATH}msg_img/loading.gif" /> 正在提交中... </div> </body> </html>
108wo
phpcms/modules/comment/install/templates/show_list.html
HTML
asf20
6,963
{template "content","header"} {pc:comment action="get_comment" commentid="$commentid"} {php $comment = $data;} {/pc} <div class="main"> <h2 class="comment-title blue"><a href="{if $comment[url]}{$comment[url]}{else}{$url}{/if}">{if $comment[title]}{$comment[title]}{else}{$title}{/if}</a> <a href="#comment" class="f12 fn"><font color="#FF0000">[我来说两句]</font></a></h2> <div class="comment_button"><a href="{APP_PATH}index.php?m=comment&c=index&a=init&commentid={$commentid}&title={urlencode(($comment[title] ? $comment[title] : $title))}&url={urlencode(($comment[url] ? $comment[url] : $url))}&hot=0"{if empty($hot)} class="on"{/if}>最新</a> <a href="{APP_PATH}index.php?m=comment&c=index&a=init&commentid={$commentid}&title={urlencode(($comment[title] ? $comment[title] : $title))}&url={urlencode(($comment[url] ? $comment[url] : $url))}&hot=1"{if $hot} class="on"{/if}>最热</a></div> <div class="col-left"> <div class="comment"> <h4 class="f14">评论列表<span class="f12 fn">(评论 <font color="red">{if $comment[total]}{$comment[total]}{else}0{/if}</font>)以下网友评论只代表网友个人观点,不代表本站观点。</span></h4> {pc:comment action="lists" commentid="$commentid" siteid="$siteid" page="$_GET[page]" hot="$hot" num="20"} {loop $data $r} <h5 class="title fn">{direction($r[direction])} <font color="#FF0000">{format::date($r[creat_at], 1)}</font> {if $r[userid]}{get_nickname($r[userid])}{else}{$r[username]}{/if} </h5> <div class="content">{$r[content]} <div class="rt"><a href="javascript:void(0)" onclick="reply({$r[id]}, '{$commentid}')">回复</a> <a href="javascript:void(0)" onclick="support({$r[id]}, '{$commentid}')">支持</a>(<font id="support_{$r[id]}">{$r[support]}</font>) </div> <div id="reply_{$r[id]}" style="display:none"></div> </div> <div class="bk30 hr mb8"></div> {/loop} </div> <div id="pages" class="text-r">{$pages}</div> {/pc} <div class="bk10"></div><div class="comment-form"> <form action="{APP_PATH}index.php?m=comment&c=index&a=post&commentid={$commentid}" method="post"> <input type="hidden" name="title" value="{urlencode(($comment[title] ? $comment[title] : $title))}"> <input type="hidden" name="url" value="{urlencode(($comment[url] ? $comment[url] : $url))}"> <a name="comment"></a> <h5><strong>我来说两句</strong></h5> <div class="posn">我的态度:<input type="radio" name="direction" value="1" /> <img src="{IMG_PATH}icon/zheng.png" /> <input type="radio" name="direction" value="2" /> <img src="{IMG_PATH}icon/fan.png" /> <input type="radio" name="direction" value="3" /> <img src="{IMG_PATH}icon/zhong.png" /> </div> <textarea rows="8" cols="80" name="content"></textarea><br> {if $setting[code]} <label>验证码:<input type="text" name="code" class="input-text" id="yzmText" onfocus="var offset = $(this).offset();$('#yzm').css({'left': +offset.left-8, 'top': +offset.top-$('#yzm').height()});$('#yzm').show();$('#yzmText').data('hide', 1)" onblur='$("#yzmText").data("hide", 0);setTimeout("hide_code()", 3000)' /></label> <div id="yzm" class="yzm">{form::checkcode()}<br />点击图片更换</a></div> <div class="bk10"></div> {/if} <div class="btn"><input type="submit" value="发表评论" /></div>&nbsp;&nbsp;&nbsp;&nbsp;{if $userid}{get_nickname()} <a href="{APP_PATH}index.php?m=member&c=index&a=logout&forward={urlencode(get_url())}">退出</a>{else}<a href="{APP_PATH}index.php?m=member&c=index&a=login&forward={urlencode(get_url())}" class="blue">登录</a><span> | </span><a href="{APP_PATH}index.php?m=member&c=index&a=register" class="blue">注册</a> {if !$setting[guest]}<span style="color:red">需要登陆才可发布评论</span>{/if}{/if} </form> <style type="text/css"> .look-content{ padding:10px;border:1px dashed #ffbf7a; background:#fffced; margin:10px auto} .look-content ul{ color:#666} </style> <div class="look-content"> <h6>请您注意:</h6> <ul> <li>自觉遵守:爱国、守法、自律、真实、文明的原则</li> <li>尊重网上道德,遵守《全国人大常委会关于维护互联网安全的决定》及中华人民共和国其他各项有关法律法规</li> <li>严禁发表危害国家安全,破坏民族团结、国家宗教政策和社会稳定,含侮辱、诽谤、教唆、淫秽等内容的作品</li> <li>承担一切因您的行为而直接或间接导致的民事或刑事法律责任</li> <li>您在本站评论发表的作品,本站有权在网站内保留、转载、引用或者删除</li> <li>参与本评论即表明您已经阅读并接受上述条款</li> </ul> </div> </div> </div> <div class="col-auto"> <div class="box"> <h5 class="title-2">评论排行</h5> {pc:comment action="bang" cache="3600"} <ul class="content list f12 lh22"> {loop $data $r} <li>·<a href="{$r[url]}" title="{$r[title]}">{str_cut($r[title], 26)}</a>({$r[total]})</li> {/loop} </ul> {/pc} </div> <div class="bk10"></div> </div> </div> <script type="text/javascript"> function support(id, commentid) { $.getJSON('{APP_PATH}index.php?m=comment&c=index&a=support&format=jsonp&commentid='+commentid+'&id='+id+'&callback=?', function(data){ if(data.status == 1) { $('#support_'+id).html(parseInt($('#support_'+id).html())+1); } else { alert(data.msg); } }); } function reply(id,commentid) { var str = '<form action="{APP_PATH}index.php?m=comment&c=index&a=post&commentid='+commentid+'&id='+id+'" method="post"><textarea rows="10" style="width:100%" name="content"></textarea>{if $setting[code]}<label>验证码:<input type="text" name="code" class="input-text" onfocus="var offset = $(this).offset();$(\'#yzm\').css({\'left\': +offset.left-8, \'top\': +offset.top-$(\'#yzm\').height()});$(\'#yzm\').show();$(\'#yzmText\').data(\'hide\', 1)" onblur=\'$("#yzmText").data("hide", 0);setTimeout("hide_code()", 3000)\' /></label>{/if} <div class="btn"><input type="submit" value="发表评论" /></div>&nbsp;&nbsp;&nbsp;&nbsp;{if $userid}{get_nickname()} <a href="{APP_PATH}index.php?m=member&c=index&a=logout&forward={urlencode(get_url())}">退出</a>{else}<a href="{APP_PATH}index.php?m=member&c=index&a=login&forward={urlencode(get_url())}" class="blue">登录</a> | <a href="{APP_PATH}index.php?m=member&c=index&a=register" class="blue">注册</a> {if !$setting[guest]}<span style="color:red">需要登陆才可发布评论</span>{/if}{/if}</form>'; $('#reply_'+id).html(str).toggle(); } function hide_code() { if ($('#yzmText').data('hide')==0) { $('#yzm').hide(); } } </script> {template "content","footer"}
108wo
phpcms/modules/comment/install/templates/list.html
HTML
asf20
7,018
<?php defined('IN_PHPCMS') or exit('Access Denied'); defined('INSTALL') or exit('Access Denied'); return array ( 'show_list.html' => '内容页评论列表', 'list.html' => '评论列表', ); ?>
108wo
phpcms/modules/comment/install/templates/name.inc.php
PHP
asf20
211
<?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'=>'评论列表'); ?>
108wo
phpcms/modules/comment/install/extention.inc.php
PHP
asf20
930
<?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 = ''; ?>
108wo
phpcms/modules/comment/install/config.inc.php
PHP
asf20
266
<?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'] = '请选择评论,再进行删除操作。';
108wo
phpcms/modules/comment/install/languages/zh-cn/comment.lang.php
PHP
asf20
2,406
<?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); }
108wo
phpcms/modules/comment/functions/global.func.php
PHP
asf20
1,054
<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>
108wo
phpcms/modules/special/templates/template_edit.tpl.php
PHP
asf20
241
<?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">&nbsp;&nbsp;<?php echo L('type_path')?>:<input type="text" name="type[1][typedir]" id="type_path" class="input-text" size="15">&nbsp;&nbsp;<?php echo L('listorder')?>:<input type="text" name="type[<?php echo $k?>][listorder]" value="1" size="6" class="input-text" ></span>&nbsp;<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">&nbsp;<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">&nbsp;&nbsp;<?php echo L('type_path')?>:<input type="text" name="type['+n+'][typedir]" class="input-text" size="15">&nbsp;&nbsp;<?php echo L('listorder')?>:<input type="text" name="type['+n+'][listorder]" value="'+n+'" size="6" class="input-text" ></span>&nbsp;<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>
108wo
phpcms/modules/special/templates/special_add.tpl.php
PHP
asf20
11,264
<?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?>&nbsp;&nbsp; <?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>&nbsp;&nbsp; <?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>
108wo
phpcms/modules/special/templates/import_content.tpl.php
PHP
asf20
3,844
<?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> '; } }?>&nbsp;<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>
108wo
phpcms/modules/special/templates/content_list.tpl.php
PHP
asf20
3,277
<?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')?>'>&nbsp; <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;}"/> &nbsp;<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>
108wo
phpcms/modules/special/templates/special_list.tpl.php
PHP
asf20
5,953
<?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>
108wo
phpcms/modules/special/templates/content_add.tpl.php
PHP
asf20
9,772
<?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']?>&nbsp;&nbsp;<?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">&nbsp;&nbsp;<?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">&nbsp;&nbsp;<?php echo L('listorder')?>:<input type="text" name="type[<?php echo $k?>][listorder]" value="<?php echo $t['listorder']?>" size="6" class="input-text" ></span>&nbsp;<?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">&nbsp;<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">&nbsp;&nbsp;<?php echo L('type_path')?>:<input type="text" name="type['+n+'][typedir]" class="input-text" size="15">&nbsp;&nbsp;<?php echo L('listorder')?>:<input type="text" name="type['+n+'][listorder]" value="'+n+'" size="6" class="input-text" ></span>&nbsp;<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>
108wo
phpcms/modules/special/templates/special_edit.tpl.php
PHP
asf20
12,574
<?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>
108wo
phpcms/modules/special/templates/content_edit.tpl.php
PHP
asf20
10,357
<?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?>&nbsp;&nbsp; <span id="catids"></span>&nbsp;&nbsp; <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>
108wo
phpcms/modules/special/templates/import_pics.tpl.php
PHP
asf20
3,255
<?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'); } } } ?>
108wo
phpcms/modules/special/index.php
PHP
asf20
6,818
<?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'))), ), ); } } ?>
108wo
phpcms/modules/special/classes/special_tag.class.php
PHP
asf20
6,557
<?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); } } } ?>
108wo
phpcms/modules/special/classes/special_api.class.php
PHP
asf20
16,515
<?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; } }
108wo
phpcms/modules/special/classes/search_api.class.php
PHP
asf20
1,463
<?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); } } ?>
108wo
phpcms/modules/special/classes/push_api.class.php
PHP
asf20
897
<?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; } } } }
108wo
phpcms/modules/special/classes/comment_api.class.php
PHP
asf20
952
<?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; } } ?>
108wo
phpcms/modules/special/classes/html.class.php
PHP
asf20
11,194
<?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); } } ?>
108wo
phpcms/modules/special/template.php
PHP
asf20
2,603
<?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; } }
108wo
phpcms/modules/special/content.php
PHP
asf20
12,781
<?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; } ?>
108wo
phpcms/modules/special/functions/global.func.php
PHP
asf20
4,638
<?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; } } ?>
108wo
phpcms/modules/special/special.php
PHP
asf20
18,825
<?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; } } ?>
108wo
phpcms/modules/admin/badword.php
PHP
asf20
6,711
<?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'); } } ?>
108wo
phpcms/modules/admin/setting.php
PHP
asf20
3,343
<?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); } } ?>
108wo
phpcms/modules/admin/database.php
PHP
asf20
14,752
<?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; } } ?>
108wo
phpcms/modules/admin/ipbanned.php
PHP
asf20
3,552
<?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>
108wo
phpcms/modules/admin/templates/downservers_list.tpl.php
PHP
asf20
3,167
<?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>
108wo
phpcms/modules/admin/templates/left.tpl.php
PHP
asf20
1,097
<?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>
108wo
phpcms/modules/admin/templates/login.tpl.php
PHP
asf20
3,457
<?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>
108wo
phpcms/modules/admin/templates/plugin_list_import.tpl.php
PHP
asf20
2,351
<?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 }?>>&nbsp;<?php echo L('linkage_option_style')?>&nbsp;&nbsp;<input name="info[style]" value="1" type="radio" <?php if($style==1) {?>checked<?php }?>>&nbsp;<?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>
108wo
phpcms/modules/admin/templates/linkage_edit.tpl.php
PHP
asf20
2,548
<?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>
108wo
phpcms/modules/admin/templates/copyfrom_add.tpl.php
PHP
asf20
1,710
<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>
108wo
phpcms/modules/admin/templates/cache_all.tpl.php
PHP
asf20
1,258
<?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>
108wo
phpcms/modules/admin/templates/position_item_manage.tpl.php
PHP
asf20
2,567
<?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>
108wo
phpcms/modules/admin/templates/urlrule_edit.tpl.php
PHP
asf20
3,639
<?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>
108wo
phpcms/modules/admin/templates/badword_add.tpl.php
PHP
asf20
2,446
<?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>
108wo
phpcms/modules/admin/templates/module_list.tpl.php
PHP
asf20
3,818
<?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>
108wo
phpcms/modules/admin/templates/linkage_get_list.tpl.php
PHP
asf20
1,153
<?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>
108wo
phpcms/modules/admin/templates/plugin_appcenter.tpl.php
PHP
asf20
4,089
<?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>
108wo
phpcms/modules/admin/templates/plugin_list.tpl.php
PHP
asf20
4,248
<?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>
108wo
phpcms/modules/admin/templates/position_edit.tpl.php
PHP
asf20
2,728
<?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>
108wo
phpcms/modules/admin/templates/admin_edit.tpl.php
PHP
asf20
2,843
<?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>
108wo
phpcms/modules/admin/templates/keylink_list.tpl.php
PHP
asf20
2,844
<?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');?>&nbsp;&nbsp;&nbsp;&nbsp; <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');?>&nbsp;&nbsp;&nbsp;&nbsp; <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>
108wo
phpcms/modules/admin/templates/category_page_edit.tpl.php
PHP
asf20
9,024
<?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>
108wo
phpcms/modules/admin/templates/map.tpl.php
PHP
asf20
1,086
<?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');?>&nbsp;&nbsp;&nbsp;&nbsp; <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');?>&nbsp;&nbsp;&nbsp;&nbsp; <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');?>&nbsp;&nbsp;&nbsp;&nbsp; <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>
108wo
phpcms/modules/admin/templates/category_page_add.tpl.php
PHP
asf20
9,589
<?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>
108wo
phpcms/modules/admin/templates/admin_card.tpl.php
PHP
asf20
792
<?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">&nbsp;<?php echo L('drop_down_style')?>&nbsp;&nbsp;<input name="info[style]" value="1" type="radio">&nbsp;<?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>
108wo
phpcms/modules/admin/templates/linkage_add.tpl.php
PHP
asf20
1,696
<?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>
108wo
phpcms/modules/admin/templates/plugin_setting.tpl.php
PHP
asf20
1,705
<?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>
108wo
phpcms/modules/admin/templates/urlrule_list.tpl.php
PHP
asf20
1,992
<?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')?>&nbsp;&nbsp;&nbsp;&nbsp; <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>
108wo
phpcms/modules/admin/templates/site_edit.tpl.php
PHP
asf20
13,078
<?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>
108wo
phpcms/modules/admin/templates/linkage_submenu.tpl.php
PHP
asf20
1,777
<?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>
108wo
phpcms/modules/admin/templates/role_edit.tpl.php
PHP
asf20
1,829
<?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"> &nbsp; <input type="reset" name="reset" value=" <?php echo L('clear')?> " class="button"> </td> </tr> </form> </table> </div> </body> </html>
108wo
phpcms/modules/admin/templates/badword_import.tpl.php
PHP
asf20
1,024
<?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>
108wo
phpcms/modules/admin/templates/keylink_edit.tpl.php
PHP
asf20
1,974