code stringlengths 1 2.01M | language stringclasses 1
value |
|---|---|
function title($field, $value) {
$value = htmlspecialchars($value);
return $value;
}
| PHP |
<?php
class content_input {
var $modelid;
var $fields;
var $data;
function __construct($modelid) {
$this->db = pc_base::load_model('sitemodel_field_model');
$this->db_pre = $this->db->db_tablepre;
$this->modelid = $modelid;
$this->fields = getcache('model_field_'.$modelid,'model');
//初始化附件类... | PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
$defaultvalue = isset($_POST['setting']['defaultvalue']) ? $_POST['setting']['defaultvalue'] : '';
//正整数 UNSIGNED && SIGNED
$minnumber = isset($_POST['setting']['minnumber']) ? $_POST['setting']['minnumber'] : 1;
$decimaldigits = isset($_POST['setting'... | PHP |
function map($field, $value, $fieldinfo) {
extract($fieldinfo);
$setting = string2array($setting);
$size = $setting['size'];
$errortips = $this->fields[$field]['errortips'];
$modelid = $this->fields[$field]['modelid'];
$tips = $value ? L('editmark','','map') : L('addmark','','map');
return '<input... | PHP |
<?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 = 0; //作为搜索条件
$field_allow_fulltext = 0; /... | PHP |
<?php defined('IN_PHPCMS') or exit('No permission resources.');?>
<table cellpadding="2" cellspacing="1" width="98%">
<tr>
<td>地图接口选择</td>
<td>
<input type="radio" name="setting[maptype]" value="2" <?php if($setting['maptype']==2) echo 'checked';?>> 百度地图
</td>
</tr>
<tr>
<td>... | PHP |
function map($field, $value) {
$str = '';
$setting = string2array($this->fields[$field]['setting']);
$setting[width] = $setting[width] ? $setting[width] : '600';
$setting[height] = $setting[height] ? $setting[height] : '400';
list($lngX, $latY,$zoom) = explode('|', $value);
if($setting['maptype']==1)... | PHP |
<?php
class content_output {
var $fields;
var $data;
function __construct($modelid,$catid = 0,$categorys = array()) {
$this->modelid = $modelid;
$this->catid = $catid;
$this->categorys = $categorys;
$this->fields = getcache('model_field_'.$modelid,'model');
}
function get($data) {
$this->... | PHP |
<?php
$fields = array('text'=>'单行文本',
'textarea'=>'多行文本',
'editor'=>'编辑器',
'catid'=>'栏目',
'title'=>'标题',
'box'=>'选项',
'image'=>'图片',
'images'=>'多图片',
'number'=>'数字',
'datetime'=>'日期和时间',
'posid'=>'推荐位',
'keyword'=>'关键词',
'author'=>'作者',
'copyfrom'=>'来源',... | PHP |
<?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; /... | PHP |
<?php defined('IN_PHPCMS') or exit('No permission resources.');?> | PHP |
function keyword($field, $value) {
if($value == '') return '';
$v = '';
if(strpos($value, ',')===false) {
$tags = explode(' ', $value);
} else {
$tags = explode(',', $value);
}
return $tags;
}
| PHP |
<?php
if(!$maxlength) $maxlength = 255;
$maxlength = min($maxlength, 255);
$fieldtype = $issystem ? 'CHAR' : 'VARCHAR';
$sql = "ALTER TABLE `$tablename` CHANGE `$field` `$field` $fieldtype( $maxlength ) NOT NULL DEFAULT '$defaultvalue'";
$db->query($sql);
?> | PHP |
function omnipotent($field, $value, $fieldinfo) {
extract($fieldinfo);
$formtext = str_replace('{FIELD_VALUE}',$value,$formtext);
$formtext = str_replace('{MODELID}',$this->modelid,$formtext);
preg_match_all('/{FUNC\((.*)\)}/',$formtext,$_match);
foreach($_match[1] as $key=>$match_func) {
$string = ... | PHP |
<?php
$db->query("ALTER TABLE `$tablename` DROP `$field`");
?> | PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
$field_type = 'varchar'; //字段数据库类型
$field_basic_table = 0; //是否允许作为主表字段
$field_allow_index = 0; //是否允许建立索引
$field_minlength = 0; //字符长度默认最小值
$field_maxlength = ''; //字符长度默认最大值
$field_allow_search = 1; //作为搜索条件
$field_allow_fulltext = 0; /... | PHP |
<?php defined('IN_PHPCMS') or exit('No permission resources.');?>
<table cellpadding="2" cellspacing="1" width="98%">
<tr>
<td width="100">表单</td>
<td><textarea name="setting[formtext]" rows="2" cols="20" id="options" style="height:100px;width:400px;"><?php echo htmlspecialchars($setting['formtext']);?></... | PHP |
function linkage($field, $value, $fieldinfo) {
$setting = string2array($fieldinfo['setting']);
$linkageid = $setting['linkageid'];
return menu_linkage($linkageid,$field,$value);
}
| PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
$field_type = 'number'; //字段数据库类型
$field_basic_table = 1; //是否允许作为主表字段
$field_allow_index = 1; //是否允许建立索引
$field_minlength = 0; //字符长度默认最小值
$field_maxlength = ''; //字符长度默认最大值
$field_allow_search = 1; //作为搜索条件
$field_allow_fulltext = 0; //... | PHP |
<?php defined('IN_PHPCMS') or exit('No permission resources.');?>
<table cellpadding="2" cellspacing="1" width="98%">
<tr>
<td>菜单ID</td>
<td><input type="text" id="linkageid" name="setting[linkageid]" value="<?php echo $setting['linkageid'];?>" size="5">
<input type='button' value="在列表中选择" onclic... | PHP |
function linkage($field, $value) {
$setting = string2array($this->fields[$field]['setting']);
$datas = getcache($setting['linkageid'],'linkage');
$infos = $datas['data'];
if($setting['showtype']==1 || $setting['showtype']==3) {
$result = get_linkage($value, $setting['linkageid'], $setting['space'], $se... | PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
$field_type = 'number'; //字段数据库类型
$field_basic_table = 1; //是否允许作为主表字段
$field_allow_index = 1; //是否允许建立索引
$field_minlength = 0; //字符长度默认最小值
$field_maxlength = ''; //字符长度默认最大值
$field_allow_search = 1; //作为搜索条件
$field_allow_fulltext = 0; //... | PHP |
<?php defined('IN_PHPCMS') or exit('No permission resources.');?>
<table cellpadding="2" cellspacing="1" width="98%">
<tr>
<td width="100">输入框大小</td>
<td><input type="text" name="setting[size]" value="<?php echo $setting['size'];?>" size="6" class="input-text"></td>
</tr>
</table> | PHP |
<?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; /... | PHP |
<?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[defaultvalue]" value="<?php echo $setting['defaultvalue'];?>" size="40" class="input-text" ></td>
</tr>
</table> | PHP |
<?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... | PHP |
<?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>
... | PHP |
function images($field, $value) {
return string2array($value);
}
| PHP |
function images($field, $value) {
//取得图片列表
$pictures = $_POST[$field.'_url'];
//取得图片说明
$pictures_alt = isset($_POST[$field.'_alt']) ? $_POST[$field.'_alt'] : array();
$array = $temp = array();
if(!empty($pictures)) {
foreach($pictures as $key=>$pic) {
$temp['url'] = $pic;
$temp['alt'] =... | PHP |
<?php
class content_form {
var $modelid;
var $fields;
var $id;
var $formValidator;
function __construct($modelid,$catid = 0,$categorys = array()) {
$this->modelid = $modelid;
$this->catid = $catid;
$this->categorys = $categorys;
$this->fields = getcache('model_field_'.$modelid,'model');
$... | PHP |
<?php
if(!$maxlength) $maxlength = 255;
$maxlength = min($maxlength, 255);
$fieldtype = $issystem ? 'CHAR' : 'VARCHAR';
$sql = "ALTER TABLE `$tablename` CHANGE `$field` `$field` $fieldtype( $maxlength ) NOT NULL DEFAULT '$defaultvalue'";
$db->query($sql);
?> | PHP |
function textarea($field, $value, $fieldinfo) {
extract($fieldinfo);
$setting = string2array($setting);
extract($setting);
if(!$value) $value = $defaultvalue;
$allow_empty = 'empty:true,';
if($minlength || $pattern) $allow_empty = '';
if($errortips) $this->formValidator .= '$("#'.$field.'").formVa... | PHP |
<?php
$db->query("ALTER TABLE `$tablename` DROP `$field`");
?> | PHP |
function text($field, $value, $fieldinfo)
{
return form::text($field, $field, $value, 'text', 15);
}
| PHP |
<?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 = 1... | PHP |
function text($field, $value)
{
return $value === '' ? '' : " `$field` LIKE '%$value%' ";
}
| PHP |
<?php defined('IN_PHPCMS') or exit('No permission resources.');?>
<table cellpadding="2" cellspacing="1" width="98%">
<tr>
<td width="100">文本域宽度</td>
<td><input type="text" name="setting[width]" value="<?php echo $setting['width'];?>" size="10" class="input-text" > %</td>
</tr>
<tr>
<td... | PHP |
function textarea($field, $value) {
if(!$this->fields[$field]['enablehtml']) $value = strip_tags($value);
return $value;
}
| PHP |
<?php
class content_update {
var $modelid;
var $fields;
var $data;
function __construct($modelid,$id) {
$this->modelid = $modelid;
$this->fields = getcache('model_field_'.$modelid,'model');
$this->id = $id;
}
function update($data) {
$info = array();
$this->data = $data;
foreach($... | PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
$field_type = 'number'; //字段数据库类型
$field_basic_table = 1; //是否允许作为主表字段
$field_allow_index = 1; //是否允许建立索引
$field_minlength = 0; //字符长度默认最小值
$field_maxlength = ''; //字符长度默认最大值
$field_allow_search = 1; //作为搜索条件
$field_allow_fulltext = 0; //... | PHP |
<table cellpadding="2" cellspacing="1" width="98%">
<tr>
<td width="100">取值范围</td>
<td><input type="text" name="setting[minnumber]" value="1" size="5" class="input-text"> - <input type="text" name="setting[maxnumber]" value="" size="5" class="input-text"></td>
</tr>
<tr>
<td>小数位数:</td>
... | PHP |
<?php defined('IN_PHPCMS') or exit('No permission resources.');?>
<table cellpadding="2" cellspacing="1" width="98%">
<tr>
<td width="100">取值范围</td>
<td><input type="text" name="setting[minnumber]" value="<?php echo $setting['minnumber'];?>" size="5" class="input-text"> - <input type="text" name="sett... | PHP |
function editor($field, $value, $fieldinfo) {
$grouplist = getcache('grouplist','member');
$_groupid = param::get_cookie('_groupid');
$grouplist = $grouplist[$_groupid];
extract($fieldinfo);
extract(string2array($setting));
$disabled_page = isset($disabled_page) ? $disabled_page : 0;
if(!$height) ... | PHP |
<?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 = 1... | PHP |
<table cellpadding="2" cellspacing="1" width="98%">
<tr>
<td width="100">编辑器样式:</td>
<td><input type="radio" name="setting[toolbar]" value="basic" checked> 简洁型 <input type="radio" name="setting[toolbar]" value="full"> 标准型 </td>
</tr>
<tr>
<td>默认值:</td>
<td><textarea name="setting[... | PHP |
<?php defined('IN_PHPCMS') or exit('No permission resources.');?>
<table cellpadding="2" cellspacing="1" width="98%">
<tr>
<td width="225">编辑器样式:</td>
<td><input type="radio" name="setting[toolbar]" value="basic" <?php if($setting['toolbar']=='basic') echo 'checked';?>>简洁型 <input type="radio" name="se... | PHP |
function editor($field, $value) {
$setting = string2array($this->fields[$field]['setting']);
if($setting['enablekeylink']) {
$value = $this->_keylinks($value, $setting['replacenum'],$setting['link_mode']);
}
return $value;
}
function _base64_encode($t,$str) {
return $t."\"".base64_encode($str)."... | PHP |
function editor($field, $value) {
$setting = string2array($this->fields[$field]['setting']);
$enablesaveimage = $setting['enablesaveimage'];
if(isset($_POST['spider_img'])) $enablesaveimage = 0;
if($enablesaveimage) {
$site_setting = string2array($this->site_config['setting']);
$watermark_enable = ... | PHP |
function editor($field, $value) {
$attachment_db = pc_base::load_model('attachment_model');
$attachment_db->api_update($GLOBALS['downloadfiles'],'c-'.$this->data['catid'].'-'.$this->id,1);
return $value;
} | PHP |
function posid($field, $value, $fieldinfo) {
$setting = string2array($fieldinfo['setting']);
$position = getcache('position','commons');
if(empty($position)) return '';
$array = array();
foreach($position as $_key=>$_value) {
if($_value['modelid'] && ($_value['modelid'] != $this->modelid) || ($_val... | PHP |
<?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; /... | PHP |
<?php defined('IN_PHPCMS') or exit('No permission resources.');?>
<table cellpadding="2" cellspacing="1" width="98%">
<tr>
<td width="200">每个位置宽度</td>
<td><input type="text" name="setting[width]" value="<?php echo $setting['width'];?>" size="5" class="input-text"> px
</td>
</tr>
<tr>
... | PHP |
function posid($field, $value) {
$number = count($value);
$value = $number==1 ? 0 : 1;
return $value;
}
| PHP |
function posid($field, $value) {
if(!empty($value) && is_array($value)) {
if($_GET['a']=='add') {
$position_data_db = pc_base::load_model('position_data_model');
$textcontent = array();
foreach($value as $r) {
if($r!='-1') {
if(empty($textcontent)) {
foreach($this->fields AS ... | PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
$field_type = 'varchar'; //字段数据库类型
$field_basic_table = 1; //是否允许作为主表字段
$field_allow_index = 0; //是否允许建立索引
$field_minlength = 0; //字符长度默认最小值
$field_maxlength = ''; //字符长度默认最大值
$field_allow_search = 0; //作为搜索条件
$field_allow_fulltext = 0; /... | PHP |
<?php defined('IN_PHPCMS') or exit('No permission resources.');?>
<table cellpadding="2" cellspacing="1" width="98%">
<tr>
<td width="100">文本框长度</td>
<td><input type="text" name="setting[size]" value="<?php echo $setting['size'];?>" size="10" class="input-text"></td>
</tr>
<tr>
<td>默认值<... | PHP |
function image($field, $value) {
return trim($value);
}
| PHP |
function typeid($field, $value, $fieldinfo) {
extract($fieldinfo);
$setting = string2array($setting);
if(!$value) $value = $setting['defaultvalue'];
if($errortips) {
$errortips = $this->fields[$field]['errortips'];
$this->formValidator .= '$("#'.$field.'").formValidator({onshow:"",onfocus:"'.$error... | PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
$field_type = 'smallint'; //字段数据库类型
$field_basic_table = 1; //是否允许作为主表字段
$field_allow_index = 1; //是否允许建立索引
$field_minlength = 0; //字符长度默认最小值
$field_maxlength = ''; //字符长度默认最大值
$field_allow_search = 1; //作为搜索条件
$field_allow_fulltext = 0; ... | PHP |
<?php defined('IN_PHPCMS') or exit('No permission resources.');?>
<table cellpadding="2" cellspacing="1" width="96%">
<tr>
<td>默认值</td>
<td>
<input type="hidden" name="setting[minnumber]" value="<?php echo $setting['minnumber'];?>">
<input type="text" name="setting[defaultvalue]" value="<?php ... | PHP |
function downfile($field, $value, $fieldinfo) {
$list_str = $str = '';
extract(string2array($fieldinfo['setting']));
if($value){
$value_arr = explode('|',$value);
$value = $value_arr['0'];
$sel_server = $value_arr['1'] ? explode(',',$value_arr['1']) : '';
$edit = 1;
} else {
$edit = 0;
... | PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
$field_type = 'varchar'; //字段数据库类型
$field_basic_table = 0; //是否允许作为主表字段
$field_allow_index = 0; //是否允许建立索引
$field_minlength = 0; //字符长度默认最小值
$field_maxlength = ''; //字符长度默认最大值
$field_allow_search = 0; //作为搜索条件
$field_allow_fulltext = 0; /... | PHP |
<?php
$server_list = getcache('downservers','commons');
foreach($server_list as $_r) if (in_array($_r['siteid'],array(0,$this->siteid))) $str .='<span class="ib" style="width:25%">'.$_r['sitename'].'</span>';
?>
<fieldset>
<legend>镜像服务器列表</legend>
<?php echo iconv(CHARSET,'utf-8',$str)?>
</fieldset>
<table cel... | PHP |
<?php
defined('IN_PHPCMS') or exit('No permission resources.');
$server_list = getcache('downservers','commons');
foreach($server_list as $_r) if (in_array($_r['siteid'],array(0,$this->siteid))) $str .='<span class="ib" style="width:25%">'.$_r['sitename'].'</span>';
?>
<fieldset>
<legend>镜像服务器列表</legend>
<?php ... | PHP |
function downfile($field, $value) {
extract(string2array($this->fields[$field]['setting']));
$list_str = array();
if($value){
$value_arr = explode('|',$value);
$fileurl = $value_arr['0'];
$sel_server = $value_arr['1'] ? explode(',',$value_arr['1']) : '';
}
$server_list = getcache('downserve... | PHP |
function downfile($field, $value) {
//取得镜像站点列表
$result = '';
$server_list = count($_POST[$field.'_servers']) > 0 ? implode(',' ,$_POST[$field.'_servers']) : '';
$result = $value.'|'.$server_list;
return $result;
}
| PHP |
<?php
if(!$maxlength) $maxlength = 255;
$maxlength = min($maxlength, 255);
$fieldtype = $issystem ? 'CHAR' : 'VARCHAR';
$sql = "ALTER TABLE `$tablename` CHANGE `$field` `$field` $fieldtype( $maxlength ) NOT NULL DEFAULT '$defaultvalue'";
$db->query($sql);
?> | PHP |
function text($field, $value, $fieldinfo) {
extract($fieldinfo);
$setting = string2array($setting);
$size = $setting['size'];
if(!$value) $value = $defaultvalue;
$type = $ispassword ? 'password' : 'text';
$errortips = $this->fields[$field]['errortips'];
if($errortips || $minlength) $this->formVali... | PHP |
<?php
$db->query("ALTER TABLE `$tablename` DROP `$field`");
?> | PHP |
<?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 = 1; /... | PHP |
<?php defined('IN_PHPCMS') or exit('No permission resources.');?>
<table cellpadding="2" cellspacing="1" width="98%">
<tr>
<td width="100">文本框长度</td>
<td><input type="text" name="setting[size]" value="<?php echo $setting['size'];?>" size="10" class="input-text"></td>
</tr>
<tr>
<td>默认值<... | PHP |
function groupid($field, $value, $fieldinfo) {
extract(string2array($fieldinfo['setting']));
$grouplist = getcache('grouplist','member');
foreach($grouplist as $_key=>$_value) {
$data[$_key] = $_value['name'];
}
return '<input type="hidden" name="info['.$field.']" value="1">'.form::checkbox($data,$v... | PHP |
<?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; /... | PHP |
<?php defined('IN_PHPCMS') or exit('No permission resources.');?>
<table cellpadding="2" cellspacing="1" width="98%">
<tr>
<td width="200">默认选择的会员组</td>
<td><input type="text" name="setting[groupids]" value="<?php echo $setting['groupids'];?>" size="20" class="input-text"> 填写会员组ID,多个用 “|” 分开</td>
... | PHP |
function groupid($field, $value) {
if($value) $value = explode(',',$value);
return $value;
}
| PHP |
function groupid($field, $value) {
$datas = '';
if(!empty($_POST[$field]) && is_array($_POST[$field])) {
$datas = implode(',',$_POST[$field]);
}
return $datas;
}
| PHP |
function box($field, $value, $fieldinfo) {
$setting = string2array($fieldinfo['setting']);
if($value=='') $value = $this->fields[$field]['defaultvalue'];
$options = explode("\n",$this->fields[$field]['options']);
foreach($options as $_k) {
$v = explode("|",$_k);
$k = trim($v[1]);
$option[$k] ... | PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
$field_type = 'int'; //字段数据库类型
$field_basic_table = 1; //是否允许作为主表字段
$field_allow_index = 1; //是否允许建立索引
$field_minlength = 0; //字符长度默认最小值
$field_maxlength = ''; //字符长度默认最大值
$field_allow_search = 1; //作为搜索条件
$field_allow_fulltext = 0; //作为全... | PHP |
<?php defined('IN_PHPCMS') or exit('No permission resources.');?>
<table cellpadding="2" cellspacing="1" width="98%">
<tr>
<td width="100">选项列表</td>
<td><textarea name="setting[options]" rows="2" cols="20" id="options" style="height:100px;width:200px;"><?php echo $setting['options'];?></textarea></td>... | PHP |
function box($field, $value) {
extract(string2array($this->fields[$field]['setting']));
if($outputtype) {
return $value;
} else {
$options = explode("\n",$this->fields[$field]['options']);
foreach($options as $_k) {
$v = explode("|",$_k);
$k = trim($v[1]);
$option[$k] = $v[0];
}... | PHP |
function box($field, $value) {
if($this->fields[$field]['boxtype'] == 'checkbox') {
if(!is_array($value) || empty($value)) return false;
array_shift($value);
$value = ','.implode(',', $value).',';
return $value;
} elseif($this->fields[$field]['boxtype'] == 'multiple') {
if(is_array($value) &&... | PHP |
function copyfrom($field, $value, $fieldinfo) {
$value_data = '';
if($value && strpos($value,'|')!==false) {
$arr = explode('|',$value);
$value = $arr[0];
$value_data = $arr[1];
}
$copyfrom_array = getcache('copyfrom','admin');
$copyfrom_datas = array(L('copyfrom_tips'));
if(!empty($copyf... | PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
$field_type = 'varchar'; //字段数据库类型
$field_basic_table = 0; //是否允许作为主表字段
$field_allow_index = 0; //是否允许建立索引
$field_minlength = 0; //字符长度默认最小值
$field_maxlength = ''; //字符长度默认最大值
$field_allow_search = 0; //作为搜索条件
$field_allow_fulltext = 0; /... | PHP |
<?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[defaultvalue]" value="<?php echo $setting['defaultvalue'];?>" size="50" class="input-text"></td>
</tr>
</table> | PHP |
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_... | PHP |
function copyfrom($field, $value) {
$field_data = $field.'_data';
if(isset($_POST[$field_data])) {
$value .= '|'.$_POST[$field_data];
}
return $value;
}
| PHP |
<?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;... | PHP |
<?php defined('IN_PHPCMS') or exit('No permission resources.');?> | PHP |
<?php
defined('IN_ADMIN') or exit('No permission resources.');
$this->db->query("ALTER TABLE `$tablename` DROP `$field`");
?> | PHP |
<?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']) ? $_PO... | PHP |
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('cati... | PHP |
<?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; /... | PHP |
<?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... | PHP |
<?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>
... | PHP |
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')... | PHP |
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;
}... | PHP |
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');
}
| PHP |
<?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; /... | PHP |
<?php defined('IN_PHPCMS') or exit('No permission resources.');?> | PHP |
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;
... | PHP |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.