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
function copyfrom($field, $value) { static $copyfrom_array; if(!$copyform_array) $copyfrom_array = getcache('copyfrom','admin'); if($value && strpos($value,'|')!==false) { $arr = explode('|',$value); $value = $arr[0]; $value_data = $arr[1]; } if($value_data) { $copyfrom_link = $copyfrom_array[$value_data]; if(!empty($copyfrom_array)) { $imgstr = ''; if($value=='') $value = $copyfrom_link['siteurl']; if($copyfrom_link['thumb']) $imgstr = "<a href='{$copyfrom_link[siteurl]}' target='_blank'><img src='{$copyfrom_link[thumb]}' height='15'></a> "; return $imgstr."<a href='$value' target='_blank' style='color:#AAA'>{$copyfrom_link[sitename]}</a>"; } } else { return $value; } }
108wo
phpcms/modules/content/fields/copyfrom/output.inc.php
PHP
asf20
753
function copyfrom($field, $value) { $field_data = $field.'_data'; if(isset($_POST[$field_data])) { $value .= '|'.$_POST[$field_data]; } return $value; }
108wo
phpcms/modules/content/fields/copyfrom/input.inc.php
PHP
asf20
173
function readpoint($field, $value, $fieldinfo) { $paytype = $this->data['paytype']; if($paytype) { $checked1 = ''; $checked2 = 'checked'; } else { $checked1 = 'checked'; $checked2 = ''; } return '<input type="text" name="info['.$field.']" value="'.$value.'" size="5"><input type="radio" name="info[paytype]" value="0" '.$checked1.'> '.L('point').' <input type="radio" name="info[paytype]" value="1" '.$checked2.'>'.L('money'); }
108wo
phpcms/modules/content/fields/readpoint/form.inc.php
Hack
asf20
464
<?php defined('IN_ADMIN') or exit('No permission resources.'); $field_type = 'readpoint'; //字段数据库类型 $field_basic_table = 1; //是否允许作为主表字段 $field_allow_index = 0; //是否允许建立索引 $field_minlength = 0; //字符长度默认最小值 $field_maxlength = ''; //字符长度默认最大值 $field_allow_search = 1; //作为搜索条件 $field_allow_fulltext = 0; //作为全站搜索信息 $field_allow_isunique = 0; //是否允许值唯一 ?>
108wo
phpcms/modules/content/fields/readpoint/config.inc.php
PHP
asf20
501
<?php defined('IN_PHPCMS') or exit('No permission resources.');?>
108wo
phpcms/modules/content/fields/readpoint/field_edit_form.inc.php
PHP
asf20
66
<?php defined('IN_ADMIN') or exit('No permission resources.'); $this->db->query("ALTER TABLE `$tablename` DROP `$field`"); ?>
108wo
phpcms/modules/content/fields/delete.sql.php
PHP
asf20
130
<?php defined('IN_ADMIN') or exit('No permission resources.'); $defaultvalue = isset($_POST['setting']['defaultvalue']) ? $_POST['setting']['defaultvalue'] : ''; $minnumber = isset($_POST['setting']['minnumber']) ? $_POST['setting']['minnumber'] : 1; $decimaldigits = isset($_POST['setting']['decimaldigits']) ? $_POST['setting']['decimaldigits'] : ''; switch($field_type) { case 'varchar': if(!$maxlength) $maxlength = 255; $maxlength = min($maxlength, 255); $fieldtype = $issystem ? 'CHAR' : 'VARCHAR'; $sql = "ALTER TABLE `$tablename` CHANGE `$oldfield` `$field` $fieldtype( $maxlength ) NOT NULL DEFAULT '$defaultvalue'"; $this->db->query($sql); break; case 'tinyint': $minnumber = intval($minnumber); $defaultvalue = intval($defaultvalue); $this->db->query("ALTER TABLE `$tablename` CHANGE `$oldfield` `$field` TINYINT ".($minnumber >= 0 ? 'UNSIGNED' : '')." NOT NULL DEFAULT '$defaultvalue'"); break; case 'number': $minnumber = intval($minnumber); $defaultvalue = $decimaldigits == 0 ? intval($defaultvalue) : floatval($defaultvalue); $sql = "ALTER TABLE `$tablename` CHANGE `$oldfield` `$field` ".($decimaldigits == 0 ? 'INT' : 'FLOAT')." ".($minnumber >= 0 ? 'UNSIGNED' : '')." NOT NULL DEFAULT '$defaultvalue'"; $this->db->query($sql); break; case 'smallint': $minnumber = intval($minnumber); $defaultvalue = intval($defaultvalue); $this->db->query("ALTER TABLE `$tablename` CHANGE `$oldfield` `$field` SMALLINT ".($minnumber >= 0 ? 'UNSIGNED' : '')." NOT NULL DEFAULT '$defaultvalue'"); break; case 'mediumint': $minnumber = intval($minnumber); $defaultvalue = intval($defaultvalue); $this->db->query("ALTER TABLE `$tablename` CHANGE `$oldfield` `$field` MEDIUMINT ".($minnumber >= 0 ? 'UNSIGNED' : '')." NOT NULL DEFAULT '$defaultvalue'"); break; case 'int': $minnumber = intval($minnumber); $defaultvalue = intval($defaultvalue); $this->db->query("ALTER TABLE `$tablename` CHANGE `$oldfield` `$field` INT ".($minnumber >= 0 ? 'UNSIGNED' : '')." NOT NULL DEFAULT '$defaultvalue'"); break; case 'mediumtext': $this->db->query("ALTER TABLE `$tablename` CHANGE `$oldfield` `$field` MEDIUMTEXT NOT NULL"); break; case 'text': $this->db->query("ALTER TABLE `$tablename` CHANGE `$oldfield` `$field` TEXT NOT NULL"); break; case 'date': $this->db->query("ALTER TABLE `$tablename` CHANGE `$oldfield` `$field` DATE NULL"); break; case 'datetime': $this->db->query("ALTER TABLE `$tablename` CHANGE `$oldfield` `$field` DATETIME NULL"); break; case 'timestamp': $this->db->query("ALTER TABLE `$tablename` CHANGE `$oldfield` `$field` TIMESTAMP NOT NULL"); break; //特殊自定义字段 case 'pages': break; case 'readpoint': $defaultvalue = intval($defaultvalue); $this->db->query("ALTER TABLE `$tablename` CHANGE `$oldfield` `readpoint` smallint(5) unsigned NOT NULL default '$defaultvalue'"); break; } ?>
108wo
phpcms/modules/content/fields/edit.sql.php
PHP
asf20
2,985
function brand($field, $value, $fieldinfo) { //品牌 $brand_db = pc_base::load_model('brand_model'); $brand_1 = $brand_db->select(array('catid'=>$this->catid, 'parentid'=>0), 'id,name', '', 'name ASC'); if (is_array($brand_1)) { foreach ($brand_1 as &$b){ $b['child'] = $brand_db->select(array('catid'=>$this->catid, 'parentid'=>$b['id']), 'id,name', '', 'name ASC'); } } if(intval($value) > 0) { $brand = $brand_db->get_one('`id`='.$value, 'id,name,parentid'); if ($brand['parentid'] == 0) { $parent_brand = $brand; } else { //$brand = $brand_db->get_one('`id`='.$arrvalue[1], 'id,name,parentid'); $parent_brand = $brand_db->get_one('`id`='.$brand['parentid'], 'id,name'); } } $str = $str2 = ''; if($brand_1) { $str = '<select name="info['.$field.'][]" id="brand_1">'; foreach($brand_1 AS $b1) { $str .= "<option value='".$b1['id']."' ".(isset($parent_brand['id']) && $parent_brand['id']==$b1['id'] ? "selected":"").">".$b1['name']."</option>"; } if ($parent_brand != $brand) { $str2 .= '<select name="info['.$field.'][]" id="brand_2">'; foreach($brand_1 AS $b1) { if($b1['id'] == $parent_brand['id']) { foreach($b1['child'] AS $b2) { $str2 .= "<option value='".$b2['id']."' ".(isset($brand['id']) && $brand['id']==$b2['id'] ? "selected":"").">".$b2['name']."</option>"; } } } } else { $str2 .= '<select name="info['.$field.'][]" id="brand_2" '.((isset($brand_1[0]['child']) && $brand_1[0]['child'] && !$value) ? '' : 'style="display:none;"').'>'; foreach($brand_1[0]['child'] AS $b2) { $str2 .= "<option value='".$b2['id']."'>".$b2['name']."</option>"; } } $str .= '</select>'; $str2 .= '</select>'; } else { return "<span class='red'>此栏目暂时没有关联品牌</span>"; } $js = '<script type="text/javascript"> var brands = '.json_encode($brand_1).'; $(function(){ $("#brand_1").change(function(){ var bid_1 = this.value; var html=""; for(i in brands) { if(brands[i].id == bid_1) { for(j in brands[i].child) { html += "<option value=\'"+brands[i].child[j].id+"\'>"+brands[i].child[j].name+"</option>"; } if(html=="") { $("#brand_2").html(html).hide(); }else { $("#brand_2").show().html(html); } } } }); }); </script>'; return $str.$str2.$js; }
108wo
phpcms/modules/content/fields/brand/form.inc.php
PHP
asf20
2,577
<?php defined('IN_ADMIN') or exit('No permission resources.'); $field_type = 'varchar'; //字段数据库类型 $field_basic_table = 1; //是否允许作为主表字段 $field_allow_index = 1; //是否允许建立索引 $field_minlength = 0; //字符长度默认最小值 $field_maxlength = ''; //字符长度默认最大值 $field_allow_search = 1; //作为搜索条件 $field_allow_fulltext = 0; //作为全站搜索信息 $field_allow_isunique = 0; //是否允许值唯一 ?>
108wo
phpcms/modules/content/fields/brand/config.inc.php
PHP
asf20
499
function downfiles($field, $value, $fieldinfo) { extract(string2array($fieldinfo['setting'])); $list_str = ''; if($value) { $value = string2array(html_entity_decode($value,ENT_QUOTES)); if(is_array($value)) { foreach($value as $_k=>$_v) { $list_str .= "<div id='multifile{$_k}'><input type='text' name='{$field}_fileurl[]' value='{$_v[fileurl]}' style='width:310px;' class='input-text'> <input type='text' name='{$field}_filename[]' value='{$_v[filename]}' style='width:160px;' class='input-text'> <a href=\"javascript:remove_div('multifile{$_k}')\">".L('remove_out')."</a></div>"; } } } $string = '<input name="info['.$field.']" type="hidden" value="1"> <fieldset class="blue pad-10"> <legend>'.L('file_list').'</legend>'; $string .= $list_str; $string .= '<ul id="'.$field.'" class="picList"></ul> </fieldset> <div class="bk10"></div> '; if(!defined('IMAGES_INIT')) { $str = '<script type="text/javascript" src="'.JS_PATH.'swfupload/swf2ckeditor.js"></script>'; define('IMAGES_INIT', 1); } $authkey = upload_key("$upload_number,$upload_allowext,$isselectimage"); $string .= $str."<input type=\"button\" class=\"button\" value=\"".L('multiple_file_list')."\" onclick=\"javascript:flashupload('{$field}_multifile', '".L('attachment_upload')."','{$field}',change_multifile,'{$upload_number},{$upload_allowext},{$isselectimage}','content','$this->catid','{$authkey}')\"/> <input type=\"button\" class=\"button\" value=\"".L('add_remote_url')."\" onclick=\"add_multifile('{$field}')\">"; return $string; }
108wo
phpcms/modules/content/fields/downfiles/form.inc.php
Hack
asf20
1,607
<?php defined('IN_ADMIN') or exit('No permission resources.'); $field_type = 'mediumtext'; //字段数据库类型 $field_basic_table = 0; //是否允许作为主表字段 $field_allow_index = 0; //是否允许建立索引 $field_minlength = 0; //字符长度默认最小值 $field_maxlength = ''; //字符长度默认最大值 $field_allow_search = 0; //作为搜索条件 $field_allow_fulltext = 0; //作为全站搜索信息 $field_allow_isunique = 0; //是否允许值唯一 ?>
108wo
phpcms/modules/content/fields/downfiles/config.inc.php
PHP
asf20
502
<table cellpadding="2" cellspacing="1" width="98%"> <tr> <td>允许上传的文件类型</td> <td><input type="text" name="setting[upload_allowext]" value="gif|jpg|jpeg|png|bmp" size="40" class="input-text"></td> </tr> <tr> <td>是否从已上传中选择</td> <td><input type="radio" name="setting[isselectfile]" value="1"> 是 <input type="radio" name="setting[isselectimage]" value="0" checked> 否</td> </tr> <tr> <td>允许同时上传的个数</td> <td><input type="text" name="setting[upload_number]" value="10" size=3></td> </tr> <tr> <td>附件下载方式</td> <td> <input name="setting[downloadlink]" value="0" type="radio"> 链接到真实软件地址 <input name="setting[downloadlink]" value="1" checked="checked" type="radio"> 链接到跳转页面 </td></tr> <tr> <td>文件下载方式</td> <td> <input name="setting[downloadtype]" value="0" type="radio"> 链接文件地址 <input name="setting[downloadtype]" value="1" checked="checked" type="radio"> 通过PHP读取 </td></tr> </table>
108wo
phpcms/modules/content/fields/downfiles/field_add_form.inc.php
Hack
asf20
1,177
<?php defined('IN_PHPCMS') or exit('No permission resources.');?> <table cellpadding="2" cellspacing="1" width="98%"> <tr> <td>允许上传的文件类型</td> <td><input type="text" name="setting[upload_allowext]" value="<?php echo $setting['upload_allowext'];?>" size="40" class="input-text"></td> </tr> <tr> <td>是否从已上传中选择</td> <td><input type="radio" name="setting[isselectimage]" value="1" <?php if($setting['isselectimage']) echo 'checked';?>> 是 <input type="radio" name="setting[isselectimage]" value="0" <?php if(!$setting['isselectimage']) echo 'checked';?>> 否</td> </tr> <tr> <td>允许同时上传的个数</td> <td><input type="text" name="setting[upload_number]" value="<?php echo $setting['upload_number'];?>" size=3></td> </tr> <tr> <td>文件链接方式</td> <td> <input name="setting[downloadlink]" value="0" type="radio" <?php if(!$setting['downloadlink']) echo 'checked';?>> 链接到真实软件地址 <input name="setting[downloadlink]" value="1" type="radio" <?php if($setting['downloadlink']) echo 'checked';?>> 链接到跳转页面 </td> </tr> <tr> <td>文件下载方式</td> <td> <input name="setting[downloadtype]" value="0" type="radio" <?php if(!$setting['downloadtype']) echo 'checked';?>> 链接文件地址 <input name="setting[downloadtype]" value="1" type="radio" <?php if($setting['downloadtype']) echo 'checked';?>> 通过PHP读取 </td> </tr> </table>
108wo
phpcms/modules/content/fields/downfiles/field_edit_form.inc.php
PHP
asf20
1,588
function downfiles($field, $value) { extract(string2array($this->fields[$field]['setting'])); $list_str = array(); $file_list = string2array($value); if(is_array($file_list)) { foreach($file_list as $_k=>$_v) { if($_v[fileurl]){ $filename = $_v[filename] ? $_v[filename] : L('click_to_down'); if($downloadlink) { $a_k = urlencode(sys_auth("i=$this->id&s=&m=1&f=$_v[fileurl]&d=$downloadtype&modelid=$this->modelid&catid=$this->catid", 'ENCODE', pc_base::load_config('system','auth_key'))); $list_str[] = "<a href='".APP_PATH."index.php?m=content&c=down&a_k={$a_k}' target='_blank'>{$filename}</a>"; } else { $list_str[] = "<a href='{$_v[fileurl]}' target='_blank'>{$filename}</a>"; } } } } return $list_str; }
108wo
phpcms/modules/content/fields/downfiles/output.inc.php
PHP
asf20
797
function downfiles($field, $value) { $files = $_POST[$field.'_fileurl']; $files_alt = $_POST[$field.'_filename']; $array = $temp = array(); if(!empty($files)) { foreach($files as $key=>$file) { $temp['fileurl'] = $file; $temp['filename'] = $files_alt[$key]; $array[$key] = $temp; } } $array = array2string($array); return $array; }
108wo
phpcms/modules/content/fields/downfiles/input.inc.php
PHP
asf20
383
function template($field, $value, $fieldinfo) { $sitelist = getcache('sitelist','commons'); $default_style = $sitelist[$this->siteid]['default_style']; return form::select_template($default_style,'content',$value,'name="info['.$field.']" id="'.$field.'"','show'); }
108wo
phpcms/modules/content/fields/template/form.inc.php
PHP
asf20
279
<?php defined('IN_ADMIN') or exit('No permission resources.'); $field_type = 'tinyint'; //字段数据库类型 $field_basic_table = 1; //是否允许作为主表字段 $field_allow_index = 1; //是否允许建立索引 $field_minlength = 0; //字符长度默认最小值 $field_maxlength = ''; //字符长度默认最大值 $field_allow_search = 1; //作为搜索条件 $field_allow_fulltext = 0; //作为全站搜索信息 $field_allow_isunique = 0; //是否允许值唯一 ?>
108wo
phpcms/modules/content/fields/template/config.inc.php
PHP
asf20
499
<?php defined('IN_PHPCMS') or exit('No permission resources.');?>
108wo
phpcms/modules/content/fields/template/field_edit_form.inc.php
PHP
asf20
65
function datetime($field, $value, $fieldinfo) { extract(string2array($fieldinfo['setting'])); $isdatetime = 0; if($fieldtype=='int') { if(!$value) $value = SYS_TIME; $format_txt = $format == 'm-d' ? 'm-d' : $format; $value = date($format_txt,$value); $isdatetime = strlen($format) > 6 ? 1 : 0; } elseif($fieldtype=='datetime') { $isdatetime = 1; } return form::date("info[$field]",$value,$isdatetime,1); }
108wo
phpcms/modules/content/fields/datetime/form.inc.php
PHP
asf20
448
<?php defined('IN_ADMIN') or exit('No permission resources.'); $field_type = 'int'; //字段数据库类型 $field_basic_table = 1; //是否允许作为主表字段 $field_allow_index = 1; //是否允许建立索引 $field_minlength = ''; //字符长度默认最小值 $field_maxlength = ''; //字符长度默认最大值 $field_allow_search = 1; //作为搜索条件 $field_allow_fulltext = 0; //作为全站搜索信息 $field_allow_isunique = 0; //是否允许值唯一 ?>
108wo
phpcms/modules/content/fields/datetime/config.inc.php
PHP
asf20
496
<table cellpadding="2" cellspacing="1" bgcolor="#ffffff"> <tr> <td><strong>时间格式:</strong></td> <td> <input type="radio" name="setting[fieldtype]" value="date" checked>日期(<?php echo date('Y-m-d');?>)<br /> <input type="radio" name="setting[fieldtype]" value="datetime">日期+时间(<?php echo date('Y-m-d H:i:s');?>)<br /> <input type="radio" name="setting[fieldtype]" value="int">整数 显示格式: <select name="setting[format]"> <option value="Y-m-d H:i:s"><?php echo date('Y-m-d H:i:s');?></option> <option value="Y-m-d H:i"><?php echo date('Y-m-d H:i');?></option> <option value="Y-m-d"><?php echo date('Y-m-d');?></option> <option value="m-d"><?php echo date('m-d');?></option> </select> </td> </tr> <tr> <td><strong>默认值:</strong></td> <td> <input type="radio" name="setting[defaulttype]" value="0" checked/>无<br /> </td> </tr> </table>
108wo
phpcms/modules/content/fields/datetime/field_add_form.inc.php
PHP
asf20
970
<?php defined('IN_PHPCMS') or exit('No permission resources.');?> <table cellpadding="2" cellspacing="1" bgcolor="#ffffff"> <tr> <td><strong>时间格式:</strong></td> <td> <input type="radio" name="setting[fieldtype]" value="date" <?php if($setting['fieldtype']=='date') echo 'checked';?>>日期(<?=date('Y-m-d')?>)<br /> <input type="radio" name="setting[fieldtype]" value="datetime" <?php if($setting['fieldtype']=='datetime') echo 'checked';?>>日期+时间(<?=date('Y-m-d H:i:s')?>)<br /> <input type="radio" name="setting[fieldtype]" value="int" <?php if($setting['fieldtype']=='int') echo 'checked';?>>整数 显示格式: <select name="setting[format]"> <option value="Y-m-d H:i:s" <?php if($setting['format']=='Y-m-d H:i:s') echo 'selected';?>><?php echo date('Y-m-d H:i:s')?></option> <option value="Y-m-d H:i" <?php if($setting['format']=='Y-m-d H:i') echo 'selected';?>><?php echo date('Y-m-d H:i')?></option> <option value="Y-m-d" <?php if($setting['format']=='Y-m-d') echo 'selected';?>><?php echo date('Y-m-d')?></option> <option value="m-d" <?php if($setting['format']=='m-d') echo 'selected';?>><?php echo date('m-d')?></option> </select> </td> </tr> <tr> <td><strong>默认值:</strong></td> <td> <input type="radio" name="setting[defaulttype]" value="0" checked/>无<br /> </td> </tr> </table>
108wo
phpcms/modules/content/fields/datetime/field_edit_form.inc.php
PHP
asf20
1,420
function datetime($field, $value) { $setting = string2array($this->fields[$field]['setting']); extract($setting); if($fieldtype=='date' || $fieldtype=='datetime') { return $value; } else { $format_txt = $format; } if(strlen($format_txt)<6) { $isdatetime = 0; } else { $isdatetime = 1; } if(!$value) $value = SYS_TIME; $value = date($format_txt,$value); return $value; }
108wo
phpcms/modules/content/fields/datetime/output.inc.php
PHP
asf20
423
function datetime($field, $value) { $setting = string2array($this->fields[$field]['setting']); if($setting['fieldtype']=='int') { $value = strtotime($value); } return $value; }
108wo
phpcms/modules/content/fields/datetime/input.inc.php
PHP
asf20
197
function catid($field, $value, $fieldinfo) { if(!$value) $value = $this->catid; $publish_str = ''; if(defined('IN_ADMIN') && ROUTE_A=='add') $publish_str = " <a href='javascript:;' onclick=\"omnipotent('selectid','?m=content&c=content&a=add_othors&siteid=".$this->siteid."','".L('publish_to_othor_category')."',1);return false;\" style='color:#B5BFBB'>[".L('publish_to_othor_category')."]</a><ul class='list-dot-othors' id='add_othors_text'></ul>"; return '<input type="hidden" name="info['.$field.']" value="'.$value.'">'.$this->categorys[$value]['catname'].$publish_str; }
108wo
phpcms/modules/content/fields/catid/form.inc.php
Hack
asf20
591
<?php defined('IN_ADMIN') or exit('No permission resources.'); $field_type = 'int'; //字段数据库类型 $field_basic_table = 1; //是否允许作为主表字段 $field_allow_index = 1; //是否允许建立索引 $field_minlength = 1; //字符长度默认最小值 $field_maxlength = ''; //字符长度默认最大值 $field_allow_search = 0; //作为搜索条件 $field_allow_fulltext = 0; //作为全站搜索信息 $field_allow_isunique = 0; //是否允许值唯一 ?>
108wo
phpcms/modules/content/fields/catid/config.inc.php
PHP
asf20
495
<?php defined('IN_PHPCMS') or exit('No permission resources.');?>
108wo
phpcms/modules/content/fields/catid/field_edit_form.inc.php
PHP
asf20
66
<?php defined('IN_PHPCMS') or exit('No permission resources.'); class readpoint { public $userid,$username; function __construct() { $this->userid = param::get_cookie('_userid'); if(!$this->userid) { header("Location: index.php?m=member&c=index&a=login&forward=".urlencode(get_url())); exit; } $this->username = param::get_cookie('_username'); } public function init() { $allow_visitor = htmlspecialchars($_GET['allow_visitor']); $auth = sys_auth($allow_visitor,'DECODE'); if(strpos($auth,'|')===false) showmessage(L('illegal_operation')); $auth_str = explode('|', $auth); $flag = $auth_str[0]; if(!preg_match('/^([0-9]+)|([0-9]+)/', $flag)) showmessage(L('illegal_operation')); $readpoint = intval($auth_str[1]); $paytype = intval($auth_str[2]); $http_referer = urldecode($_GET['http_referer']); if(!$readpoint) showmessage(L('illegal_operation')); pc_base::load_app_class('spend','pay',0); $flag_arr = explode('_', $flag); $catid = $flag_arr[0]; $siteids = getcache('category_content','commons'); $siteid = $siteids[$catid]; $CATEGORYS = getcache('category_content_'.$siteid,'commons'); if(isset($CATEGORYS[$catid])) { $setting = string2array($CATEGORYS[$catid]['setting']); $repeatchargedays = intval($setting['repeatchargedays']); if($repeatchargedays) { $fromtime = SYS_TIME - 86400 * $repeatchargedays; $r = spend::spend_time($this->userid,$fromtime,$flag); if($r) showmessage(L('have_pay'),$http_referer,1000); } } if($paytype) { if(spend::amount($readpoint, L('msg_readpoint'), $this->userid, $this->username, '', '', $flag)==false) { $msg = spend::get_msg(); $http_referer = APP_PATH.'index.php?m=pay&c=deposit&a=pay'; } else { $msg = L('readpoint_pay',array('readpoint'=>$readpoint)); } } else { if(spend::point($readpoint, L('msg_readpoint'), $this->userid, $this->username, '', '', $flag)==false) { $msg = spend::get_msg(); $http_referer = APP_PATH.'index.php?m=pay&c=deposit&a=pay'; } else { $msg = L('readpoint_pay_point',array('readpoint'=>$readpoint)); } } showmessage($msg,$http_referer,3000); } } ?>
108wo
phpcms/modules/content/readpoint.php
PHP
asf20
2,212
<?php /** * eddy * 会员中心 产品管理 */ defined('IN_PHPCMS') or exit('No permission resources.'); class product { private $db; public $memberinfo; function __construct() { $this->db = pc_base::load_model('content_model'); $this->db->set_model(13); $this->_userid = param::get_cookie('_userid'); $this->_username = param::get_cookie('_username'); $this->_groupid = param::get_cookie('_groupid'); $user_db = pc_base::load_model('member_model'); $this->memberinfo = $user_db->get_one(array('userid'=>$this->_userid)); } /** * 我的产品 */ public function init() { $in = new_addslashes(array_merge($_GET, $_POST)); $content_total = 0; $product_pages = ''; $product_data = array(); $ordernum = 0; $monthordernum = 0; //品牌 $brand_db = pc_base::load_model('brand_model'); $_brands = $brand_db->select(array('userid'=>$this->memberinfo['userid']), 'id,name,parentid', '', 'sort DESC, parentid ASC'); $brands = array(); $bids = ''; //品牌,分类的全部ID foreach ($_brands AS $v) { $bids .= $v['id'].','; if ($v['parentid'] == 0) { $brands[$v['id']] = $v; } else { $brands[$v['parentid']]['child'][$v['id']] = $v; } } if ($_GET['bid']) { $bids = $_GET['bid']; //覆盖上面的 $brand = $brand_db->get_one(array('id'=>intval($_GET['bid'])), 'id,name,parentid'); if ($brand['parentid']==0) { $top_brand = $brands[$brand['id']]; foreach ($top_brand['child'] AS $v) { $bids .= ','.$v['id']; } } else { $top_brand = $brands[$brand['parentid']]; } } if ($bids) { $page = intval($_GET['page']) ? intval($_GET['page']) : 1; $pagesize = 12; $offset = ($page - 1) * $pagesize; $content_total = $this->db->count('`bids` IN('.trim($bids, ',').')'); $product_pages = pages($content_total, $page, $pagesize); $product_data = $this->db->select('`bids` IN('.trim($bids, ',').')', 'id,title,thumb,ordernum,monthordernum', $offset.",".$pagesize, 'myhelp_inputtime DESC'); $myhelp_db = pc_base::load_model('myhelp_model'); foreach ($product_data AS &$p) { $ordernum += $p['ordernum']; $monthordernum += $p['monthordernum']; $p['myhelp'] = $myhelp_db->get_one(array('productid'=>$p['id']), 'id,title,inputtime', 'inputtime DESC'); } } $SEO = seo(1, 0, '我的产品'); $memberinfo = $this->memberinfo; include template('content', 'product_list'); } /** * 产品询价 */ public function price() { $in = new_addslashes(array_merge($_GET, $_POST)); $order_detail_model = pc_base::load_model('order_detail_model'); $where = 'supplierid='.$this->memberinfo['userid'].' AND enquiry!=0'; $total = $order_detail_model->count($where); $page = isset($_GET['page']) && intval($_GET['page']) ? intval($_GET['page']) : 1; $pagesize = 12; $offset = ($page - 1) * $pagesize; $product_pages = pages($total, $page, $pagesize); $product_data = $order_detail_model->select($where, '*', $offset.",".$pagesize, 'updatetime DESC'); //关联栏目 eddy $memberinfo = $this->memberinfo; $SEO = seo(1, 0, '产品询价'); include template('content', 'product_price'); } /** * 编辑产品名称 */ public function update_title() { $in = new_addslashes(array_merge($_GET, $_POST)); $product = $this->db->get_one(array('id'=>$in['id']), 'bids'); if ($product){ $brand_db = pc_base::load_model('brand_model'); $brand = $brand_db->get_one(array('id'=>$product['bids']), 'userid'); } if (!empty($in['title']) && $in['id'] && $brand['userid']==$this->_userid) { $this->db->update(array('title'=>$in['title']), array('id'=>$in['id'])); } die(json_encode(array('id'=>$in['id'], 'new_title'=>$in['title']))); } /** * 删除 */ public function delete() { $in = new_addslashes(array_merge($_GET, $_POST)); $product = $this->db->get_one(array('id'=>$in['id']), 'id,catid,bids'); if ($product){ $brand_db = pc_base::load_model('brand_model'); $brand = $brand_db->get_one(array('id'=>$product['bids']), 'userid'); } $id = $product['id']; $categorys = getcache('category_content_'.get_siteid(),'commons'); $catid = $product['catid']; $modelid = $categorys[$catid]['modelid']; $siteid = get_siteid(); if ($brand['userid']==$this->_userid) { //删除内容 $this->db->delete_content($id,0,$product['catid']); //删除统计表数据 $this->hits_db = pc_base::load_model('hits_model'); $this->hits_db->delete(array('hitsid'=>'c-'.$modelid.'-'.$id)); //删除审核表数据 $this->content_check_db = pc_base::load_model('content_check_model'); $this->content_check_db->delete(array('checkid'=>'c-'.$id.'-'.$modelid)); //删除推荐位数据 $this->position_data_db = pc_base::load_model('position_data_model'); $this->position_data_db->delete(array('id'=>$id,'catid'=>$catid,'module'=>'content')); //删除全站搜索中数据 $search_model = getcache('search_model_'.$siteid,'search'); $typeid = $search_model[$modelid]['typeid']; $this->search_db = pc_base::load_model('search_model'); $this->search_db->delete_search($typeid,$id); //删除相关的评论 $this->comment = pc_base::load_app_class('comment', 'comment'); $commentid = id_encode('content_'.$catid, $id, $siteid); $this->comment->del($commentid, $siteid, $id, $catid); //删除求助信息 $myhelp_db = pc_base::load_model('myhelp_model'); $myhelp_db->delete(array('productid'=>$id)); $this->db->cache_items(); showmessage(L('operation_success'),HTTP_REFERER); } } /** * 产品批量上传 * eddy */ public function batchUpload() { pc_base::load_app_func('global'); $brand_db = pc_base::load_model('brand_model'); $catModel = pc_base::load_model('category_model'); $memberModel = pc_base::load_model('member_model'); $grouplist = getcache('grouplist','member'); $this->siteid = $siteid = get_siteid(); $this->upload_url = pc_base::load_config('system','upload_url'); $this->upload_path = pc_base::load_config('system','upload_path'); $this->imgext = array('jpg','gif','png','bmp','jpeg'); $this->isadmin = $isadmin = 0; $this->siteid = $siteid = get_siteid(); $this->swf_auth_key = $swf_auth_key = md5(pc_base::load_config('system','auth_key').SYS_TIME); $args = "100,jpg|jpeg|gif|png|bmp,1,,,0"; if (isset($_POST['dosubmit'])) { $this->groupid = $_POST['groupid']; //判断权限 $memberinfo = $memberModel->get_one(array('userid'=>$_POST['userid'])); if ($memberinfo['doupload'] != 1) { die("0,对不起,您没有权限进行批量上传操作,请联系站点管理员开启!"); } $bids = explode(',', $_POST['bids']); if (count($bids)>0) { $top_brand = $brand_db->get_one(array('id'=>$bids[0]), 'id,name,catid,parentid'); $bid = array_pop($bids); } else { die("0,您还没有建立自己的栏目!"); } if( $_POST['swf_auth_key'] != md5(pc_base::load_config('system','auth_key').$_POST['SWFUPLOADSESSID']) || ($_POST['isadmin']==0 && !$grouplist[$_POST['groupid']]['allowattachment'])) { die("0,您所在的会员组未开通附件上传权限,请联系管理员开通!"); } if (!intval($top_brand['catid'])) { die("0,此品牌没有绑定栏目,不能进行上传操作!"); } pc_base::load_sys_class('attachment','',0); $attachment = new attachment($_POST['module'],$_POST['catid'],$_POST['siteid']); $attachment->set_userid($_POST['userid']); $aids = $attachment->upload('Filedata',$_POST['filetype_post'],'','',array($_POST['thumb_width'],$_POST['thumb_height']),$_POST['watermark_enable']); if($aids[0]) { $filename= (strtolower(CHARSET) != 'utf-8') ? iconv('gbk', 'utf-8', $attachment->uploadedfiles[0]['filename']) : $filename ; if($attachment->uploadedfiles[0]['isimage']) { $arrtitle = explode('.', $_FILES['Filedata']['name']); //内容数据 $_POST['status'] = 99; $_POST['style_color'] = ''; $_POST['style_font_weight'] = ''; $_POST['pc_hash'] = $_SESSION['pc_hash']; $_POST['info'] = array( 'monthordernum' => 0, 'inputtime' => date('Y-m-d H:i:s'), 'template' => '', 'catid' => $top_brand['catid'], 'title' => $arrtitle[0], 'ordernum' => 0, 'viewnum' => 0, 'keywords' => '', 'goodnum' => 0, 'badnum' => 0, 'status' => 99, 'thumb' => $this->upload_url.$attachment->uploadedfiles[0]['filepath'], 'username' => $_POST['username'], 'bids' => $bid, ); $content_model = pc_base::load_model('content_model'); $content_model->set_model(13); //只针对产品模型 $content_id = $content_model->add_content($_POST['info']); //更改附件状态 $attachment_model = pc_base::load_model('attachment_model'); $attachment_model->update(array('status'=>1),array('aid'=>$aids[0])); //插入附件关联内容表 $att_index_db = pc_base::load_model('attachment_index_model'); $att_index_db->insert(array('keyid'=>'c-'.$_POST['catid'].'-'.$content_id,'aid'=>$aids[0])); echo $aids[0].','.$this->upload_url.$attachment->uploadedfiles[0]['filepath'].','.$attachment->uploadedfiles[0]['isimage'].','.$filename; } exit; } else { echo '0,'.$attachment->error(); exit; } } //获取当前用户信息 $memberinfo = $memberModel->get_one(array('userid'=>param::get_cookie('_userid'))); if ($memberinfo['doupload'] != 1) { die("对不起,您没有权限进行批量上传操作,请联系站点管理员开启!"); } //品牌 $brand_1 = $brand_db->select(array('userid'=>$memberinfo['userid'], 'parentid'=>0), 'id,name', '', 'name ASC'); $brand_haschild = 0; if (is_array($brand_1)) { foreach ($brand_1 as &$b){ $b['child'] = $brand_db->select(array('userid'=>$memberinfo['userid'], 'parentid'=>$b['id']), 'id,name', '', 'name ASC'); if ($b['child']) $brand_haschild = 1; } } $brands_json = json_encode($brand_1); if(!$brand_1) { die('您还没有添加栏目,请您联系管理员添加栏目!'); } if (!$brand_haschild) { die('您还没有添加栏目分类,<a href="'.APP_PATH.'index.php?m=brand" target="_top">点击这里</a>添加栏目分类!'); } $siteid = $_GET['siteid']; include template('content', 'product_batchupload'); } }
108wo
phpcms/modules/content/product.php
PHP
asf20
10,456
<?php defined('IN_PHPCMS') or exit('No permission resources.'); //模型缓存路径 define('CACHE_MODEL_PATH',CACHE_PATH.'caches_model'.DIRECTORY_SEPARATOR.'caches_data'.DIRECTORY_SEPARATOR); pc_base::load_app_func('util','content'); class MY_tag { private $db; function __construct() { $this->db = pc_base::load_model('content_model'); } /** * 按照模型搜索 */ public function init() { if(!isset($_GET['catid'])) showmessage(L('missing_part_parameters')); $catid = intval($_GET['catid']); $siteids = getcache('category_content','commons'); $siteid = $siteids[$catid]; $this->categorys = getcache('category_content_'.$siteid,'commons'); if(!isset($this->categorys[$catid])) showmessage(L('missing_part_parameters')); if(isset($_GET['info']['catid']) && $_GET['info']['catid']) { $catid = intval($_GET['info']['catid']); } else { $_GET['info']['catid'] = 0; } if(isset($_GET['tag']) && trim($_GET['tag']) != '') { $tag = safe_replace(strip_tags($_GET['tag'])); } else { showmessage(L('illegal_operation')); } $modelid = $this->categorys[$catid]['modelid']; $modelid = intval($modelid); if(!$modelid) showmessage(L('illegal_parameters')); $CATEGORYS = $this->categorys; $siteid = $this->categorys[$catid]['siteid']; $siteurl = siteurl($siteid); $this->db->set_model($modelid); $page = $_GET['page']; $datas = $infos = array(); $infos = $this->db->listinfo("`keywords` LIKE '%$tag%'",'id DESC',$page,20); $total = $this->db->number; if($total>0) { $pages = $this->db->pages; foreach($infos as $_v) { if(strpos($_v['url'],'://')===false) $_v['url'] = $siteurl.$_v['url']; $datas[] = $_v; } } $SEO = seo($siteid, $catid, $tag); include template('content','tag'); } } ?>
108wo
phpcms/modules/content/MY_tag.php
PHP
asf20
1,821
<?php defined('IN_PHPCMS') or exit('No permission resources.'); //模型缓存路径 define('CACHE_MODEL_PATH',CACHE_PATH.'caches_model'.DIRECTORY_SEPARATOR.'caches_data'.DIRECTORY_SEPARATOR); pc_base::load_app_func('util','content'); class MY_search { private $db; function __construct() { $this->db = pc_base::load_model('content_model'); } /** * 按照模型搜索 */ public function init() { $grouplist = getcache('grouplist','member'); $_groupid = param::get_cookie('_groupid'); if(!$_groupid) $_groupid = 8; if(!$grouplist[$_groupid]['allowsearch']) { if ($_groupid==8) showmessage(L('guest_not_allowsearch')); else showmessage(''); } if(!isset($_GET['catid'])) showmessage(L('missing_part_parameters')); $catid = intval($_GET['catid']); $siteids = getcache('category_content','commons'); $siteid = $siteids[$catid]; $this->categorys = getcache('category_content_'.$siteid,'commons'); if(!isset($this->categorys[$catid])) showmessage(L('missing_part_parameters')); if(isset($_GET['info']['catid']) && $_GET['info']['catid']) { $catid = intval($_GET['info']['catid']); } else { $_GET['info']['catid'] = 0; } $modelid = $this->categorys[$catid]['modelid']; $modelid = intval($modelid); if(!$modelid) showmessage(L('illegal_parameters')); //搜索间隔 $minrefreshtime = getcache('common','commons'); $minrefreshtime = intval($minrefreshtime['minrefreshtime']); $minrefreshtime = $minrefreshtime ? $minrefreshtime : 5; if(param::get_cookie('search_cookie') && param::get_cookie('search_cookie')>SYS_TIME-2) { showmessage(L('search_minrefreshtime',array('min'=>$minrefreshtime)),'index.php?m=content&c=search&catid='.$catid,$minrefreshtime*1280); } else { param::set_cookie('search_cookie',SYS_TIME+2); } //搜索间隔 $CATEGORYS = $this->categorys; //产生表单 pc_base::load_sys_class('form','',0); $fields = getcache('model_field_'.$modelid,'model'); $forminfos = array(); foreach ($fields as $field=>$r) { if($r['issearch']) { if($r['formtype']=='catid') { $r['form'] = form::select_category('',$_GET['info']['catid'],'name="info[catid]"',L('please_select_category'),$modelid,0,1); } elseif($r['formtype']=='number') { $r['form'] = "<input type='text' name='{$field}_start' id='{$field}_start' value='' size=5 class='input-text'/> - <input type='text' name='{$field}_end' id='{$field}_start' value='' size=5 class='input-text'/>"; } elseif($r['formtype']=='datetime') { $r['form'] = form::date("info[$field]"); } elseif($r['formtype']=='box') { $options = explode("\n",$r['options']); foreach($options as $_k) { $v = explode("|",$_k); $option[$v[1]] = $v[0]; } switch($r['boxtype']) { case 'radio': $string = form::radio($option,$value,"name='info[$field]' id='$field'"); break; case 'checkbox': $string = form::radio($option,$value,"name='info[$field]' id='$field'"); break; case 'select': $string = form::select($option,$value,"name='info[$field]' id='$field'"); break; case 'multiple': $string = form::select($option,$value,"name='info[$field]' id='$field'"); break; } $r['form'] = $string; } elseif($r['formtype']=='typeid') { $types = getcache('type_content','commons'); $types_array = array(L('no_limit')); foreach ($types as $_k=>$_v) { if($modelid == $_v['modelid']) $types_array[$_k] = $_v['name']; } $r['form'] = form::select($types_array,0,"name='info[$field]' id='$field'"); } elseif($r['formtype']=='linkage') { $setting = string2array($r['setting']); $value = $_GET['info'][$field]; $r['form'] = menu_linkage($setting['linkageid'],$field,$value); } elseif(in_array($r['formtype'], array('text','keyword','textarea','editor','title','author','omnipotent'))) { $value = safe_replace($_GET['info'][$field]); $r['form'] = "<input type='text' name='info[$field]' id='$field' value='".$value."' class='input-text search-text'/>"; } else { continue; } $forminfos[$field] = $r; } } //----------- if(isset($_GET['dosubmit'])) { $siteid = $this->categorys[$catid]['siteid']; $siteurl = siteurl($siteid); $this->db->set_model($modelid); $tablename = $this->db->table_name; $page = max(intval($_GET['page']), 1); $sql = "SELECT * FROM `{$tablename}` a,`{$tablename}_data` b WHERE a.id=b.id AND a.status=99"; $sql_count = "SELECT COUNT(*) AS num FROM `{$tablename}` a,`{$tablename}_data` b WHERE a.id=b.id AND a.status=99"; //构造搜索SQL $where = ''; foreach ($fields as $field=>$r) { if($r['issearch']) { $table_nickname = $r['issystem'] ? 'a' : 'b'; if($r['formtype']=='catid') { if($_GET['info']['catid']) $where .= " AND {$table_nickname}.catid='$catid'"; } elseif($r['formtype']=='number') { $start = "{$field}_start"; $end = "{$field}_end"; if($_GET[$start]) { $start = intval($_GET[$start]); $where .= " AND {$table_nickname}.{$field}>'$start'"; } if($_GET[$end]) { $end = intval($_GET[$end]); $where .= " AND {$table_nickname}.{$field}<'$end'"; } } elseif($r['formtype']=='datetime') { if($_GET['info'][$field]) { $start = strtotime($_GET['info'][$field]); if($start) $where .= " AND {$table_nickname}.{$field}>'$start'"; } } elseif($r['formtype']=='box') { if($_GET['info'][$field]) { $field_value = safe_replace($_GET['info'][$field]); switch($r['boxtype']) { case 'radio': $where .= " AND {$table_nickname}.`$field`='$field_value'"; break; case 'checkbox': $where .= " AND {$table_nickname}.`$field` LIKE '%,$field_value,%'"; break; case 'select': $where .= " AND {$table_nickname}.`$field`='$field_value'"; break; case 'multiple': $where .= " AND {$table_nickname}.`$field` LIKE '%,$field_value,%'"; break; } } } elseif($r['formtype']=='typeid') { if($_GET['info'][$field]) { $typeid = intval($_GET['info'][$field]); $where .= " AND {$table_nickname}.`$field`='$typeid'"; } } elseif($r['formtype']=='linkage') { if($_GET['info'][$field]) { $linkage = intval($_GET['info'][$field]); $where .= " AND {$table_nickname}.`$field`='$linkage'"; } } elseif(in_array($r['formtype'], array('text','keyword','textarea','editor','title','author','omnipotent'))) { if($_GET['info'][$field]) { $keywords = safe_replace($_GET['info'][$field]); $where .= " AND {$table_nickname}.`$field` LIKE '%$keywords%'"; } } else { continue; } } } //----------- if($where=='') showmessage(L('please_enter_content_to_search')); $pagesize = 20; $offset = intval($pagesize*($page-1)); $sql_count .= $where; $this->db->query($sql_count); $total = $this->db->fetch_array(); $total = $total[0]['num']; if($total!=0) { $sql .= $where; $order = ''; $order = $_GET['orderby']=='a.id DESC' ? 'a.id DESC' : 'a.id ASC'; $sql .= ' ORDER BY '.$order; $sql .= " LIMIT $offset,$pagesize"; $this->db->query($sql); $datas = $this->db->fetch_array(); $pages = pages($total, $page, $pagesize); } else { $datas = array(); $pages = ''; } } $SEO = seo($siteid, $catid, $keywords); include template('content','search'); } /** * 产品搜索 * eddy * */ public function product() { $catid = TOP_PRODUCT_CATID; $siteid = 1; $keywords = trim(urldecode($_GET['keywords'])); $page = max(intval($_GET['page']), 1); $content_tag = pc_base::load_app_class("content_tag", "content"); if (method_exists($content_tag, 'lists')) { if (!$_GET['num']) { $pagesize = 20; } else { $pagesize = intval($_GET['num']) ? intval($_GET['num']) : 20; $cookie_page_num = param::get_cookie('page_num'); if($cookie_page_num && $cookie_page_num!=$pagesize) { $page = 1; } param::set_cookie('page_num', $pagesize); } if ($_GET['sortkey']) { if ($_GET['sortkey']!=param::get_cookie('sortkey')) { $page = 1; } param::set_cookie('sortkey', $_GET['sortkey']); } $oldnum = $pagesize; //排序 $order = ''; switch ($_GET['sortkey']) { case 'ordernum': $order = 'ordernum DESC'; break; case 'viewnum': $order = 'viewnum DESC'; break; case 'goodnum': $order = 'goodnum DESC'; break; default: $order = 'updatetime DESC'; } $where = ''; if (!empty($keywords)) { $where = "keywords LIKE '%".$keywords."%' or title LIKE '%".$keywords."%'"; } $page = intval($page) ? intval($page) : 1; if($page<=0){ $page=1; } $offset = ($page - 1) * $pagesize; $content_total = $content_tag->count(array('catid'=>$catid,'limit'=>$offset.",".$pagesize,'action'=>'lists','where'=>$where)); $product_pages = pages($content_total, $page, $pagesize); $product_data = $content_tag->lists(array('catid'=>$catid,'where' => $where, 'limit'=>$offset.",".$pagesize,'action'=>'lists','order' => $order)); } $SEO = seo($siteid, $catid, $keywords); include template('content','search_product'); } } ?>
108wo
phpcms/modules/content/MY_search.php
PHP
asf20
9,666
<?php defined('IN_PHPCMS') or exit('No permission resources.'); //模型缓存路径 define('CACHE_MODEL_PATH',CACHE_PATH.'caches_model'.DIRECTORY_SEPARATOR.'caches_data'.DIRECTORY_SEPARATOR); pc_base::load_app_func('util','content'); class tag { private $db; function __construct() { $this->db = pc_base::load_model('content_model'); } /** * 按照模型搜索 */ public function init() { if(!isset($_GET['catid'])) showmessage(L('missing_part_parameters')); $catid = intval($_GET['catid']); $siteids = getcache('category_content','commons'); $siteid = $siteids[$catid]; $this->categorys = getcache('category_content_'.$siteid,'commons'); if(!isset($this->categorys[$catid])) showmessage(L('missing_part_parameters')); if(isset($_GET['info']['catid']) && $_GET['info']['catid']) { $catid = intval($_GET['info']['catid']); } else { $_GET['info']['catid'] = 0; } if(isset($_GET['tag']) && trim($_GET['tag']) != '') { $tag = safe_replace(strip_tags($_GET['tag'])); } else { showmessage(L('illegal_operation')); } $modelid = $this->categorys[$catid]['modelid']; $modelid = intval($modelid); if(!$modelid) showmessage(L('illegal_parameters')); $CATEGORYS = $this->categorys; $siteid = $this->categorys[$catid]['siteid']; $siteurl = siteurl($siteid); $this->db->set_model($modelid); $page = $_GET['page']; $datas = $infos = array(); $infos = $this->db->listinfo("`keywords` LIKE '%$tag%'",'id DESC',$page,20); $total = $this->db->number; if($total>0) { $pages = $this->db->pages; foreach($infos as $_v) { if(strpos($_v['url'],'://')===false) $_v['url'] = $siteurl.$_v['url']; $datas[] = $_v; } } $SEO = seo($siteid, $catid, $tag); include template('content','tag'); } } ?>
108wo
phpcms/modules/content/tag.php
PHP
asf20
1,818
<?php defined('IN_PHPCMS') or exit('No permission resources.'); //模型缓存路径 define('CACHE_MODEL_PATH',CACHE_PATH.'caches_model'.DIRECTORY_SEPARATOR.'caches_data'.DIRECTORY_SEPARATOR); //定义在单独操作内容的时候,同时更新相关栏目页面 define('RELATION_HTML',true); pc_base::load_app_class('admin','admin',0); pc_base::load_sys_class('form','',0); pc_base::load_app_func('util'); pc_base::load_sys_class('format','',0); class MY_content extends admin { private $db,$priv_db; public $siteid,$categorys; public function __construct() { parent::__construct(); $this->db = pc_base::load_model('content_model'); $this->siteid = $this->get_siteid(); $this->categorys = getcache('category_content_'.$this->siteid,'commons'); //权限判断 if(isset($_GET['catid']) && $_SESSION['roleid'] != 1 && ROUTE_A !='pass' && strpos(ROUTE_A,'public_')===false) { $catid = intval($_GET['catid']); $this->priv_db = pc_base::load_model('category_priv_model'); $action = $this->categorys[$catid]['type']==0 ? ROUTE_A : 'init'; $priv_datas = $this->priv_db->get_one(array('catid'=>$catid,'is_admin'=>1,'action'=>$action)); if(!$priv_datas) showmessage(L('permission_to_operate'),'blank'); } } public function init() { $show_header = $show_dialog = $show_pc_hash = ''; if(isset($_GET['catid']) && $_GET['catid'] && $this->categorys[$_GET['catid']]['siteid']==$this->siteid) { $catid = $_GET['catid'] = intval($_GET['catid']); $category = $this->categorys[$catid]; $modelid = $category['modelid']; $admin_username = param::get_cookie('admin_username'); //查询当前的工作流 $setting = string2array($category['setting']); $workflowid = $setting['workflowid']; $workflows = getcache('workflow_'.$this->siteid,'commons'); $workflows = $workflows[$workflowid]; $workflows_setting = string2array($workflows['setting']); //将有权限的级别放到新数组中 $admin_privs = array(); foreach($workflows_setting as $_k=>$_v) { if(empty($_v)) continue; foreach($_v as $_value) { if($_value==$admin_username) $admin_privs[$_k] = $_k; } } //工作流审核级别 $workflow_steps = $workflows['steps']; $workflow_menu = ''; $steps = isset($_GET['steps']) ? intval($_GET['steps']) : 0; //工作流权限判断 if($_SESSION['roleid']!=1 && $steps && !in_array($steps,$admin_privs)) showmessage(L('permission_to_operate')); $this->db->set_model($modelid); if($this->db->table_name==$this->db->db_tablepre) showmessage(L('model_table_not_exists'));; $status = $steps ? $steps : 99; if(isset($_GET['reject'])) $status = 0; $where = 'catid='.$catid.' AND status='.$status; //搜索 if(isset($_GET['start_time']) && $_GET['start_time']) { $start_time = strtotime($_GET['start_time']); $where .= " AND `inputtime` > '$start_time'"; } if(isset($_GET['end_time']) && $_GET['end_time']) { $end_time = strtotime($_GET['end_time']); $where .= " AND `inputtime` < '$end_time'"; } if($start_time>$end_time) showmessage(L('starttime_than_endtime')); if(isset($_GET['keyword']) && !empty($_GET['keyword'])) { $type_array = array('title','description','username'); $searchtype = intval($_GET['searchtype']); if($searchtype < 3) { $searchtype = $type_array[$searchtype]; $keyword = strip_tags(trim($_GET['keyword'])); $where .= " AND `$searchtype` like '%$keyword%'"; } elseif($searchtype==3) { $keyword = intval($_GET['keyword']); $where .= " AND `id`='$keyword'"; } } if(isset($_GET['posids']) && !empty($_GET['posids'])) { $posids = $_GET['posids']==1 ? intval($_GET['posids']) : 0; $where .= " AND `posids` = '$posids'"; } //eddy 品牌过滤 if ($category['modelid'] == 13) { $brand_db = pc_base::load_model('brand_model'); if ($_GET['brand_1']) { $bid = $_GET['brand_1']; if ($_GET['brand_2']) { $bid = $_GET['brand_2']; } else { $brand_ids = $brand_db->select(array('parentid'=>$_GET['brand_1']), 'id'); foreach ($brand_ids AS $b){ $bid .= ','.$b['id']; } } $where .= ' AND `bids` IN('.$bid.')'; } elseif ($_GET['brand_1']==="0") { $where .= ' AND `bids`=""'; } //获取品牌 $brand_1 = $brand_db->select(array('catid'=>$catid, 'parentid'=>0), 'id,name', '', 'name ASC'); if (is_array($brand_1)) { foreach ($brand_1 as &$b){ $b['child'] = $brand_db->select(array('catid'=>$catid, 'parentid'=>$b['id']), 'id,name', '', 'name ASC'); } } $brands_json = json_encode($brand_1); } //eddy end品牌过滤 $datas = $this->db->listinfo($where,'id desc',$_GET['page']); $pages = $this->db->pages; $pc_hash = $_SESSION['pc_hash']; for($i=1;$i<=$workflow_steps;$i++) { if($_SESSION['roleid']!=1 && !in_array($i,$admin_privs)) continue; $current = $steps==$i ? 'class=on' : ''; $r = $this->db->get_one(array('catid'=>$catid,'status'=>$i)); $newimg = $r ? '<img src="'.IMG_PATH.'icon/new.png" style="padding-bottom:2px" onclick="window.location.href=\'?m=content&c=content&a=&menuid='.$_GET['menuid'].'&catid='.$catid.'&steps='.$i.'&pc_hash='.$pc_hash.'\'">' : ''; $workflow_menu .= '<a href="?m=content&c=content&a=&menuid='.$_GET['menuid'].'&catid='.$catid.'&steps='.$i.'&pc_hash='.$pc_hash.'" '.$current.' ><em>'.L('workflow_'.$i).$newimg.'</em></a><span>|</span>'; } if($workflow_menu) { $current = isset($_GET['reject']) ? 'class=on' : ''; $workflow_menu .= '<a href="?m=content&c=content&a=&menuid='.$_GET['menuid'].'&catid='.$catid.'&pc_hash='.$pc_hash.'&reject=1" '.$current.' ><em>'.L('reject').'</em></a><span>|</span>'; } include $this->admin_tpl('content_list'); } else { include $this->admin_tpl('content_quick'); } } public function add() { if(isset($_POST['dosubmit']) || isset($_POST['dosubmit_continue'])) { define('INDEX_HTML',true); $catid = $_POST['info']['catid'] = intval($_POST['info']['catid']); if(trim($_POST['info']['title'])=='') showmessage(L('title_is_empty')); $category = $this->categorys[$catid]; if($category['type']==0) { $modelid = $this->categorys[$catid]['modelid']; $this->db->set_model($modelid); //如果该栏目设置了工作流,那么必须走工作流设定 $setting = string2array($category['setting']); $workflowid = $setting['workflowid']; if($workflowid && $_POST['status']!=99) { //如果用户是超级管理员,那么则根据自己的设置来发布 $_POST['info']['status'] = $_SESSION['roleid']==1 ? intval($_POST['status']) : 1; } else { $_POST['info']['status'] = 99; } $this->db->add_content($_POST['info']); if(isset($_POST['dosubmit'])) { showmessage(L('add_success').L('2s_close'),'blank','','','function set_time() {$("#secondid").html(1);}setTimeout("set_time()", 500);setTimeout("window.close()", 1200);'); } else { showmessage(L('add_success'),HTTP_REFERER); } } else { //单网页 $this->page_db = pc_base::load_model('page_model'); $style_font_weight = $_POST['style_font_weight'] ? 'font-weight:'.strip_tags($_POST['style_font_weight']) : ''; $_POST['info']['style'] = strip_tags($_POST['style_color']).';'.$style_font_weight; if($_POST['edit']) { $this->page_db->update($_POST['info'],array('catid'=>$catid)); } else { $catid = $this->page_db->insert($_POST['info'],1); } $this->page_db->create_html($catid,$_POST['info']); $forward = HTTP_REFERER; } showmessage(L('add_success'),$forward); } else { $show_header = $show_dialog = $show_validator = ''; //设置cookie 在附件添加处调用 param::set_cookie('module', 'content'); if(isset($_GET['catid']) && $_GET['catid']) { $catid = $_GET['catid'] = intval($_GET['catid']); param::set_cookie('catid', $catid); $category = $this->categorys[$catid]; if($category['type']==0) { $modelid = $category['modelid']; //取模型ID,依模型ID来生成对应的表单 require CACHE_MODEL_PATH.'content_form.class.php'; $content_form = new content_form($modelid,$catid,$this->categorys); $forminfos = $content_form->get(); $formValidator = $content_form->formValidator; $setting = string2array($category['setting']); $workflowid = $setting['workflowid']; $workflows = getcache('workflow_'.$this->siteid,'commons'); $workflows = $workflows[$workflowid]; $workflows_setting = string2array($workflows['setting']); $nocheck_users = $workflows_setting['nocheck_users']; $admin_username = param::get_cookie('admin_username'); if(!empty($nocheck_users) && in_array($admin_username, $nocheck_users)) { $priv_status = true; } else { $priv_status = false; } include $this->admin_tpl('content_add'); } else { //单网页 $this->page_db = pc_base::load_model('page_model'); $r = $this->page_db->get_one(array('catid'=>$catid)); if($r) { extract($r); $style_arr = explode(';',$style); $style_color = $style_arr[0]; $style_font_weight = $style_arr[1] ? substr($style_arr[1],12) : ''; } include $this->admin_tpl('content_page'); } } else { include $this->admin_tpl('content_add'); } header("Cache-control: private"); } } public function edit() { //设置cookie 在附件添加处调用 param::set_cookie('module', 'content'); if(isset($_POST['dosubmit']) || isset($_POST['dosubmit_continue'])) { define('INDEX_HTML',true); $id = intval($_POST['id']); $catid = $_POST['info']['catid'] = intval($_POST['info']['catid']); if(trim($_POST['info']['title'])=='') showmessage(L('title_is_empty')); $modelid = $this->categorys[$catid]['modelid']; $this->db->set_model($modelid); $this->db->edit_content($_POST['info'],$id); if(isset($_POST['dosubmit'])) { showmessage(L('update_success').L('2s_close'),'blank','','','function set_time() {$("#secondid").html(1);}setTimeout("set_time()", 500);setTimeout("window.close()", 1200);'); } else { showmessage(L('update_success'),HTTP_REFERER); } } else { $show_header = $show_dialog = $show_validator = ''; //从数据库获取内容 $id = intval($_GET['id']); if(!isset($_GET['catid']) || !$_GET['catid']) showmessage(L('missing_part_parameters')); $catid = $_GET['catid'] = intval($_GET['catid']); $this->model = getcache('model', 'commons'); param::set_cookie('catid', $catid); $category = $this->categorys[$catid]; $modelid = $category['modelid']; $this->db->table_name = $this->db->db_tablepre.$this->model[$modelid]['tablename']; $r = $this->db->get_one(array('id'=>$id)); $this->db->table_name = $this->db->table_name.'_data'; $r2 = $this->db->get_one(array('id'=>$id)); if(!$r2) showmessage(L('subsidiary_table_datalost'),'blank'); $data = array_merge($r,$r2); require CACHE_MODEL_PATH.'content_form.class.php'; $content_form = new content_form($modelid,$catid,$this->categorys); $forminfos = $content_form->get($data); $formValidator = $content_form->formValidator; include $this->admin_tpl('content_edit'); } header("Cache-control: private"); } /** * 删除 */ public function delete() { if(isset($_GET['dosubmit'])) { $catid = intval($_GET['catid']); if(!$catid) showmessage(L('missing_part_parameters')); $modelid = $this->categorys[$catid]['modelid']; $sethtml = $this->categorys[$catid]['sethtml']; $siteid = $this->categorys[$catid]['siteid']; $html_root = pc_base::load_config('system','html_root'); if($sethtml) $html_root = ''; $setting = string2array($this->categorys[$catid]['setting']); $content_ishtml = $setting['content_ishtml']; $this->db->set_model($modelid); $this->hits_db = pc_base::load_model('hits_model'); $this->queue = pc_base::load_model('queue_model'); if(isset($_GET['ajax_preview'])) { $ids = intval($_GET['id']); $_POST['ids'] = array(0=>$ids); } if(empty($_POST['ids'])) showmessage(L('you_do_not_check')); //附件初始化 $attachment = pc_base::load_model('attachment_model'); $this->content_check_db = pc_base::load_model('content_check_model'); $this->position_data_db = pc_base::load_model('position_data_model'); $this->search_db = pc_base::load_model('search_model'); $this->comment = pc_base::load_app_class('comment', 'comment'); $search_model = getcache('search_model_'.$this->siteid,'search'); $typeid = $search_model[$modelid]['typeid']; $this->url = pc_base::load_app_class('url', 'content'); foreach($_POST['ids'] as $id) { $r = $this->db->get_one(array('id'=>$id)); if($content_ishtml && !$r['islink']) { $urls = $this->url->show($id, 0, $r['catid'], $r['inputtime']); $fileurl = $urls[1]; if($this->siteid != 1) { $sitelist = getcache('sitelist','commons'); $fileurl = $html_root.'/'.$sitelist[$this->siteid]['dirname'].$fileurl; } //删除静态文件,排除htm/html/shtml外的文件 $lasttext = strrchr($fileurl,'.'); $len = -strlen($lasttext); $path = substr($fileurl,0,$len); $path = ltrim($path,'/'); $filelist = glob(PHPCMS_PATH.$path.'*'); foreach ($filelist as $delfile) { $lasttext = strrchr($delfile,'.'); if(!in_array($lasttext, array('.htm','.html','.shtml'))) continue; @unlink($delfile); //删除发布点队列数据 $delfile = str_replace(PHPCMS_PATH, '/', $delfile); $this->queue->add_queue('del',$delfile,$this->siteid); } } else { $fileurl = 0; } //删除内容 $this->db->delete_content($id,$fileurl,$catid); //删除统计表数据 $this->hits_db->delete(array('hitsid'=>'c-'.$modelid.'-'.$id)); //删除附件 $attachment->api_delete('c-'.$catid.'-'.$id); //删除审核表数据 $this->content_check_db->delete(array('checkid'=>'c-'.$id.'-'.$modelid)); //删除推荐位数据 $this->position_data_db->delete(array('id'=>$id,'catid'=>$catid,'module'=>'content')); //删除全站搜索中数据 $this->search_db->delete_search($typeid,$id); //删除相关的评论 $commentid = id_encode('content_'.$catid, $id, $siteid); $this->comment->del($commentid, $siteid, $id, $catid); } //更新栏目统计 $this->db->cache_items(); showmessage(L('operation_success'),HTTP_REFERER); } else { showmessage(L('operation_failure')); } } /** * 过审内容 */ public function pass() { $admin_username = param::get_cookie('admin_username'); $catid = intval($_GET['catid']); if(!$catid) showmessage(L('missing_part_parameters')); $category = $this->categorys[$catid]; $setting = string2array($category['setting']); $workflowid = $setting['workflowid']; //只有存在工作流才需要审核 if($workflowid) { $steps = intval($_GET['steps']); //检查当前用户有没有当前工作流的操作权限 $workflows = getcache('workflow_'.$this->siteid,'commons'); $workflows = $workflows[$workflowid]; $workflows_setting = string2array($workflows['setting']); //将有权限的级别放到新数组中 $admin_privs = array(); foreach($workflows_setting as $_k=>$_v) { if(empty($_v)) continue; foreach($_v as $_value) { if($_value==$admin_username) $admin_privs[$_k] = $_k; } } if($_SESSION['roleid']!=1 && $steps && !in_array($steps,$admin_privs)) showmessage(L('permission_to_operate')); //更改内容状态 if(isset($_GET['reject'])) { //退稿 $status = 0; } else { //工作流审核级别 $workflow_steps = $workflows['steps']; if($workflow_steps>$steps) { $status = $steps+1; } else { $status = 99; } } $modelid = $this->categorys[$catid]['modelid']; $this->db->set_model($modelid); //审核通过,检查投稿奖励或扣除积分 if ($status==99) { $member_db = pc_base::load_model('member_model'); if (isset($_POST['ids']) && !empty($_POST['ids'])) { foreach ($_POST['ids'] as $id) { $content_info = $this->db->get_one(array('id'=>$id), 'username'); $memberinfo = $member_db->get_one(array('username'=>$content_info['username']), 'userid, username'); $flag = $catid.'_'.$id; if($setting['presentpoint']>0) { pc_base::load_app_class('receipts','pay',0); receipts::point($setting['presentpoint'],$memberinfo['userid'], $memberinfo['username'], $flag,'selfincome',L('contribute_add_point'),$memberinfo['username']); } else { pc_base::load_app_class('spend','pay',0); spend::point($setting['presentpoint'], L('contribute_del_point'), $memberinfo['userid'], $memberinfo['username'], '', '', $flag); } } } else if (isset($_GET['id']) && $_GET['id']) { $id = intval($_GET['id']); $content_info = $this->db->get_one(array('id'=>$id), 'username'); $memberinfo = $member_db->get_one(array('username'=>$content_info['username']), 'userid, username'); $flag = $catid.'_'.$id; if($setting['presentpoint']>0) { pc_base::load_app_class('receipts','pay',0); receipts::point($setting['presentpoint'],$memberinfo['userid'], $memberinfo['username'], $flag,'selfincome',L('contribute_add_point'),$memberinfo['username']); } else { pc_base::load_app_class('spend','pay',0); spend::point($setting['presentpoint'], L('contribute_del_point'), $memberinfo['userid'], $memberinfo['username'], '', '', $flag); } } } if(isset($_GET['ajax_preview'])) { $_POST['ids'] = $_GET['id']; } $this->db->status($_POST['ids'],$status); } showmessage(L('operation_success'),HTTP_REFERER); } /** * 排序 */ public function listorder() { if(isset($_GET['dosubmit'])) { $catid = intval($_GET['catid']); if(!$catid) showmessage(L('missing_part_parameters')); $modelid = $this->categorys[$catid]['modelid']; $this->db->set_model($modelid); foreach($_POST['listorders'] as $id => $listorder) { $this->db->update(array('listorder'=>$listorder),array('id'=>$id)); } showmessage(L('operation_success')); } else { showmessage(L('operation_failure')); } } /** * 显示栏目菜单列表 */ public function public_categorys() { $show_header = ''; $from = isset($_GET['from']) && in_array($_GET['from'],array('block')) ? $_GET['from'] : 'content'; $tree = pc_base::load_sys_class('tree'); if($from=='content' && $_SESSION['roleid'] != 1) { $this->priv_db = pc_base::load_model('category_priv_model'); $priv_result = $this->priv_db->select(array('action'=>'init','roleid'=>$_SESSION['roleid'],'siteid'=>$this->siteid,'is_admin'=>1)); $priv_catids = array(); foreach($priv_result as $_v) { $priv_catids[] = $_v['catid']; } if(empty($priv_catids)) return ''; } $categorys = array(); if(!empty($this->categorys)) { foreach($this->categorys as $r) { if($r['siteid']!=$this->siteid || ($r['type']==2 && $r['child']==0)) continue; if($from=='content' && $_SESSION['roleid'] != 1 && !in_array($r['catid'],$priv_catids)) { $arrchildid = explode(',',$r['arrchildid']); $array_intersect = array_intersect($priv_catids,$arrchildid); if(empty($array_intersect)) continue; } if($r['type']==1 || $from=='block') { if($r['type']==0) { $r['vs_show'] = "<a href='?m=block&c=block_admin&a=public_visualization&menuid=".$_GET['menuid']."&catid=".$r['catid']."&type=show' target='right'>[".L('content_page')."]</a>"; } else { $r['vs_show'] =''; } $r['icon_type'] = 'file'; $r['add_icon'] = ''; $r['type'] = 'add'; } else { $r['icon_type'] = $r['vs_show'] = ''; $r['type'] = 'init'; $r['add_icon'] = "<a target='right' href='?m=content&c=content&menuid=".$_GET['menuid']."&catid=".$r['catid']."' onclick=javascript:openwinx('?m=content&c=content&a=add&menuid=".$_GET['menuid']."&catid=".$r['catid']."&hash_page=".$_SESSION['hash_page']."','')><img src='".IMG_PATH."add_content.gif' alt='".L('add')."'></a> "; } $categorys[$r['catid']] = $r; } } if(!empty($categorys)) { $tree->init($categorys); switch($from) { case 'block': $strs = "<span class='\$icon_type'>\$add_icon<a href='?m=block&c=block_admin&a=public_visualization&menuid=".$_GET['menuid']."&catid=\$catid&type=list' target='right'>\$catname</a> \$vs_show</span>"; $strs2 = "<img src='".IMG_PATH."folder.gif'> <a href='?m=block&c=block_admin&a=public_visualization&menuid=".$_GET['menuid']."&catid=\$catid&type=category' target='right'>\$catname</a>"; break; default: $strs = "<span class='\$icon_type'>\$add_icon<a href='?m=content&c=content&a=\$type&menuid=".$_GET['menuid']."&catid=\$catid' target='right' onclick='open_list(this)'>\$catname</a></span>"; $strs2 = "<span class='folder'>\$catname</span>"; break; } $categorys = $tree->get_treeview(0,'category_tree',$strs,$strs2); } else { $categorys = L('please_add_category'); } include $this->admin_tpl('category_tree'); exit; } /** * 检查标题是否存在 */ public function public_check_title() { if($_GET['data']=='' || (!$_GET['catid'])) return ''; $catid = intval($_GET['catid']); $modelid = $this->categorys[$catid]['modelid']; $this->db->set_model($modelid); $title = $_GET['data']; if(CHARSET=='gbk') $title = iconv('utf-8','gbk',$title); $r = $this->db->get_one(array('title'=>$title)); if($r) { exit('1'); } else { exit('0'); } } /** * 图片裁切 */ public function public_crop() { if (isset($_GET['picurl']) && !empty($_GET['picurl'])) { $picurl = $_GET['picurl']; $catid = intval($_GET['catid']); if (isset($_GET['module']) && !empty($_GET['module'])) { $module = $_GET['module']; } $show_header = ''; include $this->admin_tpl('crop'); } } /** * 相关文章选择 */ public function public_relationlist() { pc_base::load_sys_class('format','',0); $show_header = ''; $model_cache = getcache('model','commons'); if(!isset($_GET['modelid'])) { showmessage(L('please_select_modelid')); } else { $page = intval($_GET['page']); $modelid = intval($_GET['modelid']); $this->db->set_model($modelid); $where = ''; if($_GET['catid']) { $catid = intval($_GET['catid']); $where .= "catid='$catid'"; } $where .= $where ? ' AND status=99' : 'status=99'; if(isset($_GET['keywords'])) { $keywords = trim($_GET['keywords']); $field = $_GET['field']; if(in_array($field, array('id','title','keywords','description'))) { if($field=='id') { $where .= " AND `id` ='$keywords'"; } else { $where .= " AND `$field` like '%$keywords%'"; } } } $infos = $this->db->listinfo($where,'',$page,12); $pages = $this->db->pages; include $this->admin_tpl('relationlist'); } } public function public_getjson_ids() { $modelid = intval($_GET['modelid']); $id = intval($_GET['id']); $this->db->set_model($modelid); $tablename = $this->db->table_name; $this->db->table_name = $tablename.'_data'; $r = $this->db->get_one(array('id'=>$id),'relation'); if($r['relation']) { $relation = str_replace('|', ',', $r['relation']); $where = "id IN($relation)"; $infos = array(); $this->db->table_name = $tablename; $datas = $this->db->select($where,'id,title'); foreach($datas as $_v) { $_v['sid'] = 'v'.$_v['id']; if(strtolower(CHARSET)=='gbk') $_v['title'] = iconv('gbk', 'utf-8', $_v['title']); $infos[] = $_v; } echo json_encode($infos); } } //文章预览 public function public_preview() { $catid = intval($_GET['catid']); $id = intval($_GET['id']); if(!$catid || !$id) showmessage(L('missing_part_parameters'),'blank'); $page = intval($_GET['page']); $page = max($page,1); $CATEGORYS = getcache('category_content_'.$this->get_siteid(),'commons'); if(!isset($CATEGORYS[$catid]) || $CATEGORYS[$catid]['type']!=0) showmessage(L('missing_part_parameters'),'blank'); define('HTML', true); $CAT = $CATEGORYS[$catid]; $siteid = $CAT['siteid']; $MODEL = getcache('model','commons'); $modelid = $CAT['modelid']; $this->db->table_name = $this->db->db_tablepre.$MODEL[$modelid]['tablename']; $r = $this->db->get_one(array('id'=>$id)); if(!$r) showmessage(L('information_does_not_exist')); $this->db->table_name = $this->db->table_name.'_data'; $r2 = $this->db->get_one(array('id'=>$id)); $rs = $r2 ? array_merge($r,$r2) : $r; //再次重新赋值,以数据库为准 $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); $CAT['setting'] = string2array($CAT['setting']); $template = $template ? $template : $CAT['setting']['show_template']; $allow_visitor = 1; //SEO $SEO = seo($siteid, $catid, $title, $description); define('STYLE',$CAT['setting']['template_list']); if(isset($rs['paginationtype'])) { $paginationtype = $rs['paginationtype']; $maxcharperpage = $rs['maxcharperpage']; } $pages = $titles = ''; if($rs['paginationtype']==1) { //自动分页 if($maxcharperpage < 10) $maxcharperpage = 500; $contentpage = pc_base::load_app_class('contentpage'); $content = $contentpage->get_data($content,$maxcharperpage); } if($rs['paginationtype']!=0) { //手动分页 $CONTENT_POS = strpos($content, '[page]'); if($CONTENT_POS !== false) { $this->url = pc_base::load_app_class('url', 'content'); $contents = array_filter(explode('[page]', $content)); $pagenumber = count($contents); for($i=1; $i<=$pagenumber; $i++) { $pageurls[$i] = $this->url->show($id, $i, $catid, $rs['inputtime']); } $END_POS = strpos($content, '[/page]'); if($END_POS !== false) { 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][0]; } } } else { //当不存在 [/page]时,则使用下面分页 $pages = content_pages($pagenumber,$page, $pageurls); } //判断[page]出现的位置是否在第一位 if($CONTENT_POS<7) { $content = $contents[$page]; } 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>'; } } } } include template('content',$template); $pc_hash = $_SESSION['pc_hash']; $steps = intval($_GET['steps']); echo " <link href=\"".CSS_PATH."dialog_simp.css\" rel=\"stylesheet\" type=\"text/css\" /> <script language=\"javascript\" type=\"text/javascript\" src=\"".JS_PATH."dialog.js\"></script> <script type=\"text/javascript\">art.dialog({lock:false,title:'".L('operations_manage')."',mouse:true, id:'content_m', content:'<span id=cloading ><a href=\'javascript:ajax_manage(1)\'>".L('passed_checked')."</a> | <a href=\'javascript:ajax_manage(2)\'>".L('reject')."</a> | <a href=\'javascript:ajax_manage(3)\'>".L('delete')."</a></span>',left:'right',width:'15em', top:'bottom', fixed:true}); function ajax_manage(type) { if(type==1) { $.get('?m=content&c=content&a=pass&ajax_preview=1&catid=".$catid."&steps=".$steps."&id=".$id."&pc_hash=".$pc_hash."'); } else if(type==2) { $.get('?m=content&c=content&a=pass&ajax_preview=1&reject=1&catid=".$catid."&steps=".$steps."&id=".$id."&pc_hash=".$pc_hash."'); } else if(type==3) { $.get('?m=content&c=content&a=delete&ajax_preview=1&dosubmit=1&catid=".$catid."&steps=".$steps."&id=".$id."&pc_hash=".$pc_hash."'); } $('#cloading').html('<font color=red>".L('operation_success')."<span id=\"secondid\">2</span>".L('after_a_few_seconds_left')."</font>'); setInterval('set_time()', 1000); setInterval('window.close()', 2000); } function set_time() { $('#secondid').html(1); } </script>"; } /** * 审核所有内容 */ public function public_checkall() { $page = isset($_GET['page']) && intval($_GET['page']) ? intval($_GET['page']) : 1; $show_header = ''; $workflows = getcache('workflow_'.$this->siteid,'commons'); $datas = array(); $pagesize = 20; $sql = ''; if (in_array($_SESSION['roleid'], array('1'))) { $super_admin = 1; $status = isset($_GET['status']) ? $_GET['status'] : -1; } else { $super_admin = 0; $status = isset($_GET['status']) ? $_GET['status'] : 1; if($status==-1) $status = 1; } if($status>4) $status = 4; $this->priv_db = pc_base::load_model('category_priv_model');; $admin_username = param::get_cookie('admin_username'); if($status==-1) { $sql = "`status` NOT IN (99,0,-2)"; } else { $sql = "`status` = '$status' "; } if($status!=0 && !$super_admin) { //以栏目进行循环 foreach ($this->categorys as $catid => $cat) { if($cat['type']!=0) continue; //查看管理员是否有这个栏目的查看权限。 if (!$this->priv_db->get_one(array('catid'=>$catid, 'siteid'=>$this->siteid, 'roleid'=>$_SESSION['roleid'], 'is_admin'=>'1'))) { continue; } //如果栏目有设置工作流,进行权限检查。 $workflow = array(); $cat['setting'] = string2array($cat['setting']); if (isset($cat['setting']['workflowid']) && !empty($cat['setting']['workflowid'])) { $workflow = $workflows[$cat['setting']['workflowid']]; $workflow['setting'] = string2array($workflow['setting']); $usernames = $workflow['setting'][$status]; if (empty($usernames) || !in_array($admin_username, $usernames)) {//判断当前管理,在工作流中可以审核几审 continue; } } $priv_catid[] = $catid; } if(empty($priv_catid)) { $sql .= " AND catid = -1"; } else { $priv_catid = implode(',', $priv_catid); $sql .= " AND catid IN ($priv_catid)"; } } $this->content_check_db = pc_base::load_model('content_check_model'); $datas = $this->content_check_db->listinfo($sql,'inputtime DESC',$page); $pages = $this->content_check_db->pages; include $this->admin_tpl('content_checkall'); } /** * 批量移动文章 */ public function remove() { if(isset($_POST['dosubmit'])) { if($_POST['fromtype']==0) { if($_POST['ids']=='') showmessage(L('please_input_move_source')); if(!$_POST['tocatid']) showmessage(L('please_select_target_category')); $tocatid = intval($_POST['tocatid']); $modelid = $this->categorys[$tocatid]['modelid']; if(!$modelid) showmessage(L('illegal_operation')); $ids = array_filter(explode(',', $_POST['ids']),"intval"); $ids = implode(',', $ids); $this->db->set_model($modelid); $this->db->update(array('catid'=>$tocatid),"id IN($ids)"); } else { if(!$_POST['fromid']) showmessage(L('please_input_move_source')); if(!$_POST['tocatid']) showmessage(L('please_select_target_category')); $tocatid = intval($_POST['tocatid']); $modelid = $this->categorys[$tocatid]['modelid']; if(!$modelid) showmessage(L('illegal_operation')); $fromid = array_filter($_POST['fromid'],"intval"); $fromid = implode(',', $fromid); $this->db->set_model($modelid); $this->db->update(array('catid'=>$tocatid),"catid IN($fromid)"); } showmessage(L('operation_success'),HTTP_REFERER); //ids } else { $show_header = ''; $catid = intval($_GET['catid']); $modelid = $this->categorys[$catid]['modelid']; $tree = pc_base::load_sys_class('tree'); $tree->icon = array('&nbsp;&nbsp;│ ','&nbsp;&nbsp;├─ ','&nbsp;&nbsp;└─ '); $tree->nbsp = '&nbsp;&nbsp;'; $categorys = array(); foreach($this->categorys as $cid=>$r) { if($this->siteid != $r['siteid'] || $r['type']) continue; if($modelid && $modelid != $r['modelid']) continue; $r['disabled'] = $r['child'] ? 'disabled' : ''; $r['selected'] = $cid == $catid ? 'selected' : ''; $categorys[$cid] = $r; } $str = "<option value='\$catid' \$selected \$disabled>\$spacer \$catname</option>"; $tree->init($categorys); $string .= $tree->get_tree(0, $str); $str = "<option value='\$catid'>\$spacer \$catname</option>"; $source_string = ''; $tree->init($categorys); $source_string .= $tree->get_tree(0, $str); $ids = empty($_POST['ids']) ? '' : implode(',',$_POST['ids']); include $this->admin_tpl('content_remove'); } } /** * 同时发布到其他栏目 */ public function add_othors() { $show_header = ''; $sitelist = getcache('sitelist','commons'); $siteid = $_GET['siteid']; include $this->admin_tpl('add_othors'); } /** * 同时发布到其他栏目 异步加载栏目 */ public function public_getsite_categorys() { $siteid = intval($_GET['siteid']); $this->categorys = getcache('category_content_'.$siteid,'commons'); $models = getcache('model','commons'); $tree = pc_base::load_sys_class('tree'); $tree->icon = array('&nbsp;&nbsp;&nbsp;│ ','&nbsp;&nbsp;&nbsp;├─ ','&nbsp;&nbsp;&nbsp;└─ '); $tree->nbsp = '&nbsp;&nbsp;&nbsp;'; $categorys = array(); if($_SESSION['roleid'] != 1) { $this->priv_db = pc_base::load_model('category_priv_model'); $priv_result = $this->priv_db->select(array('action'=>'add','roleid'=>$_SESSION['roleid'],'siteid'=>$siteid,'is_admin'=>1)); $priv_catids = array(); foreach($priv_result as $_v) { $priv_catids[] = $_v['catid']; } if(empty($priv_catids)) return ''; } foreach($this->categorys as $r) { if($r['siteid']!=$siteid || $r['type']!=0) continue; if($_SESSION['roleid'] != 1 && !in_array($r['catid'],$priv_catids)) { $arrchildid = explode(',',$r['arrchildid']); $array_intersect = array_intersect($priv_catids,$arrchildid); if(empty($array_intersect)) continue; } $r['modelname'] = $models[$r['modelid']]['name']; $r['style'] = $r['child'] ? 'color:#8A8A8A;' : ''; $r['click'] = $r['child'] ? '' : "onclick=\"select_list(this,'".safe_replace($r['catname'])."',".$r['catid'].")\" class='cu' title='".L('click_to_select')."'"; $categorys[$r['catid']] = $r; } $str = "<tr \$click > <td align='center'>\$id</td> <td style='\$style'>\$spacer\$catname</td> <td align='center'>\$modelname</td> </tr>"; $tree->init($categorys); $categorys = $tree->get_tree(0, $str); echo $categorys; } } ?>
108wo
phpcms/modules/content/MY_content.php
PHP
asf20
35,757
<?php defined('IN_PHPCMS') or exit('No permission resources.'); //模型缓存路径 define('CACHE_MODEL_PATH',CACHE_PATH.'caches_model'.DIRECTORY_SEPARATOR.'caches_data'.DIRECTORY_SEPARATOR); //定义在单独操作内容的时候,同时更新相关栏目页面 define('RELATION_HTML',true); pc_base::load_app_class('admin','admin',0); pc_base::load_sys_class('form','',0); pc_base::load_app_func('util'); pc_base::load_sys_class('format','',0); class content extends admin { private $db,$priv_db; public $siteid,$categorys; public function __construct() { parent::__construct(); $this->db = pc_base::load_model('content_model'); $this->siteid = $this->get_siteid(); $this->categorys = getcache('category_content_'.$this->siteid,'commons'); //权限判断 if(isset($_GET['catid']) && $_SESSION['roleid'] != 1 && ROUTE_A !='pass' && strpos(ROUTE_A,'public_')===false) { $catid = intval($_GET['catid']); $this->priv_db = pc_base::load_model('category_priv_model'); $action = $this->categorys[$catid]['type']==0 ? ROUTE_A : 'init'; $priv_datas = $this->priv_db->get_one(array('catid'=>$catid,'is_admin'=>1,'action'=>$action)); if(!$priv_datas) showmessage(L('permission_to_operate'),'blank'); } } public function init() { $show_header = $show_dialog = $show_pc_hash = ''; if(isset($_GET['catid']) && $_GET['catid'] && $this->categorys[$_GET['catid']]['siteid']==$this->siteid) { $catid = $_GET['catid'] = intval($_GET['catid']); $category = $this->categorys[$catid]; $modelid = $category['modelid']; $admin_username = param::get_cookie('admin_username'); //查询当前的工作流 $setting = string2array($category['setting']); $workflowid = $setting['workflowid']; $workflows = getcache('workflow_'.$this->siteid,'commons'); $workflows = $workflows[$workflowid]; $workflows_setting = string2array($workflows['setting']); //将有权限的级别放到新数组中 $admin_privs = array(); foreach($workflows_setting as $_k=>$_v) { if(empty($_v)) continue; foreach($_v as $_value) { if($_value==$admin_username) $admin_privs[$_k] = $_k; } } //工作流审核级别 $workflow_steps = $workflows['steps']; $workflow_menu = ''; $steps = isset($_GET['steps']) ? intval($_GET['steps']) : 0; //工作流权限判断 if($_SESSION['roleid']!=1 && $steps && !in_array($steps,$admin_privs)) showmessage(L('permission_to_operate')); $this->db->set_model($modelid); if($this->db->table_name==$this->db->db_tablepre) showmessage(L('model_table_not_exists'));; $status = $steps ? $steps : 99; if(isset($_GET['reject'])) $status = 0; $where = 'catid='.$catid.' AND status='.$status; //搜索 if(isset($_GET['start_time']) && $_GET['start_time']) { $start_time = strtotime($_GET['start_time']); $where .= " AND `inputtime` > '$start_time'"; } if(isset($_GET['end_time']) && $_GET['end_time']) { $end_time = strtotime($_GET['end_time']); $where .= " AND `inputtime` < '$end_time'"; } if($start_time>$end_time) showmessage(L('starttime_than_endtime')); if(isset($_GET['keyword']) && !empty($_GET['keyword'])) { $type_array = array('title','description','username'); $searchtype = intval($_GET['searchtype']); if($searchtype < 3) { $searchtype = $type_array[$searchtype]; $keyword = strip_tags(trim($_GET['keyword'])); $where .= " AND `$searchtype` like '%$keyword%'"; } elseif($searchtype==3) { $keyword = intval($_GET['keyword']); $where .= " AND `id`='$keyword'"; } } if(isset($_GET['posids']) && !empty($_GET['posids'])) { $posids = $_GET['posids']==1 ? intval($_GET['posids']) : 0; $where .= " AND `posids` = '$posids'"; } $datas = $this->db->listinfo($where,'id desc',$_GET['page']); $pages = $this->db->pages; $pc_hash = $_SESSION['pc_hash']; for($i=1;$i<=$workflow_steps;$i++) { if($_SESSION['roleid']!=1 && !in_array($i,$admin_privs)) continue; $current = $steps==$i ? 'class=on' : ''; $r = $this->db->get_one(array('catid'=>$catid,'status'=>$i)); $newimg = $r ? '<img src="'.IMG_PATH.'icon/new.png" style="padding-bottom:2px" onclick="window.location.href=\'?m=content&c=content&a=&menuid='.$_GET['menuid'].'&catid='.$catid.'&steps='.$i.'&pc_hash='.$pc_hash.'\'">' : ''; $workflow_menu .= '<a href="?m=content&c=content&a=&menuid='.$_GET['menuid'].'&catid='.$catid.'&steps='.$i.'&pc_hash='.$pc_hash.'" '.$current.' ><em>'.L('workflow_'.$i).$newimg.'</em></a><span>|</span>'; } if($workflow_menu) { $current = isset($_GET['reject']) ? 'class=on' : ''; $workflow_menu .= '<a href="?m=content&c=content&a=&menuid='.$_GET['menuid'].'&catid='.$catid.'&pc_hash='.$pc_hash.'&reject=1" '.$current.' ><em>'.L('reject').'</em></a><span>|</span>'; } include $this->admin_tpl('content_list'); } else { include $this->admin_tpl('content_quick'); } } public function add() { if(isset($_POST['dosubmit']) || isset($_POST['dosubmit_continue'])) { define('INDEX_HTML',true); $catid = $_POST['info']['catid'] = intval($_POST['info']['catid']); if(trim($_POST['info']['title'])=='') showmessage(L('title_is_empty')); $category = $this->categorys[$catid]; if($category['type']==0) { $modelid = $this->categorys[$catid]['modelid']; $this->db->set_model($modelid); //如果该栏目设置了工作流,那么必须走工作流设定 $setting = string2array($category['setting']); $workflowid = $setting['workflowid']; if($workflowid && $_POST['status']!=99) { //如果用户是超级管理员,那么则根据自己的设置来发布 $_POST['info']['status'] = $_SESSION['roleid']==1 ? intval($_POST['status']) : 1; } else { $_POST['info']['status'] = 99; } $this->db->add_content($_POST['info']); if(isset($_POST['dosubmit'])) { showmessage(L('add_success').L('2s_close'),'blank','','','function set_time() {$("#secondid").html(1);}setTimeout("set_time()", 500);setTimeout("window.close()", 1200);'); } else { showmessage(L('add_success'),HTTP_REFERER); } } else { //单网页 $this->page_db = pc_base::load_model('page_model'); $style_font_weight = $_POST['style_font_weight'] ? 'font-weight:'.strip_tags($_POST['style_font_weight']) : ''; $_POST['info']['style'] = strip_tags($_POST['style_color']).';'.$style_font_weight; if($_POST['edit']) { $this->page_db->update($_POST['info'],array('catid'=>$catid)); } else { $catid = $this->page_db->insert($_POST['info'],1); } $this->page_db->create_html($catid,$_POST['info']); $forward = HTTP_REFERER; } showmessage(L('add_success'),$forward); } else { $show_header = $show_dialog = $show_validator = ''; //设置cookie 在附件添加处调用 param::set_cookie('module', 'content'); if(isset($_GET['catid']) && $_GET['catid']) { $catid = $_GET['catid'] = intval($_GET['catid']); param::set_cookie('catid', $catid); $category = $this->categorys[$catid]; if($category['type']==0) { $modelid = $category['modelid']; //取模型ID,依模型ID来生成对应的表单 require CACHE_MODEL_PATH.'content_form.class.php'; $content_form = new content_form($modelid,$catid,$this->categorys); $forminfos = $content_form->get(); $formValidator = $content_form->formValidator; $setting = string2array($category['setting']); $workflowid = $setting['workflowid']; $workflows = getcache('workflow_'.$this->siteid,'commons'); $workflows = $workflows[$workflowid]; $workflows_setting = string2array($workflows['setting']); $nocheck_users = $workflows_setting['nocheck_users']; $admin_username = param::get_cookie('admin_username'); if(!empty($nocheck_users) && in_array($admin_username, $nocheck_users)) { $priv_status = true; } else { $priv_status = false; } include $this->admin_tpl('content_add'); } else { //单网页 $this->page_db = pc_base::load_model('page_model'); $r = $this->page_db->get_one(array('catid'=>$catid)); if($r) { extract($r); $style_arr = explode(';',$style); $style_color = $style_arr[0]; $style_font_weight = $style_arr[1] ? substr($style_arr[1],12) : ''; } include $this->admin_tpl('content_page'); } } else { include $this->admin_tpl('content_add'); } header("Cache-control: private"); } } public function edit() { //设置cookie 在附件添加处调用 param::set_cookie('module', 'content'); if(isset($_POST['dosubmit']) || isset($_POST['dosubmit_continue'])) { define('INDEX_HTML',true); $id = intval($_POST['id']); $catid = $_POST['info']['catid'] = intval($_POST['info']['catid']); if(trim($_POST['info']['title'])=='') showmessage(L('title_is_empty')); $modelid = $this->categorys[$catid]['modelid']; $this->db->set_model($modelid); $this->db->edit_content($_POST['info'],$id); if(isset($_POST['dosubmit'])) { showmessage(L('update_success').L('2s_close'),'blank','','','function set_time() {$("#secondid").html(1);}setTimeout("set_time()", 500);setTimeout("window.close()", 1200);'); } else { showmessage(L('update_success'),HTTP_REFERER); } } else { $show_header = $show_dialog = $show_validator = ''; //从数据库获取内容 $id = intval($_GET['id']); if(!isset($_GET['catid']) || !$_GET['catid']) showmessage(L('missing_part_parameters')); $catid = $_GET['catid'] = intval($_GET['catid']); $this->model = getcache('model', 'commons'); param::set_cookie('catid', $catid); $category = $this->categorys[$catid]; $modelid = $category['modelid']; $this->db->table_name = $this->db->db_tablepre.$this->model[$modelid]['tablename']; $r = $this->db->get_one(array('id'=>$id)); $this->db->table_name = $this->db->table_name.'_data'; $r2 = $this->db->get_one(array('id'=>$id)); if(!$r2) showmessage(L('subsidiary_table_datalost'),'blank'); $data = array_merge($r,$r2); require CACHE_MODEL_PATH.'content_form.class.php'; $content_form = new content_form($modelid,$catid,$this->categorys); $forminfos = $content_form->get($data); $formValidator = $content_form->formValidator; include $this->admin_tpl('content_edit'); } header("Cache-control: private"); } /** * 删除 */ public function delete() { if(isset($_GET['dosubmit'])) { $catid = intval($_GET['catid']); if(!$catid) showmessage(L('missing_part_parameters')); $modelid = $this->categorys[$catid]['modelid']; $sethtml = $this->categorys[$catid]['sethtml']; $siteid = $this->categorys[$catid]['siteid']; $html_root = pc_base::load_config('system','html_root'); if($sethtml) $html_root = ''; $setting = string2array($this->categorys[$catid]['setting']); $content_ishtml = $setting['content_ishtml']; $this->db->set_model($modelid); $this->hits_db = pc_base::load_model('hits_model'); $this->queue = pc_base::load_model('queue_model'); if(isset($_GET['ajax_preview'])) { $ids = intval($_GET['id']); $_POST['ids'] = array(0=>$ids); } if(empty($_POST['ids'])) showmessage(L('you_do_not_check')); //附件初始化 $attachment = pc_base::load_model('attachment_model'); $this->content_check_db = pc_base::load_model('content_check_model'); $this->position_data_db = pc_base::load_model('position_data_model'); $this->search_db = pc_base::load_model('search_model'); $this->comment = pc_base::load_app_class('comment', 'comment'); $search_model = getcache('search_model_'.$this->siteid,'search'); $typeid = $search_model[$modelid]['typeid']; $this->url = pc_base::load_app_class('url', 'content'); foreach($_POST['ids'] as $id) { $r = $this->db->get_one(array('id'=>$id)); if($content_ishtml && !$r['islink']) { $urls = $this->url->show($id, 0, $r['catid'], $r['inputtime']); $fileurl = $urls[1]; if($this->siteid != 1) { $sitelist = getcache('sitelist','commons'); $fileurl = $html_root.'/'.$sitelist[$this->siteid]['dirname'].$fileurl; } //删除静态文件,排除htm/html/shtml外的文件 $lasttext = strrchr($fileurl,'.'); $len = -strlen($lasttext); $path = substr($fileurl,0,$len); $path = ltrim($path,'/'); $filelist = glob(PHPCMS_PATH.$path.'*'); foreach ($filelist as $delfile) { $lasttext = strrchr($delfile,'.'); if(!in_array($lasttext, array('.htm','.html','.shtml'))) continue; @unlink($delfile); //删除发布点队列数据 $delfile = str_replace(PHPCMS_PATH, '/', $delfile); $this->queue->add_queue('del',$delfile,$this->siteid); } } else { $fileurl = 0; } //删除内容 $this->db->delete_content($id,$fileurl,$catid); //删除统计表数据 $this->hits_db->delete(array('hitsid'=>'c-'.$modelid.'-'.$id)); //删除附件 $attachment->api_delete('c-'.$catid.'-'.$id); //删除审核表数据 $this->content_check_db->delete(array('checkid'=>'c-'.$id.'-'.$modelid)); //删除推荐位数据 $this->position_data_db->delete(array('id'=>$id,'catid'=>$catid,'module'=>'content')); //删除全站搜索中数据 $this->search_db->delete_search($typeid,$id); //删除相关的评论 $commentid = id_encode('content_'.$catid, $id, $siteid); $this->comment->del($commentid, $siteid, $id, $catid); } //更新栏目统计 $this->db->cache_items(); showmessage(L('operation_success'),HTTP_REFERER); } else { showmessage(L('operation_failure')); } } /** * 过审内容 */ public function pass() { $admin_username = param::get_cookie('admin_username'); $catid = intval($_GET['catid']); if(!$catid) showmessage(L('missing_part_parameters')); $category = $this->categorys[$catid]; $setting = string2array($category['setting']); $workflowid = $setting['workflowid']; //只有存在工作流才需要审核 if($workflowid) { $steps = intval($_GET['steps']); //检查当前用户有没有当前工作流的操作权限 $workflows = getcache('workflow_'.$this->siteid,'commons'); $workflows = $workflows[$workflowid]; $workflows_setting = string2array($workflows['setting']); //将有权限的级别放到新数组中 $admin_privs = array(); foreach($workflows_setting as $_k=>$_v) { if(empty($_v)) continue; foreach($_v as $_value) { if($_value==$admin_username) $admin_privs[$_k] = $_k; } } if($_SESSION['roleid']!=1 && $steps && !in_array($steps,$admin_privs)) showmessage(L('permission_to_operate')); //更改内容状态 if(isset($_GET['reject'])) { //退稿 $status = 0; } else { //工作流审核级别 $workflow_steps = $workflows['steps']; if($workflow_steps>$steps) { $status = $steps+1; } else { $status = 99; } } $modelid = $this->categorys[$catid]['modelid']; $this->db->set_model($modelid); //审核通过,检查投稿奖励或扣除积分 if ($status==99) { $member_db = pc_base::load_model('member_model'); if (isset($_POST['ids']) && !empty($_POST['ids'])) { foreach ($_POST['ids'] as $id) { $content_info = $this->db->get_one(array('id'=>$id), 'username'); $memberinfo = $member_db->get_one(array('username'=>$content_info['username']), 'userid, username'); $flag = $catid.'_'.$id; if($setting['presentpoint']>0) { pc_base::load_app_class('receipts','pay',0); receipts::point($setting['presentpoint'],$memberinfo['userid'], $memberinfo['username'], $flag,'selfincome',L('contribute_add_point'),$memberinfo['username']); } else { pc_base::load_app_class('spend','pay',0); spend::point($setting['presentpoint'], L('contribute_del_point'), $memberinfo['userid'], $memberinfo['username'], '', '', $flag); } } } else if (isset($_GET['id']) && $_GET['id']) { $id = intval($_GET['id']); $content_info = $this->db->get_one(array('id'=>$id), 'username'); $memberinfo = $member_db->get_one(array('username'=>$content_info['username']), 'userid, username'); $flag = $catid.'_'.$id; if($setting['presentpoint']>0) { pc_base::load_app_class('receipts','pay',0); receipts::point($setting['presentpoint'],$memberinfo['userid'], $memberinfo['username'], $flag,'selfincome',L('contribute_add_point'),$memberinfo['username']); } else { pc_base::load_app_class('spend','pay',0); spend::point($setting['presentpoint'], L('contribute_del_point'), $memberinfo['userid'], $memberinfo['username'], '', '', $flag); } } } if(isset($_GET['ajax_preview'])) { $_POST['ids'] = $_GET['id']; } $this->db->status($_POST['ids'],$status); } showmessage(L('operation_success'),HTTP_REFERER); } /** * 排序 */ public function listorder() { if(isset($_GET['dosubmit'])) { $catid = intval($_GET['catid']); if(!$catid) showmessage(L('missing_part_parameters')); $modelid = $this->categorys[$catid]['modelid']; $this->db->set_model($modelid); foreach($_POST['listorders'] as $id => $listorder) { $this->db->update(array('listorder'=>$listorder),array('id'=>$id)); } showmessage(L('operation_success')); } else { showmessage(L('operation_failure')); } } /** * 显示栏目菜单列表 */ public function public_categorys() { $show_header = ''; $from = isset($_GET['from']) && in_array($_GET['from'],array('block')) ? $_GET['from'] : 'content'; $tree = pc_base::load_sys_class('tree'); if($from=='content' && $_SESSION['roleid'] != 1) { $this->priv_db = pc_base::load_model('category_priv_model'); $priv_result = $this->priv_db->select(array('action'=>'init','roleid'=>$_SESSION['roleid'],'siteid'=>$this->siteid,'is_admin'=>1)); $priv_catids = array(); foreach($priv_result as $_v) { $priv_catids[] = $_v['catid']; } if(empty($priv_catids)) return ''; } $categorys = array(); if(!empty($this->categorys)) { foreach($this->categorys as $r) { if($r['siteid']!=$this->siteid || ($r['type']==2 && $r['child']==0)) continue; if($from=='content' && $_SESSION['roleid'] != 1 && !in_array($r['catid'],$priv_catids)) { $arrchildid = explode(',',$r['arrchildid']); $array_intersect = array_intersect($priv_catids,$arrchildid); if(empty($array_intersect)) continue; } if($r['type']==1 || $from=='block') { if($r['type']==0) { $r['vs_show'] = "<a href='?m=block&c=block_admin&a=public_visualization&menuid=".$_GET['menuid']."&catid=".$r['catid']."&type=show' target='right'>[".L('content_page')."]</a>"; } else { $r['vs_show'] =''; } $r['icon_type'] = 'file'; $r['add_icon'] = ''; $r['type'] = 'add'; } else { $r['icon_type'] = $r['vs_show'] = ''; $r['type'] = 'init'; $r['add_icon'] = "<a target='right' href='?m=content&c=content&menuid=".$_GET['menuid']."&catid=".$r['catid']."' onclick=javascript:openwinx('?m=content&c=content&a=add&menuid=".$_GET['menuid']."&catid=".$r['catid']."&hash_page=".$_SESSION['hash_page']."','')><img src='".IMG_PATH."add_content.gif' alt='".L('add')."'></a> "; } $categorys[$r['catid']] = $r; } } if(!empty($categorys)) { $tree->init($categorys); switch($from) { case 'block': $strs = "<span class='\$icon_type'>\$add_icon<a href='?m=block&c=block_admin&a=public_visualization&menuid=".$_GET['menuid']."&catid=\$catid&type=list' target='right'>\$catname</a> \$vs_show</span>"; $strs2 = "<img src='".IMG_PATH."folder.gif'> <a href='?m=block&c=block_admin&a=public_visualization&menuid=".$_GET['menuid']."&catid=\$catid&type=category' target='right'>\$catname</a>"; break; default: $strs = "<span class='\$icon_type'>\$add_icon<a href='?m=content&c=content&a=\$type&menuid=".$_GET['menuid']."&catid=\$catid' target='right' onclick='open_list(this)'>\$catname</a></span>"; $strs2 = "<span class='folder'>\$catname</span>"; break; } $categorys = $tree->get_treeview(0,'category_tree',$strs,$strs2); } else { $categorys = L('please_add_category'); } include $this->admin_tpl('category_tree'); exit; } /** * 检查标题是否存在 */ public function public_check_title() { if($_GET['data']=='' || (!$_GET['catid'])) return ''; $catid = intval($_GET['catid']); $modelid = $this->categorys[$catid]['modelid']; $this->db->set_model($modelid); $title = $_GET['data']; if(CHARSET=='gbk') $title = iconv('utf-8','gbk',$title); $r = $this->db->get_one(array('title'=>$title)); if($r) { exit('1'); } else { exit('0'); } } /** * 图片裁切 */ public function public_crop() { if (isset($_GET['picurl']) && !empty($_GET['picurl'])) { $picurl = $_GET['picurl']; $catid = intval($_GET['catid']); if (isset($_GET['module']) && !empty($_GET['module'])) { $module = $_GET['module']; } $show_header = ''; include $this->admin_tpl('crop'); } } /** * 相关文章选择 */ public function public_relationlist() { pc_base::load_sys_class('format','',0); $show_header = ''; $model_cache = getcache('model','commons'); if(!isset($_GET['modelid'])) { showmessage(L('please_select_modelid')); } else { $page = intval($_GET['page']); $modelid = intval($_GET['modelid']); $this->db->set_model($modelid); $where = ''; if($_GET['catid']) { $catid = intval($_GET['catid']); $where .= "catid='$catid'"; } $where .= $where ? ' AND status=99' : 'status=99'; if(isset($_GET['keywords'])) { $keywords = trim($_GET['keywords']); $field = $_GET['field']; if(in_array($field, array('id','title','keywords','description'))) { if($field=='id') { $where .= " AND `id` ='$keywords'"; } else { $where .= " AND `$field` like '%$keywords%'"; } } } $infos = $this->db->listinfo($where,'',$page,12); $pages = $this->db->pages; include $this->admin_tpl('relationlist'); } } public function public_getjson_ids() { $modelid = intval($_GET['modelid']); $id = intval($_GET['id']); $this->db->set_model($modelid); $tablename = $this->db->table_name; $this->db->table_name = $tablename.'_data'; $r = $this->db->get_one(array('id'=>$id),'relation'); if($r['relation']) { $relation = str_replace('|', ',', $r['relation']); $where = "id IN($relation)"; $infos = array(); $this->db->table_name = $tablename; $datas = $this->db->select($where,'id,title'); foreach($datas as $_v) { $_v['sid'] = 'v'.$_v['id']; if(strtolower(CHARSET)=='gbk') $_v['title'] = iconv('gbk', 'utf-8', $_v['title']); $infos[] = $_v; } echo json_encode($infos); } } //文章预览 public function public_preview() { $catid = intval($_GET['catid']); $id = intval($_GET['id']); if(!$catid || !$id) showmessage(L('missing_part_parameters'),'blank'); $page = intval($_GET['page']); $page = max($page,1); $CATEGORYS = getcache('category_content_'.$this->get_siteid(),'commons'); if(!isset($CATEGORYS[$catid]) || $CATEGORYS[$catid]['type']!=0) showmessage(L('missing_part_parameters'),'blank'); define('HTML', true); $CAT = $CATEGORYS[$catid]; $siteid = $CAT['siteid']; $MODEL = getcache('model','commons'); $modelid = $CAT['modelid']; $this->db->table_name = $this->db->db_tablepre.$MODEL[$modelid]['tablename']; $r = $this->db->get_one(array('id'=>$id)); if(!$r) showmessage(L('information_does_not_exist')); $this->db->table_name = $this->db->table_name.'_data'; $r2 = $this->db->get_one(array('id'=>$id)); $rs = $r2 ? array_merge($r,$r2) : $r; //再次重新赋值,以数据库为准 $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); $CAT['setting'] = string2array($CAT['setting']); $template = $template ? $template : $CAT['setting']['show_template']; $allow_visitor = 1; //SEO $SEO = seo($siteid, $catid, $title, $description); define('STYLE',$CAT['setting']['template_list']); if(isset($rs['paginationtype'])) { $paginationtype = $rs['paginationtype']; $maxcharperpage = $rs['maxcharperpage']; } $pages = $titles = ''; if($rs['paginationtype']==1) { //自动分页 if($maxcharperpage < 10) $maxcharperpage = 500; $contentpage = pc_base::load_app_class('contentpage'); $content = $contentpage->get_data($content,$maxcharperpage); } if($rs['paginationtype']!=0) { //手动分页 $CONTENT_POS = strpos($content, '[page]'); if($CONTENT_POS !== false) { $this->url = pc_base::load_app_class('url', 'content'); $contents = array_filter(explode('[page]', $content)); $pagenumber = count($contents); for($i=1; $i<=$pagenumber; $i++) { $pageurls[$i] = $this->url->show($id, $i, $catid, $rs['inputtime']); } $END_POS = strpos($content, '[/page]'); if($END_POS !== false) { 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][0]; } } } else { //当不存在 [/page]时,则使用下面分页 $pages = content_pages($pagenumber,$page, $pageurls); } //判断[page]出现的位置是否在第一位 if($CONTENT_POS<7) { $content = $contents[$page]; } 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>'; } } } } include template('content',$template); $pc_hash = $_SESSION['pc_hash']; $steps = intval($_GET['steps']); echo " <link href=\"".CSS_PATH."dialog_simp.css\" rel=\"stylesheet\" type=\"text/css\" /> <script language=\"javascript\" type=\"text/javascript\" src=\"".JS_PATH."dialog.js\"></script> <script type=\"text/javascript\">art.dialog({lock:false,title:'".L('operations_manage')."',mouse:true, id:'content_m', content:'<span id=cloading ><a href=\'javascript:ajax_manage(1)\'>".L('passed_checked')."</a> | <a href=\'javascript:ajax_manage(2)\'>".L('reject')."</a> | <a href=\'javascript:ajax_manage(3)\'>".L('delete')."</a></span>',left:'right',width:'15em', top:'bottom', fixed:true}); function ajax_manage(type) { if(type==1) { $.get('?m=content&c=content&a=pass&ajax_preview=1&catid=".$catid."&steps=".$steps."&id=".$id."&pc_hash=".$pc_hash."'); } else if(type==2) { $.get('?m=content&c=content&a=pass&ajax_preview=1&reject=1&catid=".$catid."&steps=".$steps."&id=".$id."&pc_hash=".$pc_hash."'); } else if(type==3) { $.get('?m=content&c=content&a=delete&ajax_preview=1&dosubmit=1&catid=".$catid."&steps=".$steps."&id=".$id."&pc_hash=".$pc_hash."'); } $('#cloading').html('<font color=red>".L('operation_success')."<span id=\"secondid\">2</span>".L('after_a_few_seconds_left')."</font>'); setInterval('set_time()', 1000); setInterval('window.close()', 2000); } function set_time() { $('#secondid').html(1); } </script>"; } /** * 审核所有内容 */ public function public_checkall() { $page = isset($_GET['page']) && intval($_GET['page']) ? intval($_GET['page']) : 1; $show_header = ''; $workflows = getcache('workflow_'.$this->siteid,'commons'); $datas = array(); $pagesize = 20; $sql = ''; if (in_array($_SESSION['roleid'], array('1'))) { $super_admin = 1; $status = isset($_GET['status']) ? $_GET['status'] : -1; } else { $super_admin = 0; $status = isset($_GET['status']) ? $_GET['status'] : 1; if($status==-1) $status = 1; } if($status>4) $status = 4; $this->priv_db = pc_base::load_model('category_priv_model');; $admin_username = param::get_cookie('admin_username'); if($status==-1) { $sql = "`status` NOT IN (99,0,-2)"; } else { $sql = "`status` = '$status' "; } if($status!=0 && !$super_admin) { //以栏目进行循环 foreach ($this->categorys as $catid => $cat) { if($cat['type']!=0) continue; //查看管理员是否有这个栏目的查看权限。 if (!$this->priv_db->get_one(array('catid'=>$catid, 'siteid'=>$this->siteid, 'roleid'=>$_SESSION['roleid'], 'is_admin'=>'1'))) { continue; } //如果栏目有设置工作流,进行权限检查。 $workflow = array(); $cat['setting'] = string2array($cat['setting']); if (isset($cat['setting']['workflowid']) && !empty($cat['setting']['workflowid'])) { $workflow = $workflows[$cat['setting']['workflowid']]; $workflow['setting'] = string2array($workflow['setting']); $usernames = $workflow['setting'][$status]; if (empty($usernames) || !in_array($admin_username, $usernames)) {//判断当前管理,在工作流中可以审核几审 continue; } } $priv_catid[] = $catid; } if(empty($priv_catid)) { $sql .= " AND catid = -1"; } else { $priv_catid = implode(',', $priv_catid); $sql .= " AND catid IN ($priv_catid)"; } } $this->content_check_db = pc_base::load_model('content_check_model'); $datas = $this->content_check_db->listinfo($sql,'inputtime DESC',$page); $pages = $this->content_check_db->pages; include $this->admin_tpl('content_checkall'); } /** * 批量移动文章 */ public function remove() { if(isset($_POST['dosubmit'])) { if($_POST['fromtype']==0) { if($_POST['ids']=='') showmessage(L('please_input_move_source')); if(!$_POST['tocatid']) showmessage(L('please_select_target_category')); $tocatid = intval($_POST['tocatid']); $modelid = $this->categorys[$tocatid]['modelid']; if(!$modelid) showmessage(L('illegal_operation')); $ids = array_filter(explode(',', $_POST['ids']),"intval"); $ids = implode(',', $ids); $this->db->set_model($modelid); $this->db->update(array('catid'=>$tocatid),"id IN($ids)"); } else { if(!$_POST['fromid']) showmessage(L('please_input_move_source')); if(!$_POST['tocatid']) showmessage(L('please_select_target_category')); $tocatid = intval($_POST['tocatid']); $modelid = $this->categorys[$tocatid]['modelid']; if(!$modelid) showmessage(L('illegal_operation')); $fromid = array_filter($_POST['fromid'],"intval"); $fromid = implode(',', $fromid); $this->db->set_model($modelid); $this->db->update(array('catid'=>$tocatid),"catid IN($fromid)"); } showmessage(L('operation_success'),HTTP_REFERER); //ids } else { $show_header = ''; $catid = intval($_GET['catid']); $modelid = $this->categorys[$catid]['modelid']; $tree = pc_base::load_sys_class('tree'); $tree->icon = array('&nbsp;&nbsp;│ ','&nbsp;&nbsp;├─ ','&nbsp;&nbsp;└─ '); $tree->nbsp = '&nbsp;&nbsp;'; $categorys = array(); foreach($this->categorys as $cid=>$r) { if($this->siteid != $r['siteid'] || $r['type']) continue; if($modelid && $modelid != $r['modelid']) continue; $r['disabled'] = $r['child'] ? 'disabled' : ''; $r['selected'] = $cid == $catid ? 'selected' : ''; $categorys[$cid] = $r; } $str = "<option value='\$catid' \$selected \$disabled>\$spacer \$catname</option>"; $tree->init($categorys); $string .= $tree->get_tree(0, $str); $str = "<option value='\$catid'>\$spacer \$catname</option>"; $source_string = ''; $tree->init($categorys); $source_string .= $tree->get_tree(0, $str); $ids = empty($_POST['ids']) ? '' : implode(',',$_POST['ids']); include $this->admin_tpl('content_remove'); } } /** * 同时发布到其他栏目 */ public function add_othors() { $show_header = ''; $sitelist = getcache('sitelist','commons'); $siteid = $_GET['siteid']; include $this->admin_tpl('add_othors'); } /** * 同时发布到其他栏目 异步加载栏目 */ public function public_getsite_categorys() { $siteid = intval($_GET['siteid']); $this->categorys = getcache('category_content_'.$siteid,'commons'); $models = getcache('model','commons'); $tree = pc_base::load_sys_class('tree'); $tree->icon = array('&nbsp;&nbsp;&nbsp;│ ','&nbsp;&nbsp;&nbsp;├─ ','&nbsp;&nbsp;&nbsp;└─ '); $tree->nbsp = '&nbsp;&nbsp;&nbsp;'; $categorys = array(); if($_SESSION['roleid'] != 1) { $this->priv_db = pc_base::load_model('category_priv_model'); $priv_result = $this->priv_db->select(array('action'=>'add','roleid'=>$_SESSION['roleid'],'siteid'=>$siteid,'is_admin'=>1)); $priv_catids = array(); foreach($priv_result as $_v) { $priv_catids[] = $_v['catid']; } if(empty($priv_catids)) return ''; } foreach($this->categorys as $r) { if($r['siteid']!=$siteid || $r['type']!=0) continue; if($_SESSION['roleid'] != 1 && !in_array($r['catid'],$priv_catids)) { $arrchildid = explode(',',$r['arrchildid']); $array_intersect = array_intersect($priv_catids,$arrchildid); if(empty($array_intersect)) continue; } $r['modelname'] = $models[$r['modelid']]['name']; $r['style'] = $r['child'] ? 'color:#8A8A8A;' : ''; $r['click'] = $r['child'] ? '' : "onclick=\"select_list(this,'".safe_replace($r['catname'])."',".$r['catid'].")\" class='cu' title='".L('click_to_select')."'"; $categorys[$r['catid']] = $r; } $str = "<tr \$click > <td align='center'>\$id</td> <td style='\$style'>\$spacer\$catname</td> <td align='center'>\$modelname</td> </tr>"; $tree->init($categorys); $categorys = $tree->get_tree(0, $str); echo $categorys; } } ?>
108wo
phpcms/modules/content/content.php
PHP
asf20
34,810
<?php defined('IN_PHPCMS') or exit('No permission resources.'); pc_base::load_app_class('admin','admin',0); pc_base::load_sys_class('push_factory', '', 0); //权限判断,根据栏目里面的权限设置检查 if((isset($_GET['catid']) || isset($_POST['catid'])) && $_SESSION['roleid'] != 1) { $catid = isset($_GET['catid']) ? intval($_GET['catid']) : intval($_POST['catid']); $this->priv_db = pc_base::load_model('category_priv_model'); $priv_datas = $this->priv_db->get_one(array('catid'=>$catid,'is_admin'=>1,'action'=>'push')); if(!$priv_datas['catid']) showmessage(L('permission_to_operate'),'blank'); } class push extends admin { public function __construct() { parent::__construct(); $this->siteid = $this->get_siteid(); $module = (isset($_GET['module']) && !empty($_GET['module'])) ? $_GET['module'] : 'admin'; if (in_array($module, array('admin', 'special','content'))) { $this->push = push_factory::get_instance()->get_api($module); } else { showmessage(L('not_exists_push'), 'blank'); } } /** * 推送选择界面 */ public function init() { if ($_POST['dosubmit']) { $c = pc_base::load_model('content_model'); $c->set_model($_POST['modelid']); $info = array(); $ids = explode('|', $_POST['id']); if(is_array($ids)) { foreach($ids as $id) { $info[$id] = $c->get_content($_POST['catid'], $id); } } $_GET['add_action'] = $_GET['add_action'] ? $_GET['add_action'] : $_GET['action']; $this->push->$_GET['add_action']($info, $_POST); showmessage(L('success'), '', '', 'push'); } else { pc_base::load_app_func('global', 'template'); if (method_exists($this->push, $_GET['action'])) { $html = $this->push->{$_GET['action']}(array('modelid'=>$_GET['modelid'], 'catid'=>$_GET['catid'])); $tpl = isset($_GET['tpl']) ? 'push_to_category' : 'push_list'; include $this->admin_tpl($tpl); } else { showmessage('CLASS METHOD NO EXISTS!', 'blank'); } } } public function public_ajax_get() { if (method_exists($this->push, $_GET['action'])) { $html = $this->push->{$_GET['action']}($_GET['html']); echo $html; } else { echo 'CLASS METHOD NO EXISTS!'; } } } ?>
108wo
phpcms/modules/content/push.php
PHP
asf20
2,252
<?php defined('IN_PHPCMS') or exit('No permission resources.'); //模型缓存路径 define('CACHE_MODEL_PATH',CACHE_PATH.'caches_model'.DIRECTORY_SEPARATOR.'caches_data'.DIRECTORY_SEPARATOR); class down { private $db; function __construct() { $this->db = pc_base::load_model('content_model'); } public function init() { $a_k = trim($_GET['a_k']); if(!isset($a_k)) showmessage(L('illegal_parameters')); $a_k = sys_auth($a_k, 'DECODE', pc_base::load_config('system','auth_key')); if(empty($a_k)) showmessage(L('illegal_parameters')); unset($i,$m,$f); parse_str($a_k); if(isset($i)) $i = $id = intval($i); if(!isset($m)) showmessage(L('illegal_parameters')); if(!isset($modelid)||!isset($catid)) showmessage(L('illegal_parameters')); if(empty($f)) showmessage(L('url_invalid')); $allow_visitor = 1; $MODEL = getcache('model','commons'); $tablename = $this->db->table_name = $this->db->db_tablepre.$MODEL[$modelid]['tablename']; $this->db->table_name = $tablename.'_data'; $rs = $this->db->get_one(array('id'=>$id)); $siteids = getcache('category_content','commons'); $siteid = $siteids[$catid]; $CATEGORYS = getcache('category_content_'.$siteid,'commons'); $this->category = $CATEGORYS[$catid]; $this->category_setting = string2array($this->category['setting']); //检查文章会员组权限 $groupids_view = ''; if ($rs['groupids_view']) $groupids_view = explode(',', $rs['groupids_view']); if($groupids_view && is_array($groupids_view)) { $_groupid = param::get_cookie('_groupid'); $_groupid = intval($_groupid); if(!$_groupid) { $forward = urlencode(get_url()); showmessage(L('login_website'),APP_PATH.'index.php?m=member&c=index&a=login&forward='.$forward); } if(!in_array($_groupid,$groupids_view)) showmessage(L('no_priv')); } else { //根据栏目访问权限判断权限 $_priv_data = $this->_category_priv($catid); if($_priv_data=='-1') { $forward = urlencode(get_url()); showmessage(L('login_website'),APP_PATH.'index.php?m=member&c=index&a=login&forward='.$forward); } elseif($_priv_data=='-2') { showmessage(L('no_priv')); } } //阅读收费 类型 $paytype = $rs['paytype']; $readpoint = $rs['readpoint']; if($readpoint || $this->category_setting['defaultchargepoint']) { if(!$readpoint) { $readpoint = $this->category_setting['defaultchargepoint']; $paytype = $this->category_setting['paytype']; } //检查是否支付过 $allow_visitor = self::_check_payment($catid.'_'.$id,$paytype,$catid); if(!$allow_visitor) { $http_referer = urlencode(get_url()); $allow_visitor = sys_auth($catid.'_'.$id.'|'.$readpoint.'|'.$paytype).'&http_referer='.$http_referer; } else { $allow_visitor = 1; } } if(preg_match('/(php|phtml|php3|php4|jsp|dll|asp|cer|asa|shtml|shtm|aspx|asax|cgi|fcgi|pl)(\.|$)/i',$f) || strpos($f, ":\\")!==FALSE || strpos($f,'..')!==FALSE) showmessage(L('url_error')); if(strpos($f, 'http://') !== FALSE || strpos($f, 'ftp://') !== FALSE || strpos($f, '://') === FALSE) { $pc_auth_key = md5(pc_base::load_config('system','auth_key').$_SERVER['HTTP_USER_AGENT']); $a_k = urlencode(sys_auth("i=$i&d=$d&s=$s&t=".SYS_TIME."&ip=".ip()."&m=".$m."&f=$f&modelid=".$modelid, 'ENCODE', $pc_auth_key)); $downurl = '?m=content&c=down&a=download&a_k='.$a_k; } else { $downurl = $f; } include template('content','download'); } public function download() { $a_k = trim($_GET['a_k']); $pc_auth_key = md5(pc_base::load_config('system','auth_key').$_SERVER['HTTP_USER_AGENT']); $a_k = sys_auth($a_k, 'DECODE', $pc_auth_key); if(empty($a_k)) showmessage(L('illegal_parameters')); unset($i,$m,$f,$t,$ip); parse_str($a_k); if(isset($i)) $downid = intval($i); if(!isset($m)) showmessage(L('illegal_parameters')); if(!isset($modelid)) showmessage(L('illegal_parameters')); if(empty($f)) showmessage(L('url_invalid')); if(!$i || $m<0) showmessage(L('illegal_parameters')); if(!isset($t)) showmessage(L('illegal_parameters')); if(!isset($ip)) showmessage(L('illegal_parameters')); $starttime = intval($t); if(preg_match('/(php|phtml|php3|php4|jsp|dll|asp|cer|asa|shtml|shtm|aspx|asax|cgi|fcgi|pl)(\.|$)/i',$f) || strpos($f, ":\\")!==FALSE || strpos($f,'..')!==FALSE) showmessage(L('url_error')); $fileurl = trim($f); if(!$downid || empty($fileurl) || !preg_match("/[0-9]{10}/", $starttime) || !preg_match("/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/", $ip) || $ip != ip()) showmessage(L('illegal_parameters')); $endtime = SYS_TIME - $starttime; if($endtime > 3600) showmessage(L('url_invalid')); if($m) $fileurl = trim($s).trim($fileurl); //远程文件 if(strpos($fileurl, ':/') && (strpos($fileurl, pc_base::load_config('system','upload_url')) === false)) { header("Location: $fileurl"); } else { if($d == 0) { header("Location: ".$fileurl); } else { $fileurl = str_replace(array(pc_base::load_config('system','upload_url'),'/'), array(pc_base::load_config('system','upload_path'),DIRECTORY_SEPARATOR), $fileurl); $filename = basename($fileurl); //处理中文文件 if(preg_match("/^([\s\S]*?)([\x81-\xfe][\x40-\xfe])([\s\S]*?)/", $fileurl)) { $filename = str_replace(array("%5C", "%2F", "%3A"), array("\\", "/", ":"), urlencode($fileurl)); $filename = urldecode(basename($filename)); } $ext = fileext($filename); $filename = date('Ymd_his').random(3).'.'.$ext; file_down($fileurl, $filename); } } } /** * 检查支付状态 */ private function _check_payment($flag,$paytype,$catid) { $_userid = param::get_cookie('_userid'); $_username = param::get_cookie('_username'); $siteids = getcache('category_content','commons'); $siteid = $siteids[$catid]; $CATEGORYS = getcache('category_content_'.$siteid,'commons'); $this->category = $CATEGORYS[$catid]; $this->category_setting = string2array($this->category['setting']); if(!$_userid) return false; pc_base::load_app_class('spend','pay',0); $setting = $this->category_setting; $repeatchargedays = intval($setting['repeatchargedays']); if($repeatchargedays) { $fromtime = SYS_TIME - 86400 * $repeatchargedays; $r = spend::spend_time($_userid,$fromtime,$flag); if($r['id']) return true; } return false; } /** * 检查阅读权限 * */ private function _category_priv($catid) { $catid = intval($catid); if(!$catid) return '-2'; $_groupid = param::get_cookie('_groupid'); $_groupid = intval($_groupid); if($_groupid==0) $_groupid = 8; $this->category_priv_db = pc_base::load_model('category_priv_model'); $result = $this->category_priv_db->select(array('catid'=>$catid,'is_admin'=>0,'action'=>'visit')); if($result) { if(!$_groupid) return '-1'; foreach($result as $r) { if($r['roleid'] == $_groupid) return '1'; } return '-1'; } else { return '1'; } } } ?>
108wo
phpcms/modules/content/down.php
PHP
asf20
7,080
<?php /** * 分页函数 * * @param $num 信息总数 * @param $curr_page 当前分页 * @param $pageurls 链接地址 * @return 分页 */ function content_pages($num, $curr_page,$pageurls) { $multipage = ''; $page = 11; $offset = 4; $pages = $num; $from = $curr_page - $offset; $to = $curr_page + $offset; $more = 0; if($page >= $pages) { $from = 2; $to = $pages-1; } else { if($from <= 1) { $to = $page-1; $from = 2; } elseif($to >= $pages) { $from = $pages-($page-2); $to = $pages-1; } $more = 1; } if($curr_page>0) { $perpage = $curr_page == 1 ? 1 : $curr_page-1; $multipage .= '<a class="a1" href="'.$pageurls[$perpage][0].'">'.L('previous').'</a>'; if($curr_page==1) { $multipage .= ' <span>1</span>'; } elseif($curr_page>6 && $more) { $multipage .= ' <a href="'.$pageurls[1][0].'">1</a>..'; } else { $multipage .= ' <a href="'.$pageurls[1][0].'">1</a>'; } } for($i = $from; $i <= $to; $i++) { if($i != $curr_page) { $multipage .= ' <a href="'.$pageurls[$i][0].'">'.$i.'</a>'; } else { $multipage .= ' <span>'.$i.'</span>'; } } if($curr_page<$pages) { if($curr_page<$pages-5 && $more) { $multipage .= ' ..<a href="'.$pageurls[$pages][0].'">'.$pages.'</a> <a class="a1" href="'.$pageurls[$curr_page+1][0].'">'.L('next').'</a>'; } else { $multipage .= ' <a href="'.$pageurls[$pages][0].'">'.$pages.'</a> <a class="a1" href="'.$pageurls[$curr_page+1][0].'">'.L('next').'</a>'; } } elseif($curr_page==$pages) { $multipage .= ' <span>'.$pages.'</span> <a class="a1" href="'.$pageurls[$curr_page][0].'">'.L('next').'</a>'; } return $multipage; } ?>
108wo
phpcms/modules/content/functions/util.func.php
PHP
asf20
1,704
<?php defined('IN_PHPCMS') or exit('No permission resources.'); class rss { private $db; function __construct() { $this->db = pc_base::load_model('content_model'); pc_base::load_app_class('rssbuilder','','','0'); $this->siteid = $_GET['siteid'] ? intval($_GET['siteid']) : '1'; $this->rssid = intval($_GET['rssid']); define('SITEID', $this->siteid); } public function init() { $siteurl = siteurl(SITEID); if(empty($this->rssid)) { $catid = $_GET['catid'] ? intval($_GET['catid']) : '0'; $siteids = getcache('category_content','commons'); $siteid = $siteids[$catid] ? $siteids[$catid] : 1; $CATEGORYS = getcache('category_content_'.$siteid,'commons'); $subcats = subcat($catid,0,1,$siteid); foreach ($CATEGORYS as $r) if($r['parentid'] == 0) $channel[] = $r; include template('content','rss'); } else { $CATEGORYS = getcache('category_content_'.$this->siteid,'commons'); $SITEINFO = getcache('sitelist','commons'); $CAT = $CATEGORYS[$this->rssid]; if(count($CAT) == 0) showmessage(L('missing_part_parameters'),'blank'); $siteid = $CAT['siteid']; $sitedomain = $SITEINFO[$siteid]['domain']; //获取站点域名 $MODEL = getcache('model','commons'); $modelid = $CAT['modelid']; $encoding = CHARSET; $about = SITE_PROTOCOL.SITE_URL; $title = $CAT['catname']; $description = $CAT['description']; $content_html = $CAT['content_ishtml']; $image_link = "<![CDATA[".$CAT['image']."]]> "; $category = ''; $cache = 60; $rssfile = new RSSBuilder($encoding, $about, $title, $description, $image_link, $category, $cache); $publisher = ''; $creator = SITE_PROTOCOL.SITE_URL; $date = date('r'); $rssfile->addDCdata($publisher, $creator, $date); $ids = explode(",",$CAT['arrchildid']); if(count($ids) == 1 && in_array($this->rssid, $ids)) { $sql .= "`catid` = '$this->rssid' AND `status` = '99'"; } else { $sql .= get_sql_catid('category_content_'.$siteid,$this->rssid)." AND `status` = '99'"; } $this->db->table_name = $this->db->db_tablepre.$MODEL[$modelid]['tablename']; $info = $this->db->select($sql,'`title`, `description`, `url`, `inputtime`, `thumb`, `keywords`','0,20','id DESC'); foreach ($info as $r) { //添加项目 if(!empty($r['thumb'])) $img = "<img src=".thumb($r['thumb'], 150, 150)." border='0' /><br />";else $img = ''; $about = $link = (strpos($r['url'], 'http://') !== FALSE || strpos($r['url'], 'https://') !== FALSE) ? "<![CDATA[".$r['url']."]]> " : (($content_html == 1) ? "<![CDATA[".substr($sitedomain,0,-1).$r['url']."]]> " : "<![CDATA[".substr(APP_PATH,0,-1).$r['url']."]]> "); $title = "<![CDATA[".$r['title']."]]> "; $description = "<![CDATA[".$img.$r['description']."]]> "; $subject = ''; $date = date('Y-m-d H:i:s' , $r['inputtime']); $author = $PHPCMS['sitename'].' '.SITE_PROTOCOL.SITE_URL; $comments = '';//注释; $rssfile->addItem($about, $title, $link, $description, $subject, $date, $author, $comments, $image); } $version = '2.00'; $rssfile->outputRSS($version); } } } ?>
108wo
phpcms/modules/content/rss.php
PHP
asf20
3,405
<?php defined('IN_PHPCMS') or exit('No permission resources.'); pc_base::load_app_class('admin', 'admin', 0); class block_admin extends admin { private $db, $siteid, $priv_db, $history_db, $roleid; public function __construct() { $this->db = pc_base::load_model('block_model'); $this->priv_db = pc_base::load_model('block_priv_model'); $this->history_db = pc_base::load_model('block_history_model'); $this->roleid = $_SESSION['roleid']; $this->siteid = $this->get_siteid(); parent::__construct(); } public function init() { $page = isset($_GET['page']) && intval($_GET['page']) ? intval($_GET['page']) : 1; if ($_SESSION['roleid'] != 1) { $offset = ($page-1) * 20; $r = $this->priv_db->select(array('roleid'=>$this->roleid, 'siteid'=>$this->siteid),'blockid', $offset.',20'); $blockid_list = array(); foreach ($r as $key=>$v) { $blockid_list[$key] = $v['blockid']; } $sql = implode('\',\'', $blockid_list); $list = $this->db->listinfo("id in ('$sql')", '', $page, 20); } else { $list = $this->db->listinfo(array('siteid'=>$this->siteid), '', $page, 20); } $pages = $this->db->pages; include $this->admin_tpl('block_list'); } public function add() { $pos = isset($_GET['pos']) && trim($_GET['pos']) ? trim($_GET['pos']) : showmessage(L('illegal_operation')); if (isset($_POST['dosubmit'])) { $name = isset($_POST['name']) && trim($_POST['name']) ? trim($_POST['name']) : showmessage(L('illegal_operation'), HTTP_REFERER); $type = isset($_POST['type']) && intval($_POST['type']) ? intval($_POST['type']) : 1; //判断名称是否已经存在 if ($this->db->get_one(array('name'=>$name))) { showmessage(L('name').L('exists'), HTTP_REFERER); } if ($id = $this->db->insert(array('name'=>$name, 'pos'=>$pos, 'type'=>$type, 'siteid'=>$this->siteid), true)) { //设置权限 $priv = isset($_POST['priv']) ? $_POST['priv'] : ''; if (!empty($priv)) { if (is_array($priv)) foreach ($priv as $v) { if (empty($v)) continue; $this->priv_db->insert(array('roleid'=>$v, 'blockid'=>$id, 'siteid'=>$this->siteid)); } } showmessage(L('operation_success'), '?m=block&c=block_admin&a=block_update&id='.$id); } else { showmessage(L('operation_failure'), HTTP_REFERER); } } else { $show_header = $show_validator = true; pc_base::load_sys_class('form'); $administrator = getcache('role', 'commons'); unset($administrator[1]); include $this->admin_tpl('block_add_edit'); } } public function edit() { $id = isset($_GET['id']) && intval($_GET['id']) ? intval($_GET['id']) : showmessage(L('illegal_operation')); if (!$data = $this->db->get_one(array('id'=>$id))) { showmessage(L('nofound')); } if (isset($_POST['dosubmit'])) { $name = isset($_POST['name']) && trim($_POST['name']) ? trim($_POST['name']) : showmessage(L('illegal_operation'), HTTP_REFERER); if ($data['name'] != $name) { if ($this->db->get_one(array('name'=>$name))) { showmessage(L('name').L('exists'), HTTP_REFERER); } } if ($this->db->update(array('name'=>$name, 'siteid'=>$this->siteid), array('id'=>$id))) { //设置权限 $priv = isset($_POST['priv']) ? $_POST['priv'] : ''; $this->priv_db->delete(array('blockid'=>$id, 'siteid'=>$this->siteid)); if (!empty($priv)) { if (is_array($priv)) foreach ($priv as $v) { if (empty($v)) continue; $this->priv_db->insert(array('roleid'=>$v, 'blockid'=>$id, 'siteid'=>$this->siteid)); } } showmessage(L('operation_success'), '', '' ,'edit'); } else { showmessage(L('operation_failure'), HTTP_REFERER); } } $show_header = $show_validator = true; pc_base::load_sys_class('form'); $administrator = getcache('role', 'commons'); unset($administrator[1]); $r = $this->priv_db->select(array('blockid'=>$id, 'siteid'=>$this->siteid),'roleid'); $priv_list = array(); foreach ($r as $v) { if($v['roleid']) $priv_list[] = $v['roleid']; } include $this->admin_tpl('block_add_edit'); } public function del() { $id = isset($_GET['id']) && intval($_GET['id']) ? intval($_GET['id']) : showmessage(L('illegal_operation')); if (!$data = $this->db->get_one(array('id'=>$id))) { showmessage(L('nofound')); } if ($this->db->delete(array('id'=>$id)) && $this->history_db->delete(array('blockid'=>$id)) && $this->priv_db->delete(array('blockid'=>$id))) { if (pc_base::load_config('system','attachment_stat')) { $this->attachment_db = pc_base::load_model('attachment_model'); $keyid = 'block-'.$id; $this->attachment_db->api_delete($keyid); } showmessage(L('operation_success'), HTTP_REFERER); } else { showmessage(L('operation_failure'), HTTP_REFERER); } } public function block_update() { $id = isset($_GET['id']) && intval($_GET['id']) ? intval($_GET['id']) : showmessage(L('illegal_operation'), HTTP_REFERER); //进行权限判断 if ($this->roleid != 1) { if (!$this->priv_db->get_one(array('blockid'=>$id, 'roleid'=>$this->roleid, 'siteid'=>$this->siteid))) { showmessage(L('not_have_permissions')); } } if (!$data = $this->db->get_one(array('id'=>$id))) { showmessage(L('nofound')); } if (isset($_POST['dosubmit'])) { $sql = array(); if ($data['type'] == 2) { $title = isset($_POST['title']) ? $_POST['title'] : ''; $url = isset($_POST['url']) ? $_POST['url'] : ''; $thumb = isset($_POST['thumb']) ? $_POST['thumb'] : ''; $desc = isset($_POST['desc']) ? $_POST['desc'] : ''; $template = isset($_POST['template']) && trim($_POST['template']) ? trim($_POST['template']) : ''; $datas = array(); foreach ($title as $key=>$v) { if (empty($v) || !isset($url[$key]) ||empty($url[$key])) continue; $datas[$key] = array('title'=>$v, 'url'=>$url[$key], 'thumb'=>$thumb[$key], 'desc'=>str_replace(array(chr(13), chr(43)), array('<br />', '&nbsp;'), $desc[$key])); } if ($template) { $block = pc_base::load_app_class('block_tag'); $block->template_url($id, $template); } if (is_array($thumb) && !empty($thumb)) { if(pc_base::load_config('system','attachment_stat')) { $this->attachment_db = pc_base::load_model('attachment_model'); $this->attachment_db->api_update($thumb, 'block-'.$id, 1); } } $sql = array('data'=>array2string($datas), 'template'=>$template); } elseif ($data['type'] == 1) { $datas = isset($_POST['data']) && trim($_POST['data']) ? trim($_POST['data']) : ''; $sql = array('data'=>$datas); } if ($this->db->update($sql, array('id'=>$id))) { //添加历史记录 $this->history_db->insert(array('blockid'=>$data['id'], 'data'=>array2string($data), 'creat_at'=>SYS_TIME, 'userid'=>param::get_cookie('userid'), 'username'=>param::get_cookie('admin_username'))); showmessage(L('operation_success').'<script style="text/javascript">if(!parent.right){parent.location.reload();}art.dialog({id:"edit"}).close();</script>', '','','edit'); } else { showmessage(L('operation_failure'), HTTP_REFERER); } } else { if (!empty($data['data'])) { if ($data['type'] == 2) $data['data'] = string2array($data['data']); $total = count($data['data']); } pc_base::load_sys_class('form'); pc_base::load_sys_class('format', '', 0); $page = isset($_GET['page']) && intval($_GET['page']) ? intval($_GET['page']) : 1; $history_list = $this->history_db->listinfo(array('blockid'=>$id), '', $page, 10); $pages = $this->history_db->pages; $show_header = $show_validator = $show_dialog = true; include $this->admin_tpl('block_update'); } } public function public_visualization() { echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'; $catid = isset($_GET['catid']) && intval($_GET['catid']) ? intval($_GET['catid']) : 0; $type = isset($_GET['type']) && trim($_GET['type']) ? trim($_GET['type']) : 'list'; $siteid = $GLOBALS['siteid'] = $this->get_siteid(); if (!empty($catid)) { $CATEGORY = getcache('category_content_'.$siteid, 'commons'); if (!isset($CATEGORY[$catid])) { showmessage(L('notfound')); } $cat = $CATEGORY[$catid]; $cat['setting'] = string2array($cat['setting']); } if($cat['type']==2) showmessage(L('link_visualization_not_exists')); $file = ''; $style = $cat['setting']['template_list']; switch ($type) { case 'category': if($cat['type']==1) { $file = $cat['setting']['page_template']; } else { $file = $cat['setting']['category_template']; } break; case 'list': if($cat['type']==1) { $file = $cat['setting']['page_template']; } else { $file = $cat['setting']['list_template']; } break; case 'show': $file = $cat['setting']['show_template']; break; case 'index': $sites = pc_base::load_app_class('sites', 'admin'); $sites_info = $sites->get_by_id($this->siteid); $file = 'index'; $style = $sites_info['default_style']; break; case 'page': $file = $cat['setting']['page_template']; break; } pc_base::load_app_func('global','template'); ob_start(); include template('content', $file, $style); $html = ob_get_contents(); ob_clean(); echo visualization($html, $style, 'content', $file.'.html'); } public function public_view() { $id = isset($_GET['id']) && intval($_GET['id']) ? intval($_GET['id']) : exit('0'); if (!$data = $this->db->get_one(array('id'=>$id))) { showmessage(L('nofound')); } if ($data['type'] == 1) { exit('<script type="text/javascript">parent.showblock('.$id.', \''.str_replace("\r\n", '', $_POST['data']).'\')</script>'); } elseif ($data['type'] == 2) { extract($data); unset($data); $title = isset($_POST['title']) ? $_POST['title'] : ''; $url = isset($_POST['url']) ? $_POST['url'] : ''; $thumb = isset($_POST['thumb']) ? $_POST['thumb'] : ''; $desc = isset($_POST['desc']) ? $_POST['desc'] : ''; $template = isset($_POST['template']) && trim($_POST['template']) ? trim($_POST['template']) : ''; $data = array(); foreach ($title as $key=>$v) { if (empty($v) || !isset($url[$key]) ||empty($url[$key])) continue; $data[$key] = array('title'=>$v, 'url'=>$url[$key], 'thumb'=>$thumb[$key], 'desc'=>str_replace(array(chr(13), chr(43)), array('<br />', '&nbsp;'), $desc[$key])); } $tpl = pc_base::load_sys_class('template_cache'); $str = $tpl->template_parse(new_stripslashes($template)); $filepath = CACHE_PATH.'caches_template'.DIRECTORY_SEPARATOR.'block'.DIRECTORY_SEPARATOR.'tmp_'.$id.'.php'; $dir = dirname($filepath); if(!is_dir($dir)) { @mkdir($dir, 0777, true); } if (@file_put_contents($filepath,$str)) { ob_start(); include $filepath; $html = ob_get_contents(); ob_clean(); @unlink($filepath); } exit('<script type="text/javascript">parent.showblock('.$id.', \''.str_replace("\r\n", '', $html).'\')</script>'); } } 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']) : ''; $name = safe_replace($name); $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'); } } public function history_restore() { $id = isset($_GET['id']) && intval($_GET['id']) ? intval($_GET['id']) : showmessage(L('illegal_operation'), HTTP_REFERER); if (!$data = $this->history_db->get_one(array('id'=>$id))) { showmessage(L('nofound'), HTTP_REFERER); } $data['data'] = string2array($data['data']); $this->db->update(array('data'=>new_addslashes($data['data']['data']), 'template'=>new_addslashes($data['data']['template'])), array('id'=>$data['blockid'])); if ($data['data']['type'] == 2) { $block = pc_base::load_app_class('block_tag'); $block->template_url($data['blockid'], $data['data']['template']); } showmessage(L('operation_success'), HTTP_REFERER); } public function history_del() { $id = isset($_GET['id']) && intval($_GET['id']) ? intval($_GET['id']) : showmessage(L('illegal_operation'), HTTP_REFERER); if (!$data = $this->history_db->get_one(array('id'=>$id))) { showmessage(L('nofound'), HTTP_REFERER); } $this->history_db->delete(array('id'=>$id)); showmessage(L('operation_success'), HTTP_REFERER); } public function public_search_content() { $catid = isset($_GET['catid']) && intval($_GET['catid']) ? intval($_GET['catid']) : ''; $posids = isset($_GET['posids']) && intval($_GET['posids']) ? intval($_GET['posids']) : 0; $page = isset($_GET['page']) && intval($_GET['page']) ? intval($_GET['page']) : 1; $searchtype = isset($_GET['searchtype']) && intval($_GET['searchtype']) ? intval($_GET['searchtype']) : 0; $end_time = isset($_GET['end_time']) && trim($_GET['end_time']) ? strtotime(trim($_GET['end_time'])) : ''; $start_time = isset($_GET['start_time']) && trim($_GET['start_time']) ? strtotime(trim($_GET['start_time'])) : ''; $keyword = isset($_GET['keyword']) && trim($_GET['keyword']) ? trim($_GET['keyword']) : ''; if (isset($_GET['dosubmit']) && !empty($catid)) { if (!empty($start_time) && empty($end_time)) { $end_time = SYS_TIME; } if ($end_time < $start_time) { showmessage(L('end_of_time_to_time_to_less_than')); } if (!empty($end_time) && empty($start_time)) { showmessage(L('please_set_the_starting_time')); } $sql = "`catid` = '$catid' AND `posids` = '$posids'"; if (!empty($start_time) && !empty($end_time)) $sql .= " AND `inputtime` BETWEEN '$start_time' AND '$end_time' "; if (!empty($searchtype) && !empty($keyword)) { switch ($searchtype) { case '1'://标题搜索 $sql .= " AND `title` LIKE '%$keyword%' "; break; case '2'://简介搜索 $sql .= " AND `description` LIKE '%$keyword%' "; break; case '3'://用户名 $sql .= " AND `username` = '$keyword' "; break; case '4'://ID搜索 $sql .= " AND `id` = '$keyword' "; break; } } $content_db = pc_base::load_model('content_model'); $content_db->set_catid($catid); $data = $content_db->listinfo($sql, 'id desc', $page); $pages = $content_db->pages; } pc_base::load_sys_class('form'); $show_header = $show_validator = $show_dialog = true; include $this->admin_tpl('search_content'); } }
108wo
phpcms/modules/block/block_admin.php
PHP
asf20
15,098
<?php defined('IN_ADMIN') or exit('No permission resources.'); include $this->admin_tpl('header', 'admin'); ?> <div class="pad_10"> <div class="table-list"> <table width="100%" cellspacing="0"> <thead> <tr> <th><?php echo L('name')?></th> <th width="80"><?php echo L('type')?></th> <th><?php echo L('display_position')?></th> <th width="150"><?php echo L('operations_manage')?></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 if($v['type']==1) {echo L('code');} else {echo L('table_style');}?></td> <td align="center"><?php echo $v['pos']?></td> <td align="center"><a href="javascript:block_update(<?php echo $v['id']?>, '<?php echo $v['name']?>')"><?php echo L('updates')?></a> | <a href="javascript:edit(<?php echo $v['id']?>, '<?php echo $v['name']?>')"><?php echo L('edit')?></a> | <a href="?m=block&c=block_admin&a=del&id=<?php echo $v['id']?>" onclick="return confirm('<?php echo L('confirm', array('message'=>$v['name']))?>')"><?php echo L('delete')?></a></td> </tr> <?php endforeach; endif; ?> </tbody> </table> </div> </div> <div id="pages"><?php echo $pages?></div> <div id="closeParentTime" style="display:none"></div> <script type="text/javascript"> <!-- if(window.top.$("#current_pos").data('clicknum')==1 || window.top.$("#current_pos").data('clicknum')==null) { parent.document.getElementById('display_center_id').style.display=''; parent.document.getElementById('center_frame').src = '?m=content&c=content&a=public_categorys&type=add&from=block&pc_hash=<?php echo $_SESSION['pc_hash'];?>'; window.top.$("#current_pos").data('clicknum',0); } function block_update(id, name) { window.top.art.dialog({id:'edit'}).close(); window.top.art.dialog({title:'<?php echo L('edit')?>《'+name+'》',id:'edit',iframe:'?m=block&c=block_admin&a=block_update&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 edit(id, name) { window.top.art.dialog({id:'edit'}).close(); window.top.art.dialog({title:'<?php echo L('edit')?>《'+name+'》',id:'edit',iframe:'?m=block&c=block_admin&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()}); } //--> </script> </body> </html>
108wo
phpcms/modules/block/templates/block_list.tpl.php
PHP
asf20
2,638
<?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'})}}); $("#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=block&c=block_admin&a=public_name&id=<?php if(isset($id) && !empty($id))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')?>"})<?php if(ROUTE_A=='edit')echo '.defaultPassed()';?>; }) //--> </script> <div class="pad-10"> <form action="?m=block&c=block_admin&a=<?php echo ROUTE_A?>&pos=<?php echo $_GET['pos']?>&id=<?php if(isset($id) && !empty($id))echo $id;?>" method="post" id="myform"> <div> <fieldset> <legend><?php echo L('block_configuration')?></legend> <table width="100%" class="table_form"> <tr> <th width="80"><?php echo L('name')?>:</th> <td class="y-bg"><input type="text" name="name" id="name" size="30" value="<?php echo isset($data['name']) ? $data['name'] : '';?>" /></td> </tr> <tr> <th width="80"><?php echo L('display_position')?>:</th> <td class="y-bg"> <?php echo isset($data['pos']) ? $data['pos'] : $_GET['pos'];?></td> </tr> <tr> <th width="80"><?php echo L('type')?>:</th> <td class="y-bg"><?php echo form::radio(array('1'=>L('code'), '2'=>L('table_style')), (isset($data['type']) ? $data['type'] : 1), 'name="type"'.(ROUTE_A=='edit' ? ' disabled = "disabled"' : ''))?></td> </tr> </table> </fieldset> <div class="bk15"></div> <fieldset> <legend><?php echo L('permission_configuration')?></legend> <table width="100%" class="table_form"> <tr> <th width="80"><?php echo L('role')?>:</th> <td class="y-bg"><?php echo form::checkbox($administrator, (isset($priv_list) ? implode(',', $priv_list) : ''), 'name="priv[]"')?></td> </tr> </table> </fieldset> <input type="submit" class="dialog" id="dosubmit" name="dosubmit" value="" /> </div> </div> </form> </body> </html>
108wo
phpcms/modules/block/templates/block_add_edit.tpl.php
PHP
asf20
2,451
<?php defined('IN_ADMIN') or exit('No permission resources.'); include $this->admin_tpl('header', 'admin'); $authkey = upload_key('1,jpg|jpeg|gif|bmp|png,1,200,200'); ?> <?php if ($data['type'] == 2) :?> <style> .arrowhead,.arrowhead-b{background: url(<?php echo IMG_PATH?>icon/arrowhead.png) no-repeat; height:15px; width:16px;} .arrowhead-b{background-position: left -28px;} .thumb{float: left;width: 100px; height: 90px} a.close{background: url(<?php echo IMG_PATH?>cross.png) no-repeat left -46px; display:block; width:16px;height:16px;display:inline-block;display:-moz-inline-stack;zoom:1;*display:inline;} .forms{display:none;} </style> <script type="text/javascript" src="<?php echo JS_PATH?>swfupload/swf2ckeditor.js"></script> <?php endif;?> <div class="pad-10"> <form action="?m=block&c=block_admin&a=block_update&id=<?php echo $id?>" method="post" id="myform"> <fieldset> <legend><?php echo L('block_data')?></legend> <table width="100%" class="table_form" id="table_form"> <?php if ($data['type'] == 1) :?> <tr> <td class="y-bg"><textarea cols="80" id="data" name="data" rows="10"><?php echo htmlspecialchars($data['data'])?></textarea> <?php echo form::editor('data','full','#E0EAFC','','',1)?></td> </tr> <?php else:?> <?php if(is_array($data['data'])) foreach($data['data'] as $key=>$val):?> <tr> <td> <div class="contents" id="content_<?php echo $key?>"><a href="<?php echo $val['url']?>" target="blank"><b><?php echo $val['title']?></b></a><br /><div style="color:#ccc;"><?php if($val['thumb']):?><img src="<?php echo $val['thumb']?>" class="thumb" /><?php endif;?><?php echo $val['desc']?></div></div> <div class="forms" id="form_<?php echo $key?>"> <?php echo L('title')?>:<input type="text" id="title_<?php echo $key?>" name="title[]" class="input-text" value="<?php echo $val['title']?>" > <?php echo L('link')?>:<input type="text" id="url_<?php echo $key?>" name="url[]" class="input-text" value="<?php echo $val['url']?>" > <?php echo L('thumb')?>:<input type="hidden" name="thumb[]" id="thumb_<?php echo $key?>" value="<?php echo $val['thumb']?>" > <a href="javascript:void(0)" onclick="flashupload('thumb_images', '<?php echo L('attachment_upload')?>','thumb_<?php echo $key?>',submit_images,'1,jpg|jpeg|gif|bmp|png,1','block', '', '<?php echo upload_key('1,jpg|jpeg|gif|bmp|png,1')?>')"><?php echo L('pic_upload')?></a> <a href="javascript:void(0)" onclick="$('#thumb_<?php echo $key?>').val('')"><?php echo L('delete_image')?></a><br /><?php echo L('desc')?>:<textarea id="desc_<?php echo $key?>" name="desc[]" rows="10" cols="80"><?php echo str_replace(array(chr(13), chr(43)), array('<br />', '&nbsp;'), $val['desc'])?></textarea><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" value="<?php echo L('submit')?>" class="button" onclick="form_submit(<?php echo $key?>)" /> </div> </td> <td width="80"><a href="javascript:void(0);" class="arrowhead" onclick="moveUp(this);" title="<?php echo L('up')?>"></a><a href="javascript:void(0);" onclick="moveDown(this);" class="arrowhead-b" title="<?php echo L('down')?>"></a><a href="javascript:void(0)" onclick="edit_form(<?php echo $key?>)"><img src="<?php echo IMG_PATH?>icon/m_2.png" alt="<?php echo L('edit')?>" /></a><a href="javascript:void(0)" onclick="$(this).parent().parent().remove();" class="close" title="<?php echo L('delete')?>"></a></td> </tr> <?php endforeach;endif;?> </table> <div class="bk15"></div> <input type="button" value="<?php echo L('preview')?>" class="button" onclick="block_view(<?php echo $id?>)" /> <input type="button" value="<?php echo L('history')?>" class="button" onclick="show_history()" /> <input type="button" value="<?php echo L('search_content')?>" class="button" onclick="search_content()"> <?php if ($data['type'] == 2) :?><?php echo L('datatable')?>: <input type="text" id="linenum" size="2" value="1" /><input type="button" value="<?php echo L('submit')?>" class="button" onclick="add_line()" /> </fieldset> <div class="bk15"></div> <fieldset> <legend><?php echo L('pieces_template')?></legend> <table width="100%" class="table_form"> <tr> <Td><textarea name="template" id="template" style="width:100%;height:120px;"><?php if ($data['template']) :echo htmlspecialchars($data['template']); else:?>{$name} <ul> {loop $data $i $r} <li style="clear:both"> <a href="{$r[url]}">{$r[title]}</a><br /> <div style="color:#ccc;">{if $r[thumb]}<img src="{$r[thumb]}" style="float:left">{/if}{$r[desc]} </div> {/loop} </li> </ul><?php endif;?> </textarea></Td> <td width="120"><span style="height:25px"><input type="button" class="button" value="{loop }" title="<?php echo L('insert')?>" style="width:50px" onClick="javascript:insertText('{loop $data $n $r}')" /></span> <span style="height:25px"><input type="button" class="button" value="{/loop}" title="<?php echo L('insert')?>" style="width:50px" onClick="javascript:insertText('{/loop}')" /></span><br /> <span style="height:25px"><input type="button" class="button" value="<?php echo L('name')?>" title="<?php echo L('insert')?>" style="width:50px" onClick="javascript:insertText('{$name}')" /></span> <span style="height:25px"><input type="button" class="button" value="<?php echo L('title')?>" title="<?php echo L('insert')?>" style="width:50px" onClick="javascript:insertText('{$r[title]}')" /></span><br /> <span style="height:25px"><input type="button" class="button" value="URL" title="<?php echo L('insert')?>" style="width:50px" onClick="javascript:insertText('{$r[url]}')" /></span> <span style="height:25px"><input type="button" class="button" value="<?php echo L('thumb')?>" title="<?php echo L('insert')?>" style="width:50px" onClick="javascript:insertText('{$r[thumb]}')" /></span><br /> <span style="height:25px"><input type="button" class="button" value="<?php echo L('desc')?>" title="<?php echo L('insert')?>" style="width:50px" onClick="javascript:insertText('{$r[desc]}')" /></span> </td> </tr> </table> </fieldset> <?php endif;?> <div class="bk15"></div> <a name="history_div"></a> <fieldset id="history" style="display:none"> <legend><?php echo L('history')?></legend> <div class="bk15"></div> <div class="table-list"> <table width="100%" cellspacing="0"> <thead> <tr> <th width="120"><?php echo L('time')?></th> <th align="left"><?php echo L('admin')?></th> <th align="left" width="150"><?php echo L('operations_manage')?></th> </tr> </thead> <tbody> <?php if(is_array($history_list)) foreach ($history_list as $val):?> <tr> <td><?php echo format::date($val['creat_at'], 1)?></td> <td><?php echo $val['username']?></td> <td><a href="?m=block&c=block_admin&a=history_restore&id=<?php echo $val['id']?>"><?php echo L('restore')?></a> <a href="?m=block&c=block_admin&a=history_del&id=<?php echo $val['id']?>" onclick="return confirm('<?php echo L('are_you_sure_you_want_to_delete')?>')"><?php echo L('delete')?></a></td> </tr> <?php endforeach;?> </tbody> </table> </div> <?php if($pages):?><div id="pages"><?php echo $pages;?></div><?php endif;?> </fieldset> <input type="submit" class="dialog" id="dosubmit" name="dosubmit" value="" /> <iframe name="view" id="view" src='' width="0" height="0"></iframe> </div> </form> <script language="JavaScript" type="text/javascript"><!-- var j=<?php echo isset($total) ? $total : 0?>; function add_line() { for (var i=1; i<= $('#linenum').val(); i++) { $('#table_form').append('<tr><td><div class="contents" id="content_'+j+'"></div><div class="forms" style="display:block" id="form_'+j+'"><?php echo L('title')?>:<input type="text" id="title_'+j+'" name="title[]" class="input-text"> <?php echo L('link')?>:<input type="text" id="url_'+j+'" name="url[]" class="input-text"> <?php echo L('thumb')?>:<input type="hidden" name="thumb[]" id="thumb_'+j+'"> <a href="javascript:void(0)" onclick="flashupload(\'thumb_images\', \'<?php echo L('attachment_upload')?>\',\'thumb_'+j+'\',submit_images,\'1,jpg|jpeg|gif|bmp|png,1\',\'block\', \'\', \'<?php echo upload_key('1,jpg|jpeg|gif|bmp|png,1')?>\')"><?php echo L('pic_upload')?></a> <a href="javascript:void(0)" onclick="$(\'#thumb_'+j+'\').val(\'\')"><?php echo L('delete_image')?></a><br /><?php echo L('desc')?>:<textarea id="desc_'+j+'" name="desc[]" rows="10" cols="80"></textarea><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" value="<?php echo L('submit')?>" class="button" onclick="form_submit('+j+')" /></div></td><td width="80"><a href="javascript:void(0);" class="arrowhead" onclick="moveUp(this);" title="<?php echo L('up')?>"></a><a href="javascript:void(0);" onclick="moveDown(this);" class="arrowhead-b" title="<?php echo L('down')?>"></a><a href="javascript:void(0)" onclick="edit_form('+j+')"><img src="<?php echo IMG_PATH?>icon/m_2.png" alt="<?php echo L('edit')?>" /></a><a href="javascript:void(0)" onclick="$(this).parent().parent().remove();" class="close" title="<?php echo L('delete')?>"></a></td></tr>'); j++; } } function insert_forms(obj) { eval("var d = "+obj+";"); $('#table_form').append('<tr><td><div class="contents" id="content_'+j+'"></div><div class="forms" style="display:block" id="form_'+j+'"><?php echo L('title')?>:<input type="text" id="title_'+j+'" name="title[]" class="input-text" value="'+d.title+'" > <?php echo L('link')?>:<input type="text" id="url_'+j+'" name="url[]" value="'+d.url+'" class="input-text"> <?php echo L('thumb')?>:<input type="hidden" name="thumb[]" value="'+d.thumb+'" id="thumb_'+j+'"> <a href="javascript:void(0)" onclick="flashupload(\'thumb_images\', \'<?php echo L('attachment_upload')?>\',\'thumb_'+j+'\',submit_images,\'1,jpg|jpeg|gif|bmp|png,1,200,200\',\'block\',\'\',\'<?php echo upload_key('1,jpg|jpeg|gif|bmp|png,1,200,200')?>\')"><?php echo L('pic_upload')?></a> <a href="javascript:void(0)" onclick="$(\'#thumb_'+j+'\').val(\'\')"><?php echo L('delete_image')?></a><br /><?php echo L('desc')?>:<textarea id="desc_'+j+'" name="desc[]" rows="10" cols="80">'+d.desc+'</textarea><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" value="<?php echo L('submit')?>" class="button" onclick="form_submit('+j+')" /></div></td><td width="80"><a href="javascript:void(0);" class="arrowhead" onclick="moveUp(this);" title="<?php echo L('up')?>"></a><a href="javascript:void(0);" onclick="moveDown(this);" class="arrowhead-b" title="<?php echo L('down')?>"></a><a href="javascript:void(0)" onclick="edit_form('+j+')"><img src="<?php echo IMG_PATH?>icon/m_2.png" alt="<?php echo L('edit')?>" /></a><a href="javascript:void(0)" onclick="$(this).parent().parent().remove();" class="close" title="<?php echo L('delete')?>"></a></td></tr>'); form_submit(j); j++; } function block_view(id) { var old_action = $('#myform').attr('action'); $('#myform').attr('action', '?m=block&c=block_admin&a=public_view&id='+id); $('#myform').attr('target', 'view'); $('#myform').submit(); $('#myform').attr('action', old_action); $('#myform').attr('target', ''); } function showblock(id, html){ if (parent.right) { parent.right.$("#block_id_"+id).html(html); } else { parent.$("#block_id_"+id).html(html); } } function edit_form(id) { $('#content_'+id).hide(); $('#form_'+id).show(); } function search_content() { art.dialog({title:'<?php echo L('search_content')?>',id:'search_content',iframe:"?m=block&c=block_admin&a=public_search_content",width:'600',height:'400'}); } function form_submit(id) { var title = $('#title_'+id).val(); var url = $('#url_'+id).val(); var thumb = $('#thumb_'+id).val(); var desc = $('#desc_'+id).val(); if (title == '') { alert('<?php echo L('title').L('empty')?>'); $('#title_'+id).focus(); return false; } if (url == '') { alert('<?php echo L('link').L('empty')?>'); $('#url_'+id).focus(); return false; } var str = '<a href="http://'+url+'" target="blank"><b>'+title+'</b></a><br />'; str += '<div style="color:#ccc;">'+(thumb ? '<img src="'+thumb+'" class="thumb" />': '')+desc+'</div>'; $('#content_'+id).html(str).show(); $('#form_'+id).hide(); } function cleanWhitespace(element) { for (var i = 0; i < element.childNodes.length; i++) { var node = element.childNodes[i]; if (node.nodeType == 3 && !/S/.test(node.nodeValue)) node.parentNode.removeChild(node); } } var _table=document.getElementById("table_form"); cleanWhitespace(_table); function moveUp(_a){ var _row=_a.parentNode.parentNode; if(_row.previousSibling)swapNode(_row,_row.previousSibling); } function moveDown(_a){ var _row=_a.parentNode.parentNode; if(_row.nextSibling)swapNode(_row,_row.nextSibling); } function swapNode(node1,node2){ var _parent=node1.parentNode; var _t1=node1.nextSibling; var _t2=node2.nextSibling; if(_t1)_parent.insertBefore(node2,_t1); else _parent.appendChild(node2); if(_t2)_parent.insertBefore(node1,_t2); else _parent.appendChild(node1); } function insertText(text) { $('#template').focus(); var str = document.selection.createRange(); str.text = text; } function show_history() { $('#history').show(); location.href = '#history_div'; } // --></script> </body> </html>
108wo
phpcms/modules/block/templates/block_update.tpl.php
PHP
asf20
13,426
<?php defined('IN_ADMIN') or exit('No permission resources.'); include $this->admin_tpl('header', 'admin'); ?> <div class="pad_10"> <form action="?" method="get"> <input type="hidden" name="m" value="block"> <input type="hidden" name="c" value="block_admin"> <input type="hidden" name="a" value="public_search_content"> <table width="100%" class="table_form"> <tr> <td width="80"><?php echo L('category')?>:</td> <td><?php if(isset($_GET['dosubmit'])){?><div class="rt"><a href="javascript:void(0)" onclick="$('#search').toggle()"><?php echo L('folded_up_in_search_of')?></a></div><?php } echo form::select_category('category_content', $catid, 'name="catid" id="catid"', '', '', '0', 1)?> </td> </tr> <tbody id="search" <?php if(isset($_GET['dosubmit'])) echo 'style="display:none"';?>> <tr> <td><?php echo L('posterize_time')?>:</td> <td><?php echo form::date('start_time', $start_time ? date('Y-m-d', $start_time) : '')?> - <?php echo form::date('end_time', $end_time ? date('Y-m-d',$end_time) : '')?></td> </tr> <tr> <td><?php echo L('recommend')?>:</td> <td> <?php echo form::select(array(''=>L('all'), '1'=>L('recommend'), '2'=>L('not_recommend')), $posids, 'name="posids"')?> </td> </tr> <tr> <td><?php echo L('search_mode')?>:</td> <td> <?php echo form::select(array('1'=>L('title'), '2'=>L('desc'), '3'=>L('username'), '4'=>'ID'), $searchtype, 'name="searchtype"')?> </td> </tr> <tr> <td><?php echo L('key_word')?>:</td> <td> <input name="keyword" type="text" value="<?php echo $keyword?>" class="input-text" /> </td> </tr> <tr> <td></td> <td> <input name="dosubmit" type="submit" value="<?php echo L('submit')?>" class="button" /> </td> </tr> </tbody> </table> </form> <?php if (isset($_GET['dosubmit']) && !empty($data)) :?> <div class="table-list"> <div class="btn"><input type="checkbox" value="" id="check_box" onclick="selectall('ids[]');"> <input type="button" value="<?php echo L('insert_a_comment_about_the_selected_text')?>" class="button" onclick="insert_form()"></div> <table width="100%"> <tbody> <?php foreach ($data as $v):?> <tr> <td align="center" width="40"><input class="inputcheckbox " name="ids[]" value="{title:'<?php echo str_replace('\'', '\\\'', $v['title'])?>', thumb:'<?php echo $v['thumb']?>', desc:'<?php echo str_replace(array('\'', "\r","\n"), array('\\\'', "", ""), $v['description'])?>', url:'<?php echo $v['url']?>'}" type="checkbox"></td> <td><?php echo $v['title']?> <?php if ($v['thumb']) echo '<font color="red">['.L('pic').']</font>'?></td> </tr> <?php endforeach;?> </tbody> </table> <div class="btn"><label for="check_box"><?php echo L('select_all')?>/<?php echo L('cancel')?></label> <input type="button" value="<?php echo L('insert_a_comment_about_the_selected_text')?>" class="button" onclick="insert_form()"></div> <dir id="pages"><?php echo $pages?></dir> </div> <?php endif;?> </div> <script type="text/javascript"> <!-- function insert_form() { $("input[type='checkbox'][name='ids[]']:checked").each(function(i,n){parent.insert_forms($(n).val());}); parent.art.dialog({id:'search_content'}).close(); } //--> </script> </body> </html>
108wo
phpcms/modules/block/templates/search_content.tpl.php
PHP
asf20
3,263
<?php defined('IN_PHPCMS') or exit('No permission resources.'); class block_tag { private $db; public function __construct() { $this->db = pc_base::load_model('block_model'); } /** * PC标签中调用数据 * @param array $data 配置数据 */ public function pc_tag($data) { $siteid = isset($data['siteid']) && intval($data['siteid']) ? intval($data['siteid']) : get_siteid(); $r = $this->db->select(array('pos'=>$data['pos'], 'siteid'=>$siteid)); $str = ''; if (!empty($r) && is_array($r)) foreach ($r as $v) { if (defined('IN_ADMIN') && !defined('HTML')) $str .= '<div id="block_id_'.$v['id'].'" class="admin_block" blockid="'.$v['id'].'">'; if ($v['type'] == '2') { extract($v, EXTR_OVERWRITE); $data = string2array($data); if (!defined('HTML')) { ob_start(); include $this->template_url($id); $str .= ob_get_contents(); ob_clean(); } else { include $this->template_url($id); } } else { $str .= $v['data']; } if (defined('IN_ADMIN') && !defined('HTML')) $str .= '</div>'; } return $str; } /** * 生成模板返回路径 * @param integer $id 碎片ID号 * @param string $template 风格 */ public function template_url($id, $template = '') { $filepath = CACHE_PATH.'caches_template'.DIRECTORY_SEPARATOR.'block'.DIRECTORY_SEPARATOR.$id.'.php'; $dir = dirname($filepath); if ($template) { if(!is_dir($dir)) { mkdir($dir, 0777, true); } $tpl = pc_base::load_sys_class('template_cache'); $str = $tpl->template_parse(new_stripslashes($template)); @file_put_contents($filepath, $str); } else { if (!file_exists($filepath)) { if(!is_dir($dir)) { mkdir($dir, 0777, true); } $tpl = pc_base::load_sys_class('template_cache'); $str = $this->db->get_one(array('id'=>$id), 'template'); $str = $tpl->template_parse($str['template']); @file_put_contents($filepath, $str); } } return $filepath; } } ?>
108wo
phpcms/modules/block/classes/block_tag.class.php
PHP
asf20
2,053
<?php defined('IN_PHPCMS') or exit('Access Denied'); defined('UNINSTALL') or exit('Access Denied'); return array('link'); ?>
108wo
phpcms/modules/link/uninstall/model.php
PHP
asf20
129
<?php defined('IN_PHPCMS') or exit('Access Denied'); defined('UNINSTALL') or exit('Access Denied'); $type_db = pc_base::load_model('type_model'); $typeid = $type_db->delete(array('module'=>'link')); if(!$typeid) return FALSE; ?>
108wo
phpcms/modules/link/uninstall/extention.inc.php
PHP
asf20
237
<?php defined('IN_PHPCMS') or exit('No permission resources.'); pc_base::load_app_class('admin','admin',0); class link extends admin { function __construct() { parent::__construct(); $this->M = new_html_special_chars(getcache('link', 'commons')); $this->db = pc_base::load_model('link_model'); $this->db2 = pc_base::load_model('type_model'); } public function init() { if($_GET['typeid']!=''){ $where = array('typeid'=>$_GET['typeid'],'siteid'=>$this->get_siteid()); }else{ $where = array('siteid'=>$this->get_siteid()); } $page = isset($_GET['page']) && intval($_GET['page']) ? intval($_GET['page']) : 1; $infos = $this->db->listinfo($where,$order = 'listorder DESC,linkid DESC',$page, $pages = '9'); $pages = $this->db->pages; $types = $this->db2->listinfo(array('module'=>ROUTE_M,'siteid'=>$this->get_siteid()),$order = 'typeid DESC'); $types = new_html_special_chars($types); $type_arr = array (); foreach($types as $typeid=>$type){ $type_arr[$type['typeid']] = $type['name']; } $big_menu = array('javascript:window.top.art.dialog({id:\'add\',iframe:\'?m=link&c=link&a=add\', title:\''.L('link_add').'\', width:\'700\', height:\'450\'}, 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('link_add')); include $this->admin_tpl('link_list'); } /* *判断标题重复和验证 */ public function public_name() { $link_title = isset($_GET['link_name']) && trim($_GET['link_name']) ? (pc_base::load_config('system', 'charset') == 'gbk' ? iconv('utf-8', 'gbk', trim($_GET['link_name'])) : trim($_GET['link_name'])) : exit('0'); $linkid = isset($_GET['linkid']) && intval($_GET['linkid']) ? intval($_GET['linkid']) : ''; $data = array(); if ($linkid) { $data = $this->db->get_one(array('linkid'=>$linkid), 'name'); if (!empty($data) && $data['name'] == $link_title) { exit('1'); } } if ($this->db->get_one(array('name'=>$link_title), 'linkid')) { exit('0'); } else { exit('1'); } } //添加分类时,验证分类名是否已存在 public function public_check_name() { $type_name = isset($_GET['type_name']) && trim($_GET['type_name']) ? (pc_base::load_config('system', 'charset') == 'gbk' ? iconv('utf-8', 'gbk', trim($_GET['type_name'])) : trim($_GET['type_name'])) : exit('0'); $typeid = isset($_GET['typeid']) && intval($_GET['typeid']) ? intval($_GET['typeid']) : ''; $data = array(); if ($typeid) { $data = $this->db2->get_one(array('typeid'=>$typeid), 'name'); if (!empty($data) && $data['name'] == $type_name) { exit('1'); } } if ($this->db2->get_one(array('name'=>$type_name), 'typeid')) { exit('0'); } else { exit('1'); } } //添加友情链接 public function add() { if(isset($_POST['dosubmit'])) { $_POST['link']['addtime'] = SYS_TIME; $_POST['link']['siteid'] = $this->get_siteid(); if(empty($_POST['link']['name'])) { showmessage(L('sitename_noempty'),HTTP_REFERER); } $linkid = $this->db->insert($_POST['link'],true); if(!$linkid) return FALSE; $siteid = $this->get_siteid(); //更新附件状态 if(pc_base::load_config('system','attachment_stat') & $_POST['link']['logo']) { $this->attachment_db = pc_base::load_model('attachment_model'); $this->attachment_db->api_update($_POST['link']['logo'],'link-'.$linkid,1); } showmessage(L('operation_success'),HTTP_REFERER,'', 'add'); } else { $show_validator = $show_scroll = $show_header = true; pc_base::load_sys_class('form', '', 0); $siteid = $this->get_siteid(); $types = $this->db2->get_types($siteid); //print_r($types);exit; include $this->admin_tpl('link_add'); } } /** * 说明:异步更新排序 * @param $optionid */ public function listorder_up() { $result = $this->db->update(array('listorder'=>'+=1'),array('linkid'=>$_GET['linkid'])); if($result){ echo 1; } else { echo 0; } } //更新排序 public function listorder() { if(isset($_POST['dosubmit'])) { foreach($_POST['listorders'] as $linkid => $listorder) { $this->db->update(array('listorder'=>$listorder),array('linkid'=>$linkid)); } showmessage(L('operation_success'),HTTP_REFERER); } } //添加友情链接分类 public function add_type() { if(isset($_POST['dosubmit'])) { if(empty($_POST['type']['name'])) { showmessage(L('typename_noempty'),HTTP_REFERER); } $_POST['type']['siteid'] = $this->get_siteid(); $_POST['type']['module'] = ROUTE_M; $this->db2 = pc_base::load_model('type_model'); $typeid = $this->db2->insert($_POST['type'],true); if(!$typeid) return FALSE; showmessage(L('operation_success'),HTTP_REFERER); } else { $show_validator = $show_scroll = true; $big_menu = array('javascript:window.top.art.dialog({id:\'add\',iframe:\'?m=link&c=link&a=add\', title:\''.L('link_add').'\', width:\'700\', height:\'450\'}, 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('link_add')); include $this->admin_tpl('link_type_add'); } } /** * 删除分类 */ public function delete_type() { if((!isset($_GET['typeid']) || empty($_GET['typeid'])) && (!isset($_POST['typeid']) || empty($_POST['typeid']))) { showmessage(L('illegal_parameters'), HTTP_REFERER); } else { if(is_array($_POST['typeid'])){ foreach($_POST['typeid'] as $typeid_arr) { $this->db2->delete(array('typeid'=>$typeid_arr)); } showmessage(L('operation_success'),HTTP_REFERER); }else{ $typeid = intval($_GET['typeid']); if($typeid < 1) return false; $result = $this->db2->delete(array('typeid'=>$typeid)); if($result) { showmessage(L('operation_success'),HTTP_REFERER); }else { showmessage(L("operation_failure"),HTTP_REFERER); } } } } //:分类管理 public function list_type() { $this->db2 = pc_base::load_model('type_model'); $infos = $this->db2->listinfo(array('module'=> ROUTE_M,'siteid'=>$this->get_siteid()),$order = 'listorder DESC',$page, $pages = '10'); $big_menu = array('javascript:window.top.art.dialog({id:\'add\',iframe:\'?m=link&c=link&a=add\', title:\''.L('link_add').'\', width:\'700\', height:\'450\'}, 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('link_add')); include $this->admin_tpl('link_list_type'); } public function edit() { if(isset($_POST['dosubmit'])){ $linkid = intval($_GET['linkid']); if($linkid < 1) return false; if(!is_array($_POST['link']) || empty($_POST['link'])) return false; if((!$_POST['link']['name']) || empty($_POST['link']['name'])) return false; $this->db->update($_POST['link'],array('linkid'=>$linkid)); //更新附件状态 if(pc_base::load_config('system','attachment_stat') & $_POST['link']['logo']) { $this->attachment_db = pc_base::load_model('attachment_model'); $this->attachment_db->api_update($_POST['link']['logo'],'link-'.$linkid,1); } showmessage(L('operation_success'),'?m=link&c=link&a=edit','', 'edit'); }else{ $show_validator = $show_scroll = $show_header = true; pc_base::load_sys_class('form', '', 0); $types = $this->db2->listinfo(array('module'=> ROUTE_M,'siteid'=>$this->get_siteid()),$order = 'typeid DESC',$page, $pages = '10'); $type_arr = array (); foreach($types as $typeid=>$type){ $type_arr[$type['typeid']] = $type['name']; } //解出链接内容 $info = $this->db->get_one(array('linkid'=>$_GET['linkid'])); if(!$info) showmessage(L('link_exit')); extract($info); include $this->admin_tpl('link_edit'); } } /** * 修改友情链接 分类 */ public function edit_type() { if(isset($_POST['dosubmit'])){ $typeid = intval($_GET['typeid']); if($typeid < 1) return false; if(!is_array($_POST['type']) || empty($_POST['type'])) return false; if((!$_POST['type']['name']) || empty($_POST['type']['name'])) return false; $this->db2->update($_POST['type'],array('typeid'=>$typeid)); showmessage(L('operation_success'),'?m=link&c=link&a=list_type','', 'edit'); }else{ $show_validator = $show_scroll = $show_header = true; //解出分类内容 $info = $this->db2->get_one(array('typeid'=>$_GET['typeid'])); if(!$info) showmessage(L('linktype_exit')); extract($info); include $this->admin_tpl('link_type_edit'); } } /** * 删除友情链接 * @param intval $sid 友情链接ID,递归删除 */ public function delete() { if((!isset($_GET['linkid']) || empty($_GET['linkid'])) && (!isset($_POST['linkid']) || empty($_POST['linkid']))) { showmessage(L('illegal_parameters'), HTTP_REFERER); } else { if(is_array($_POST['linkid'])){ foreach($_POST['linkid'] as $linkid_arr) { //批量删除友情链接 $this->db->delete(array('linkid'=>$linkid_arr)); //更新附件状态 if(pc_base::load_config('system','attachment_stat')) { $this->attachment_db = pc_base::load_model('attachment_model'); $this->attachment_db->api_delete('link-'.$linkid_arr); } } showmessage(L('operation_success'),'?m=link&c=link'); }else{ $linkid = intval($_GET['linkid']); if($linkid < 1) return false; //删除友情链接 $result = $this->db->delete(array('linkid'=>$linkid)); //更新附件状态 if(pc_base::load_config('system','attachment_stat')) { $this->attachment_db = pc_base::load_model('attachment_model'); $this->attachment_db->api_delete('link-'.$linkid); } if($result){ showmessage(L('operation_success'),'?m=link&c=link'); }else { showmessage(L("operation_failure"),'?m=link&c=link'); } } showmessage(L('operation_success'), HTTP_REFERER); } } /** * 投票模块配置 */ public function setting() { //读取配置文件 $data = array(); $siteid = $this->get_siteid();//当前站点 //更新模型数据库,重设setting 数据. $m_db = pc_base::load_model('module_model'); $data = $m_db->select(array('module'=>'link')); $setting = string2array($data[0]['setting']); $now_seting = $setting[$siteid]; //当前站点配置 if(isset($_POST['dosubmit'])) { //多站点存储配置文件 $setting[$siteid] = $_POST['setting']; setcache('link', $setting, 'commons'); //更新模型数据库,重设setting 数据. $m_db = pc_base::load_model('module_model'); //调用模块数据模型 $set = array2string($setting); $m_db->update(array('setting'=>$set), array('module'=>ROUTE_M)); showmessage(L('setting_updates_successful'), '?m=link&c=link&a=init'); } else { @extract($now_seting); $big_menu = array('javascript:window.top.art.dialog({id:\'add\',iframe:\'?m=link&c=link&a=add\', title:\''.L('link_add').'\', width:\'700\', height:\'450\'}, 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('link_add')); include $this->admin_tpl('setting'); } } //批量审核申请 ... public function check_register(){ if(isset($_POST['dosubmit'])) { if((!isset($_GET['linkid']) || empty($_GET['linkid'])) && (!isset($_POST['linkid']) || empty($_POST['linkid']))) { showmessage(L('illegal_parameters'), HTTP_REFERER); } else { if(is_array($_POST['linkid'])){//批量审核 foreach($_POST['linkid'] as $linkid_arr) { $this->db->update(array('passed'=>1),array('linkid'=>$linkid_arr)); } showmessage(L('operation_success'),'?m=link&c=link'); }else{//单个审核 $linkid = intval($_GET['linkid']); if($linkid < 1) return false; $result = $this->db->update(array('passed'=>1),array('linkid'=>$linkid)); if($result){ showmessage(L('operation_success'),'?m=link&c=link'); }else { showmessage(L("operation_failure"),'?m=link&c=link'); } } } }else {//读取未审核列表 $where = array('siteid'=>$this->get_siteid(),'passed'=>0); $page = isset($_GET['page']) && intval($_GET['page']) ? intval($_GET['page']) : 1; $infos = $this->db->listinfo($where,'linkid DESC',$page, $pages = '9'); $pages = $this->db->pages; $big_menu = array('javascript:window.top.art.dialog({id:\'add\',iframe:\'?m=link&c=link&a=add\', title:\''.L('link_add').'\', width:\'700\', height:\'450\'}, 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('link_add')); include $this->admin_tpl('check_register_list'); } } //单个审核申请 public function check(){ if((!isset($_GET['linkid']) || empty($_GET['linkid'])) && (!isset($_POST['linkid']) || empty($_POST['linkid']))) { showmessage(L('illegal_parameters'), HTTP_REFERER); } else { $linkid = intval($_GET['linkid']); if($linkid < 1) return false; //删除友情链接 $result = $this->db->update(array('passed'=>1),array('linkid'=>$linkid)); if($result){ showmessage(L('operation_success'),'?m=link&c=link'); }else { showmessage(L("operation_failure"),'?m=link&c=link'); } } } /** * 说明:对字符串进行处理 * @param $string 待处理的字符串 * @param $isjs 是否生成JS代码 */ function format_js($string, $isjs = 1){ $string = addslashes(str_replace(array("\r", "\n"), array('', ''), $string)); return $isjs ? 'document.write("'.$string.'");' : $string; } } ?>
108wo
phpcms/modules/link/link.php
PHP
asf20
14,348
<?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();})}}); $("#link_name").formValidator({onshow:"<?php echo L("input").L('link_name')?>",onfocus:"<?php echo L("input").L('link_name')?>"}).inputValidator({min:1,onerror:"<?php echo L("input").L('link_name')?>"}); $("#link_url").formValidator({onshow:"<?php echo L("input").L('url')?>",onfocus:"<?php echo L("input").L('url')?>"}).inputValidator({min:1,onerror:"<?php echo L("input").L('url')?>"}).regexValidator({regexp:"^http:\/\/[A-Za-z0-9]+\.[A-Za-z0-9]+[\/=\?%\-&]*([^<>])*$",onerror:"<?php echo L('link_onerror')?>"}) }) //--> </script> <div class="pad_10"> <form action="?m=link&c=link&a=add" method="post" name="myform" id="myform"> <table cellpadding="2" cellspacing="1" class="table_form" width="100%"> <tr> <th width="20%"><?php echo L('typeid')?>:</th> <td><select name="link[typeid]" id=""> <option value="0">默认分类</option> <?php $i=0; foreach($types as $typeid=>$type){ $i++; ?> <option value="<?php echo $type['typeid'];?>"><?php echo $type['name'];?></option> <?php }?> </select></td> </tr> <tr> <th width="100"><?php echo L('link_type')?>:</th> <td> <input name="link[linktype]" type="radio" value="1" checked="checked" style="border:0" onclick="$('#logolink').show()" class="radio_style"> <?php echo L('logo_link')?>&nbsp;&nbsp;&nbsp;&nbsp; <input type="radio" name="link[linktype]" value="0" style="border:0" onclick="$('#logolink').hide()" class="radio_style"> <?php echo L('word_link')?> </td> </tr> <tr> <th width="100"><?php echo L('link_name')?>:</th> <td><input type="text" name="link[name]" id="link_name" size="30" class="input-text"></td> </tr> <tr> <th width="100"><?php echo L('url')?>:</th> <td><input type="text" name="link[url]" id="link_url" size="30" class="input-text"></td> </tr> <tr id="logolink"> <th width="100"><?php echo L('logo')?>:</th> <td><?php echo form::images('link[logo]', 'logo', '', 'link')?></td> </tr> <tr> <th width="100"><?php echo L('username')?>:</th> <td><input type="text" name="link[username]" id="link_username" size="30" class="input-text"></td> </tr> <tr> <th><?php echo L('web_description')?>:</th> <td><textarea name="link[introduce]" id="introduce" cols="50" rows="6"></textarea></td> </tr> <tr> <th><?php echo L('elite')?>:</th> <td><input name="link[elite]" type="radio" value="1" >&nbsp;<?php echo L('yes')?>&nbsp;&nbsp;<input name="link[elite]" type="radio" value="0" checked>&nbsp;<?php echo L('no')?></td> </tr> <tr> <th><?php echo L('passed')?>:</th> <td><input name="link[passed]" type="radio" value="1" checked>&nbsp;<?php echo L('yes')?>&nbsp;&nbsp;<input name="link[passed]" type="radio" value="0">&nbsp;<?php echo L('no')?></td> </tr> <tr> <th></th> <td><input type="hidden" name="forward" value="?m=vote&c=vote&a=add"> <input type="submit" name="dosubmit" id="dosubmit" class="dialog" value=" <?php echo L('submit')?> "></td> </tr> </table> </form> </div> </body> </html>
108wo
phpcms/modules/link/templates/link_add.tpl.php
PHP
asf20
3,471
<?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" action="?m=link&c=link&a=delete_type" 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('typeid[]');"></th> <th width="80"><?php echo L('link_type_listorder')?></th> <th><?php echo L('type_name')?></th> <th width="12%" align="center"><?php echo L('type_id')?></th> <th width="20%" align="center"><?php echo L('operations_manage')?></th> </tr> </thead> <tbody> <tr> <td align="center" width="35"><input type="checkbox" name="typeid[]" value="<?php echo $info['typeid']?>" disabled></td> <td align="center"><input name='listorders[<?php echo $info['typeid']?>]' type='text' size='3' value='<?php echo $info['listorder']?>' class="input_center"></td> <td>默认分类</td> <td align="center" width="12%"> 0</td> <td align="center" width="20%" style="color: #999"> 修改 | 删除</td> </tr> <?php if(is_array($infos)){ foreach($infos as $info){ ?> <tr> <td align="center" width="35"><input type="checkbox" name="typeid[]" value="<?php echo $info['typeid']?>"></td> <td align="center"><input name='listorders[<?php echo $info['typeid']?>]' type='text' size='3' value='<?php echo $info['listorder']?>' class="input_center"></td> <td><?php echo $info['name']?></td> <td align="center" width="12%"> <?php echo $info['typeid'];?></td> <td align="center" width="20%"><a href="###" onclick="edit(<?php echo $info['typeid']?>, '<?php echo new_addslashes($info['name'])?>')" title="<?php echo L('edit')?>"><?php echo L('edit')?></a> | <a href='?m=link&c=link&a=delete_type&typeid=<?php echo $info['typeid']?>' onClick="return confirm('<?php echo L('confirm', array('message' => new_addslashes($info['name'])))?>')"><?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 name="submit" type="submit" class="button" value="<?php echo L('remove_all_selected')?>" onClick="return confirm('<?php echo L('confirm', array('message' => L('selected')))?>')">&nbsp;&nbsp;</div> <div id="pages"><?php echo $this->pages?></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('edit')?> '+name+' ',id:'edit',iframe:'?m=link&c=link&a=edit_type&typeid='+id,width:'450',height:'280'}, 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='typeid[]']:checked").each(function(i, n){ ids += $(n).val() + ','; }); if(ids=='') { window.top.art.dialog({content:"<?php echo L('before_select_operations')?>",lock:true,width:'200',height:'50',time:1.5},function(){}); return false; } else { myform.submit(); } } </script>
108wo
phpcms/modules/link/templates/link_list_type.tpl.php
PHP
asf20
3,500
<?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=link&c=link&a=check_register" 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('linkid[]');"></th> <th><?php echo L('link_name')?></th> <th width="20%" align="center"><?php echo L('url')?></th> <th width="12%" align="center"><?php echo L('logo')?></th> <th width="20%" align="center"><?php echo L('operations_manage')?></th> </tr> </thead> <tbody> <?php if(is_array($infos)){ foreach($infos as $info){ ?> <tr> <td align="center" width="35"><input type="checkbox" name="linkid[]" value="<?php echo $info['linkid']?>"></td> <td><a href="<?php echo $info['url'];?>" title="<?php echo L('go_website')?>" target="_blank"><?php echo $info['name']?></a></td> <th width="20%" align="center"><a href="<?php echo $info['url']?>" target="_blank"><?php echo $info['url']?></a></th> <td align="center" width="12%"><?php if($info['linktype']==1){?><img src="<?php echo $info['logo'];?>" width=83 height=31><?php }?></td> <td align="center" width="20%"><a href="###" onclick="edit(<?php echo $info['linkid']?>, '<?php echo new_addslashes($info['name'])?>')" title="<?php echo L('edit')?>"><?php echo L('edit')?></a> | <a href='?m=link&c=link&a=delete&linkid=<?php echo $info['linkid']?>' onClick="return confirm('<?php echo L('confirm', array('message' => new_addslashes($info['name'])))?>')"><?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 name="dosubmit" type="submit" class="button" value="<?php echo L('pass_check')?>" onClick="return confirm('<?php echo L('pass_or_not')?>')">&nbsp;&nbsp;<input type="submit" class="button" name="dosubmit" onclick="document.myform.action='?m=link&c=link&a=delete'" value="<?php echo L('delete')?>"/> </div> <div id="pages"><?php echo $this->pages?></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('edit')?> '+name+' ',id:'edit',iframe:'?m=link&c=link&a=edit&linkid='+id,width:'700',height:'450'}, 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='linkid[]']:checked").each(function(i, n){ ids += $(n).val() + ','; }); if(ids=='') { window.top.art.dialog({content:"<?php echo L('before_select_operations')?>",lock:true,width:'200',height:'50',time:1.5},function(){}); return false; } else { myform.submit(); } } </script>
108wo
phpcms/modules/link/templates/check_register_list.tpl.php
PHP
asf20
3,285
<?php defined('IN_ADMIN') or exit('No permission resources.'); $show_dialog = 1; include $this->admin_tpl('header', 'admin'); ?> <div class="pad-lr-10"> <table width="100%" cellspacing="0" class="search-form"> <tbody> <tr> <td><div class="explain-col"> <?php echo L('all_linktype')?>: &nbsp;&nbsp; <a href="?m=link&c=link"><?php echo L('all')?></a> &nbsp;&nbsp; <a href="?m=link&c=link&typeid=0">默认分类</a>&nbsp; <?php if(is_array($type_arr)){ foreach($type_arr as $typeid => $type){ ?><a href="?m=link&c=link&typeid=<?php echo $typeid;?>"><?php echo $type;?></a>&nbsp; <?php }}?> </div> </td> </tr> </tbody> </table> <form name="myform" id="myform" action="?m=link&c=link&a=listorder" method="post" > <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('linkid[]');"></th> <th width="35" align="center"><?php echo L('listorder')?></th> <th><?php echo L('link_name')?></th> <th width="12%" align="center"><?php echo L('logo')?></th> <th width="10%" align="center"><?php echo L('typeid')?></th> <th width='10%' align="center"><?php echo L('link_type')?></th> <th width="8%" align="center"><?php echo L('status')?></th> <th width="12%" align="center"><?php echo L('operations_manage')?></th> </tr> </thead> <tbody> <?php if(is_array($infos)){ foreach($infos as $info){ ?> <tr> <td align="center" width="35"><input type="checkbox" name="linkid[]" value="<?php echo $info['linkid']?>"></td> <td align="center" width="35"><input name='listorders[<?php echo $info['linkid']?>]' type='text' size='3' value='<?php echo $info['listorder']?>' class="input-text-c"></td> <td><a href="<?php echo $info['url'];?>" title="<?php echo L('go_website')?>" target="_blank"><?php echo $info['name']?></a> </td> <td align="center" width="12%"><?php if($info['linktype']==1){?><img src="<?php echo $info['logo'];?>" width=83 height=31><?php }?></td> <td align="center" width="10%"><?php echo $type_arr[$info['typeid']];?></td> <td align="center" width="10%"><?php if($info['linktype']==0){echo L('word_link');}else{echo L('logo_link');}?></td> <td width="8%" align="center"><?php if($info['passed']=='0'){?><a href='?m=link&c=link&a=check&linkid=<?php echo $info['linkid']?>' onClick="return confirm('<?php echo L('pass_or_not')?>')"><font color=red><?php echo L('audit')?></font></a><?php }else{echo L('passed');}?></td> <td align="center" width="12%"><a href="###" onclick="edit(<?php echo $info['linkid']?>, '<?php echo new_addslashes($info['name'])?>')" title="<?php echo L('edit')?>"><?php echo L('edit')?></a> | <a href='?m=link&c=link&a=delete&linkid=<?php echo $info['linkid']?>' onClick="return confirm('<?php echo L('confirm', array('message' => new_addslashes($info['name'])))?>')"><?php echo L('delete')?></a> </td> </tr> <?php } } ?> </tbody> </table> </div> <div class="btn"> <input name="dosubmit" type="submit" class="button" value="<?php echo L('listorder')?>">&nbsp;&nbsp;<input type="submit" class="button" name="dosubmit" onClick="document.myform.action='?m=link&c=link&a=delete'" value="<?php echo L('delete')?>"/></div> <div id="pages"><?php echo $pages?></div> </form> </div> <script type="text/javascript"> function edit(id, name) { window.top.art.dialog({id:'edit'}).close(); window.top.art.dialog({title:'<?php echo L('edit')?> '+name+' ',id:'edit',iframe:'?m=link&c=link&a=edit&linkid='+id,width:'700',height:'450'}, 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='linkid[]']:checked").each(function(i, n){ ids += $(n).val() + ','; }); if(ids=='') { window.top.art.dialog({content:"<?php echo L('before_select_operations')?>",lock:true,width:'200',height:'50',time:1.5},function(){}); return false; } else { myform.submit(); } } //向下移动 function listorder_up(id) { $.get('?m=link&c=link&a=listorder_up&linkid='+id,null,function (msg) { if (msg==1) { //$("div [id=\'option"+id+"\']").remove(); alert('<?php echo L('move_success')?>'); } else { alert(msg); } }); } </script> </body> </html>
108wo
phpcms/modules/link/templates/link_list.tpl.php
PHP
asf20
4,475
<?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();})}}); $("#type_name").formValidator({onshow:"<?php echo L("input").L('type_name')?>",onfocus:"<?php echo L("input").L('type_name')?>"}).inputValidator({min:1,onerror:"<?php echo L("input").L('type_name')?>"}).ajaxValidator({type : "get",url : "",data :"m=link&c=link&a=public_check_name&typeid=<?php echo $typeid;?>",datatype : "html",async:'false',success : function(data){ if( data == "1" ){return true;}else{return false;}},buttons: $("#dosubmit"),onerror : "<?php echo L('type_name').L('exists')?>",onwait : "<?php echo L('connecting')?>"}).defaultPassed(); }) //--> </script> <div class="pad-lr-10"> <form action="?m=link&c=link&a=edit_type&typeid=<?php echo $typeid; ?>" method="post" name="myform" id="myform"> <table cellpadding="2" cellspacing="1" class="table_form" width="100%"> <tr> <th width="60"><?php echo L('type_name')?>:</th> <td><input type="text" name="type[name]" id="type_name" size="30" class="input-text" value="<?php echo $name;?>"></td> </tr> <tr> <th width="100"><?php echo L('link_type_listorder')?>:</th> <td><input type="text" name="type[listorder]" id="listorder" size="5" class="input-text" value="<?php echo $listorder;?>"></td> </tr> <tr> <th><?php echo L('type_description')?>:</th> <td><textarea name="type[description]" id="description" cols="50" rows="6"><?php echo $description;?></textarea></td> </tr> <input type="submit" name="dosubmit" id="dosubmit" class="dialog" value=" <?php echo L('submit')?> "> </table> </form> </div> </body> </html>
108wo
phpcms/modules/link/templates/link_type_edit.tpl.php
PHP
asf20
1,939
<?php 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();})}}); $("#link_name").formValidator({onshow:"<?php echo L("input").L('link_name')?>",onfocus:"<?php echo L("input").L('link_name')?>"}).inputValidator({min:1,onerror:"<?php echo L("input").L('link_name')?>"}).ajaxValidator({type : "get",url : "",data :"m=link&c=link&a=public_name&linkid=<?php echo $linkid;?>",datatype : "html",async:'false',success : function(data){ if( data == "1" ){return true;}else{return false;}},buttons: $("#dosubmit"),onerror : "<?php echo L('link_name').L('exists')?>",onwait : "<?php echo L('connecting')?>"}).defaultPassed(); $("#link_url").formValidator({onshow:"<?php echo L("input").L('url')?>",onfocus:"<?php echo L("input").L('url')?>"}).inputValidator({min:1,onerror:"<?php echo L("input").L('url')?>"}).regexValidator({regexp:"^http:\/\/[A-Za-z0-9]+\.[A-Za-z0-9]+[\/=\?%\-&]*([^<>])*$",onerror:"<?php echo L('link_onerror')?>"}) }) //--> </script> <div class="pad_10"> <form action="?m=link&c=link&a=edit&linkid=<?php echo $linkid; ?>" method="post" name="myform" id="myform"> <table cellpadding="2" cellspacing="1" class="table_form" width="100%"> <tr> <th width="20%"><?php echo L('typeid')?>:</th> <td><select name="link[typeid]" id=""> <option value="0" <?php if($typeid=='0'){echo "selected";}?>>默认分类</option> <?php $i=0; foreach($types as $type_key=>$type){ $i++; ?> <option value="<?php echo $type['typeid'];?>" <?php if($type['typeid']==$typeid){echo "selected";}?>><?php echo $type['name'];?></option> <?php }?> </select></td> </tr> <tr> <th width="100"><?php echo L('link_type')?>:</th> <td> <?php if($linktype == 1){ ?> <input name="link[linktype]" type="radio" value="1" checked="checked" style="border:0" onclick="$('#logolink').show()" class="radio_style"> <?php echo L('logo_link')?>&nbsp;&nbsp;&nbsp;&nbsp; <input type="radio" name="link[linktype]" value="0" style="border:0" onclick="$('#logolink').hide()" class="radio_style"> <?php echo L('word_link')?> <?php }else{?> <input name="link[linktype]" type="radio" value="1" style="border:0" onclick="$('#logolink').show()" class="radio_style"> <?php echo L('logo_link')?>&nbsp;&nbsp;&nbsp;&nbsp; <input type="radio" name="link[linktype]" value="0" checked="checked" style="border:0" onclick="$('#logolink').hide()" class="radio_style"> <?php echo L('word_link')?> <?php } ?> </td> </tr> <tr> <th width="100"><?php echo L('link_name')?>:</th> <td><input type="text" name="link[name]" id="link_name" size="30" class="input-text" value="<?php echo $name;?>"></td> </tr> <tr> <th width="100"><?php echo L('url')?>:</th> <td><input type="text" name="link[url]" id="link_url" size="30" class="input-text" value="<?php echo $url;?>"></td> </tr> <?php if($linktype==1){?> <tr id="logolink"> <th width="100"><?php echo L('logo')?>:</th> <td><?php echo form::images('link[logo]', 'logo', $info['logo'], 'link')?></td> </tr> <?php }else{?> <tr id="logolink" style="display: none;"> <th width="100"><?php echo L('logo')?>:</th> <td><?php echo form::images('link[logo]', 'logo', $info['logo'], 'link')?></td> </tr> <?php }?> <tr> <th width="100"><?php echo L('username')?>:</th> <td><input type="text" name="link[username]" id="link_username" size="30" class="input-text" value="<?php echo $username;?>"></td> </tr> <tr> <th><?php echo L('web_description')?>:</th> <td><textarea name="link[introduce]" id="introduce" cols="50" rows="6"><?php echo $introduce;?></textarea></td> </tr> <tr> <th><?php echo L('elite')?>:</th> <td><input name="link[elite]" type="radio" value="1" <?php if($elite==1){echo "checked";}?>>&nbsp;<?php echo L('yes')?>&nbsp;&nbsp;<input name="link[elite]" type="radio" value="0" <?php if($elite==0){echo "checked";}?>>&nbsp;<?php echo L('no')?></td> </tr> <tr> <th><?php echo L('passed')?>:</th> <td><input name="link[passed]" type="radio" value="1" <?php if($passed==1){echo "checked";}?>>&nbsp;<?php echo L('yes')?>&nbsp;&nbsp;<input name="link[passed]" type="radio" value="0" <?php if($passed==0){echo "checked";}?>>&nbsp;<?php echo L('no')?></td> </tr> <tr> <th></th> <td><input type="hidden" name="forward" value="?m=link&c=link&a=edit"> <input type="submit" name="dosubmit" id="dosubmit" class="dialog" value=" <?php echo L('submit')?> "></td> </tr> </table> </form> </div> </body> </html>
108wo
phpcms/modules/link/templates/link_edit.tpl.php
PHP
asf20
4,828
<?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();})}}); $("#type_name").formValidator({onshow:"<?php echo L("input").L('type_name')?>",onfocus:"<?php echo L("input").L('type_name')?>"}).inputValidator({min:1,onerror:"<?php echo L("input").L('type_name')?>"}).ajaxValidator({type : "get",url : "",data :"m=link&c=link&a=public_check_name",datatype : "html",async:'false',success : function(data){ if( data == "1" ){return true;}else{return false;}},buttons: $("#dosubmit"),onerror : "<?php echo L('type_name').L('exists')?>",onwait : "<?php echo L('connecting')?>"}); }) //--> </script> <div class="pad-lr-10"> <form action="?m=link&c=link&a=add_type" method="post" name="myform" id="myform"> <table cellpadding="2" cellspacing="1" class="table_form" width="100%"> <tr> <th width="100"><?php echo L('type_name')?>:</th> <td><input type="text" name="type[name]" id="type_name" size="30" class="input-text"></td> </tr> <tr> <th width="100"><?php echo L('link_type_listorder')?>:</th> <td><input type="text" name="type[listorder]" id="listorder" size="5" class="input-text" value="0"></td> </tr> <tr> <th><?php echo L('type_description')?>:</th> <td><textarea name="type[description]" id="description" cols="50" rows="6"></textarea></td> </tr> <tr> <th></th> <td><input type="hidden" name="forward" value="?m=link&c=link&a=add_type"> <input type="submit" name="dosubmit" id="dosubmit" class="button" value=" <?php echo L('submit')?> "></td> </tr> </table> </form> </div> </body> </html>
108wo
phpcms/modules/link/templates/link_type_add.tpl.php
PHP
asf20
1,892
<?php defined('IN_ADMIN') or exit('No permission resources.'); include $this->admin_tpl('header', 'admin'); ?> <form method="post" action="?m=link&c=link&a=setting"> <table width="100%" cellpadding="0" cellspacing="1" class="table_form"> <tr> <th width="20%"><?php echo L('application_or_not')?>:</th> <td><input type='radio' name='setting[is_post]' value='1' <?php if($is_post == 1) {?>checked<?php }?>> <?php echo L('yes')?>&nbsp;&nbsp;&nbsp;&nbsp; <input type='radio' name='setting[is_post]' value='0' <?php if($is_post == 0) {?>checked<?php }?>> <?php echo L('no')?></td> </tr> <tr> <th><?php echo L('code_or_not')?>:</th> <td><input type='radio' name='setting[enablecheckcode]' value='1' <?php if($enablecheckcode == 1) {?>checked<?php }?>> <?php echo L('yes')?>&nbsp;&nbsp;&nbsp;&nbsp; <input type='radio' name='setting[enablecheckcode]' value='0' <?php if($enablecheckcode == 0) {?>checked<?php }?>> <?php echo L('no')?></td> </tr> <tr> <td>&nbsp;</td> <td><input type="submit" name="dosubmit" id="dosubmit" value=" <?php echo L('ok')?> " class="button">&nbsp;</td> </tr> </table> </form> </body> </html>
108wo
phpcms/modules/link/templates/setting.tpl.php
PHP
asf20
1,174
<?php defined('IN_PHPCMS') or exit('No permission resources.'); class index { function __construct() { pc_base::load_app_func('global'); $siteid = isset($_GET['siteid']) ? intval($_GET['siteid']) : get_siteid(); define("SITEID",$siteid); } public function init() { $siteid = SITEID; $setting = getcache('link', 'commons'); $SEO = seo(SITEID, '', L('link'), '', ''); include template('link', 'index'); } /** * 友情链接列表页 */ public function list_type() { $siteid = SITEID; $type_id = trim(urldecode($_GET['type_id'])); $type_id = intval($type_id); if($type_id==""){ $type_id ='0'; } $setting = getcache('link', 'commons'); $SEO = seo(SITEID, '', L('link'), '', ''); include template('link', 'list_type'); } /** * 申请友情链接 */ public function register() { $siteid = SITEID; if(isset($_POST['dosubmit'])){ if($_POST['name']==""){ showmessage(L('sitename_noempty'),"?m=link&c=index&a=register&siteid=$siteid"); } if($_POST['url']==""){ showmessage(L('siteurl_not_empty'),"?m=link&c=index&a=register&siteid=$siteid"); } if(!in_array($_POST['linktype'],array('0','1'))){ $_POST['linktype'] = '0'; } $link_db = pc_base::load_model(link_model); $_POST['logo'] =new_html_special_chars($_POST['logo']); if($_POST['linktype']=='0'){ $sql = array('siteid'=>$siteid,'typeid'=>$_POST['typeid'],'linktype'=>$_POST['linktype'],'name'=>$_POST['name'],'url'=>$_POST['url']); }else{ $sql = array('siteid'=>$siteid,'typeid'=>$_POST['typeid'],'linktype'=>$_POST['linktype'],'name'=>$_POST['name'],'url'=>$_POST['url'],'logo'=>$_POST['logo']); } $link_db->insert($sql); showmessage(L('add_success'), "?m=link&c=index&siteid=$siteid"); } else { $setting = getcache('link', 'commons'); $setting = $setting[$siteid]; if($setting['is_post']=='0'){ showmessage(L('suspend_application'), HTTP_REFERER); } $this->type = pc_base::load_model('type_model'); $types = $this->type->get_types($siteid);//获取站点下所有友情链接分类 pc_base::load_sys_class('form', '', 0); $SEO = seo(SITEID, '', L('application_links'), '', ''); include template('link', 'register'); } } } ?>
108wo
phpcms/modules/link/index.php
PHP
asf20
2,359
<?php defined('IN_PHPCMS') or exit('No permission resources.'); class link_tag { private $link_db,$type_db; public function __construct() { $this->link_db = pc_base::load_model('link_model'); $this->type_db = pc_base::load_model('type_model'); } /** * 取出该分类的详细 信息 * @param $typeid 分类ID */ public function get_type($data){ $typeid = intval($data['typeid']); if($typeid=='0'){ $arr = array(); $arr['name'] = '默认分类'; return $arr; }else { $r = $this->type_db->get_one(array('typeid'=>$typeid)); return new_html_special_chars($r); } } /** * 友情链接 * @param $data */ public function lists($data) { $typeid = intval($data['typeid']);//分类ID $linktype = $data['linktype']? $data['linktype'] : 0; $siteid = $data['siteid']; if (empty($siteid)){ $siteid = get_siteid(); } if($typeid!='' || $typeid=='0'){ $sql = array('typeid'=>$typeid,'linktype'=>$linktype,'siteid'=>$siteid,'passed'=>'1'); }else { $sql = array('linktype'=>$linktype,'siteid'=>$siteid,'passed'=>'1'); } $r = $this->link_db->select($sql, '*', $data['limit'], 'listorder '.$data['order']); return new_html_special_chars($r); } /** * 返回该分类下的友情链接 ... * @param $data 传入数组参数 */ public function type_list($data) { $siteid = $data['siteid']; $linktype = $data['linktype']? $data['linktype'] : 0; $typeid = $data['typeid']; if (empty($siteid)){ $siteid = get_siteid(); } if($typeid){ if(is_int($typeid)) return false; $sql = array('typeid'=>$typeid,'linktype'=>$linktype,'siteid'=>$siteid,'passed'=>'1'); }else { $sql = array('linktype'=>$linktype,'siteid'=>$siteid,'passed'=>'1'); } $r = $this->link_db->select($sql, '*', $data['limit'], $data['order']); return new_html_special_chars($r); } /** * 首页 友情链接分类 循环 . * @param $data */ public function type_lists($data) { if (!in_array($data['listorder'], array('desc', 'asc'))) { $data ['listorder'] = 'desc'; } $sql = array('module'=>ROUTE_M,'siteid'=>$data['siteid']); $r = $this->type_db->select($sql, '*', $data['limit'], 'listorder '.$data['listorder']); return new_html_special_chars($r); } /** * * 传入的站点ID,读取站点下的友情链接分类 ... * @param $siteid 选择的站点ID */ public function get_typelist($siteid='1', $value = '', $id = '') { $data = $arr = array(); $data = $this->type_db->select(array('module'=>'link', 'siteid'=>$siteid)); 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 count(){ } /** * pc 标签调用 */ public function pc_tag() { $sites = pc_base::load_app_class('sites','admin'); $sitelist = $sites->pc_tag_list(); return array( 'action'=>array('type_list'=>L('link_list', '', 'link')), 'type_list'=>array( 'siteid'=>array('name'=>L('site_id','','comment'),'htmltype'=>'input_select', 'data'=>$sitelist, 'ajax'=>array('name'=>L('for_type','','special'), 'action'=>'get_typelist', 'id'=>'typeid')), 'linktype'=>array('name'=>L('link_type','','link'), 'htmltype'=>'select', 'data'=>array('0'=>L('word_link','','link'), '1'=>L('logo_link','','link'))), 'order'=>array('name'=>L('sort', '', 'comment'), 'htmltype'=>'select','data'=>array('listorder DESC'=>L('listorder_desc', '', 'content'),'listorder ASC'=>L('listorder_asc', '', 'content'))), ), ); } }
108wo
phpcms/modules/link/classes/link_tag.class.php
PHP
asf20
3,862
<?php defined('IN_PHPCMS') or exit('Access Denied'); defined('INSTALL') or exit('Access Denied'); return array('link'); ?>
108wo
phpcms/modules/link/install/model.php
PHP
asf20
128
{template "content","header"} <script type="text/javascript" src="{JS_PATH}formvalidator.js" charset="UTF-8"></script> <script type="text/javascript" src="{JS_PATH}formvalidatorregex.js" charset="UTF-8"></script> <link href="{CSS_PATH}link.css" rel="stylesheet" type="text/css" /> <link href="{CSS_PATH}table_form.css" rel="stylesheet" type="text/css" /> <!--main--> <div class="main"> <!--left_bar--> <div class="col-left"> <div class="crumbs"><a href="{siteurl($siteid)}">网站首页</a><span> &gt; </span><a href="{APP_PATH}index.php?m={ROUTE_M}&siteid={$siteid}">友情链接</a><span> &gt; </span>{$type_arr[name]}</div> <div> <form action="{APP_PATH}index.php?m=link&c=index&a=register&siteid={$siteid}" method="post" name="myform" id="myform"> <table cellspacing="1" cellpadding="0" class="table_form"> <caption>申请友情链接</caption> <tbody><tr> <th width='60'>链接类型</th> <td width="300"><input type="radio" onclick="$('#logolink').hide()" checked="checked" value="0" name="linktype" class="radio_style"> 文字链接 <input type="radio" onclick="$('#logolink').show()" value="1" name="linktype" class="radio_style"> Logo链接 </td> </tr> <tr> <th>所属分类</th> <td> <select style="width: 36%;" id="typeid" name="typeid"> <option value="0">默认分类</option> {loop $types $type_arr} <option value="{$type_arr['typeid']}">{$type_arr['name']}</option> {/loop} </select> </td> </tr> <tr> <th>网站名称</th> <td><input type="text" value="" id="name" name="name" class="input-text"></td> </tr> <tr> <th>网站地址</th> <td><input type="text" size="40" value="" name="url" id="url" class="input-text"></td> </tr> <tr style="display: none;" id="logolink"> <th>Logo地址</th> <td><input type="text" size="40" value="" name="logo" id="logo" class="input-text"></td> </tr> {if $setting['enablecheckcode']=='1'} <tr> <th>验证码:</th> <td><input name="code" type="text" id="code" size="10" class="input-text"/> {form::checkcode('code_img','4','14',110,30)}</td> </tr> {/if} <tr> <th></th> <td><input type="submit" value=" 申 请 " name="dosubmit" class="button"> <input type="reset" value=" 取 消 " name="reset" class="button"> </td> </tr> </tbody></table> </form> </div> </div> <!--right_bar--> <div class="col-auto"> <!--广告228x90--> <div class="box"> <h5 class="title-2">友情链接分类</h5> <div class="tag_a"> <a href="{APP_PATH}index.php?m=link&c=index&a=list_type&type_id=0&siteid={$siteid}" title="默认分类">默认分类</a> {pc:link action="type_lists" listorder="desc" siteid="$siteid"} {loop $data $type_v} <a href="{APP_PATH}index.php?m=link&c=index&a=list_type&type_id={$type_v[typeid]}&siteid={$siteid}" title="{$type_v[name]}">{$type_v[name]}</a> {/loop} {/pc} </div> </div> <div class="bk10"></div> <div class="box"> <h5 class="title-2">本站LOGO:</h5> <div class="tag_a pad-lr-10"> {pc:block pos="3"} {/pc} </div> </div> <div class="bk10"></div> <div class="box"> <h5 class="title-2">合作联系方式</h5> <div class="tag_a pad-lr-10"> {pc:block pos="2"} {/pc} </div> </div> <div class="bk10"></div> <div class="box"> <h5 class="title-2">链接要求</h5> <div class="tag_a pad-lr-10"> {pc:block pos="1"} {/pc} </div> </div> </div> </div> <script type="text/javascript"> <!-- $(function(){ $.formValidator.initConfig({autotip:true,formid:"myform",onerror:function(msg){}}); $("#name").formValidator({onshow:"请输入网站名称",onfocus:"请输入网站名称"}).inputValidator({min:1,max:999,onerror:"网站名称不能为空"}); $("#url").formValidator({onshow:"请输入网站网址",onfocus:"请输入网站网址"}).inputValidator({min:1,onerror:"请输入网站网址"}).regexValidator({regexp:"^http:\/\/[A-Za-z0-9]+\.[A-Za-z0-9]+[\/=\?%\-&]*([^<>])*$",onerror:"格式应该为http://www.phpcms.cn/"}) $("#code").formValidator({onshow:"请输入验证码",onfocus:"验证码不能为空"}).inputValidator({min:1,max:999,onerror:"验证码不能为空"}).ajaxValidator({ type : "get", url : "", data :"m=pay&c=deposit&a=public_checkcode", datatype : "html", async:'false', success : function(data){ if(data == 1) { return true; } else { return false; } }, buttons: $("#dosubmit"), onerror : "验证码错误", onwait : "验证中" }); }) //--> </script> {template "content","footer"}
108wo
phpcms/modules/link/install/templates/register.html
HTML
asf20
4,935
{template "content","header"} <link href="{CSS_PATH}link.css" rel="stylesheet" type="text/css" /> <!--main--> <div class="main"> <!--left_bar--> <div class="col-left"> <div class="crumbs"><a href="{siteurl($siteid)}">网站首页</a><span> &gt; </span><a href="{APP_PATH}index.php?m={ROUTE_M}&siteid={$siteid}">友情链接</a></div> <div class="box boxsbg cboxs"> <h5>默认分类 <a href="{APP_PATH}index.php?m=link&c=index&a=list_type&type_id=0&siteid={$siteid}" class="more">更多>></a></h5> <div class="tag_a"> {pc:link action="lists" typeid="0" siteid="$siteid" linktype="1" order="desc" num="6" return="dat"} {loop $dat $v} <a href="{$v[url]}" title="{$v[name]}" target="_blank"><img src="{$v[logo]}" width="92" height="31" /></a> {/loop} {/pc} </div> <div class="tag_a"> {pc:link action="lists" typeid="0" siteid="$siteid" linktype="0" order="desc" num="10" return="dat"} {loop $dat $v} <a href="{$v[url]}" title="{$v[name]}" target="_blank">{$v[name]} </a> {/loop} {/pc} </div> {pc:link action="type_lists" listorder="desc" siteid="$siteid"} {loop $data $type_v} <h5>{$type_v[name]} <a href="{APP_PATH}index.php?m=link&c=index&a=list_type&type_id={$type_v[typeid]}&siteid={$siteid}" class="more">更多>></a></h5> <div class="tag_a"> {pc:link action="lists" typeid="$type_v[typeid]" siteid="$siteid" linktype="1" order="desc" num="6" return="dat"} {loop $dat $v} <a href="{$v[url]}" title="{$v[name]}" target="_blank"><img src="{$v[logo]}" width="92" height="31" /></a> {/loop} {/pc} </div> <div class="tag_a"> {pc:link action="lists" typeid="$type_v[typeid]" siteid="$siteid" linktype="0" order="desc" num="10" return="dat"} {loop $dat $v} <a href="{$v[url]}" title="{$v[name]}" target="_blank">{$v[name]} </a> {/loop} {/pc} </div> {/loop} {/pc} <!--pages--> </div> </div> <!--right_bar--> <div class="col-auto"> <!--广告228x90--> <div class="box"> <h5 class="title-2">友情链接分类</h5> <div class="tag_a"> <a href="{APP_PATH}index.php?m=link&c=index&a=list_type&type_id=0&siteid={$siteid}" title="默认分类">默认分类</a> {pc:link action="type_lists" listorder="desc" siteid="$siteid"} {loop $data $type_v} <a href="{APP_PATH}index.php?m=link&c=index&a=list_type&type_id={$type_v[typeid]}&siteid={$siteid}" title="{$type_v[name]}">{$type_v[name]}</a> {/loop} {/pc} </div> </div> <div class="bk10"></div> {if $setting[$siteid]['is_post']=='1'} <div class="txt_c"> <a href="{APP_PATH}index.php?m=link&c=index&a=register&siteid={$siteid}" class="sqlj_btn" target="_blank"></a> </div> {/if} </div> </div> {template "content","footer"}
108wo
phpcms/modules/link/install/templates/index.html
HTML
asf20
3,099
{template "content","header"} <link href="{CSS_PATH}link.css" rel="stylesheet" type="text/css" /> <!--main--> <div class="main"> <!--left_bar--> {pc:link action="get_type" typeid="$type_id" siteid="$siteid"} {php $type_arr = $data;} {/pc} <div class="col-left"> <div class="crumbs"><a href="{siteurl($siteid)}">网站首页</a><span> &gt; </span><a href="{APP_PATH}index.php?m={ROUTE_M}&siteid={$siteid}">友情链接</a><span> &gt; </span>{$type_arr[name]}</div> <div class="box boxsbg cboxs"> <h5>{$type_arr[name]} </h5> <div class="tag_a"> {pc:link action="lists" typeid="$type_id" siteid="$siteid" linktype="1" order="desc" num="6" return="dat"} {loop $dat $v} <a href="{$v[url]}" title="{$v[name]}" target="_blank"><img src="{$v[logo]}" width="92" height="31" /></a> {/loop} {/pc} </div> <div class="tag_a"> {pc:link action="lists" typeid="$type_id" siteid="$siteid" linktype="0" order="desc" num="10" return="dat"} {loop $dat $v} <a href="{$v[url]}" title="{$v[name]}" target="_blank">{$v[name]} </a> {/loop} {/pc} </div> <!--pages--> </div> </div> <!--right_bar--> <div class="col-auto"> <!--广告228x90--> <div class="box"> <h5 class="title-2">友情链接分类</h5> <div class="tag_a"> <a href="{APP_PATH}index.php?m=link&c=index&a=list_type&type_id=0&siteid={$siteid}" title="默认分类">默认分类</a> {pc:link action="type_lists" listorder="desc" siteid="$siteid"} {loop $data $type_v} <a href="{APP_PATH}index.php?m=link&c=index&a=list_type&type_id={$type_v[typeid]}&siteid={$siteid}" title="{$type_v[name]}">{$type_v[name]}</a> {/loop} {/pc} </div> </div> <div class="bk10"></div> {if $setting['is_post']=='1'} <div class="txt_c"> <a href="{APP_PATH}index.php?m=link&c=index&a=register&siteid={$siteid}" class="sqlj_btn"></a> </div> {/if} </div> </div> {template "content","footer"}
108wo
phpcms/modules/link/install/templates/list_type.html
HTML
asf20
2,221
<?php defined('IN_PHPCMS') or exit('Access Denied'); defined('INSTALL') or exit('Access Denied'); $parentid = $menu_db->insert(array('name'=>'link', 'parentid'=>29, 'm'=>'link', 'c'=>'link', 'a'=>'init', 'data'=>'', 'listorder'=>0, 'display'=>'1'), true); $menu_db->insert(array('name'=>'add_link', 'parentid'=>$parentid, 'm'=>'link', 'c'=>'link', 'a'=>'add', 'data'=>'', 'listorder'=>0, 'display'=>'0')); $menu_db->insert(array('name'=>'edit_link', 'parentid'=>$parentid, 'm'=>'link', 'c'=>'link', 'a'=>'edit', 'data'=>'', 'listorder'=>0, 'display'=>'0')); $menu_db->insert(array('name'=>'delete_link', 'parentid'=>$parentid, 'm'=>'link', 'c'=>'link', 'a'=>'delete', 'data'=>'', 'listorder'=>0, 'display'=>'0')); $menu_db->insert(array('name'=>'link_setting', 'parentid'=>$parentid, 'm'=>'link', 'c'=>'link', 'a'=>'setting', 'data'=>'', 'listorder'=>0, 'display'=>'1')); $menu_db->insert(array('name'=>'add_type', 'parentid'=>$parentid, 'm'=>'link', 'c'=>'link', 'a'=>'add_type', 'data'=>'', 'listorder'=>0, 'display'=>'1')); $menu_db->insert(array('name'=>'list_type', 'parentid'=>$parentid, 'm'=>'link', 'c'=>'link', 'a'=>'list_type', 'data'=>'', 'listorder'=>0, 'display'=>'1')); $menu_db->insert(array('name'=>'check_register', 'parentid'=>$parentid, 'm'=>'link', 'c'=>'link', 'a'=>'check_register', 'data'=>'', 'listorder'=>0, 'display'=>'1')); $link_db = pc_base::load_model('link_model'); $link_db->insert(array('siteid'=>1,'typeid'=>$typeid,'linktype'=>'1','name'=>'PHPCMS','url'=>'http://www.phpcms.cn','logo'=>'http://www.phpcms.cn/images/logo_88_31.gif','passed'=>1,'addtime'=>SYS_TIME)); $link_db->insert(array('siteid'=>1,'typeid'=>$typeid,'linktype'=>'1','name'=>'盛大在线','url'=>'http://www.sdo.com','logo'=>'http://www.snda.com/cn/logo/comp_logo_sdo.gif','passed'=>1,'addtime'=>SYS_TIME)); $language = array('link'=>'友情链接', 'add_link'=>'添加友情链接', 'edit_link'=>'编辑友情链接', 'delete_link'=>'删除友情链接', 'link_setting'=>'模块配置', 'add_type'=>'添加类别', 'list_type'=>'分类管理', 'check_register'=>'审核申请'); ?>
108wo
phpcms/modules/link/install/extention.inc.php
PHP
asf20
2,106
<?php defined('IN_PHPCMS') or exit('Access Denied'); defined('INSTALL') or exit('Access Denied'); $module = 'link'; $modulename = '友情链接'; $introduce = '友情链接模块'; $author = 'phpcms Team'; $authorsite = 'http://www.phpcms.cn'; $authoremail = ''; ?>
108wo
phpcms/modules/link/install/config.inc.php
PHP
asf20
275
<?php $LANG['link'] = '友情链接'; $LANG['link_add'] = '添加友情链接'; $LANG['link_name'] = '网站名称'; $LANG['logo'] = '图片LOGO'; $LANG['url'] = '网站网址'; $LANG['link_type'] = '链接类型'; $LANG['typeid'] = '所属分类'; $LANG['status'] = '状 态'; $LANG['type_id'] = '分类ID'; $LANG['type_name'] = '分类名称'; $LANG['list_type'] = '分类管理'; $LANG['link_type_listorder'] = '排序权值'; $LANG['web_description'] = '网站介绍'; $LANG['type_description'] = '分类描述'; $LANG['username'] = '网站联系人'; $LANG['elite'] = '推 荐'; $LANG['passed'] = '批 准'; $LANG['setting_updates_successful'] = '配置更新完成!'; $LANG['input_not_space'] = '输入内容请勿带空格'; $LANG['remove_all_selected'] = '删除选中'; $LANG['sitename_noempty'] = '网站名称不能为空'; $LANG['siteurl_not_empty'] = '网站网址不能为空'; $LANG['typename_noempty'] = '分类名称不能为空'; $LANG['add_success'] = '提交成功,正在返回!'; $LANG['suspend_application'] = '暂停申请,正在返回!'; $LANG['link_exit'] = '友情链接不存在'; $LANG['linktype_exit'] = '友情链接分类不存在'; $LANG['all_linktype'] = '所有分类'; $LANG['all'] = '全部'; $LANG['word_link'] = '文字链接'; $LANG['logo_link'] = 'LOGO链接'; $LANG['before_select_operations'] = '请选择再执行操作'; $LANG['yes'] = '是'; $LANG['no'] = '否'; $LANG['link_list'] = '友情链接列表'; $LANG['go_website'] = '前往网站'; $LANG['pass_check'] = '通过审核'; $LANG['pass_or_not'] = '是否通过审核'; $LANG['audit'] = '审核'; $LANG['passed'] = '通过'; $LANG['move_success'] = '移动成功'; $LANG['application_or_not'] = '是否允许申请'; $LANG['code_or_not'] = '是否开启验证码'; $LANG['choose_true_type'] = '请选择正确的分类!'; $LANG['application_links'] = '友情链接申请'; $LANG['link_onerror'] = '格式应该为http://www.phpcms.cn/'; ?>
108wo
phpcms/modules/link/install/languages/zh-cn/link.lang.php
PHP
asf20
2,242
<?php ?>
108wo
phpcms/modules/link/functions/global.func.php
PHP
asf20
9
<?php defined('IN_ADMIN') or exit('No permission resources.'); include $this->admin_tpl('header','admin'); ?><style type="text/css"> <!-- *{ padding:0; margin:0; font-size:12px} a:link,a:visited{text-decoration:none;color:#0068a6} a:hover,a:active{color:#ff6600;text-decoration: underline} .showMsg{border: 1px solid #1e64c8; zoom:1; width:450px; height:172px;position:absolute;top:44%;left:50%;margin:-87px 0 0 -225px} .showMsg h5{background-image:color:#fff; padding-left:35px; height:25px; line-height:26px;*line-height:28px; overflow:hidden; font-size:14px; text-align:left} .showMsg .content{ padding:10px 12px 10px 12px; font-size:14px; height:100px; line-height:96px} --> </style> <link href="<?php echo CSS_PATH?>progress_bar.css" rel="stylesheet" type="text/css" /> <div class="showMsg" style="text-align:center"> <h5><?php echo L('generate_progress')?></h5> <div class="content"> <?php echo $msg?> </div> </div> </body> </html>
108wo
phpcms/modules/scan/templates/md5_creat.tpl.php
PHP
asf20
973
<?php defined('IN_ADMIN') or exit('No permission resources.'); include $this->admin_tpl('header','admin'); ?> <div class="pad-10"> <div class="common-form"> <form name="myform" action="?m=scan&c=index&a=public_update_config" method="post" id="myform" onsubmit="return check_form()"> <table width="100%" class="table_form"> <tr> <td width="80"><?php echo L('ravsingle')?>:</td> <td><ul id="file" style="list-style:none; height:200px;overflow:auto;width:300px;"> <?php $dir = $file= ''; foreach ($list as $v){ $filename = basename($v); if (is_dir($v)) { $dir .= '<li><input type="checkbox" name="dir[]" value="'.$v.'" '.(isset($scan['dir']) && is_array($scan['dir']) && !empty($scan['dir']) && in_array($v, $scan['dir']) ? 'checked' :'').'><img src="'.IMG_PATH.'folder.gif"> '.$filename.'</li>'; } elseif (substr(strtolower($v), -3, 3)=='php'){ $file .= '<li><input type="checkbox" name="dir[]" value="'.$v.'" '.(isset($scan['dir']) && is_array($scan['dir']) && !empty($scan['dir']) && in_array($v, $scan['dir']) ? 'checked' :'').'><img src="'.IMG_PATH.'file.gif">'.$filename.'</li>'; } else { continue; } } echo $dir,$file; ?> </ul></td> </tr> <tr> <td><?php echo L('file_type')?>:</td> <td><input type="text" name="info[file_type]" size="100" class="input-text" value="<?php echo $scan['file_type']?>"></input></td> </tr> <tr> <td><?php echo L('characteristic_function')?>:</td> <td><input type="text" name="info[func]" size="100" class="input-text" value="<?php echo $scan['func']?>"></input></td> </tr> <tr> <td><?php echo L('characteristic_key')?>:</td> <td><input type="text" name="info[code]" size="100" class="input-text" value="<?php echo $scan['code']?>"></input></td> </tr> <tr> <td><?php echo L('md5_the_mirror')?>:</td> <td> <?php echo form::select($md5_file_list, $scan['md5_file'], 'name="info[md5_file]"')?> </td> </tr> </table> <div class="bk15"></div> <input name="dosubmit" type="submit" id="dosubmit" value="<?php echo L('submit')?>" class="button"> </form> </div> </div> <script type="text/javascript"> function check_form() { var checked = 0; $("input[type='checkbox'][name='dir[]']").each(function(i,n){if ($(this).attr('checked')==true) {checked = 1;}}); if (checked) { return true; } else { alert('<?php echo L('please_select_the_content')?>'); return false; } } </script> </body> </html>
108wo
phpcms/modules/scan/templates/scan_index.tpl.php
PHP
asf20
2,514
<?php defined('IN_ADMIN') or exit('No permission resources.'); include $this->admin_tpl('header', 'admin'); ?> <div class="pad-10" style="padding-bottom:0px;"> <table width="100%" height="400" class="table_form"> <?php if (isset($func)) :?> <tr> <td><?php echo L('characteristic_function')?>:<?php if ($func) { foreach ($func as $val) { if($val) { echo "<input type='button' onclick=\"fnSearch('$val');\" value='".$val."' class='button'> "; } } } ?></td> </tr> <?php endif;?> <?php if (isset($code)) :?> <tr> <td><?php echo L('characteristic_key')?>:<?php if($code) { foreach ($code as $val) { if($val) { echo "<input type='button' onclick=\"fnSearch('".htmlentities($val)."');\" value='".htmlentities($val)."' class='button'> "; } } } ?></td> </tr> <?php endif;?> <tr> <td><textarea name="code" id="code" style="width:650px;height: 380px;"><?php echo htmlspecialchars($html)?></textarea></td> </tr> </table> </div> <script type="text/javascript"> var oRange; var intCount = 0; var intTotalCount = 100; function fnSearch(strBeReplaced) { var strBeReplaced; var strReplace; fnNext(); $('#code').focus(); oRange = document.getElementById('code').createTextRange(); for (i=1; oRange.findText(strBeReplaced)!=false; i++) { if(i==intCount){ oRange.select(); oRange.scrollIntoView(); break; } oRange.collapse(false); } } function fnNext(){ if (intCount > 0 && intCount < intTotalCount){ intCount = intCount + 1; } else { intCount = 1 ; } } //--> </SCRIPT> </script> </body> </html>
108wo
phpcms/modules/scan/templates/public_view.tpl.php
PHP
asf20
1,678
<?php defined('IN_ADMIN') or exit('No permission resources.');?> <?php include $this->admin_tpl('header', 'admin');?> <div class="pad-lr-10"> <div class="table-list"> <table width="100%" cellspacing="0"> <thead> <tr> <th align="left"><?php echo L('file_address')?></th> <th align="left"><?php echo L('function_of_characteristics')?></th> <th align="left"><?php echo L('characteristic_function')?></th> <th align="left"><?php echo L('code_number_of_features')?></th> <th align="left"><?php echo L('characteristic_key')?></th> <th align="left">Zend encoded</th> <th align="left"><?php echo L('operation')?></th> </tr> </thead> <tbody> <?php foreach($badfiles as $k=>$v) { ?> <tr> <td align="left"><?php echo $k?></td> <td align="left"><?php if(isset($v['func'])){echo count($v['func']);}else{echo '0';}?></td> <td align="left"><?php if(isset($v['func'])){ foreach ($v['func'] as $keys=>$vs) { $d[$keys] = strtolower($vs[1]); } $d = array_unique($d); foreach ($d as $vs) { echo "<font color='red'>".$vs."</font> "; } }?></td> <td align="left"><?php if(isset($v['code'])){echo count($v['code']);}else{echo '0';}?></td> <td align="left"><?php if(isset($v['code'])){ foreach ($v['code'] as $keys=>$vs) { $d[$keys] = strtolower($vs[1]); } $d = array_unique($d); foreach ($d as $vs) { echo "<font color='red'>".htmlentities($vs)."</font> "; } }?></td> <td align="left"><?php if(isset($v['zend'])){echo '<font color=\'red\'>Yes</font>';}else{echo 'No';}?></td> <td align="left"><a href="javascript:void(0)" onclick="view('<?php echo urlencode($k)?>')"><?php echo L('view')?></a> <a href="<?php echo APP_PATH,$k;?>" target="_blank"><?php echo L('access')?></a></td> </tr> <?php } ?> </tbody> </table> </div> </div> <script type="text/javascript"> <!-- function view(url) { window.top.art.dialog({id:'edit'}).close(); window.top.art.dialog({title:'<?php echo L('view_code')?>',id:'edit',iframe:'?m=scan&c=index&a=public_view&url='+url,width:'700',height:'500'}); } //--> </script> </body> </html>
108wo
phpcms/modules/scan/templates/scan_report.tpl.php
PHP
asf20
2,131
<?php defined('IN_PHPCMS') or exit('No permission resources.'); pc_base::load_app_class('admin', 'admin', 0); class index extends admin { protected $safe = array ('file_type' => 'php|js','code' => '','func' => 'com|system|exec|eval|escapeshell|cmd|passthru|base64_decode|gzuncompress','dir' => '', 'md5_file'=>''); public function __construct() { parent::__construct(); } public function init() { $list = glob(PHPCMS_PATH.'*'); if (file_exists(CACHE_PATH.'caches_scan'.DIRECTORY_SEPARATOR.'caches_data')) { $md5_file_list = glob(CACHE_PATH.'caches_scan'.DIRECTORY_SEPARATOR.'caches_data'.DIRECTORY_SEPARATOR.'md5_*.php'); foreach ($md5_file_list as $k=>$v) { $md5_file_list[$v] = basename($v); unset($md5_file_list[$k]); } } $scan = getcache('scan_config', 'scan'); if (is_array($scan)) { $scan = array_merge($this->safe, $scan); } else { $scan = $this->safe; } $scan['dir'] = string2array($scan['dir']); pc_base::load_sys_class('form', '', 0); include $this->admin_tpl('scan_index'); } //进行配置文件更新 public function public_update_config() { $info = isset($_POST['info']) ? $_POST['info'] : showmessage(L('illegal_action'), HTTP_REFERER); $dir = isset($_POST['dir']) ? new_stripslashes($_POST['dir']) : ''; if (empty($dir)) { showmessage(L('please_select_the_content'), '?m=scan&c=index&a=init'); } $info['dir'] = var_export($dir, true); setcache('scan_config', $info, 'scan'); showmessage(L('configuration_file_save_to_the'), '?m=scan&c=index&a=public_file_count'); } //对要进行扫描的文件进行统计 public function public_file_count() { $scan = getcache('scan_config', 'scan'); pc_base::load_app_func('global'); set_time_limit(120); $scan['dir'] = string2array($scan['dir']); $scan['file_type'] = explode('|', $scan['file_type']); $list = array(); foreach ($scan['dir'] as $v) { if (is_dir($v)) { foreach ($scan['file_type'] as $k ) { $list = array_merge($list, scan_file_lists($v.DIRECTORY_SEPARATOR, 1, $k, 0, 1, 1)); } } else { $list = array_merge($list, array(str_replace(PHPCMS_PATH, '', $v)=>md5_file($v))); } } setcache('scan_list', $list, 'scan'); showmessage(L('documents_to_file_the_statistics'), '?m=scan&c=index&a=public_file_filter'); } //对文件进行筛选 public function public_file_filter() { $scan_list = getcache('scan_list', 'scan'); $scan = getcache('scan_config', 'scan'); if (file_exists($scan['md5_file'])) { $old_md5 = include $scan['md5_file']; foreach ($scan_list as $k=>$v) { if ($v == $old_md5[$k]) { unset($scan_list[$k]); } } } setcache('scan_list', $scan_list, 'scan'); showmessage(L('file_through_a_feature_the_function_is'), '?m=scan&c=index&a=public_file_func'); } //进行特征函数过滤 public function public_file_func() { @set_time_limit(600); $file_list = getcache('scan_list', 'scan'); $scan = getcache('scan_config', 'scan'); if (isset($scan['func']) && !empty($scan['func'])) { foreach ($file_list as $key=>$val) { $html = file_get_contents(PHPCMS_PATH.$key); if(stristr($key,'.php.') != false || preg_match_all('/[^a-z]?('.$scan['func'].')\s*\(/i', $html, $state, PREG_SET_ORDER)) { $badfiles[$key]['func'] = $state; } } } if(!isset($badfiles)) $badfiles = array(); setcache('scan_bad_file', $badfiles, 'scan'); showmessage(L('feature_function_complete_a_code_used_by_filtration'), '?m=scan&c=index&a=public_file_code'); } //进行特征代码过滤 public function public_file_code() { @set_time_limit(600); $file_list = getcache('scan_list', 'scan'); $scan = getcache('scan_config', 'scan'); $badfiles = getcache('scan_bad_file', 'scan'); if (isset($scan['code']) && !empty($scan['code'])) { foreach ($file_list as $key=>$val) { $html = file_get_contents(PHPCMS_PATH.$key); if(stristr($key, '.php.') != false || preg_match_all('/[^a-z]?('.$scan['code'].')/i', $html, $state, PREG_SET_ORDER)) { $badfiles[$key]['code'] = $state; } if(strtolower(substr($key, -4)) == '.php' && function_exists('zend_loader_file_encoded') && zend_loader_file_encoded(PHPCMS_PATH.$key)) { $badfiles[$key]['zend'] = 'zend encoded'; } } } setcache('scan_bad_file', $badfiles, 'scan'); showmessage(L('scan_completed'), '?m=scan&c=index&a=scan_report&menuid=1005'); } public function scan_report() { $badfiles = getcache('scan_bad_file', 'scan'); if (empty($badfiles)) { showmessage(L('scan_to_find_a_result_please_to_scan'), '?m=scan&c=index&a=init'); } include $this->admin_tpl('scan_report'); } public function public_view() { $url = isset($_GET['url']) && trim($_GET['url']) ? new_stripslashes(urldecode(trim($_GET['url']))) : showmessage(L('illegal_action'), HTTP_REFERER); if (!file_exists(PHPCMS_PATH.$url)) { showmessage(L('file_not_exists')); } $html = file_get_contents(PHPCMS_PATH.$url); $file_list = getcache('scan_bad_file', 'scan'); if (isset($file_list[$url]['func']) && is_array($file_list[$url]['func']) && !empty($file_list[$url]['func'])) foreach ($file_list[$url]['func'] as $key=>$val) { $func[$key] = strtolower($val[1]); } if (isset($file_list[$url]['code']) && is_array($file_list[$url]['code']) && !empty($file_list[$url]['code'])) foreach ($file_list[$url]['code'] as $key=>$val) { $code[$key] = strtolower($val[1]); } if (isset($func)) $func = array_unique($func); if (isset($code)) $code = array_unique($code); $show_header = true; include $this->admin_tpl('public_view'); } public function md5_creat() { set_time_limit(120); $pro = isset($_GET['pro']) && intval($_GET['pro']) ? intval($_GET['pro']) : 1; pc_base::load_app_func('global'); switch ($pro) { case '1'://统计文件 $msg = L('please_wait'); ob_start(); include $this->admin_tpl('md5_creat'); ob_flush(); ob_clean(); $list = scan_file_lists(PHPCMS_PATH, 1, 'php', 0, 1); setcache('md5_'.date('Y-m-d'), $list, 'scan'); echo '<script type="text/javascript">location.href="?m=scan&c=index&a=md5_creat&pro=2&pc_hash='.$_SESSION['pc_hash'].'"</script>'; break; case '2': showmessage(L('viewreporttrue'),'?m=scan&c=index&a=init'); break; } } }
108wo
phpcms/modules/scan/index.php
PHP
asf20
6,490
<?php /** * 文件扫描 * @param $filepath 目录 * @param $subdir 是否搜索子目录 * @param $ex 搜索扩展 * @param $isdir 是否只搜索目录 * @param $md5 是否生成MD5验证码 * @param $enforcement 强制更新缓存 */ function scan_file_lists($filepath, $subdir = 1, $ex = '', $isdir = 0, $md5 = 0, $enforcement = 0) { static $file_list = array(); if ($enforcement) $file_list = array(); $flags = $isdir ? GLOB_ONLYDIR : 0; $list = glob($filepath.'*'.(!empty($ex) && empty($subdir) ? '.'.$ex : ''), $flags); if (!empty($ex)) $ex_num = strlen($ex); foreach ($list as $k=>$v) { $v1 = str_replace(PHPCMS_PATH, '', $v); if ($subdir && is_dir($v)) { scan_file_lists($v.DIRECTORY_SEPARATOR, $subdir, $ex, $isdir, $md5); continue; } if (!empty($ex) && strtolower(substr($v, -$ex_num, $ex_num)) == $ex) { if ($md5) { $file_list[$v1] = md5_file($v); } else { $file_list[] = $v1; } continue; } elseif (!empty($ex) && strtolower(substr($v, -$ex_num, $ex_num)) != $ex) { unset($list[$k]); continue; } } return $file_list; }
108wo
phpcms/modules/scan/functions/global.func.php
PHP
asf20
1,156
<?php defined('IN_PHPCMS') or exit('Access Denied'); defined('UNINSTALL') or exit('Access Denied'); return array('mood'); ?>
108wo
phpcms/modules/mood/uninstall/model.php
PHP
asf20
129
<?php defined('IN_PHPCMS') or exit('Access Denied'); defined('UNINSTALL') or exit('Access Denied'); ?>
108wo
phpcms/modules/mood/uninstall/extention.inc.php
PHP
asf20
106
<?php defined('IN_ADMIN') or exit('No permission resources.');?> <?php include $this->admin_tpl('header', 'admin');?> <div class="pad-lr-10"> <form name="searchform" action="" method="get" > <input type="hidden" value="mood" name="m"> <input type="hidden" value="mood_admin" name="c"> <input type="hidden" value="init" name="a"> <table width="100%" cellspacing="0" class="search-form"> <tbody> <tr> <td> <div class="explain-col"> <?php echo L('category')?>:<?php echo form::select_category('', $catid, 'name="catid"', L('please_select'), '', 0, 1)?> <?php echo L('time')?>:<?php echo form::select(array('1'=>L('today'), '2'=>L('yesterday'), '3'=>L('this_week'), '4'=>L('this_month'), '5'=>L('all')), $datetype, 'name="datetype"')?> <?php echo L('sort')?>:<?php echo form::select($order_list, $order, 'name="order"')?> <input type="submit" name="search" class="button" value="<?php echo L('view')?>" /> </div> </td> </tr> </tbody> </table> </form> <div class="table-list"> <?php if ($catid) :?> <table width="100%" cellspacing="0"> <thead> <tr> <th align="left" width="300"><?php echo L('title')?></th> <th align="left"><?php echo L('total')?></th> <?php foreach ($mood_program as $k=>$v) { echo '<th align="left">'.$v['name'].'</th>'; }?> </tr> </thead> <tbody> <?php if(is_array($data) && !empty($data))foreach($data as $k=>$v) { ?> <tr> <td align="left"><a href="<?php echo $content_data[$v['contentid']]['url']?>" target="_blank"><?php echo $content_data[$v['contentid']]['title']?></a></td> <td align="left" <?php if ($order == -1) echo 'class="on"';?>><?php echo $v['total']?></td> <?php foreach ($mood_program as $k=>$b) { $d = 'n'.$k; echo '<td align="left" '.($order==$k ? 'class="on"' : '').'>'.$v[$d].'</td>'; }?> </tr> <?php } ?> </tbody> </table> <div id="pages"><?php echo $pages?></div> <?php endif;?> </div> </div> </body> </html>
108wo
phpcms/modules/mood/templates/mood_list.tpl.php
PHP
asf20
2,013
<?php defined('IN_ADMIN') or exit('No permission resources.');?> <?php include $this->admin_tpl('header', 'admin');?> <div class="pad-lr-10"> <form name="myform" action="?m=mood&c=mood_admin&a=setting" method="post"> <div class="table-list"> <table width="100%" cellspacing="0"> <thead> <tr> <th align="left" width="40"><?php echo L('on_hand')?></th> <th align="left" width="200"><?php echo L('name')?></th> <th align="left"><?php echo L('pic')?></th> </tr> </thead> <tbody> <?php for($i=1; $i<=10; $i++) { ?> <tr> <td align="left"><input type="checkbox" value="1" name="use[<?php echo $i?>]" <?php if($mood_program[$i]['use']==1){echo 'checked';}?>></td> <td align="left"><input type="text" name="name[<?php echo $i?>]" value="<?php echo $mood_program[$i]['name']?>"></td> <td align="left"><input type="text" name="pic[<?php echo $i?>]" value="<?php echo $mood_program[$i]['pic']?>"><?php if ($mood_program[$i]['pic']) {echo '<img src="'.IMG_PATH.$mood_program[$i]['pic'].'">';}?></td> </tr> <?php } ?> </tbody> </table> <div class="btn"> <input type="submit" class="button" name="dosubmit" value="<?php echo L('submit')?>"/> </div> </div> </form> </div> </body> </html>
108wo
phpcms/modules/mood/templates/mood_setting.tpl.php
PHP
asf20
1,245
<?php defined('IN_PHPCMS') or exit('No permission resources.'); class index { private $setting, $catid, $contentid, $siteid, $mood_id; public function __construct() { $this->setting = getcache('mood_program', 'commons'); $this->mood_id = isset($_GET['id']) ? $_GET['id'] : ''; if (empty($this->mood_id)) { showmessage(L('id_cannot_be_empty')); } list($this->catid, $this->contentid, $this->siteid) = id_decode($this->mood_id); $this->setting = isset($this->setting[$this->siteid]) ? $this->setting[$this->siteid] : array(); foreach ($this->setting as $k=>$v) { if (empty($v['use'])) unset($this->setting[$k]); } define('SITEID', $this->siteid); } //显示心情 public function init() { $mood_id =& $this->mood_id; $setting =& $this->setting; $mood_db = pc_base::load_model('mood_model'); $data = $mood_db->get_one(array('catid'=>$this->catid, 'siteid'=>$this->siteid, 'contentid'=>$this->contentid)); foreach ($setting as $k=>$v) { $setting[$k]['fields'] = 'n'.$k; if (!isset($data[$setting[$k]['fields']])) $data[$setting[$k]['fields']] = 0; if (isset($data['total']) && !empty($data['total'])) { $setting[$k]['per'] = ceil(($data[$setting[$k]['fields']]/$data['total']) * 60); } else { $setting[$k]['per'] = 0; } } ob_start(); include template('mood', 'index'); $html = ob_get_contents(); ob_clean(); echo format_js($html); } //提交选中 public function post() { $mood_id =& $this->mood_id; $setting =& $this->setting; $cookies = param::get_cookie('mood_id'); $cookie = explode(',', $cookies); if (in_array($this->mood_id, $cookie)) { $this->_show_result(0, L('expressed')); } else { $mood_db = pc_base::load_model('mood_model'); $key = isset($_GET['k']) && intval($_GET['k']) ? intval($_GET['k']) : ''; $fields = 'n'.$key; if ($data = $mood_db->get_one(array('catid'=>$this->catid, 'siteid'=>$this->siteid, 'contentid'=>$this->contentid))) { $mood_db->update(array('total'=>'+=1', $fields=>'+=1', 'lastupdate'=>SYS_TIME), array('id'=>$data['id'])); $data['total']++; $data[$fields]++; } else { $mood_db->insert(array('total'=>'1', $fields=>'1', 'catid'=>$this->catid, 'siteid'=>$this->siteid, 'contentid'=>$this->contentid,' lastupdate'=>SYS_TIME)); $data['total'] = 1; $data[$fields] = 1; } param::set_cookie('mood_id', $cookies.','.$mood_id); foreach ($setting as $k=>$v) { $setting[$k]['fields'] = 'n'.$k; if (!isset($data[$setting[$k]['fields']])) $data[$setting[$k]['fields']] = 0; if (isset($data['total']) && !empty($data['total'])) { $setting[$k]['per'] = ceil(($data[$setting[$k]['fields']]/$data['total']) * 60); } else { $setting[$k]['per'] = 0; } } ob_start(); include template('mood', 'index'); $html = ob_get_contents(); ob_clean(); $this->_show_result(1,$html); } } //显示AJAX结果 protected function _show_result($status = 0, $msg = '') { if(CHARSET != 'utf-8') { $msg = iconv(CHARSET, 'utf-8', $msg); } exit(trim_script($_GET['callback']).'('.json_encode(array('status'=>$status, 'data'=>$msg)).')'); } }
108wo
phpcms/modules/mood/index.php
PHP
asf20
3,251
<?php defined('IN_PHPCMS') or exit('No permission resources.'); pc_base::load_app_class('admin', 'admin', 0); class mood_admin extends admin { public function __construct() { parent::__construct(); } //排行榜查看 public function init() { $mood_program = getcache('mood_program', 'commons'); $mood_program = isset($mood_program[$this->get_siteid()]) ? $mood_program[$this->get_siteid()] : array(); $mood_db = pc_base::load_model('mood_model'); $catid = isset($_GET['catid']) && intval($_GET['catid']) ? intval($_GET['catid']) : ''; $datetype = isset($_GET['datetype']) && intval($_GET['datetype']) ? intval($_GET['datetype']) : 0; $order = isset($_GET['order']) && intval($_GET['order']) ? intval($_GET['order']) : 0; $sql = ''; if ($catid) { $sql = "`catid` = '$catid' AND `siteid` = '".$this->get_siteid()."'"; switch ($datetype) { case 1://今天 $sql .= " AND `lastupdate` BETWEEN '".(strtotime(date('Y-m-d')." 00:00:00"))."' AND '".(strtotime(date('Y-m-d')." 23:59:59"))."'"; break; case 2://昨天 $sql .= " AND `lastupdate` BETWEEN '".(strtotime(date('Y-m-d')." 00:00:00")-86400)."' AND '".(strtotime(date('Y-m-d')." 23:59:59")-86400)."'"; break; case 3://本周 $week = date('w'); if (empty($week)) $week = 7; $sql .= " AND `lastupdate` BETWEEN '".(strtotime(date('Y-m-d')." 23:59:59")-86400*$week)."' AND '".(strtotime(date('Y-m-d')." 23:59:59")+(86400*(7-$week)))."'"; break; case 4://本月 $day = date('t'); $sql .= " AND `lastupdate` BETWEEN '".strtotime(date('Y-m-1')." 00:00:00")."' AND '".strtotime(date('Y-m-'.$day)." 23:59:59")."'"; break; case 5://所有 $sql .= " AND `lastupdate` <= '".SYS_TIME."'"; break; } $sql_order = ''; if ($order == '-1') { $sql_order = " `total` desc"; } elseif ($order) { $sql_order = "`n$order` desc"; } $page = isset($_GET['page']) && intval($_GET['page']) ? intval($_GET['page']) : 1; $data = $mood_db->listinfo($sql, $sql_order, $page); $content_db = pc_base::load_model('content_model'); $contentid = ''; foreach ($data as $v) { $contentid .= $contentid ? "','".$v['contentid'] : $v['contentid']; } $content_db->set_catid($catid); $content_data = $content_db->select("`id` IN ('$contentid')", 'id,url,title'); foreach ($content_data as $k=>$v) { $content_data[$v['id']] = array('title'=>$v['title'], 'url'=>$v['url']); unset($content_data[$k]); } $pages = $mood_db->pages; } $order_list = array('-1'=>L('total')); foreach ($mood_program as $k=>$v) { $order_list[$k]=$v['name']; } pc_base::load_sys_class('form', '', 0); include $this->admin_tpl('mood_list'); } //配置 public function setting() { $mood_program = getcache('mood_program', 'commons'); if (isset($_POST['dosubmit'])) { $use = isset($_POST['use']) ? $_POST['use'] : ''; $name = isset($_POST['name']) ? $_POST['name'] : ''; $pic = isset($_POST['pic']) ? $_POST['pic'] : ''; $data = array(); foreach ($name as $k=>$v) { $data[$k] = array('use'=>$use[$k], 'name'=>$v, 'pic'=>$pic[$k]); } $mood_program[$this->get_siteid()] = $data; setcache('mood_program', $mood_program, 'commons'); showmessage(L('operation_success'), HTTP_REFERER); } else { $mood_program = isset($mood_program[$this->get_siteid()]) ? $mood_program[$this->get_siteid()] : array(); include $this->admin_tpl('mood_setting'); } } }
108wo
phpcms/modules/mood/mood_admin.php
PHP
asf20
3,584
<?php defined('IN_PHPCMS') or exit('Access Denied'); defined('INSTALL') or exit('Access Denied'); return array('mood'); ?>
108wo
phpcms/modules/mood/install/model.php
PHP
asf20
128
<style type="text/css"> #mood{text-align: center;} #mood ul li,#mood ul li div.pillar{display:inline-block;display:-moz-inline-stack;zoom:1;*display:inline;} #mood ul li{vertical-align: bottom} #mood ul li{width:80px; padding-bottom:10px} #mood ul li span{ font-size:12px} #mood ul li label{ display:block;} #mood ul li div.pillar{ height:20px; width:80px; background:url({IMG_PATH}mood/mood.gif) repeat-y 28px center; margin-bottom:5px;} #mood ul li div.pass{background-position: -83px center;} </style> <div id="mood"> <ul> {loop $setting $k $v} <li><span>{$data[$v['fields']]}</span><div class="pillar{if isset($key) && $key==$k} pass{/if}" style="height:{$v[per]}px;"></div>{if $v[pic]}<img src="{IMG_PATH}{$v[pic]}">{/if}<br /><label for="n{$k}">{$v[name]}<br /><input type="radio" id="n{$k}" name="n" onclick="vote({$k})" {if isset($key) && $key==$k} checked{/if}></label></li>{/loop} </ul> </div> <script type="text/javascript"> function vote(id) { $.getJSON('{APP_PATH}index.php?m=mood&c=index&a=post&id={$mood_id}&k='+id+'&'+Math.random()+'&callback=?', function(data){ if(data.status==1) { $('#mood').html(data.data); }else { alert(data.data); } }) } </script>
108wo
phpcms/modules/mood/install/templates/index.html
HTML
asf20
1,280
<?php defined('IN_PHPCMS') or exit('Access Denied'); defined('INSTALL') or exit('Access Denied'); return array ( 'index.html' => '新闻心情', ); ?>
108wo
phpcms/modules/mood/install/templates/name.inc.php
PHP
asf20
161
<?php defined('IN_PHPCMS') or exit('Access Denied'); defined('INSTALL') or exit('Access Denied'); $parentid = $menu_db->insert(array('name'=>'mood', 'parentid'=>'29', 'm'=>'mood', 'c'=>'mood_admin', 'a'=>'init', 'data'=>'', 'listorder'=>0, 'display'=>'1'), true); $menu_db->insert(array('name'=>'mood_setting', 'parentid'=>$parentid, 'm'=>'mood', 'c'=>'mood_admin', 'a'=>'setting', 'data'=>'', 'listorder'=>0, 'display'=>'1')); $language = array('mood'=>'新闻心情', 'mood_setting'=>'心情配置'); setcache('mood_program', array('1'=>array( 1 => array ( 'use' => '1', 'name' => '震惊', 'pic' => 'mood/a1.gif', ), 2 => array ( 'use' => '1', 'name' => '不解', 'pic' => 'mood/a2.gif', ), 3 => array ( 'use' => '1', 'name' => '愤怒', 'pic' => 'mood/a3.gif', ), 4 => array ( 'use' => '1', 'name' => '杯具', 'pic' => 'mood/a4.gif', ), 5 => array ( 'use' => '1', 'name' => '无聊', 'pic' => 'mood/a5.gif', ), 6 => array ( 'use' => '1', 'name' => '高兴', 'pic' => 'mood/a6.gif', ), 7 => array ( 'use' => '1', 'name' => '支持', 'pic' => 'mood/a7.gif', ), 8 => array ( 'use' => '1', 'name' => '超赞', 'pic' => 'mood/a8.gif', ), 9 => array ( 'use' => NULL, 'name' => '', 'pic' => '', ), 10 => array ( 'use' => NULL, 'name' => '', 'pic' => '', ), )), 'commons'); ?>
108wo
phpcms/modules/mood/install/extention.inc.php
PHP
asf20
1,533
<?php defined('IN_PHPCMS') or exit('Access Denied'); defined('INSTALL') or exit('Access Denied'); $module = 'mood'; $modulename = '新闻心情'; $introduce = '新闻心情模块'; $author = 'phpcms team'; $authorsite = 'http://www.phpcms.cn'; $authoremail = ''; ?>
108wo
phpcms/modules/mood/install/config.inc.php
PHP
asf20
275
<?php $LANG['id_cannot_be_empty'] = 'ID不能为空'; $LANG['total'] = '总数'; $LANG['expressed'] = '你已经表达过心情了,保持平常心有益身体健康!'; $LANG['category'] = '栏目'; $LANG['time'] = '时间'; $LANG['sort'] = '排序'; $LANG['today'] = '今天'; $LANG['yesterday'] = '昨天'; $LANG['this_week'] = '本周'; $LANG['this_month'] = '本月'; $LANG['all'] = '所有'; $LANG['view'] = '查看'; $LANG['title'] = '标题'; $LANG['on_hand'] = '可用'; $LANG['name'] = '名称'; $LANG['pic'] = '图片';
108wo
phpcms/modules/mood/install/languages/zh-cn/mood.lang.php
PHP
asf20
548
<?php defined('IN_PHPCMS') or exit('Access Denied'); defined('UNINSTALL') or exit('Access Denied'); return array('poster', 'poster_space'); ?>
108wo
phpcms/modules/poster/uninstall/model.php
PHP
asf20
149
<?php defined('IN_PHPCMS') or exit('Access Denied'); defined('UNINSTALL') or exit('Access Denied'); $poster_stat = pc_base::load_model('poster_stat_model'); $diff1 = date('Y', SYS_TIME); //当前年份 $diff2 = date('m', SYS_TIME); //当前月份 $diff = ($diff1-2010)*12+$diff2; for($y=$diff;$y>0;$y--) { $value = date('Ym', mktime(0, 0, 0, $y, 1, 2010)); if($value<'201006' || !$this->db->table_exists($this->db_tablepre.'poster_'.$value)) break; $poster_stat->query("DROP TABLE IF EXISTS `".$this->db_tablepre."poster_".$value."`"); } ?>
108wo
phpcms/modules/poster/uninstall/extention.inc.php
PHP
asf20
560
<?php defined('IN_PHPCMS') or exit('No permission resources.'); pc_base::load_app_class('admin','admin',0); pc_base::load_app_func('global', 'poster'); class poster extends admin { private $db, $s_db; function __construct() { parent::__construct(); $this->s_db = pc_base::load_model('poster_space_model'); $this->db = pc_base::load_model('poster_model'); $setting = new_html_special_chars(getcache('poster', 'commons')); $this->M = $setting[$this->get_siteid()]; } /** * 广告列表 */ public function init() { $spaceid = $_GET['spaceid'] ? intval($_GET['spaceid']) : 0; if (!isset($spaceid) || empty($spaceid)) { showmessage(L('illegal_action'), HTTP_REFERER); } $page = max($_GET['page'], 1); $infos = $this->db->listinfo(array('spaceid'=>$spaceid, 'siteid'=>$this->get_siteid()), '`listorder` ASC, `id` DESC', $page); pc_base::load_sys_class('format', '', 0); $types = array('images'=>L('photo'), 'flash'=>L('flash'), 'text'=>L('title')); $show_dialog = $show_header = true; $big_menu = array('javascript:window.top.art.dialog({id:\'add\',iframe:\'?m=poster&c=poster&a=add&spaceid='.$spaceid.'\', title:\''.L('add_ads').'\', 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_ads')); include $this->admin_tpl('poster_list'); } /** * 添加广告 */ public function add() { if (isset($_POST['dosubmit'])) { $poster = $this->check($_POST['poster']); $setting = $this->check_setting($_POST['setting'], $poster['type']); $poster['siteid'] = $this->get_siteid(); $poster['setting'] = array2string($setting); $poster['addtime'] = SYS_TIME; $id = $this->db->insert($poster, true); if ($id) { $this->s_db->update(array('items'=>'+=1'), array('spaceid'=>$poster['spaceid'], 'siteid'=>$this->get_siteid())); $this->create_js($poster['spaceid']); foreach ($setting['images'] as $im) { $imgs[] = $im['imageurl']; } if (pc_base::load_config('system','attachment_stat')) { $this->attachment_db = pc_base::load_model('attachment_model'); $this->attachment_db->api_update($imgs, 'poster-'.$id, 1); } showmessage(L('add_ads_success'), HTTP_REFERER, '', 'add'); } else { showmessage(L('operation_failure'), HTTP_REFERER, '', 'add'); } } else { $spaceid = intval($_GET['spaceid']); $sinfo = $this->s_db->get_one(array('spaceid' => $spaceid, 'siteid'=>$this->get_siteid()), 'name, type'); $setting = $this->get_setting($sinfo['type']); $TYPES = get_types(); $default = count($setting)>0 ? L('please_select').'&nbsp;&nbsp;&nbsp;&nbsp;' : ''; } pc_base::load_sys_class('form', '', 0); include $this->admin_tpl('poster_add'); } /** * 广告修改 */ public function edit() { $_GET['id'] = intval($_GET['id']); if (!$_GET['id']) showmessage(L('illegal_action'), HTTP_REFERER); if (isset($_POST['dosubmit'])) { $poster = $this->check($_POST['poster']); $setting = $this->check_setting($_POST['setting'], $poster['type']); $poster['setting'] = array2string($setting); $this->db->update($poster, array('id'=>$_GET['id'], 'siteid'=>$this->get_siteid())); $this->create_js(intval($_GET['spaceid'])); foreach ($setting as $im) { $imgs[] = $im['imageurl']; } if(pc_base::load_config('system','attachment_stat')) { $this->attachment_db = pc_base::load_model('attachment_model'); $this->attachment_db->api_update($imgs, 'poster-'.$_GET['id'], 1); } showmessage(L('operation_success'), HTTP_REFERER, '', 'edit'); } else { $info = $this->db->get_one(array('id'=>$_GET['id'], 'siteid'=>$this->get_siteid())); $sinfo = $this->s_db->get_one(array('spaceid' => $info['spaceid'], 'siteid'=>$this->get_siteid()), 'name, type'); $setting = $this->get_setting($sinfo['type']); $TYPES = get_types(); $info['setting'] = string2array($info['setting']); $default = count($setting)>0 ? L('please_select').'&nbsp;&nbsp;&nbsp;&nbsp;' : ''; pc_base::load_sys_class('form', '', 0); include $this->admin_tpl('poster_edit'); } } /** * 广告排序 */ public function listorder() { if (isset($_POST['listorder']) && is_array($_POST['listorder'])) { $listorder = $_POST['listorder']; foreach ($listorder as $k => $v) { $this->db->update(array('listorder'=>$v), array('id'=>$k)); } } showmessage(L('operation_success'), HTTP_REFERER); } /** * 生成广告js文件 * @param intval $id 广告版位ID * @return boolen 成功返回true */ private function create_js($id = 0) { $html = pc_base::load_app_class('html'); if (!$html->create_js($id)) showmessge($html->msg, HTTP_REFERER); return true; } /** * 启用、停用广告。此方法不真正执行操作,调用真正的操作方法 * @param intval $id 广告ID */ public function public_approval() { if (!isset($_POST['id']) || !is_array($_POST['id'])) { showmessage(L('illegal_parameters'), HTTP_REFERER); } else { array_map(array($this, _approval), $_POST['id']); } showmessage(L('operation_success'), HTTP_REFERER); } private function _approval($id = 0) { $id = intval($id); if (!$id) return false; $_GET['passed'] = intval($_GET['passed']); $this->db->update(array('disabled'=>$_GET['passed'] ), array('id'=>$id, 'siteid'=>$this->get_siteid())); return true; } /** * 删除广告 此方法不真正执行删除操作,调用真正的删除操作方法 * @param invtal $id 广告ID */ public function delete() { if (!isset($_POST['id']) || !is_array($_POST['id'])) { showmessage(L('illegal_parameters'), HTTP_REFERER); } else { array_map(array($this, _del), $_POST['id']); } showmessage(L('operation_success'), HTTP_REFERER); } /*** * 广告删除 */ private function _del($id = 0) { $id = intval($id); if (!$id) return false; $r = $this->db->get_one(array('id'=>$id, 'siteid'=>$this->get_siteid()), 'spaceid'); $this->s_db->update(array('items'=>'-=1'), array('spaceid'=>$r['spaceid'], 'siteid'=>$this->get_siteid())); $this->db->delete(array('id'=>$id, 'siteid'=>$this->get_siteid())); if (pc_base::load_config('system','attachment_stat')) { $this->attachment_db = pc_base::load_model('attachment_model'); $keyid = 'poster-'.$id; $this->attachment_db->api_delete($keyid); } return true; } /** * 广告统计 */ public function stat() { $_GET['id'] = intval($_GET['id']); $info = $this->db->get_one(array('id'=>$_GET['id']), 'spaceid'); if (!$_GET['id']) showmessage(L('illegal_operation')); /** *如果设置了日期查询,设置查询的开始时间和结束时间 */ $sdb = pc_base::load_model('poster_stat_model'); //调用广告统计的数据模型 $year = date('Y', SYS_TIME); $month = date('m', SYS_TIME); $day = date('d', SYS_TIME); $where = $group = $order = ''; $fields = '*'; $where = "`pid`='".$_GET['id']."' AND `siteid`='".$this->get_siteid()."'"; if ($_GET['range'] == 2) { //昨天的统计 $fromtime = mktime(0, 0, 0, $month, $day-2, $year); $totime = mktime(0, 0, 0, $month, $day-1, $year); $where .= " AND `clicktime`>='".$fromtime."'"; $where .= " AND `clicktime`<='".$totime."'"; } elseif(is_numeric($_GET['range'])) { //如果设置了查询的天数 $fromtime = mktime(0, 0, 0, $month, $day-$_GET['range'], $year); $where .= " AND `clicktime`>='".$fromtime."'"; } $order = '`clicktime` DESC'; //如果设置了按点击、展示统计 $_GET['click'] = isset($_GET['click']) ? intval($_GET['click']) : 0; if (is_numeric($_GET['click'])) { $_GET['click'] = intval($_GET['click']); $where .= " AND `type`='".$_GET['click']."'"; //如果设置了按地区或者按ip分类 if ($_GET['group']) { $group = " `".$_GET['group']."`"; $fields = "*, COUNT(".$_GET['group'].") AS num"; $order = " `num` DESC"; } $r = $sdb->get_one($where, 'COUNT(*) AS num', '', $group); //取得总数 } else { $r = $sdb->get_one($where, 'COUNT(*) AS num'); } $page = max(intval($_GET['page']), 1); $curr_page = 20; $limit = ($page-1)*$curr_page.','.$curr_page; $pages = pages($r['num'], $page, 20); //生成分页 $data = $sdb->select($where, $fields, $limit, $order, $group); $selectstr = $sdb->get_list($_GET['year']); //取得历史查询下拉框,有历史数据查询时,会自动换表 pc_base::load_sys_class('format', '', 0); $show_header = true; unset($r); include $this->admin_tpl('poster_stat'); } /** * 根据版位的类型,得到版位的配置信息。如广告类型等 * @param string $type 版位的类型,默认情况下是一张图片或者动画 * return boolean */ private function get_setting($type) { $data = $poster_template = array(); $poster_template = getcache('poster_template', 'commons'); if (is_array($poster_template) && !empty($poster_template)) { $data = $poster_template[$type]; } else { switch($type) { case 'banner': $data['type'] = array('images' => L('photo'), 'flash' => L('flash')); $data['num'] = 1; break; case 'fixure': $data['type'] = array('images' => L('photo'), 'flash' => L('flash')); $data['num'] = 1; break; case 'float': $data['type'] = array('images' => L('photo'), 'flash' => L('flash')); $data['num'] = 1; break; case 'couplet': $data['type'] = array('images' => L('photo'), 'flash' => L('flash')); $data['num'] = 2; break; case 'imagechange': $data['type'] = array('images' => L('photo')); $data['num'] = 1; break; case 'imagelist': $data['type'] = array('images' => L('photo')); $data['num'] = 1; break; case 'text': $data['type'] = array('text' => L('title')); break; case 'code': $data['type'] = array('text' => L('title')); break; default : $data['type'] = array('images' => L('photo'), 'flash' => L('flash')); $data['num'] = 1; } } return $data; } /** * 检查广告属性信息 * @param array $data * return array */ private function check($data) { if (!isset($data['name']) || empty($data['name'])) showmessage(L('adsname_no_empty'), HTTP_REFERER); if (!isset($data['type']) || empty($data['type'])) showmessage(L('no_ads_type'), HTTP_REFERER); $data['startdate'] = $data['startdate'] ? strtotime($data['startdate']) : SYS_TIME; $data['enddate'] = $data['enddate'] ? strtotime($data['enddate']) : strtotime('next month', $data['startdate']); if($data['startdate']>=$data['enddate']) $data['enddate'] = strtotime('next month', $data['startdate']); return $data; } /** * 检查广告的内容信息,如图片、flash、文字 * @param array $setting * @param string $type 广告的类型 * @return array */ private function check_setting($setting = array(), $type = 'images') { switch ($type) { case 'images': unset($setting['flash'], $setting['text']); if(is_array($setting['images'])) { $tag = 0; foreach ($setting['images'] as $k => $s) { if($s['linkurl']=='http://') { $setting['images'][$k]['linkurl'] = ''; } if (!$s['imageurl']) unset($setting['images'][$k]); else $tag = 1; } if (!$tag) showmessage(L('no_setting_photo'), HTTP_REFERER); } break; case 'flash': unset($setting['images'], $setting['text']); if (is_array($setting['flash'])) { $tag = 0; foreach ($setting['flash'] as $k => $s) { if (!$s['flashurl']) unset($setting['flash'][$k]); else $tag = 1; } if (!$tag) showmessage(L('no_flash_path'), HTTP_REFERER); } break; case 'text': unset($setting['images'], $setting['flash']); if ((!isset($setting['text'][1]['title']) || empty($setting['text'][1]['title'])) && (!isset($setting['text']['code']) || empty($setting['text']['code']))) { showmessage(L('no_title_info'), HTTP_REFERER); } break; } return $setting[$type]; } /** * ajax检查广告名的合法性 */ public function public_check_poster() { if (!$_GET['name']) exit(0); if (CHARSET=='gbk') { $_GET['name'] = safe_replace(iconv('UTF-8', 'GBK', $_GET['name'])); } if ($_GET['id']) { $spaceid = intval($_GET['spaceid']); $r = $this->db->get_one(array('id' => $id)); if($r['name'] == $_GET['name']) { exit('1'); } } $r = $this->db->get_one(array('siteid' => $this->get_siteid(), 'name' => $_GET['name']), 'id'); if ($r['id']) { exit('0'); } else { exit('1'); } } } ?>
108wo
phpcms/modules/poster/poster.php
PHP
asf20
13,333
<?php defined('IN_ADMIN') or exit('No permission resources.'); include $this->admin_tpl('header','admin'); ?> <div class="subnav"> <h2 class="title-1 line-x f14 fb blue lh28"><?php echo L('ads_module')?></h2> <div class="content-menu ib-a blue line-x"> <a class="add fb" href="?m=poster&c=poster&a=init&spaceid=<?php echo $info['spaceid'];?>"><em><?php echo L('ad_list')?></em></a> <a class="on" href="?m=poster&c=space"><em><?php echo L('space_list')?></em></a></div> </div> <div class="pad-lr-10"> <div class="col-tab"> <ul class="tabBut cu-li"> <li<?php if($_GET['click']) {?> class="on"<?php }?>><a href="?m=poster&c=poster&a=stat&id=<?php echo $_GET['id']?>&click=1"><?php echo L('hits_stat')?></a></li> <li<?php if($_GET['click']==0){?> class="on"<?php }?>><a href="?m=poster&c=poster&a=stat&id=<?php echo $_GET['id']?>&click=0"><?php echo L('show_stat')?></a></li><li style="background:none; border:none;"><?php if(is_numeric($_GET['click'])) {?><strong><a href="?m=poster&c=poster&a=stat&id=<?php echo $_GET['id']?>&click=<?php echo $_GET['click']?>&group=area"><?php echo L('listorder_f_area')?></a></strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong><a href="?m=poster&c=poster&a=stat&id=<?php echo $_GET['id']?>&click=<?php echo $_GET['click']?>&group=ip"><?php echo L('listorder_f_ip')?></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong><?php }?> <input name='range' type='radio' value='' onclick="redirect('?m=poster&c=poster&a=stat&id=<?php echo $_GET['id']?>&click=<?php echo $_GET['click']?>&pc_hash=<?php echo $_GET['pc_hash']?>&group=<?php echo $_GET['group']?>')" <?php if(!$_GET['range']) {?>checked<?php }?>> <?php echo L('all')?> <input name='range' type='radio' value='1' onclick="redirect('?m=poster&c=poster&a=stat&id=<?php echo $_GET['id']?>&click=<?php echo $_GET['click']?>&pc_hash=<?php echo $_GET['pc_hash']?>&group=<?php echo $_GET['group']?>&range='+this.value)" <?php if($_GET['range']==1) {?>checked<?php }?>> <?php echo L('today')?> <input name='range' type='radio' value='2' onclick="redirect('?m=poster&c=poster&a=stat&id=<?php echo $_GET['id']?>&click=<?php echo $_GET['click']?>&pc_hash=<?php echo $_GET['pc_hash']?>&group=<?php echo $_GET['group']?>&range='+this.value)" <?php if($_GET['range']==2) {?>checked<?php }?>> <?php echo L('yesterday')?> <input name='range' type='radio' value='7' onclick="redirect('?m=poster&c=poster&a=stat&id=<?php echo $_GET['id']?>&click=<?php echo $_GET['click']?>&pc_hash=<?php echo $_GET['pc_hash']?>&group=<?php echo $_GET['group']?>&range='+this.value)" <?php if($_GET['range']==7) {?>checked<?php }?>> <?php echo L('one_week')?> <input name='range' type='radio' value='14' onclick="redirect('?m=poster&c=poster&a=stat&id=<?php echo $_GET['id']?>&click=<?php echo $_GET['click']?>&pc_hash=<?php echo $_GET['pc_hash']?>&group=<?php echo $_GET['group']?>&range='+this.value)" <?php if($_GET['range']==14) {?>checked<?php }?>> <?php echo L('two_week')?> <input name='range' type='radio' value='30' onclick="redirect('?m=poster&c=poster&a=stat&id=<?php echo $_GET['id']?>&click=<?php echo $_GET['click']?>&pc_hash=<?php echo $_GET['pc_hash']?>&group=<?php echo $_GET['group']?>&range='+this.value)" <?php if($_GET['range']==30) {?>checked<?php }?>> <?php echo L('one_month')?> <font color="red"><?php echo L('history_select')?>:</font><select name="year" onchange="if(this.value!=''){location='?m=poster&c=poster&a=stat&id=<?php echo $_GET['id']?>&click=<?php echo $_GET['click']?>&pc_hash=<?php echo $_GET['pc_hash']?>&group=<?php echo $_GET['group']?>&year='+this.value;}"> <?php echo $selectstr;?></select></li> </ul> <div class="content pad-10"> <?php if(is_numeric($_GET['click']) && $_GET['group']) {?> <div class="table-list"> <table width="100%" cellspacing="0"> <thead> <tr> <?php if($_GET['group']=='ip') {?> <th width="30%" align="center"><?php echo L('browse_ip')?></th><?php }?> <th width="30%" align="center"><?php echo L('for_area')?></th> <th width="30%" align="center"><?php echo L('show_times')?></th> </tr> </thead> </table> <table width="100%" class="contentWrap"> <?php if(is_array($data)){ foreach($data as $info){ ?> <tr> <?php if($_GET['group']=='ip') {?> <td align="center" width="30%"><?php echo $info['ip']?></td><?php }?> <td align="center" width="30%"> <?php echo $info['area']?> </td> <td align="center" width="30%"><?php echo $info['num']?></td> </tr> <?php } } ?> </table> </div> <div id="pages"><?php echo $pages?></div> <?php } else {?> <table width="100%" border="0" cellspacing="0" cellpadding="0" style="table-layout:fixed;"> <tr> <td style="padding-top:2px;padding-left:6px;padding-right:6px;padding-bottom:8px;"> <table width="100%" border="1" class="contentWrap" bordercolor="#dddddd" cellpadding="0" cellspacing="0"> <?php if(is_array($data)) { foreach($data as $k => $v) {?> <tr> <td width="24" align="center"><?php echo intval($k+1);?></td> <td style="padding:5px;"><div><span> <b>IP:<?php echo $v['ip']?></b> ( <b><?php echo $v['area']?></b> )</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo L('come_from')?>: <a href="<?php echo $v['referer']?>" target="_blank"> <?php echo $v['referer']?></a></div> <div><span class="item"><?php echo L('visit_time')?>:<em><?php echo format::date($v['clicktime'], 1);?></em></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo L('operate')?>:<?php if($v['type']) { echo L('click'); } else { echo L('show'); }?></div></td> </tr> <?php } }?> </table> </td> </tr> <tr> <td><div id="pages"><?php echo $pages;?></div></td> </tr> </table> <?php } ?> </div> </div> </div> </body> </html>
108wo
phpcms/modules/poster/templates/poster_stat.tpl.php
PHP
asf20
5,946
<?php defined('IN_ADMIN') or exit('No permission resources.'); $show_header = $show_validator = $show_scroll = 1; include $this->admin_tpl('header', 'admin'); $authkey = upload_key('1,'.$this->M['ext'].',1'); ?> <form method="post" action="?m=poster&c=poster&a=add" id="myform"> <table class="table_form" width="100%" cellspacing="0"> <tbody> <tr> <th width="100"><?php echo L('poster_title')?>:</th> <td><input name="poster[name]" id="name" class="input-text" type="text" size="25"></td> </tr> <tr> <th><?php echo L('for_postion')?>:</th> <td><?php if($spaceid) { echo '<b style="color:#F60;">',$sinfo['name'],'</b>&nbsp;[',$TYPES[$sinfo['type']],']<input type="hidden" name="poster[spaceid]" value="'.$spaceid.'">'; } else {?><select name="poster[spaceid]" id="spaceid" onchange="AdsType(this.value)"> <option value=''><?php echo L('please_select')?></option> <?php foreach($spaces as $s) {?> <option value="<?php echo $s['spaceid']?>"><?php echo $s['name']?></option> <?php } ?></select><?php }?></td> </tr> <tr> <th align="right" valign="top"><?php echo L('poster_type')?>:</th> <td valign="top" colspan="2"><?php echo form::select($setting['type'], '', 'name="poster[type]" id="type" onchange="AdsType(this.value)"', $default);?> </td> </tr> <tr> <th><?php echo L('line_time')?>:</th> <td><?php echo form::date('poster[startdate]', date('Y-m-d H:i:s', SYS_TIME), 1)?></td> </tr> <tr> <th><?php echo L('down_time')?>:</th> <td><?php echo form::date('poster[enddate]', '', 1)?></td> </tr> </tbody> </table><?php if(array_key_exists('images', $setting['type'])) {?><div class="pad-10" id="imagesdiv" style="display:"> <fieldset> <legend><?php echo L('photo_setting')?></legend> <?php if($setting['num']>1) { for($i=1; $i<=$setting['num']; $i++) {?> <table width="100%" class="table_form"> <tbody> <tr> <th width="80"><?php echo L('linkurl')?>:</th> <td class="y-bg"><input type="text" class="input-text" name="setting[images][<?php echo $i;?>][linkurl]" id="linkurl<?php echo $i;?>" size="30" value="http://" /></td> <td rowspan="2"><a href="javascript:flashupload('imgurl<?php echo $i;?>_images', '<?php echo L('upload_photo')?>','imgurl<?php echo $i;?>',preview,'1,<?php echo $this->M['ext']?>,1','poster', '', '<?php echo $authkey?>');void(0);"><img src="<?php echo IMG_PATH;?>icon/upload-pic.png" id="imgurl<?php echo $i;?>_s" width="105" height="88"></a><input type="hidden" id="imgurl<?php echo $i;?>" name="setting[images][<?php echo $i;?>][imageurl]"></td> </tr> <tr> <th><?php echo L('alt')?>:</th> <td class="y-bg"><input type="text" class="input-text" name="setting[images][<?php echo $i;?>][alt]" id="alt<?php echo $i;?>" size="30" /></td> </tr> </table> <?php } } else {?> <table width="100%" class="table_form"> <tbody> <tr> <th width="80"><?php echo L('linkurl')?>:</th> <td class="y-bg"><input type="text" class="input-text" name="setting[images][1][linkurl]" id="linkurl3" size="30" value="http://" /></td> <td rowspan="2"><a href="javascript:flashupload('imgurl_images', '<?php echo L('upload_photo')?>','imgurl',preview,'1,<?php echo $this->M['ext']?>,1','poster', '', '<?php echo $authkey?>');void(0);"><img src="<?php echo IMG_PATH;?>icon/upload-pic.png" id="imgurl_s" width="105" height="88"></a><input type="hidden" id="imgurl" name="setting[images][1][imageurl]"></td> </tr> <tr> <th><?php echo L('alt')?>:</th> <td class="y-bg"><input type="text" class="input-text" name="setting[images][1][alt]" id="alt3" size="30" /></td> </tr> </tbody> </table> <?php } ?> </fieldset></div><?php } if(array_key_exists('flash', $setting['type'])) {?> <div class="pad-10" id="flashdiv" style="display:none;"> <fieldset> <legend><?php echo L('flash_setting')?></legend> <?php if($setting['num']>1) { for($i=1; $i<=$setting['num']; $i++) {?> <table width="100%" class="table_form"> <tbody> <tr> <th width="80"><?php echo L('flash_url')?>:</th> <td class="y-bg"><input type="text" class="input-text" name="setting[flash][<?php echo $i;?>][flashurl]" id="flashurl<?php echo $i;?>" size="40" /></td> <td class="y-bg"><input type="button" class="button" onclick="javascript:flashupload('flashurl<?php echo $i;?>_images', '<?php echo L('flash_upload')?>','flashurl<?php echo $i;?>',submit_attachment,'1,<?php echo $this->M['ext']?>,1','poster', '', '<?php echo $authkey?>')" value="<?php echo L('flash_upload')?>"></td> </tr> </tbody> </table> <?php } } else {?> <table width="100%" class="table_form"> <tbody> <tr> <th width="80"><?php echo L('flash_url')?>:</th> <td class="y-bg"><input type="text" class="input-text" name="setting[flash][1][flashurl]" id="flashurl" size="40" /></td> <td class="y-bg"><input type="button" class="button" onclick="javascript:flashupload('flashurl_images', '<?php echo L('flash_upload')?>','flashurl',submit_attachment,'1,<?php echo $this->M['ext']?>,1','poster', '', '<?php echo $authkey?>')" value="<?php echo L('flash_upload')?>"></td> </tr> </tbody> </table> <?php } ?> </fieldset></div><?php } if(array_key_exists('text', $setting['type'])) {?><div class="pad-10" id="textdiv" style="display:"> <fieldset> <legend><?php if ($sinfo['type']=='text') { echo L('word_link'); } elseif ($sinfo['type']=='code') { echo L('code_setting'); } ?></legend> <table width="100%" class="table_form"> <tbody> <?php if($sinfo['type']=='text') {?> <tr> <th width="80"><?php echo L('word_content')?>:</th> <td class="y-bg"><input type="text" class="input-text" name="setting[text][1][title]" id="title" size="30" /></td> </tr> <tr> <th><?php echo L('linkurl')?>:</th> <td class="y-bg"><input type="text" class="input-text" name="setting[text][1][linkurl]" id="link" size="30" value="http://" onclick="javascript:this.value='';" /></td> </tr> <?php } elseif($sinfo['type']=='code') {?> <tr> <th width="80"><?php echo L('code_content')?>:</th> <td class="y-bg"><textarea name="setting[text][code]" id="code" cols="55" rows="6"></textarea></td> </tr><?php }?> </tbody> </table> </fieldset></div><?php }?> <div class="bk15"></div> <input type="submit" name="dosubmit" id="dosubmit" value=" <?php echo L('ok')?> " class="dialog">&nbsp;<input type="reset" value=" <?php echo L('clear')?> " class="dialog"> </form> </body> </html> <script type="text/javascript"> function AdsType(type) { $('#imagesdiv').css('display', 'none'); $('#flashdiv').css('display', 'none'); $('#'+type+'div').css('display', ''); } $(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();})}}); $('#name').formValidator({onshow:"<?php echo L('please_input_name')?>",onfocus:"<?php echo L('name_three_length')?>",oncorrect:"<?php echo L('correct')?>"}).inputValidator({min:6,onerror:"<?php echo L('adsname_no_empty')?>"}).ajaxValidator({type:"get",url:"",data:"m=poster&c=poster&a=public_check_poster",datatype:"html",cached:false,async:'true',success : function(data) { if( data == "1" ) { return true; } else { return false; } }, error: function(){alert("<?php echo L('server_busy')?>");}, onerror : "<?php echo L('ads_exist')?>", onwait : "<?php echo L('checking')?>" }); $('#type').formValidator({onshow:"<?php echo L('choose_ads_type')?>",onfocus:"<?php echo L('type_selected')?>",oncorrect:"<?php echo L('correct')?>",defaultvalue:"images"}).inputValidator({min:1,onerror: "<?php echo L('choose_ads_type')?>"}); $('#startdate').formValidator({onshow:"<?php echo L('online_time')?>",onfocus:"<?php echo L('online_time')?>",oncorrect:"<?php echo L('correct')?>"}).functionValidator({fun:isDateTime}); $('#enddate').formValidator({onshow:"<?php echo L('one_month_no_select')?>",onfocus:"<?php echo L('down_time')?>",oncorrect:"<?php echo L('correct')?>"}).inputValidator(); <?php if(array_key_exists('text', $setting['type'])) {?> <?php if($sinfo['type']=='text') {?> $('#title').formValidator({onshow:'<?php echo L('link_content')?>',onfoucs:'<?php echo L('link_content')?>',oncorrect:'<?php echo L('correct')?>'}).inputValidator({min:1,onerror:'<?php echo L('no_link_content')?>'}); <?php } elseif($sinfo['type']=='code') {?> $('#code').formValidator({onshow:"<?php echo L('input_code')?>",onfocus:"<?php echo L('input_code')?>",oncorrect:"<?php echo L('correct')?>"}).inputValidator({min:1,onerror:'<?php echo L('input_code')?>'}); <?php } }?> }); function preview(uploadid,returnid){ var d = window.top.art.dialog({id:uploadid}).data.iframe; var in_content = d.$("#att-status").html().substring(1); $('#'+returnid).val(in_content); $('#'+returnid+'_s').attr('src', in_content); } </script> <script type="text/javascript" src="<?php echo JS_PATH?>swfupload/swf2ckeditor.js"></script>
108wo
phpcms/modules/poster/templates/poster_add.tpl.php
PHP
asf20
9,132
<?php defined('IN_ADMIN') or exit('No permission resources.'); $show_header = 1; include $this->admin_tpl('header', 'admin'); ?> <form method="post" action="?m=poster&c=space&a=public_tempate_setting" name="myform" id="myform"> <table class="table_form" width="100%" cellspacing="0"> <tbody> <tr> <th width="200"><strong><?php echo L('template_file_name')?>:</strong></th> <td><?php echo $template?><input type="hidden" value="<?php echo $template?>" name="template"></td> </tr> <tr> <th><strong><?php echo L('name_cn')?>:</strong></th> <td><input type="text" size="20" value="<?php echo $info['name']?>" name="info[name]"></td> </tr> <tr> <th><strong><?php echo L('show_this_param')?>:</strong></th> <td><label><input type="radio" value="align"<?php if ($info['align']=='align'){?> checked<?php }?> name="info[align]" onclick="$('#choose_select').show();"> <?php echo L('lightbox')?></label> <label><input type="radio" value="scroll"<?php if ($info['align']=='scroll'){?> checked<?php }?> name="info[align]" onclick="$('#choose_select').show();"> <?php echo L('rolling')?></label></td> </tr> <tr id="choose_select" style="display:<?php if ($info['align']=='') {?>none<?php }?>"> <th><strong><?php echo L('this_param_selected')?>:</strong></th> <td><label><input type="radio" value="1" name="info[select]"<?php if(!isset($info) || $info['select']==1) {?> checked<?php }?>> <?php echo L('yes')?></label> <label><input type="radio" value="0" name="info[select]"<?php if(!isset($info) || $info['select']==0) {?> checked<?php }?>> <?php echo L('no')?></label></td> </tr> <tr> <th><strong><?php echo L('is_set_space')?>:</strong></th> <td><input type="radio" value="1" name="info[padding]"<?php if(!isset($info) || $info['padding']==1) {?> checked<?php }?>> <?php echo L('yes')?> <input type="radio" value="0" name="info[padding]"<?php if(!isset($info) || $info['padding']==0) {?> checked<?php }?>> <?php echo L('no')?></td> </tr> <tr> <th><strong><?php echo L('is_set_size')?>:</strong></th> <td><input type="radio" value="1" name="info[size]"<?php if(!isset($info) || $info['size']==1) {?> checked<?php }?>> <?php echo L('yes')?> <input type="radio" value="0" name="info[size]"<?php if(!isset($info) || $info['size']==0) {?> checked<?php }?>> <?php echo L('no')?></td> </tr> <tr> <th><strong><?php echo L('space_poster')?>:</strong></th> <td><input type="radio" value="1" name="info[option]"<?php if(!isset($info) || $info['option']==1) {?> checked<?php }?>> <?php echo L('all_list')?> <input type="radio" value="0" name="info[option]"<?php if(!isset($info) || $info['option']==0) {?> checked<?php }?>> <?php echo L('only_one')?></td> </tr> <tr> <th><strong><?php echo L('is_used_type')?>:</strong></th> <td><label><input type="checkbox" value="images" name="info[type][]"<?php if (is_array($info['type']) && in_array('images', $info['type'])) {?> checked<?php }?>> <?php echo L('photo')?></label> <label><input type="checkbox" value="flash" name="info[type][]"<?php if (is_array($info['type']) && in_array('flash', $info['type'])) {?> checked<?php }?>> <?php echo L('flash')?></label> <label><input type="checkbox" value="text" name="info[type][]"<?php if (is_array($info['type']) && in_array('text', $info['type'])) {?> checked<?php }?>> <?php echo L('title')?></label></td> </tr> <tr> <th><strong><?php echo L('max_add_param')?>:</strong></th> <td><input type="text" size="10" value="<?php echo $info['num']?>" name="info[num]"></td> </tr> </tbody> </table> <div class="bk15" ><?php if ($info['iscore']) {?><input type="hidden" name="info[iscore]" value="1"><?php } else {?> <input type="submit" name="dosubmit" id="dosubmit" class="dialog" value=" <?php echo L('ok')?> " >&nbsp;<input type="reset" value=" <?php echo L('clear')?> " class='dialog'><?php }?> </div> </form> </body> </html>
108wo
phpcms/modules/poster/templates/template_setting.tpl.php
PHP
asf20
3,915
<?php defined('IN_ADMIN') or exit('No permission resources.'); include $this->admin_tpl('header', 'admin'); ?> <form method="post" action="?m=poster&c=space&a=add" name="myform" id="myform"> <table class="table_form" width="100%" cellspacing="0"> <tbody> <tr> <th width="80"><strong><?php echo L('boardtype')?>:</strong></th> <td><input name="space[name]" id="name" class="input-text" type="text" size="25"></td> </tr> <tr> <th><strong><?php echo L('ads_type')?>:</strong></th> <td><?php echo form::select($TYPES, '', 'name="space[type]" id="type" onchange="AdsType(this.value)"')?>&nbsp;&nbsp;<span id="ScrollSpan" style="padding-left:30px;display:none;"><label><input type="checkbox" id="ScrollBox" name="setting[scroll]" value='1'/><?php echo L('rolling')?></label></span> <span id="AlignSpan" style="padding-left:30px;display:none;"><label><input type="checkbox" id="AlignBox" name="setting[align]" value='1'/><?php echo L('lightbox')?></label></span></td> </tr> <tr id="trPosition" style="display:none;"> <th align="right" valign="top"><strong><?php echo L('position')?>:</strong></th> <td valign="top" colspan="2"> <?php echo L('left_margin')?>:<input name='setting[paddleft]' id='PaddingLeft' type='text' size='5' value=''class="input-text"> px&nbsp;&nbsp; <?php echo L('top_margin')?>:<input name='setting[paddtop]' id='PaddingTop' type='text' size='5' value='' class="input-text" /> px </td> </tr> <tr id="SizeFormat" style="display: ;"> <th><strong><?php echo L('size_format')?>:</strong></th> <td><label><?php echo L('plate_width')?></label><input name="space[width]" id="s_width" class="input-text" type="text" size="10"> px &nbsp;&nbsp;&nbsp;&nbsp; <label><?php echo L('plate_height')?></label><input name="space[height]" type="text" id="h_height" class="input-text" size="10"> px</td> </tr> <tr> <th><strong><?php echo L('description')?>:</strong></th> <td><textarea name="space[description]" id="description" class="input-textarea" cols="45" rows="4"></textarea></td> </tr></tbody> </table> <div class="bk15"></div> <input type="submit" name="dosubmit" id="dosubmit" value=" <?php echo L('ok')?> " class='dialog'>&nbsp;<input type="reset" value=" <?php echo L('clear')?> " class='dialog'> </form> </body> </html> <script language="javascript" type="text/javascript"> function AdsType(adstype) { $('input[type=checkbox]').attr('checked', false); $('#ScrollSpan').css('display', 'none'); $('#AlignSpan').css('display', 'none'); $('#trPosition').css('display', 'none'); $('#SizeFormat').css('display', ''); $('#PaddingLeft').attr('disabled', false); $('#PaddingTop').attr('disabled', false); <?php if (is_array($poster_template) && !empty($poster_template)) { $n = 0; foreach ($poster_template as $key => $p) { if ($n==0) { echo 'if (adstype==\''.$key.'\') {'; } else { echo '} else if (adstype==\''.$key.'\') {'; } if ($p['align']) { if ($p['align']=='align') { echo '$(\'#AlignSpan\').css(\'display\', \'\');'; if ($p['select']) { echo '$(\'#AlignBox\').attr(\'checked\', \'true\');'; echo '$(\'#PaddingLeft\').attr(\'disabled\', true);'; echo '$(\'#PaddingTop\').attr(\'disabled\', true);'; } } elseif ($p['align']=='scroll') { echo '$(\'#ScrollSpan\').css(\'display\', \'\');'; if ($p['select']) { echo '$(\'#ScrollBox\').attr(\'checked\', \'true\');'; } } } if ($p['padding']) { echo '$(\'#trPosition\').css(\'display\', \'\');'; } if (!isset($p['size']) || !$p['size']) { echo '$(\'#SizeFormat\').css(\'display\', \'none\');'; } $n++; } } echo '}'; ?> } $('#AlignBox').click( function (){ if($('#AlignBox').attr('checked')) { $('#PaddingLeft').attr('disabled', true); $('#PaddingTop').attr('disabled', true); } else { $('#PaddingLeft').attr('disabled', false); $('#PaddingTop').attr('disabled', false); } }); $(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();})}}); $("#name").formValidator({onshow:"<?php echo L('please_input_space_name')?>",onfocus:"<?php echo L('spacename_three_length')?>",oncorrect:"<?php echo L('correct')?>"}).inputValidator({min:6,onerror:"<?php echo L('spacename_illegality')?>"}).ajaxValidator({type:"get",url:"",data:"m=poster&c=space&a=public_check_space&spaceid=<?php echo $_GET['spaceid']?>",datatype:"html",cached:false,async:'true',success : function(data) { if( data == "1" ) { return true; } else { return false; } }, error: function(){alert("<?php echo L('server_busy')?>");}, onerror : "<?php echo L('space_exist')?>", onwait : "<?php echo L('checking')?>" }); $('#type').formValidator({onshow:"<?php echo L('choose_space_type')?>",onfocus:"<?php echo L('choose_space_type')?>",oncorrect:"<?php echo L('correct')?>"}).inputValidator(); $('#s_width').formValidator({tipid:"w_hTip",onshow:"<?php echo L('input_width_height')?>",onfocus:"<?php echo L('three_numeric')?>",oncorrect:"<?php echo L('correct')?>"}).inputValidator(); $('#s_width').formValidator({tipid:"w_hTip",onshow:"<?php echo L('choose_space_type')?>",onfocus:"<?php echo L('choose_space_type')?>",oncorrect:"<?php echo L('correct')?>"}).inputValidator(); }) </script>
108wo
phpcms/modules/poster/templates/space_add.tpl.php
PHP
asf20
5,622
<?php defined('IN_ADMIN') or exit('No permission resources.'); include $this->admin_tpl('header', 'admin'); ?> <div class="subnav"> <h2 class="title-1 line-x f14 fb blue lh28"><?php echo L('ad_list')?></h2> <div class="content-menu ib-a blue line-x">   <?php if(isset($big_menu)) echo '<a class="add fb" href="'.$big_menu[0].'"><em>'.$big_menu[1].'</em></a> ';?><a class="on" href="?m=poster&c=space"><em><?php echo L('space_list')?></em></a></div> </div> <div class="pad-lr-10"> <form name="myform" action="?m=poster&c=poster&a=listorder" method="post"> <div class="table-list"> <table width="100%" cellspacing="0" class="contentWrap"> <thead> <tr> <th width="30" align="center"><input type="checkbox" value="" id="check_box" onclick="selectall('id[]');"></th> <th width="35">ID</th> <th width="70"><?php echo L('listorder')?></th> <th align="center"><?php echo L('poster_title')?></th> <th width="70" align="center"><?php echo L('poster_type')?></th> <th width='200' align="center"><?php echo L('for_postion')?></th> <th width="50" align="center"><?php echo L('status')?></th> <th width='50' align="center"><?php echo L('hits')?></th> <th width="130" align="center"><?php echo L('addtime')?></th> <th width="110" align="center"><?php echo L('operations_manage')?></th> </tr> </thead> <tbody> <?php if(is_array($infos)){ foreach($infos as $info){ $space = $this->s_db->get_one(array('spaceid'=>$info['spaceid']), 'name'); ?> <tr> <td align="center"> <input type="checkbox" name="id[]" value="<?php echo $info['id']?>"> </td> <td align="center"><?php echo $info['id']?></td> <th width="70"><input type="text" size="5" name="listorder[<?php echo $info['id']?>]" value="<?php echo $info['listorder']?>" id="listorder"></th> <td><?php echo $info['name']?></td> <td align="center"><?php echo $types[$info['type']]?></td> <td align="center"><?php echo $space['name']?></td> <td align="center"><?php if($info['disabled']) { echo L('stop'); } elseif((strtotime($info['enddate'])<SYS_TIME) && (strtotime($info['enddate'])>0)) { echo L('past'); } else { echo L('start'); }?></td> <td align="center"><?php echo $info['clicks']?></td> <td align="center"><?php echo format::date($info['addtime'], 1);?></td> <td align="center"><a href="###" onclick="edit(<?php echo $info['id']?>, '<?php echo $info['name']?>')" title="<?php echo L('edit')?>" ><?php echo L('edit')?></a>|<a href="?m=poster&c=poster&a=stat&id=<?php echo $info['id']?>&spaceid=<?php echo $_GET['spaceid'];?>"><?php echo L('stat')?></a></td> </tr> <?php } } ?> </tbody> </table> <div class="btn"><label for="check_box"><?php echo L('selected_all')?>/<?php echo L('cancel')?></label> <input name='submit' type='submit' class="button" value='<?php echo L('listorder')?>'>&nbsp; <input name='submit' type='submit' class="button" value='<?php echo L('start')?>' onClick="document.myform.action='?m=poster&c=poster&a=public_approval&passed=0'">&nbsp; <input name='submit' type='submit' class="button" value='<?php echo L('stop')?>' onClick="document.myform.action='?m=poster&c=poster&a=public_approval&passed=1'">&nbsp; <input name="submit" type="submit" class="button" value="<?php echo L('delete')?>" onClick="document.myform.action='?m=poster&c=poster&a=delete';return confirm('<?php echo L('confirm', array('message' => L('selected')))?>')">&nbsp;&nbsp;</div> </div> <div id="pages"><?php echo $this->db->pages;?></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('edit_ads')?>--'+name, id:'edit', iframe:'?m=poster&c=poster&a=edit&id='+id ,width:'600px',height:'430px'}, 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()}); } //--> </script>
108wo
phpcms/modules/poster/templates/poster_list.tpl.php
PHP
asf20
4,153
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title><?php echo L('preview')?></title> </head> <body> <table width="100%" border="0" cellspacing="0" align="center" > <tr align="center" valign="middle"> <td align="center" valign="middle"><?php if($r['type']=='code') { echo $data; } else {?><script language='javascript' src='<?php echo $path;?>'></script><?php }?></td> </tr> </table> </body> </html>
108wo
phpcms/modules/poster/templates/space_preview.tpl.php
PHP
asf20
618
<?php defined('IN_ADMIN') or exit('No permission resources.'); $show_header = $show_validator = $show_scroll = 1; include $this->admin_tpl('header', 'admin'); ?> <div class="pad-10"> <h2 class="title-1 f14 lh28">(<?php echo $r['name'];?>)<?php echo L('get_code_space')?></h2> <div class="bk10"></div> <div class="explain-col"> <strong><?php echo L('explain')?>:</strong><br /> <?php echo L('notice')?> </div> <div class="bk10"></div> <?php if($r['type']=='code') {?> <fieldset> <legend><?php echo L('one_way')?></legend> <?php echo L('js_code')?><font color='red'><?php echo L('this_way_stat_show')?></font><br /> <input name="jscode1" id="jscode1" value='<?php echo $r['path']?>' style="width:416px"> <input type="button" onclick="$('#jscode1').select();document.execCommand('Copy');" value="<?php echo L('copy_code')?>" class="button" style="width:114px"> </fieldset> <?php } else {?> <fieldset> <legend><?php echo L('one_way')?></legend> <?php echo L('js_code')?><font color='red'><?php echo L('this_way_stat_show')?></font><br /> <input name="jscode1" id="jscode1" value='<script language="javascript" src="{APP_PATH}index.php?m=poster&c=index&a=show_poster&id=<?php echo $r['spaceid']?>"></script>' style="width:410px"> <input type="button" onclick="$('#jscode1').select();document.execCommand('Copy');" value="<?php echo L('copy_code')?>" class="button" style="width:114px"> </fieldset> <div class="bk10"></div> <fieldset> <legend><?php echo L('second_code')?></legend> <?php echo L('js_code_html')?><br /> <input name="jscode2" id="jscode2" value='<script language="javascript" src="{APP_PATH}caches/<?php echo $r['path']?>"></script>' style="width:410px"> <input type="button" onclick="$('#jscode2').select();$('#jscode2').val().execCommand('Copy');" class="button" style="width:114px" value="<?php echo L('copy_code')?>"> </fieldset> <?php } ?> </div> </body> </html>
108wo
phpcms/modules/poster/templates/space_call.tpl.php
PHP
asf20
1,932
<?php defined('IN_ADMIN') or exit('No permission resources.'); $show_dialog = $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)) echo '<a class="add fb" href="'.$big_menu[0].'"><em>'.$big_menu[1].'</em></a> ';?> <?php echo admin::submenu($_GET['menuid'],$big_menu); ?><span>|</span><a href="javascript:window.top.art.dialog({id:'setting',iframe:'?m=poster&c=space&a=setting', title:'<?php echo L('module_setting')?>', width:'540', height:'320'}, function(){var d = window.top.art.dialog({id:'setting'}).data.iframe;var form = d.document.getElementById('dosubmit');form.click();return false;}, function(){window.top.art.dialog({id:'setting'}).close()});void(0);"><em><?php echo L('module_setting')?></em></a> </div> </div> <div class="pad-lr-10"> <form name="myform" action="?m=poster&c=space&a=delete" method="post" id="myform"> <div class="table-list"> <table width="100%" cellspacing="0"> <thead> <tr> <th width="6%" align="center"><input type="checkbox" value="" id="check_box" onclick="selectall('spaceid[]');"></th> <th><?php echo L('boardtype')?></th> <th width="12%" align="center"><?php echo L('ads_type')?></th> <th width='10%' align="center"><?php echo L('size_format')?></th> <th width="10%" align="center"><?php echo L('ads_num')?></th> <th align="center" width="13%"><?php echo L('description')?></th> <th width="26%" align="center"><?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="spaceid[]" value="<?php echo $info['spaceid']?>"> </td> <td><?php echo $info['name']?></td> <td align="center"><?php echo $TYPES[$info['type']]?></td> <td align="center"><?php echo $info['width']?>*<?php echo $info['height']?></td> <td align="center"><?php echo $info['items']?></td> <td align="center"><?php echo $info['description']?></td> <td align="center"> <a href="?m=poster&c=space&a=public_preview&spaceid=<?php echo $info['spaceid']?>" target="_blank"><?php echo L('preview')?></a> | <a href="javascript:call(<?php echo $info['spaceid']?>);void(0);"><?php echo L('get_code')?></a> | <a href='?m=poster&c=poster&a=init&spaceid=<?php echo $info['spaceid']?>' ><?php echo L('ad_list')?></a> | <a href="###" onclick="edit(<?php echo $info['spaceid']?>, '<?php echo addslashes(htmlspecialchars($info['name']))?>')" title="<?php echo L('edit')?>" ><?php echo L('edit')?></a> | <a href='?m=poster&c=space&a=delete&spaceid=<?php echo $info['spaceid']?>' onClick="return confirm('<?php echo L('confirm', array('message' => addslashes(htmlspecialchars($info['name']))))?>')"><?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 name="submit" type="submit" class="button" value="<?php echo L('remove_all_selected')?>" onClick="return confirm('<?php echo L('confirm', array('message' => L('selected')))?>')">&nbsp;&nbsp;</div> </div> <div id="pages"><?php echo $pages?></div> </form> </div> <script type="text/javascript"> <!-- function edit(id, name){ window.top.art.dialog({title:'<?php echo L('edit_space')?>--'+name, id:'testIframe'+id, iframe:'?m=poster&c=space&a=edit&spaceid='+id ,width:'540px',height:'320px'}, function(){var d = window.top.art.dialog({id:'testIframe'+id}).data.iframe;// 使用内置接口获取iframe对象 var form = d.document.getElementById('dosubmit');form.click();return false;}, function(){window.top.art.dialog({id:'testIframe'+id}).close()}); }; function call(id) { window.top.art.dialog({id:'call'}).close(); window.top.art.dialog({title:'<?php echo L('get_code')?>', id:'call', iframe:'?m=poster&c=space&a=public_call&sid='+id, width:'600px', height:'470px'}, function(){window.top.art.dialog({id:'call'}).close();}, function(){window.top.art.dialog({id:'call'}).close();}) } //--> </script> </body> </html>
108wo
phpcms/modules/poster/templates/space_list.tpl.php
PHP
asf20
4,221
<?php defined('IN_ADMIN') or exit('No permission resources.'); include $this->admin_tpl('header', 'admin'); ?> <form method="post" action="?m=poster&c=space&a=edit&spaceid=<?php echo $_GET['spaceid']?>" name="myform" id="myform"> <table class="table_form" width="100%" cellspacing="0"> <tbody> <tr> <th width="80"><strong><?php echo L('boardtype')?>:</strong></th> <td><input name="space[name]" class="input-text" id="name" type="text" value="<?php echo htmlspecialchars($info['name'])?>" size="25"></td> </tr> <tr> <th><strong><?php echo L('ads_type')?>:</strong></th> <td><?php echo form::select($TYPES, $info['type'], 'name="space[type]" id="type" onchange="AdsType(this.value)"')?>&nbsp;&nbsp;<span id="ScrollSpan" style="padding-left:30px;display:none;"><label><input type="checkbox" id="ScrollBox" name="setting[scroll]"<?php if($setting['scroll']) {?> checked<?php }?> value='1'/> <?php echo L('rolling')?></label></span> <span id="AlignSpan" style="padding-left:30px;display:none;"><label><input type="checkbox" <?php if($setting['align']) {?> checked<?php }?> id="AlignBox" name="setting[align]" value='1'/> <?php echo L('lightbox')?></label></span></td> </tr> <tr id="trPosition" style="display:none;"> <th align="right" valign="top"><strong><?php echo L('position')?>:</strong></th> <td valign="top" colspan="2"> <?php echo L('left_margin')?>:<input name='setting[paddleft]' id='PaddingLeft' type='text' size='5' value='<?php echo $setting['paddleft']?>' class="input-text"> px&nbsp;&nbsp; <?php echo L('top_margin')?>:<input name='setting[paddtop]' id='PaddingTop' type='text' size='5' value='<?php echo $setting['paddtop']?>' class="input-text" /> px</div> </td> </tr> <tr id="SizeFormat"> <th><strong><?php echo L('size_format')?>:</strong></th> <td><label><?php echo L('plate_width')?></label><input name="space[width]" id="s_width" class="input-text" type="text" value="<?php echo $info['width']?>" size="10"> px &nbsp;&nbsp;&nbsp;&nbsp; <label><?php echo L('plate_height')?></label><input name="space[height]" id="h_height" type="text" class="input-text" value="<?php echo $info['height']?>" size="10"> px<div id="w_hTip"></div></td> </tr> <tr> <th><strong><?php echo L('description')?>:</strong></th> <td><textarea name="space[description]" id="description" class="input-textarea" cols="45" rows="4"><?php echo $info['description']?></textarea></td> </tr></tbody> </table> <div class="bk15"></div> <input type="hidden" name="old_type" value="<?php echo $info['type']?>"> <input type="submit" name="dosubmit" id="dosubmit" class='dialog' value="2"/></form> </body> </html> <script language="javascript" type="text/javascript"> function AdsType(adstype) { $('input[type=checkbox]').attr('checked', false); $('#ScrollSpan').css('display', 'none'); $('#AlignSpan').css('display', 'none'); $('#trPosition').css('display', 'none'); $('#SizeFormat').css('display', ''); $('#PaddingLeft').attr('disabled', false); $('#PaddingTop').attr('disabled', false); <?php if (is_array($poster_template) && !empty($poster_template)) { $n = 0; foreach ($poster_template as $key => $p) { if ($n==0) { echo 'if (adstype==\''.$key.'\') {'; } else { echo '} else if (adstype==\''.$key.'\') {'; } if ($p['align']) { if ($p['align']=='align') { echo '$(\'#AlignSpan\').css(\'display\', \'\');'; if ($setting['align']) { echo '$(\'#AlignBox\').attr(\'checked\', \'true\');'; echo '$(\'#PaddingLeft\').attr(\'disabled\', true);'; echo '$(\'#PaddingTop\').attr(\'disabled\', true);'; } } elseif ($p['align']=='scroll') { echo '$(\'#ScrollSpan\').css(\'display\', \'\');'; if ($setting['scroll']) { echo '$(\'#ScrollBox\').attr(\'checked\', \'true\');'; } } } if ($p['padding']) { echo '$(\'#trPosition\').css(\'display\', \'\');'; } if (!isset($p['size']) || !$p['size']) { echo '$(\'#SizeFormat\').css(\'display\', \'none\');'; } $n++; } } echo '}'; ?> } $('#AlignBox').click( function (){ if($('#AlignBox').attr('checked')) { $('#PaddingLeft').attr('disabled', true); $('#PaddingTop').attr('disabled', true); } else { $('#PaddingLeft').attr('disabled', false); $('#PaddingTop').attr('disabled', false); } }); AdsType($('#type').val()); $(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();})}}); $("#name").formValidator({onshow:"<?php echo L('please_input_space_name')?>",onfocus:"<?php echo L('spacename_three_length')?>",oncorrect:"<?php echo L('correct')?>"}).inputValidator({min:6,onerror:"<?php echo L('spacename_illegality')?>"}).ajaxValidator({type:"get",url:"",data:"m=poster&c=space&a=public_check_space&spaceid=<?php echo $_GET['spaceid']?>",datatype:"html",cached:false,async:'true',success : function(data) { if( data == "1" ) { return true; } else { return false; } }, error: function(){alert("<?php echo L('server_busy')?>");}, onerror : "<?php echo L('space_exist')?>", onwait : "<?php echo L('checking')?>" }).defaultPassed(); $('#type').formValidator({onshow:"<?php echo L('choose_space_type')?>",onfocus:"<?php echo L('choose_space_type')?>",oncorrect:"<?php echo L('correct')?>"}).inputValidator(); $('#s_width').formValidator({tipid:"w_hTip",onshow:"<?php echo L('input_width_height')?>",onfocus:"<?php echo L('three_numeric')?>",oncorrect:"<?php echo L('correct')?>"}).inputValidator().defaultPassed(); }) </script>
108wo
phpcms/modules/poster/templates/space_edit.tpl.php
PHP
asf20
5,891
<?php defined('IN_ADMIN') or exit('No permission resources.'); $show_header = $show_validator = $show_scroll = 1; include $this->admin_tpl('header', 'admin'); $authkey = upload_key('1,'.$this->M['ext'].',1'); ?> <form method="post" action="?m=poster&c=poster&a=edit&id=<?php echo $_GET['id']?>&spaceid=<?php echo $info['spaceid']?>" id="myform"> <table class="table_form" width="100%" cellspacing="0"> <tbody> <tr> <th width="100"><?php echo L('poster_title')?>:</th> <td><input name="poster[name]" id="name" value="<?php echo $info['name']?>" class="input-text" type="text" size="25"></td> </tr> <tr> <th><?php echo L('for_postion')?>:</th> <td><b style="color:#F60;"><?php echo $sinfo['name']?></b>&nbsp;[<?php echo $TYPES[$sinfo['type']]?>]</td> </tr> <tr> <th align="right" valign="top"><?php echo L('poster_type')?>:</th> <td valign="top" colspan="2"><?php echo form::select($setting['type'], trim($info['type']), 'name="poster[type]" id="type" onchange="AdsType(this.value)"', $default);?> </td> </tr> <tr> <th><?php echo L('line_time')?>:</th> <td><?php echo form::date('poster[startdate]', date('Y-m-d H:i:s', $info['startdate']), 1)?></td> </tr> <tr> <th><?php echo L('down_time')?>:</th> <td><?php echo form::date('poster[enddate]', date('Y-m-d H:i:s', $info['enddate']), 1)?></td> </tr> </tbody> </table><?php if(array_key_exists('images', $setting['type'])) {?><div class="pad-10" id="imagesdiv" style="display:<?php if($info['type']=='flash') {?>none;<?php }?>"> <fieldset> <legend><?php echo L('photo_setting')?></legend> <?php if($setting['num']>1) { for($i=1; $i<=$setting['num']; $i++) {?> <table width="100%" class="table_form"> <tbody> <tr> <th width="80"><?php echo L('linkurl')?>:</th> <td class="y-bg"><input type="text" class="input-text" name="setting[images][<?php echo $i;?>][linkurl]" id="linkurl<?php echo $i;?>" size="30" value="<?php echo $info['setting'][$i]['linkurl']?>" /></td> <td rowspan="2"><a href="javascript:flashupload('imgurl<?php echo $i;?>_images', '<?php echo L('upload_photo')?>','imgurl<?php echo $i;?>',preview,'1,<?php echo $this->M['ext']?>,1','poster', '', '<?php echo $authkey?>');void(0);"><img src="<?php echo $info['setting'][$i]['imageurl']?>" id="imgurl<?php echo $i;?>_s" width="105" height="88" onerror="this.src='<?php echo IMG_PATH;?>nopic.gif'"></a><input type="hidden" id="imgurl<?php echo $i;?>" name="setting[images][<?php echo $i;?>][imageurl]" value="<?php echo $info['setting'][$i]['imageurl']?>"></td> </tr> <tr> <th><?php echo L('alt')?>:</th> <td class="y-bg"><input type="text" class="input-text" name="setting[images][<?php echo $i;?>][alt]" id="alt<?php echo $i;?>" value="<?php echo $info['setting'][$i]['alt']?>" size="30" /></td> </tr> </table> <?php } } else {?> <table width="100%" class="table_form"> <tbody> <tr> <th width="80"><?php echo L('linkurl')?>:</th> <td class="y-bg"><input type="text" class="input-text" name="setting[images][1][linkurl]" id="linkurl3" size="30" value="<?php echo $info['setting'][1]['linkurl']?>" /></td> <td rowspan="2"><a href="javascript:flashupload('imgurl_images', '<?php echo L('flash_upload')?>','imgurl',preview,'1,<?php echo $this->M['ext']?>,1','poster', '', '<?php echo $authkey?>');void(0);"><img src="<?php echo $info['setting'][1]['imageurl']?>" id="imgurl_s" width="105" height="88" onerror="this.src='<?php echo IMG_PATH;?>nopic.gif'"></a><input type="hidden" id="imgurl" name="setting[images][1][imageurl]" value="<?php echo $info['setting'][1]['imageurl']?>"></td> </tr> <tr> <th><?php echo L('alt')?>:</th> <td class="y-bg"><input type="text" class="input-text" name="setting[images][1][alt]" value="<?php echo $info['setting'][1]['alt']?>" id="alt3" size="30" /></td> </tr> </tbody> </table> <?php } ?> </fieldset></div><?php } if(array_key_exists('flash', $setting['type'])) {?> <div class="pad-10" id="flashdiv" style="display:<?php if($info['type']=='images') {?>none<?php }?>;"> <fieldset> <legend><?php echo L('flash_setting')?></legend> <?php if($setting['num']>1) { for($i=1; $i<=$setting['num']; $i++) {?> <table width="100%" class="table_form"> <tbody> <tr> <th width="80"><?php echo L('flash_url')?>:</th> <td class="y-bg"><input type="text" class="input-text" name="setting[flash][<?php echo $i;?>][flashurl]" value="<?php echo $info['setting'][$i]['flashurl']?>" id="flashurl<?php echo $i;?>" size="40" /></td> <td class="y-bg"><input type="button" class="button" onclick="javascript:flashupload('flashurl<?php echo $i;?>_images', '<?php echo L('flash_upload')?>','flashurl<?php echo $i;?>',submit_attachment,'1,<?php echo $this->M['ext']?>,1','poster', '', '<?php echo $authkey?>')" value="<?php echo L('flash_upload')?>"></td> </tr> </tbody> </table> <?php } } else {?> <table width="100%" class="table_form"> <tbody> <tr> <th width="80"><?php echo L('flash_url')?>:</th> <td class="y-bg"><input type="text" class="input-text" name="setting[flash][1][flashurl]" id="flashurl" size="40" value="<?php echo $info['setting'][1]['flashurl']?>" /></td> <td class="y-bg"><input type="button" class="button" onclick="javascript:flashupload('flashurl_images', '<?php echo L('flash_upload')?>','flashurl',submit_attachment,'1,<?php echo $this->M['ext']?>,1','poster', '', '<?php echo $authkey?>')" value="<?php echo L('flash_upload')?>"></td> </tr> </tbody> </table> <?php } ?> </fieldset></div><?php } if(array_key_exists('text', $setting['type'])) {?><div class="pad-10" id="textdiv" style="display:"> <fieldset> <legend><?php if ($sinfo['type']=='text') { echo L('word_link'); } elseif ($sinfo['type']=='code') { echo L('code_setting'); } ?></legend> <table width="100%" class="table_form"> <tbody> <?php if($sinfo['type']=='text') {?> <tr> <th width="80"><?php echo L('word_content')?>:</th> <td class="y-bg"><input type="text" class="input-text" name="setting[text][1][title]" value="<?php echo $info['setting'][1]['title']?>" id="title" size="30" /></td> </tr> <tr> <th><?php echo L('linkurl')?>:</th> <td class="y-bg"><input type="text" class="input-text" name="setting[text][1][linkurl]" id="link" size="30" value="<?php echo $info['setting'][1]['linkurl']?>" /></td> </tr> <?php } elseif($sinfo['type']=='code') {?> <tr> <th width="80"><?php echo L('code_content')?>:</th> <td class="y-bg"><textarea name="setting[text][code]" id="code" cols="55" rows="6"><?php echo $info['setting']['code']?></textarea></td> </tr><?php }?> </tbody> </table> </fieldset></div><?php }?> <div class="bk15"></div> <input type="submit" name="dosubmit" id="dosubmit" value=" <?php echo L('ok')?> " class="dialog">&nbsp;<input type="reset" value=" <?php echo L('clear')?> " class="dialog"> </form> </body> </html> <script type="text/javascript"> function AdsType(type) { $('#imagesdiv').css('display', 'none'); $('#flashdiv').css('display', 'none'); $('#'+type+'div').css('display', ''); } $(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();})}}); $('#name').formValidator({onshow:"<?php echo L('please_input_name')?>",onfocus:"<?php echo L('name_three_length')?>",oncorrect:"<?php echo L('correct')?>"}).inputValidator({min:6,onerror:"<?php echo L('adsname_no_empty')?>"}).ajaxValidator({type:"get",url:"",data:"m=poster&c=poster&a=public_check_poster",datatype:"html",cached:false,async:'true',success : function(data) { if( data == "1" ) { return true; } else { return false; } }, error: function(){alert("<?php echo L('server_busy')?>");}, onerror : "<?php echo L('ads_exist')?>", onwait : "<?php echo L('checking')?>" }).defaultPassed(); $('#type').formValidator({onshow:"<?php echo L('choose_ads_type')?>",onfocus:"<?php echo L('type_selected')?>",oncorrect:"<?php echo L('correct')?>"}).inputValidator({min:1,onerror: "<?php echo L('choose_ads_type')?>"}); $('#startdate').formValidator({onshow:"<?php echo L('online_time')?>",onfocus:"<?php echo L('online_time')?>",oncorrect:"<?php echo L('correct')?>"}).functionValidator({fun:isDateTime}); $('#enddate').formValidator({onshow:"<?php echo L('one_month_no_select')?>",onfocus:"<?php echo L('down_time')?>",oncorrect:"<?php echo L('correct')?>"}).inputValidator(); <?php if(array_key_exists('text', $setting['type'])) {?> <?php if($sinfo['type']=='text') {?> $('#title').formValidator({onshow:'<?php echo L('link_content')?>',onfoucs:'<?php echo L('link_content')?>',oncorrect:'<?php echo L('correct')?>'}).inputValidator({min:1,onerror:'<?php echo L('no_link_content')?>'}); <?php } elseif($sinfo['type']=='code') {?> $('#code').formValidator({onshow:"<?php echo L('input_code')?>",onfocus:"<?php echo L('input_code')?>",oncorrect:"<?php echo L('correct')?>"}).inputValidator({min:1,onerror:'<?php echo L('input_code')?>'}); <?php } }?> }); function preview(uploadid,returnid){ var d = window.top.art.dialog({id:uploadid}).data.iframe; var in_content = d.$("#att-status").html().substring(1); $('#'+returnid).val(in_content); $('#'+returnid+'_s').attr('src', in_content); } </script> <script type="text/javascript" src="<?php echo JS_PATH?>swfupload/swf2ckeditor.js"></script>
108wo
phpcms/modules/poster/templates/poster_edit.tpl.php
PHP
asf20
9,599
<?php defined('IN_ADMIN') or exit('No permission resources.'); $show_header = 1; include $this->admin_tpl('header', 'admin'); ?> <form method="post" action="?m=poster&c=space&a=setting" id="myform" name="myform"> <table width="100%" cellpadding="0" cellspacing="1" class="table_form"> <tr> <th width="130"><?php echo L('ads_show_time')?></th> <td><input type='radio' name='setting[enablehits]' value='1' <?php if($enablehits == 1) {?>checked<?php }?>> <?php echo L('yes')?>&nbsp;&nbsp;&nbsp;&nbsp; <input type='radio' name='setting[enablehits]' value='0' <?php if($enablehits == 0) {?>checked<?php }?>> <?php echo L('no')?></td> </tr> <tr> <th><?php echo L('upload_file_ext')?>:</th> <td><input name='setting[ext]' type='text' id='ext' value='<?php echo $ext?>' size='40' maxlength='70'></td> </tr> <tr> <th><?php echo L('file_size')?>:</th> <td><input name='setting[maxsize]' type='text' id='maxsize' value='<?php echo $maxsize?>' size='12'> M</td> </tr> <tr> <td>&nbsp;</td> <td><input type="submit" name="dosubmit" id="dosubmit" class="dialog" value=" <?php echo L('ok')?> ">&nbsp;<input type="reset" class="dialog" value=" <?php echo L('clear')?> "></td> </tr> </table> </form> </body> </html>
108wo
phpcms/modules/poster/templates/setting.tpl.php
PHP
asf20
1,258
<?php defined('IN_ADMIN') or exit('No permission resources.'); $show_dialog = $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)) echo '<a class="add fb" href="'.$big_menu[0].'"><em>'.$big_menu[1].'</em></a> ';?> <?php echo admin::submenu($_GET['menuid'],$big_menu); ?><span>|</span><a href="javascript:window.top.art.dialog({id:'setting',iframe:'?m=poster&c=space&a=setting', title:'<?php echo L('module_setting')?>', width:'540', height:'320'}, function(){var d = window.top.art.dialog({id:'setting'}).data.iframe;var form = d.document.getElementById('dosubmit');form.click();return false;}, function(){window.top.art.dialog({id:'setting'}).close()});void(0);"><em><?php echo L('module_setting')?></em></a> </div> </div> <div class="pad-lr-10"> <div class="table-list"> <table width="100%" cellspacing="0"> <thead> <tr> <th width="50" align="center"><?php echo L('template_name')?></th> <th width="24%" align="center"><?php echo L('operations_manage')?></th> </tr> </thead> <tbody> <?php if(is_array($templates)){ foreach($templates as $info){ ?> <tr> <td><?php if ($poster_template[$info]['name']) { echo $poster_template[$info]['name'].' ('.$info.')'; } else { echo $info; }?></td> <td align="center"> <a href="javascript:<?php if ($poster_template[$info]['iscore']) {?>check<?php } else {?>edit<?php }?>('<?php echo addslashes(htmlspecialchars($info))?>', '<?php echo addslashes(htmlspecialchars($poster_template[$info]['name']))?>');void(0);"><?php if ($poster_template[$info]['iscore']) { echo L('check_template'); } else { echo '<font color="#009933">'.L('setting_template').'</font>'; }?></a> | <a href="?m=poster&c=space&a=public_tempate_del&id=<?php echo $info?>"><?php echo L('delete')?></a> </td> </tr> <?php } } ?> </tbody> </table> </div> <div id="pages"><?php echo $this->pages?></div> </div> <script type="text/javascript"> <!-- function edit(id, name) { window.top.art.dialog({id:'testIframe'}).close(); window.top.art.dialog({title:name, id:'testIframe', iframe:'?m=poster&c=space&a=public_tempate_setting&template='+id ,width:'540px',height:'360px'}, function(){var d = window.top.art.dialog({id:'testIframe'}).data.iframe;// 使用内置接口获取iframe对象 var form = d.document.getElementById('dosubmit');form.click();return false;}, function(){window.top.art.dialog({id:'testIframe'}).close()}); }; function check(id, name) { window.top.art.dialog({id:'testIframe'}).close(); window.top.art.dialog({title:name, id:'testIframe', iframe:'?m=poster&c=space&a=public_tempate_setting&template='+id ,width:'540px',height:'360px'}) } //--> </script> </body> </html>
108wo
phpcms/modules/poster/templates/poster_template.tpl.php
PHP
asf20
2,866
<?php return array ( 'banner' => array ( 'name' => '矩形横幅', 'select' => '0', 'padding' => '0', 'size' => '1', 'option' => '0', 'num' => '1', 'iscore' => '1', 'type' => array ( 'images' => '图片', 'flash' => '动画', ), ), 'fixure' => array ( 'name' => '固定位置', 'align' => 'align', 'select' => '1', 'padding' => '1', 'size' => '1', 'option' => '0', 'num' => '1', 'iscore' => '1', 'type' => array ( 'images' => '图片', 'flash' => '动画', ), ), 'float' => array ( 'name' => '漂浮移动', 'select' => '0', 'padding' => '1', 'size' => '1', 'option' => '0', 'num' => '1', 'iscore' => '1', 'type' => array ( 'images' => '图片', 'flash' => '动画', ), ), 'couplet' => array ( 'name' => '对联广告', 'align' => 'scroll', 'select' => '0', 'padding' => '1', 'size' => '1', 'option' => '0', 'num' => '2', 'iscore' => '1', 'type' => array ( 'images' => '图片', 'flash' => '动画', ), ), 'imagechange' => array ( 'name' => '图片轮换广告', 'select' => '0', 'padding' => '0', 'size' => '1', 'option' => '1', 'num' => '1', 'iscore' => '1', 'type' => array ( 'images' => '图片', ), ), 'imagelist' => array ( 'name' => '图片列表广告', 'select' => '0', 'padding' => '0', 'size' => '1', 'option' => '1', 'num' => '1', 'iscore' => '1', 'type' => array ( 'images' => '图片', ), ), 'text' => array ( 'name' => '文字广告', 'select' => '0', 'padding' => '0', 'size' => '0', 'option' => '1', 'num' => '1', 'iscore' => '1', 'type' => array ( 'text' => '文字', ), ), 'code' => array ( 'name' => '代码广告', 'type' => array ( 'text' => '代码', ), 'num' => 1, 'iscore' => 1, 'option' => 0, ), ); ?>
108wo
phpcms/modules/poster/poster_template.cache.php
PHP
asf20
2,079
<?php return array ( 'banner' => array ( 'name' => '矩形横幅', 'select' => '0', 'padding' => '0', 'size' => '1', 'option' => '0', 'num' => '1', 'iscore' => '1', 'type' => array ( 'images' => '图片', 'flash' => '动画', ), ), 'fixure' => array ( 'name' => '固定位置', 'align' => 'align', 'select' => '1', 'padding' => '1', 'size' => '1', 'option' => '0', 'num' => '1', 'iscore' => '1', 'type' => array ( 'images' => '图片', 'flash' => '动画', ), ), 'float' => array ( 'name' => '漂浮移动', 'select' => '0', 'padding' => '1', 'size' => '1', 'option' => '0', 'num' => '1', 'iscore' => '1', 'type' => array ( 'images' => '图片', 'flash' => '动画', ), ), 'couplet' => array ( 'name' => '对联广告', 'align' => 'scroll', 'select' => '0', 'padding' => '1', 'size' => '1', 'option' => '0', 'num' => '2', 'iscore' => '1', 'type' => array ( 'images' => '图片', 'flash' => '动画', ), ), 'imagechange' => array ( 'name' => '图片轮换广告', 'select' => '0', 'padding' => '0', 'size' => '1', 'option' => '1', 'num' => '1', 'iscore' => '1', 'type' => array ( 'images' => '图片', ), ), 'imagelist' => array ( 'name' => '图片列表广告', 'select' => '0', 'padding' => '0', 'size' => '1', 'option' => '1', 'num' => '1', 'iscore' => '1', 'type' => array ( 'images' => '图片', ), ), 'text' => array ( 'name' => '文字广告', 'select' => '0', 'padding' => '0', 'size' => '0', 'option' => '1', 'num' => '1', 'iscore' => '1', 'type' => array ( 'text' => '文字', ), ), 'code' => array ( 'name' => '代码广告', 'type' => array ( 'text' => '代码', ), 'num' => 1, 'iscore' => 1, 'option' => 0, ), ); ?>
108wo
phpcms/modules/poster/poster_template_1.cache.php
PHP
asf20
2,079