code
stringlengths
1
2.01M
repo_name
stringlengths
3
62
path
stringlengths
1
267
language
stringclasses
231 values
license
stringclasses
13 values
size
int64
1
2.01M
<?php defined('IN_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; //作为全站搜索信息 $field_allow_isunique = 0; //是否允许值唯一 ?>
108wo
phpcms/modules/content/fields/map/config.inc.php
PHP
asf20
499
<table cellpadding="2" cellspacing="1" width="98%"> <tr> <td>地图接口选择</td> <td> <input type="radio" name="setting[maptype]" value="2"> 百度地图 </td> </tr> <tr> <td>地图API Key </td> <td><input type="text" name="setting[api_key]" value="" size="30" class="input-text"></td> </tr> <tr> <td>默认城市</td> <td><input type="text" name="setting[defaultcity]" value="" size="30" class="input-text"> 直接填写中文城市名称</td> </tr> <tr> <td width="100">热门城市</td> <td> <textarea style="height:100px;width:100px;" id="options" cols="20" rows="2" name="setting[hotcitys]"></textarea> 多个城市请使用半角逗号分隔</td> </tr> <tr> <td>地图尺寸 </td> <td> 宽度: <input type="text" name="setting[width]" value="" size="10" class="input-text">px 高度: <input type="text" name="setting[height]" value="" size="10" class="input-text">px </td> </tr> </table>
108wo
phpcms/modules/content/fields/map/field_add_form.inc.php
Hack
asf20
1,035
<?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>地图API Key </td> <td><input type="text" name="setting[api_key]" value="<?php echo $setting['api_key'];?>" size="30" class="input-text"></td> </tr> <tr> <td>默认城市</td> <td><input type="text" name="setting[defaultcity]" value="<?php echo $setting['defaultcity'];?>" size="30" class="input-text"></td> </tr> <tr> <td width="100">热门城市</td> <td> <textarea style="height:100px;width:100px;" id="options" cols="20" rows="2" name="setting[hotcitys]"><?php echo $setting['hotcitys'];?></textarea> 多个城市请使用半角逗号分隔</td> </tr> <tr> <td>地图尺寸 </td> <td> 宽度: <input type="text" name="setting[width]" value="<?php echo $setting['width'];?>" size="10" class="input-text">px 高度: <input type="text" name="setting[height]" value="<?php echo $setting['height'];?>" size="10" class="input-text">px </td> </tr> </table>
108wo
phpcms/modules/content/fields/map/field_edit_form.inc.php
PHP
asf20
1,294
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) { $str = "<script src='http://app.mapabc.com/apis?&t=flashmap&v=2.4&key=$setting[api_key]&hl=zh-CN' type='text/javascript'></script>"; } elseif($setting['maptype']==2) { $str = "<script type='text/javascript' src='http://api.map.baidu.com/api?v=1.2&key=$setting[api_key]'></script>"; } $str .= '<div id="mapObj" class="view" style="width: '.$setting[width].'px; height:'.$setting[height].'px"></div>'; $str .='<script type="text/javascript">'; if($setting['maptype']==1) { $str .=' var mapObj=null; lngX = "'.$lngX.'"; latY = "'.$latY.'"; zoom = "'.$zoom.'"; var mapOptions = new MMapOptions(); mapOptions.toolbar = MConstants.MINI; mapOptions.scale = new MPoint(20,20); mapOptions.zoom = zoom; mapOptions.mapComButton = MConstants.SHOW_NO mapOptions.center = new MLngLat(lngX,latY); var mapObj = new MMap("mapObj", mapOptions); var maptools = new MMapTools(mapObj); drawPoints(); '; $str .=' function drawPoints(){ var markerOption = new MMarkerOptions(); var tipOption=new MTipOptions();//添加信息窗口 var address = "'.$address.'"; tipOption.tipType = MConstants.HTML_BUBBLE_TIP;//信息窗口标题 tipOption.title = address;//信息窗口标题 tipOption.content = address;//信息窗口内容 var markerOption = new MMarkerOptions(); markerOption.imageUrl="'.IMG_PATH.'icon/mak.png"; markerOption.picAgent=false; markerOption.imageAlign=MConstants.BOTTOM_CENTER; markerOption.tipOption = tipOption; markerOption.canShowTip= address ? true : false; markerOption.dimorphicColor="0x00A0FF"; Mmarker = new MMarker(new MLngLat(lngX,latY),markerOption); Mmarker.id="mark101"; mapObj.addOverlay(Mmarker,true) }'; } elseif($setting['maptype']==2) { $str .=' var mapObj=null; lngX = "'.$lngX.'"; latY = "'.$latY.'"; zoom = "'.$zoom.'"; var mapObj = new BMap.Map("mapObj"); var ctrl_nav = new BMap.NavigationControl({anchor:BMAP_ANCHOR_TOP_LEFT,type:BMAP_NAVIGATION_CONTROL_LARGE}); mapObj.addControl(ctrl_nav); mapObj.enableDragging(); mapObj.enableScrollWheelZoom(); mapObj.enableDoubleClickZoom(); mapObj.centerAndZoom(new BMap.Point(lngX,latY),zoom); drawPoints(); '; $str .=' function drawPoints(){ var myIcon = new BMap.Icon("'.IMG_PATH.'icon/mak.png", new BMap.Size(27, 45)); var center = mapObj.getCenter(); var point = new BMap.Point(lngX,latY); var marker = new BMap.Marker(point, {icon: myIcon}); mapObj.addOverlay(marker); }'; } $str .='</script>'; return $str; }
108wo
phpcms/modules/content/fields/map/output.inc.php
PHP
asf20
2,995
<?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->data = $data; $this->id = $data['id']; $info = array(); foreach($this->fields as $field=>$v) { if(!isset($data[$field])) continue; $func = $v['formtype']; $value = $data[$field]; $result = method_exists($this, $func) ? $this->$func($field, $data[$field]) : $data[$field]; if($result !== false) $info[$field] = $result; } return $info; } }?>
108wo
phpcms/modules/content/fields/content_output.class.php
PHP
asf20
698
<?php $fields = array('text'=>'单行文本', 'textarea'=>'多行文本', 'editor'=>'编辑器', 'catid'=>'栏目', 'title'=>'标题', 'box'=>'选项', 'image'=>'图片', 'images'=>'多图片', 'number'=>'数字', 'datetime'=>'日期和时间', 'posid'=>'推荐位', 'keyword'=>'关键词', 'author'=>'作者', 'copyfrom'=>'来源', 'groupid'=>'会员组', 'islink'=>'转向链接', 'template'=>'模板', 'pages'=>'分页选择', 'typeid'=>'类别', 'readpoint'=>'积分、点数', 'linkage'=>'联动菜单', 'downfile'=>'镜像下载', 'downfiles'=>'多文件上传', 'map'=>'地图字段', 'omnipotent'=>'万能字段', 'brand'=>'品牌', //eddy 增加品牌字段 ); //不允许删除的字段,这些字段讲不会在字段添加处显示 $not_allow_fields = array('catid','typeid','title','keyword','posid','template','username'); //允许添加但必须唯一的字段 $unique_fields = array('pages','readpoint','author','copyfrom','islink'); //禁止被禁用的字段列表 $forbid_fields = array('catid','title','updatetime','inputtime','url','listorder','status','template','username'); //禁止被删除的字段列表 $forbid_delete = array('catid','typeid','title','thumb','keywords','updatetime','inputtime','posids','url','listorder','status','template','username'); //可以追加 JS和CSS 的字段 $att_css_js = array('text','textarea','box','number','keyword','typeid'); ?>
108wo
phpcms/modules/content/fields/fields.inc.php
PHP
asf20
1,537
function keyword($field, $value, $fieldinfo) { extract($fieldinfo); if(!$value) $value = $defaultvalue; return "<input type='text' name='info[$field]' id='$field' value='$value' style='width:280px' {$formattribute} {$css} class='input-text'>"; }
108wo
phpcms/modules/content/fields/keyword/form.inc.php
Hack
asf20
259
<?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 = 1; //是否允许值唯一 ?>
108wo
phpcms/modules/content/fields/keyword/config.inc.php
PHP
asf20
499
<?php defined('IN_PHPCMS') or exit('No permission resources.');?>
108wo
phpcms/modules/content/fields/keyword/field_edit_form.inc.php
PHP
asf20
66
function keyword($field, $value) { if($value == '') return ''; $v = ''; if(strpos($value, ',')===false) { $tags = explode(' ', $value); } else { $tags = explode(',', $value); } return $tags; }
108wo
phpcms/modules/content/fields/keyword/output.inc.php
PHP
asf20
226
<?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); ?>
108wo
phpcms/modules/content/fields/omnipotent/field_edit.inc.php
PHP
asf20
265
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 = ''; $params = explode('~~',$match_func); $user_func = $params[0]; $string = $user_func($params[1]); $formtext = str_replace($_match[0][$key],$string,$formtext); } $id = $this->id ? $this->id : 0; $formtext = str_replace('{ID}',$id,$formtext); $errortips = $this->fields[$field]['errortips']; if($errortips) $this->formValidator .= '$("#'.$field.'").formValidator({onshow:"",onfocus:"'.$errortips.'"}).inputValidator({min:'.$minlength.',max:'.$maxlength.',onerror:"'.$errortips.'"});'; if($errortips) $this->formValidator .= '$("#'.$field.'").formValidator({onshow:"'.$errortips.'",onfocus:"'.$errortips.'"}).inputValidator({min:1,onerror:"'.$errortips.'"});'; return $formtext; }
108wo
phpcms/modules/content/fields/omnipotent/form.inc.php
PHP
asf20
1,043
<?php $db->query("ALTER TABLE `$tablename` DROP `$field`"); ?>
108wo
phpcms/modules/content/fields/omnipotent/field_delete.inc.php
PHP
asf20
65
<?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; //作为全站搜索信息 $field_allow_isunique = 0; //是否允许值唯一 ?>
108wo
phpcms/modules/content/fields/omnipotent/config.inc.php
PHP
asf20
499
<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;"></textarea><BR> 例如:&lt;input type='text' name='info[voteid]' id='voteid' value='{FIELD_VALUE}' style='50' &gt;</td> </tr> <tr> <td>字段类型</td> <td> <select name="setting[fieldtype]" onchange="javascript:fieldtype_setting(this.value);"> <option value="varchar">字符 VARCHAR</option> <option value="tinyint">整数 TINYINT(3)</option> <option value="smallint">整数 SMALLINT(5)</option> <option value="mediumint">整数 MEDIUMINT(8)</option> <option value="int">整数 INT(10)</option> </select> <span id="minnumber" style="display:none"><input type="radio" name="setting[minnumber]" value="1" checked/> <font color='red'>正整数</font> <input type="radio" name="setting[minnumber]" value="-1" /> 整数</span> </td> </tr> </table>
108wo
phpcms/modules/content/fields/omnipotent/field_add_form.inc.php
Hack
asf20
1,017
<?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']);?></textarea><BR> 例如:&lt;input type='text' name='info[voteid]' id='voteid' value='{FIELD_VALUE}' style='50' &gt;</td> </tr> <tr> <td>字段类型</td> <td> <select name="setting[fieldtype]" onchange="javascript:fieldtype_setting(this.value);"> <option value="varchar" <?php if($setting['fieldtype']=='varchar') echo 'selected';?>>字符 VARCHAR</option> <option value="tinyint" <?php if($setting['fieldtype']=='tinyint') echo 'selected';?>>整数 TINYINT(3)</option> <option value="smallint" <?php if($setting['fieldtype']=='smallint') echo 'selected';?>>整数 SMALLINT(5)</option> <option value="mediumint" <?php if($setting['fieldtype']=='mediumint') echo 'selected';?>>整数 MEDIUMINT(8)</option> <option value="int" <?php if($setting['fieldtype']=='int') echo 'selected';?>>整数 INT(10)</option> </select> <span id="minnumber" style="display:none"><input type="radio" name="setting[minnumber]" value="1" <?php if($setting['minnumber']==1) echo 'checked';?>/> <font color='red'>正整数</font> <input type="radio" name="setting[minnumber]" value="-1" <?php if($setting['minnumber']==-1) echo 'checked';?>/> 整数</span> </td> </tr> </table>
108wo
phpcms/modules/content/fields/omnipotent/field_edit_form.inc.php
PHP
asf20
1,539
function linkage($field, $value, $fieldinfo) { $setting = string2array($fieldinfo['setting']); $linkageid = $setting['linkageid']; return menu_linkage($linkageid,$field,$value); }
108wo
phpcms/modules/content/fields/linkage/form.inc.php
PHP
asf20
193
<?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; //作为全站搜索信息 $field_allow_isunique = 1; //是否允许值唯一 ?>
108wo
phpcms/modules/content/fields/linkage/config.inc.php
PHP
asf20
498
<table cellpadding="2" cellspacing="1" width="98%"> <tr> <td>菜单ID</td> <td><input type="text" id="linkageid" name="setting[linkageid]" value="0" size="5" class="input-text"> <input type='button' value="在列表中选择" onclick="omnipotent('selectid','?m=admin&c=linkage&a=public_get_list','在列表中选择')" class="button"> 请到导航 扩展 > 联动菜单 > 添加联动菜单</td> </tr> <tr> <td>显示方式</td> <td> <input name="setting[showtype]" value="0" type="radio"> 只显示名称 <input name="setting[showtype]" value="1" type="radio"> 显示完整路径 <input name="setting[showtype]" value="2" type="radio"> 返回联动菜单id <input name="setting[showtype]" value="3" type="radio"> 返回菜单层级数组 </td></tr> <tr> <td>路径分隔符</td> <td><input type="text" name="setting[space]" value="" size="5" class="input-text"> 显示完整路径时生效</td> </tr> <tr> <td>是否作为筛选字段</td> <td> <input type="radio" name="setting[filtertype]" value="1"/> 是 <input type="radio" name="setting[filtertype]" value="0"/> 否 </td> </tr> </table>
108wo
phpcms/modules/content/fields/linkage/field_add_form.inc.php
Hack
asf20
1,266
<?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="在列表中选择" onclick="omnipotent('selectid','?m=admin&c=linkage&a=public_get_list','在列表中选择')" class="button"> 请到导航 扩展 > 联动菜单 > 添加联动菜单</td> </tr> <tr> <td>显示方式</td> <td> <input name="setting[showtype]" value="0" type="radio" <?php if($setting['showtype']==0) echo 'checked';?>> 只显示名称 <input name="setting[showtype]" value="1" type="radio" <?php if($setting['showtype']==1) echo 'checked';?>> 显示完整路径 <input name="setting[showtype]" value="2" type="radio" <?php if($setting['showtype']==2) echo 'checked';?>> 返回联动菜单id <input name="setting[showtype]" value="3" type="radio" <?php if($setting['showtype']==3) echo 'checked';?>> 返回菜单层级数组 </td></tr> <tr> <td>路径分隔符</td> <td><input type="text" name="setting[space]" value="<?php echo $setting['space'];?>" size="5" class="input-text"> 显示完整路径时生效</td> </tr> <tr> <td>是否作为筛选字段</td> <td> <input type="radio" name="setting[filtertype]" value="1" <?php if($setting['filtertype']) echo 'checked';?> /> 是 <input type="radio" name="setting[filtertype]" value="0" <?php if(!$setting['filtertype']) echo 'checked';?>/> 否 </td> </tr> </table>
108wo
phpcms/modules/content/fields/linkage/field_edit_form.inc.php
PHP
asf20
1,693
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'], $setting['showtype']); } elseif($setting['showtype']==2) { $result = $value; } else { $result = get_linkage($value, $setting['linkageid'], $setting['space'], 2); } return $result; }
108wo
phpcms/modules/content/fields/linkage/output.inc.php
PHP
asf20
524
function islink($field, $value, $fieldinfo) { if($value) { $url = $this->data['url']; $checked = 'checked'; $_GET['islink'] = 1; } else { $disabled = 'disabled'; $url = $checked = ''; $_GET['islink'] = 0; } $size = $fieldinfo['size'] ? $fieldinfo['size'] : 25; return '<input type="hidden" name="info[islink]" value="0"><input type="text" name="linkurl" id="linkurl" value="'.$url.'" size="'.$size.'" maxlength="255" '.$disabled.' class="input-text"> <input name="info[islink]" type="checkbox" id="islink" value="1" onclick="ruselinkurl();" '.$checked.'> <font color="red">'.L('islink_url').'</font>'; }
108wo
phpcms/modules/content/fields/islink/form.inc.php
Hack
asf20
647
<?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; //作为全站搜索信息 $field_allow_isunique = 1; //是否允许值唯一 ?>
108wo
phpcms/modules/content/fields/islink/config.inc.php
PHP
asf20
498
<table cellpadding="2" cellspacing="1" width="98%"> <tr> <td>输入框大小</td> <td><input type="text" name="setting[size]" value="30" size="6" class="input-text"></td> </tr> </table>
108wo
phpcms/modules/content/fields/islink/field_add_form.inc.php
Hack
asf20
208
<?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>
108wo
phpcms/modules/content/fields/islink/field_edit_form.inc.php
PHP
asf20
315
function author($field, $value, $fieldinfo) { return '<input type="text" name="info['.$field.']" value="'.$value.'" size="30">'; }
108wo
phpcms/modules/content/fields/author/form.inc.php
Hack
asf20
138
<?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 = 1; //是否允许值唯一 ?>
108wo
phpcms/modules/content/fields/author/config.inc.php
PHP
asf20
499
<table cellpadding="2" cellspacing="1" width="98%"> <tr> <td>默认值</td> <td><input type="text" name="setting[defaultvalue]" value="" size="40" class="input-text"></td> </tr> </table>
108wo
phpcms/modules/content/fields/author/field_add_form.inc.php
Hack
asf20
209
<?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>
108wo
phpcms/modules/content/fields/author/field_edit_form.inc.php
PHP
asf20
315
function images($field, $value, $fieldinfo) { extract($fieldinfo); $list_str = ''; if($value) { $value = string2array(html_entity_decode($value,ENT_QUOTES)); if(is_array($value)) { foreach($value as $_k=>$_v) { $list_str .= "<li id='image_{$field}_{$_k}' style='padding:1px'><input type='text' name='{$field}_url[]' value='{$_v[url]}' style='width:310px;' ondblclick='image_priview(this.value);' class='input-text'> <input type='text' name='{$field}_alt[]' value='{$_v[alt]}' style='width:160px;' class='input-text'> <a href=\"javascript:remove_div('image_{$field}_{$_k}')\">".L('remove_out', '', 'content')."</a></li>"; } } } else { $list_str .= "<center><div class='onShow' id='nameTip'>".L('upload_pic_max', '', 'content')." <font color='red'>{$upload_number}</font> ".L('tips_pics', '', 'content')."</div></center>"; } $string = '<input name="info['.$field.']" type="hidden" value="1"> <fieldset class="blue pad-10"> <legend>'.L('pic_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="statics/js/swfupload/swf2ckeditor.js"></script>'; define('IMAGES_INIT', 1); } $authkey = upload_key("$upload_number,$upload_allowext,$isselectimage"); $string .= $str."<div class='picBut cu'><a herf='javascript:void(0);' onclick=\"javascript:flashupload('{$field}_images', '".L('attachment_upload')."','{$field}',change_images,'{$upload_number},{$upload_allowext},{$isselectimage}','content','$this->catid','{$authkey}')\"/> ".L('select_pic')." </a></div>"; return $string; }
108wo
phpcms/modules/content/fields/images/form.inc.php
Hack
asf20
1,725
<?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/images/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[isselectimage]" 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> </table>
108wo
phpcms/modules/content/fields/images/field_add_form.inc.php
Hack
asf20
614
<?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> </table>
108wo
phpcms/modules/content/fields/images/field_edit_form.inc.php
PHP
asf20
840
function images($field, $value) { return string2array($value); }
108wo
phpcms/modules/content/fields/images/output.inc.php
PHP
asf20
72
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'] = $pictures_alt[$key]; $array[$key] = $temp; } } $array = array2string($array); return $array; }
108wo
phpcms/modules/content/fields/images/input.inc.php
PHP
asf20
461
<?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'); $this->siteid = get_siteid(); } function get($data = array()) { $_groupid = param::get_cookie('_groupid'); $this->data = $data; if(isset($data['id'])) $this->id = $data['id']; $info = array(); $this->content_url = $data['url']; foreach($this->fields as $field=>$v) { if(defined('IN_ADMIN')) { if($v['iscore'] || check_in($_SESSION['roleid'], $v['unsetroleids'])) continue; } else { if($v['iscore'] || !$v['isadd'] || check_in($_groupid, $v['unsetgroupids'])) continue; } $func = $v['formtype']; $value = isset($data[$field]) ? htmlspecialchars($data[$field], ENT_QUOTES) : ''; if($func=='pages' && isset($data['maxcharperpage'])) { $value = $data['paginationtype'].'|'.$data['maxcharperpage']; } if(!method_exists($this, $func)) continue; $form = $this->$func($field, $value, $v); if($form !== false) { if(defined('IN_ADMIN')) { if($v['isbase']) { $star = $v['minlength'] || $v['pattern'] ? 1 : 0; $info['base'][$field] = array('name'=>$v['name'], 'tips'=>$v['tips'], 'form'=>$form, 'star'=>$star,'isomnipotent'=>$v['isomnipotent'],'formtype'=>$v['formtype']); } else { $star = $v['minlength'] || $v['pattern'] ? 1 : 0; $info['senior'][$field] = array('name'=>$v['name'], 'tips'=>$v['tips'], 'form'=>$form, 'star'=>$star,'isomnipotent'=>$v['isomnipotent'],'formtype'=>$v['formtype']); } } else { $star = $v['minlength'] || $v['pattern'] ? 1 : 0; $info[$field] = array('name'=>$v['name'], 'tips'=>$v['tips'], 'form'=>$form, 'star'=>$star,'isomnipotent'=>$v['isomnipotent'],'formtype'=>$v['formtype']); } } } return $info; } }?>
108wo
phpcms/modules/content/fields/content_form.class.php
PHP
asf20
2,013
<?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); ?>
108wo
phpcms/modules/content/fields/textarea/field_edit.inc.php
PHP
asf20
265
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.'").formValidator({'.$allow_empty.'onshow:"'.$errortips.'",onfocus:"'.$errortips.'"}).inputValidator({min:1,onerror:"'.$errortips.'"});'; $value = empty($value) ? $setting[defaultvalue] : $value; $str = "<textarea name='info[{$field}]' id='$field' style='width:{$width}%;height:{$height}px;' $formattribute $css"; if($maxlength) $str .= " onkeyup=\"strlen_verify(this, '{$field}_len', {$maxlength})\""; $str .= ">{$value}</textarea>"; if($maxlength) $str .= L('can_enter').'<B><span id="'.$field.'_len">'.$maxlength.'</span></B> '.L('characters'); return $str; }
108wo
phpcms/modules/content/fields/textarea/form.inc.php
PHP
asf20
894
<?php $db->query("ALTER TABLE `$tablename` DROP `$field`"); ?>
108wo
phpcms/modules/content/fields/textarea/field_delete.inc.php
PHP
asf20
65
function text($field, $value, $fieldinfo) { return form::text($field, $field, $value, 'text', 15); }
108wo
phpcms/modules/content/fields/textarea/search_form.inc.php
PHP
asf20
110
<?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; //作为全站搜索信息 $field_allow_isunique = 0; //是否允许值唯一 ?>
108wo
phpcms/modules/content/fields/textarea/config.inc.php
PHP
asf20
504
<table cellpadding="2" cellspacing="1" width="98%"> <tr> <td width="100">文本域宽度</td> <td><input type="text" name="setting[width]" value="100%" size="10" class="input-text" >%</td> </tr> <tr> <td>文本域高度</td> <td><input type="text" name="setting[height]" value="46" size="10" class="input-text"> px</td> </tr> <tr> <td>默认值</td> <td><textarea name="setting[defaultvalue]" rows="2" cols="20" id="defaultvalue" style="height:60px;width:250px;" ></textarea></td> </tr> <tr> <td>是否允许Html</td> <td><input type="radio" name="setting[enablehtml]" value="1"> 是 <input type="radio" name="setting[enablehtml]" value="0" checked> 否</td> </tr> </table>
108wo
phpcms/modules/content/fields/textarea/field_add_form.inc.php
Hack
asf20
762
function text($field, $value) { return $value === '' ? '' : " `$field` LIKE '%$value%' "; }
108wo
phpcms/modules/content/fields/textarea/search.inc.php
PHP
asf20
101
<?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>文本域高度</td> <td><input type="text" name="setting[height]" value="<?php echo $setting['height'];?>" size="10" class="input-text"> px</td> </tr> <tr> <td>默认值</td> <td><textarea name="setting[defaultvalue]" rows="2" cols="20" id="defaultvalue" style="height:60px;width:250px;" ><?php echo htmlspecialchars($setting['defaultvalue']);?></textarea></td> </tr> <tr> <td>是否允许Html</td> <td><input type="radio" name="setting[enablehtml]" value="1" <?php if($setting['enablehtml']==1) {?>checked<?php }?>> 是 <input type="radio" name="setting[enablehtml]" value="0" <?php if($setting['enablehtml']==0) {?>checked<?php }?>> 否</td> </tr> </table>
108wo
phpcms/modules/content/fields/textarea/field_edit_form.inc.php
PHP
asf20
1,047
function textarea($field, $value) { if(!$this->fields[$field]['enablehtml']) $value = strip_tags($value); return $value; }
108wo
phpcms/modules/content/fields/textarea/input.inc.php
PHP
asf20
133
<?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($data as $field=>$value) { if(!isset($this->fields[$field])) continue; $func = $this->fields[$field]['formtype']; $info[$field] = method_exists($this, $func) ? $this->$func($field, $value) : $value; } } }?>
108wo
phpcms/modules/content/fields/content_update.class.php
PHP
asf20
543
function number($field, $value, $fieldinfo) { extract($fieldinfo); $setting = string2array($setting); $size = $setting['size']; if(!$value) $value = $defaultvalue; return "<input type='text' name='info[$field]' id='$field' value='$value' class='input-text' size='$size' {$formattribute} {$css}>"; }
108wo
phpcms/modules/content/fields/number/form.inc.php
Hack
asf20
320
<?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; //作为全站搜索信息 $field_allow_isunique = 1; //是否允许值唯一 ?>
108wo
phpcms/modules/content/fields/number/config.inc.php
PHP
asf20
498
<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> <td> <select name="setting[decimaldigits]"> <option value="-1">自动</option> <option value="0" selected>0</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> </select> </td> </tr> <tr> <td>默认值</td> <td><input type="text" name="setting[defaultvalue]" value="<?php echo $defaultvalue?>" size="40" class="input-text"></td> </tr> <tr> <td>是否作为区间字段</td> <td> <input type="radio" name="setting[rangetype]" value="1"/> 是 <input type="radio" name="setting[rangetype]" value="0" checked />否   注:区间字段可以通过filters('字段名称','模型id','自定义数组')调用 </td> </tr> </table>
108wo
phpcms/modules/content/fields/number/field_add_form.inc.php
PHP
asf20
1,169
<?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="setting[maxnumber]" value="<?php echo $setting['maxnumber'];?>" size="5" class="input-text"></td> </tr> <tr> <td>小数位数:</td> <td> <select name="setting[decimaldigits]"> <option value="-1" <?php if($setting['decimaldigits']==-1) echo 'selected';?>)>自动</option> <option value="0" <?php if($setting['decimaldigits']==0) echo 'selected';?>>0</option> <option value="1" <?php if($setting['decimaldigits']==1) echo 'selected';?>>1</option> <option value="2" <?php if($setting['decimaldigits']==2) echo 'selected';?>>2</option> <option value="3" <?php if($setting['decimaldigits']==3) echo 'selected';?>>3</option> <option value="4" <?php if($setting['decimaldigits']==4) echo 'selected';?>>4</option> <option value="5" <?php if($setting['decimaldigits']==5) echo 'selected';?>>5</option> </select> </td> </tr> <tr> <td>输入框长度</td> <td><input type="text" name="setting[size]" value="<?php echo $setting['size'];?>" size="3" class="input-text"> px</td> </tr> <tr> <td>默认值</td> <td><input type="text" name="setting[defaultvalue]" value="<?php echo $setting['defaultvalue'];?>" size="40" class="input-text"></td> </tr> <tr> <td>是否作为区间字段</td> <td> <input type="radio" name="setting[rangetype]" value="1" <?php if($setting['rangetype']) echo 'checked';?> /> 是 <input type="radio" name="setting[rangetype]" value="0" <?php if(!$setting['rangetype']) echo 'checked';?> /> 否   注:区间字段可以通过filters('字段名称','模型id','自定义数组')调用 </td> </tr> </table>
108wo
phpcms/modules/content/fields/number/field_edit_form.inc.php
PHP
asf20
1,988
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) $height = 300; $allowupload = defined('IN_ADMIN') ? 1 : $grouplist['allowattachment'] ? 1: 0; if(!$value) $value = $defaultvalue; if($minlength || $pattern) $allow_empty = ''; if($minlength) $this->formValidator .= '$("#'.$field.'").formValidator({'.$allow_empty.'onshow:"",onfocus:"'.$errortips.'"}).functionValidator({ fun:function(val,elem){ var oEditor = CKEDITOR.instances.'.$field.'; var data = oEditor.getData(); if($(\'#islink\').attr(\'checked\')){ return true; } else if(($(\'#islink\').attr(\'checked\')==false) && (data==\'\')){ return "'.$errortips.'"; } else if (data==\'\' || $.trim(data)==\'\') { return "'.$errortips.'"; } return true; } });'; return "<div id='{$field}_tip'></div>".'<textarea name="info['.$field.']" id="'.$field.'" boxid="'.$field.'">'.$value.'</textarea>'.form::editor($field,$toolbar,'content',$this->catid,'',$allowupload,1,'',$height,$disabled_page); }
108wo
phpcms/modules/content/fields/editor/form.inc.php
PHP
asf20
1,303
<?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; //作为全站搜索信息 $field_allow_isunique = 0; //是否允许值唯一 ?>
108wo
phpcms/modules/content/fields/editor/config.inc.php
PHP
asf20
502
<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[defaultvalue]" rows="2" cols="20" id="defaultvalue" style="height:100px;width:250px;"></textarea></td> </tr> <tr> <td>是否启用关联链接:</td> <td><input type="radio" name="setting[enablekeylink]" value="1"> 是 <input type="radio" name="setting[enablekeylink]" value="0" checked> 否 <input type="text" name="setting[replacenum]" value="1" size="4" class="input-text"> 替换次数 (留空则为替换全部)</td> </tr> <tr> <td>关联链接方式:</td> <td><input type="radio" name="setting[link_mode]" value="1" <?php if($setting['link_mode']==1) echo 'checked';?>> 关键字链接 <input type="radio" name="setting[link_mode]" value="0" <?php if($setting['link_mode']==0) echo 'checked';?>> 网址链接 </td> </tr> <tr> <td>是否保存远程图片:</td> <td><input type="radio" name="setting[enablesaveimage]" value="1"> 是 <input type="radio" name="setting[enablesaveimage]" value="0" checked> 否</td> </tr> <tr> <td>编辑器默认高度:</td> <td><input type="text" name="setting[height]" value="200" size="4" class="input-text"> px</td> </tr> </table>
108wo
phpcms/modules/content/fields/editor/field_add_form.inc.php
PHP
asf20
1,529
<?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="setting[toolbar]" value="full" <?php if($setting['toolbar']=='full') echo 'checked';?>> 标准型 </td> </tr> <tr> <td>默认值:</td> <td><textarea name="setting[defaultvalue]" rows="2" cols="20" id="defaultvalue" style="height:100px;width:250px;"><?php echo $setting['defaultvalue'];?></textarea></td> </tr> <tr> <td>是否启用关联链接:</td> <td><input type="radio" name="setting[enablekeylink]" value="1" <?php if($setting['enablekeylink']==1) echo 'checked';?>> 是 <input type="radio" name="setting[enablekeylink]" value="0" <?php if($setting['enablekeylink']==0) echo 'checked';?>> 否 <input type="text" name="setting[replacenum]" value="<?php echo $setting['replacenum'];?>" size="4" class="input-text"> 替换次数 (留空则为替换全部)</td> </tr> <tr> <td>关联链接方式:</td> <td><input type="radio" name="setting[link_mode]" value="1" <?php if($setting['link_mode']==1) echo 'checked';?>> 关键字链接 <input type="radio" name="setting[link_mode]" value="0" <?php if($setting['link_mode']==0) echo 'checked';?>> 网址链接 </td> </tr> <tr> <td>是否保存远程图片:</td> <td><input type="radio" name="setting[enablesaveimage]" value="1" <?php if($setting['enablesaveimage']==1) echo 'checked';?>> 是 <input type="radio" name="setting[enablesaveimage]" value="0" <?php if($setting['enablesaveimage']==0) echo 'checked';?>> 否</td> </tr> <tr> <td>编辑器默认高度:</td> <td><input type="text" name="setting[height]" value="<?php echo $setting['height'];?>" size="4" class="input-text"> px</td> </tr> <tr> <td>禁止显示编辑器下方的分页符与子标题:</td> <td><input type="radio" name="setting[disabled_page]" value="1" <?php if($setting['disabled_page']==1) echo 'checked';?>> 禁止 <input type="radio" name="setting[disabled_page]" value="0" <?php if($setting['disabled_page']==0) echo 'checked';?>> 显示</td> </tr> </table>
108wo
phpcms/modules/content/fields/editor/field_edit_form.inc.php
PHP
asf20
2,375
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)."\""; } function _base64_decode($t,$str) { return $t."\"".base64_decode($str)."\""; } function _keylinks($txt, $replacenum = '',$link_mode = 1) { $search = "/(alt\s*=\s*|title\s*=\s*)[\"|\'](.+?)[\"|\']/ise"; $replace = "\$this->_base64_encode('\\1','\\2')"; $replace1 = "\$this->_base64_decode('\\1','\\2')"; $txt = preg_replace($search, $replace, $txt); $keywords = $this->data['keywords']; if($keywords) $keywords = strpos(',',$keywords) === false ? explode(' ',$keywords) : explode(',',$keywords); if($link_mode && !empty($keywords)) { foreach($keywords as $keyword) { $linkdatas[] = $keyword; } } else { $linkdatas = getcache('keylink','commons'); } if($linkdatas) { $word = $replacement = array(); foreach($linkdatas as $v) { if($link_mode && $keywords) { $word1[] = '/'.preg_quote($v, '/').'/'; $word2[] = $v; $replacement[] = '<a href="javascript:;" onclick="show_ajax(this)" class="keylink">'.$v.'</a>'; } else { $word1[] = '/'.preg_quote($v[0], '/').'/'; $word2[] = $v[0]; $replacement[] = '<a href="'.$v[1].'" target="_blank" class="keylink">'.$v[0].'</a>'; } } if($replacenum != '') { $txt = preg_replace($word1, $replacement, $txt, $replacenum); } else { $txt = str_replace($word2, $replacement, $txt); } } $txt = preg_replace($search, $replace1, $txt); return $txt; }
108wo
phpcms/modules/content/fields/editor/output.inc.php
PHP
asf20
1,763
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 = intval($site_setting['watermark_enable']); $value = $this->attachment->download('content', $value,$watermark_enable); } return $value; }
108wo
phpcms/modules/content/fields/editor/input.inc.php
PHP
asf20
470
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; }
108wo
phpcms/modules/content/fields/editor/update.inc.php
PHP
asf20
214
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) || ($_value['catid'] && strpos(','.$this->categorys[$_value['catid']]['arrchildid'].',',','.$this->catid.',')===false)) continue; $array[$_key] = $_value['name']; } $posids = array(); if(ROUTE_A=='edit') { $this->position_data_db = pc_base::load_model('position_data_model'); $result = $this->position_data_db->select(array('id'=>$this->id,'modelid'=>$this->modelid),'*','','','','posid'); $posids = implode(',', array_keys($result)); } else { $posids = $setting['defaultvalue']; } return "<input type='hidden' name='info[$field][]' value='-1'>".form::checkbox($array,$posids,"name='info[$field][]'",'',$setting['width']); }
108wo
phpcms/modules/content/fields/posid/form.inc.php
PHP
asf20
977
<?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/posid/config.inc.php
PHP
asf20
499
<table cellpadding="2" cellspacing="1" width="98%"> <tr> <td width="200">每个位置宽度</td> <td><input type="text" name="setting[width]" value="125" size="5" class="input-text"> px </td> </tr> <tr> <td>默认选中项</td> <td><input type="text" name="setting[defaultvalue]" value="" size="20" class="input-text"> 多个之间用半角逗号隔开 </td> </tr> </table>
108wo
phpcms/modules/content/fields/posid/field_add_form.inc.php
Hack
asf20
426
<?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> <td>默认选中项</td> <td><input type="text" name="setting[defaultvalue]" value="<?php echo $setting['defaultvalue'];?>" size="20" class="input-text"> 多个之间用半角逗号隔开 </td> </tr> </table>
108wo
phpcms/modules/content/fields/posid/field_edit_form.inc.php
PHP
asf20
562
function posid($field, $value) { $number = count($value); $value = $number==1 ? 0 : 1; return $value; }
108wo
phpcms/modules/content/fields/posid/input.inc.php
PHP
asf20
117
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 $_key=>$_value) { if($_value['isposition']) { $textcontent[$_key] = $this->data[$_key]; } } $textcontent = array2string($textcontent); } $position_data_db->insert(array('id'=>$this->id,'catid'=>$this->data['catid'],'posid'=>$r,'module'=>'content','modelid'=>$this->modelid,'data'=>$textcontent,'listorder'=>$this->id)); } } } else { $posids = array(); $catid = $this->data['catid']; $push_api = pc_base::load_app_class('push_api','admin'); foreach($value as $r) { if($r!='-1') $posids[] = $r; } $textcontent = array(); foreach($this->fields AS $_key=>$_value) { if($_value['isposition']) { $textcontent[$_key] = $this->data[$_key]; } } //颜色选择为隐藏域 在这里进行取值 $textcontent['style'] = $_POST['style_color'] ? strip_tags($_POST['style_color']) : ''; $textcontent['inputtime'] = strtotime($textcontent['inputtime']); if($_POST['style_font_weight']) $textcontent['style'] = $textcontent['style'].';'.strip_tags($_POST['style_font_weight']); $push_api->position_update($this->id, $this->modelid, $catid, $posids, $textcontent); } } }
108wo
phpcms/modules/content/fields/posid/update.inc.php
PHP
asf20
1,555
function image($field, $value, $fieldinfo) { $setting = string2array($fieldinfo['setting']); extract($setting); if(!defined('IMAGES_INIT')) { $str = '<script type="text/javascript" src="'.JS_PATH.'swfupload/swf2ckeditor.js"></script>'; define('IMAGES_INIT', 1); } $html = ''; if (defined('IN_ADMIN')) { $html = "<input type=\"button\" style=\"width: 66px;\" class=\"button\" onclick=\"crop_cut_".$field."($('#$field').val());return false;\" value=\"".L('cut_the_picture','','content')."\"><input type=\"button\" style=\"width: 66px;\" class=\"button\" onclick=\"$('#".$field."_preview').attr('src','".IMG_PATH."icon/upload-pic.png');$('#".$field."').val(' ');return false;\" value=\"".L('cancel_the_picture','','content')."\"><script type=\"text/javascript\">function crop_cut_".$field."(id){ if (id=='') { alert('".L('upload_thumbnails', '', 'content')."');return false;} window.top.art.dialog({title:'".L('cut_the_picture','','content')."', id:'crop', iframe:'index.php?m=content&c=content&a=public_crop&module=content&catid='+catid+'&picurl='+encodeURIComponent(id)+'&input=$field&preview=".($show_type && defined('IN_ADMIN') ? $field."_preview" : '')."', width:'680px', height:'480px'}, function(){var d = window.top.art.dialog({id:'crop'}).data.iframe; d.uploadfile();return false;}, function(){window.top.art.dialog({id:'crop'}).close()}); };</script>"; } $authkey = upload_key("1,$upload_allowext,$isselectimage,$images_width,$images_height,$watermark"); if($show_type && defined('IN_ADMIN')) { $preview_img = $value ? $value : IMG_PATH.'icon/upload-pic.png'; return $str."<div class='upload-pic img-wrap'><input type='hidden' name='info[$field]' id='$field' value='$value'> <a href='javascript:void(0);' onclick=\"flashupload('{$field}_images', '".L('attachment_upload', '', 'content')."','{$field}',thumb_images,'1,{$upload_allowext},$isselectimage,$images_width,$images_height,$watermark','content','$this->catid','$authkey');return false;\"> <img src='$preview_img' id='{$field}_preview' width='135' height='113' style='cursor:hand' /></a>".$html."</div>"; } else { return $str."<input type='text' name='info[$field]' id='$field' value='$value' size='$size' class='input-text' /> <input type='button' class='button' onclick=\"flashupload('{$field}_images', '".L('attachment_upload', '', 'content')."','{$field}',submit_images,'1,{$upload_allowext},$isselectimage,$images_width,$images_height,$watermark','content','$this->catid','$authkey')\"/ value='".L('upload_pic', '', 'content')."'>".$html; } }
108wo
phpcms/modules/content/fields/image/form.inc.php
Hack
asf20
2,590
<?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; //作为全站搜索信息 $field_allow_isunique = 0; //是否允许值唯一 ?>
108wo
phpcms/modules/content/fields/image/config.inc.php
PHP
asf20
499
<table cellpadding="2" cellspacing="1" width="98%"> <tr> <td width="100">文本框长度</td> <td><input type="text" name="setting[size]" size="10" class="input-text"></td> </tr> <tr> <td>默认值</td> <td><input type="text" name="setting[defaultvalue]" size="40" class="input-text"></td> </tr> <tr> <td>表单显示模式</td> <td><input type="radio" name="setting[show_type]" value="1" /> 图片模式 <input type="radio" name="setting[show_type]" value="0" checked/> 文本框模式</td> </tr> <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[watermark]" value="1"> 是 <input type="radio" name="setting[watermark]" value="0" checked> 否</td> </tr> <tr> <td>是否从已上传中选择</td> <td><input type="radio" name="setting[isselectimage]" value="1" checked> 是 <input type="radio" name="setting[isselectimage]" value="0"> 否</td> </tr> <tr> <td>图像大小</td> <td>宽 <input type="text" name="setting[images_width]" value="" size="3" class="input-text">px 高 <input type="text" name="setting[images_height]" value="" size="3" class="input-text">px</td> </tr> </table>
108wo
phpcms/modules/content/fields/image/field_add_form.inc.php
Hack
asf20
1,442
<?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>默认值</td> <td><input type="text" name="setting[defaultvalue]" value="<?php echo $setting['defaultvalue'];?>" size="40" class="input-text"></td> </tr> <tr> <td>表单显示模式</td> <td><input type="radio" name="setting[show_type]" value="1" <?php if($setting['show_type']) echo 'checked';?>/> 图片模式 <input type="radio" name="setting[show_type]" value="0" <?php if(!$setting['show_type']) echo 'checked';?>/> 文本框模式</td> </tr> <tr> <td>允许上传的图片大小</td> <td><input type="text" name="setting[upload_maxsize]" value="<?php echo $setting['upload_maxsize'];?>" size="5" class="input-text">KB 提示:1KB=1024Byte,1MB=1024KB *</td> </tr> <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[watermark]" value="1" <?php if($setting['watermark']) echo 'checked';?>> 是 <input type="radio" name="setting[watermark]" value="0" <?php if(!$setting['watermark']) echo 'checked';?>> 否</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[images_width]" value="<?php echo $setting['images_width'];?>" size="3" class="input-text">px 高 <input type="text" name="setting[images_height]" value="<?php echo $setting['images_height'];?>" size="3" class="input-text">px</td> </tr> </table>
108wo
phpcms/modules/content/fields/image/field_edit_form.inc.php
PHP
asf20
2,223
function image($field, $value) { return trim($value); }
108wo
phpcms/modules/content/fields/image/input.inc.php
PHP
asf20
63
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:"'.$errortips.'"}).inputValidator({min:1,onerror:"'.$errortips.'"});'; } $usable_type = $this->categorys[$this->catid]['usable_type']; $usable_array = array(); if($usable_type) $usable_array = explode(',',$usable_type); $type_data = getcache('type_content','commons'); foreach($type_data as $_key=>$_value) { if(in_array($_key,$usable_array)) $data[$_key] = $_value['name']; } return form::select($data,$value,'name="info['.$field.']" id="'.$field.'" '.$formattribute.' '.$css,L('copyfrom_tips')); }
108wo
phpcms/modules/content/fields/typeid/form.inc.php
PHP
asf20
846
<?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; //作为全站搜索信息 $field_allow_isunique = 0; //是否允许值唯一 ?>
108wo
phpcms/modules/content/fields/typeid/config.inc.php
PHP
asf20
500
<table cellpadding="2" cellspacing="1" width="96%"> <tr> <td>默认值</td> <td> <input type="hidden" name="setting[minnumber]" value="5"> <input type="text" name="setting[defaultvalue]" value="0" size="40" class="input-text"> 正整数 最大长度 5 </td> </tr> </table>
108wo
phpcms/modules/content/fields/typeid/field_add_form.inc.php
Hack
asf20
303
<?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 echo $setting['defaultvalue'];?>" size="40" class="input-text"> 正整数 最大长度 5 </td> </tr> </table>
108wo
phpcms/modules/content/fields/typeid/field_edit_form.inc.php
PHP
asf20
441
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; } $server_list = getcache('downservers','commons'); if(is_array($server_list)) { foreach($server_list as $_k=>$_v) { if (in_array($_v['siteid'],array(0,$fieldinfo['siteid']))) { $checked = $edit ? ((is_array($sel_server) && in_array($_k,$sel_server)) ? ' checked' : '') : ' checked'; $list_str .= "<lable id='downfile{$_k}' class='ib lh24' style='width:25%'><input type='checkbox' value='{$_k}' name='{$field}_servers[]' {$checked}> {$_v['sitename']}</lable>"; } } } $string = ' <fieldset class="blue pad-10"> <legend>'.L('mirror_server_list').'</legend>'; $string .= $list_str; $string .= '</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='text' name='info[$field]' id='$field' value='$value' class='input-text' style='width:80%'/> <input type='button' class='button' onclick=\"javascript:flashupload('{$field}_downfield', '".L('attachment_upload')."','{$field}',submit_files,'{$upload_number},{$upload_allowext},{$isselectimage}','content','$this->catid','{$authkey}')\"/ value='".L('upload_soft')."'>"; return $string; }
108wo
phpcms/modules/content/fields/downfile/form.inc.php
PHP
asf20
1,692
<?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; //作为全站搜索信息 $field_allow_isunique = 0; //是否允许值唯一 ?>
108wo
phpcms/modules/content/fields/downfile/config.inc.php
PHP
asf20
499
<?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 cellpadding="2" cellspacing="1" width="98%"> <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> <tr> <td>允许上传的文件类型</td> <td><input type="text" name="setting[upload_allowext]" value="rar|zip" 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> </table> <SCRIPT LANGUAGE="JavaScript"> <!-- function add_mirrorsite(obj) { var name = $(obj).siblings("#addname").val(); var url = $(obj).siblings("#addurl").val(); var servers = $("#servers").text()+name+" | "+url+"\r\n"; $("#servers").text(servers); } //--> </SCRIPT>
108wo
phpcms/modules/content/fields/downfile/field_add_form.inc.php
PHP
asf20
1,771
<?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 echo $str?> </fieldset> <table cellpadding="2" cellspacing="1" width="98%"> <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> <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> </table> <SCRIPT LANGUAGE="JavaScript"> <!-- function add_mirrorsite(obj) { var name = $(obj).siblings("#addname").val(); var url = $(obj).siblings("#addurl").val(); var servers = $("#servers").text()+name+" | "+url+"\r\n"; $("#servers").text(servers); } //--> </SCRIPT>
108wo
phpcms/modules/content/fields/downfile/field_edit_form.inc.php
PHP
asf20
2,163
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('downservers','commons'); if(is_array($server_list)) { foreach($server_list as $_k=>$_v) { if($value && is_array($sel_server) && in_array($_k,$sel_server)) { $downloadurl = $_v[siteurl].$fileurl; if($downloadlink) { $a_k = urlencode(sys_auth("i=$this->id&s=$_v[siteurl]&m=1&f=$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'>{$_v[sitename]}</a>"; } else { $list_str[] = "<a href='{$downloadurl}' target='_blank'>{$_v[sitename]}</a>"; } } } } return $list_str; }
108wo
phpcms/modules/content/fields/downfile/output.inc.php
PHP
asf20
1,014
function downfile($field, $value) { //取得镜像站点列表 $result = ''; $server_list = count($_POST[$field.'_servers']) > 0 ? implode(',' ,$_POST[$field.'_servers']) : ''; $result = $value.'|'.$server_list; return $result; }
108wo
phpcms/modules/content/fields/downfile/input.inc.php
PHP
asf20
249
<?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); ?>
108wo
phpcms/modules/content/fields/text/field_edit.inc.php
PHP
asf20
265
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->formValidator .= '$("#'.$field.'").formValidator({onshow:"",onfocus:"'.$errortips.'"}).inputValidator({min:1,onerror:"'.$errortips.'"});'; return '<input type="text" name="info['.$field.']" id="'.$field.'" size="'.$size.'" value="'.$value.'" class="input-text" '.$formattribute.' '.$css.'>'; }
108wo
phpcms/modules/content/fields/text/form.inc.php
PHP
asf20
612
<?php $db->query("ALTER TABLE `$tablename` DROP `$field`"); ?>
108wo
phpcms/modules/content/fields/text/field_delete.inc.php
PHP
asf20
65
<?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; //作为全站搜索信息 $field_allow_isunique = 1; //是否允许值唯一 ?>
108wo
phpcms/modules/content/fields/text/config.inc.php
PHP
asf20
499
<table cellpadding="2" cellspacing="1" width="98%"> <tr> <td width="100">文本框长度</td> <td><input type="text" name="setting[size]" value="50" size="10" class="input-text"></td> </tr> <tr> <td>默认值</td> <td><input type="text" name="setting[defaultvalue]" value="" size="40" class="input-text"></td> </tr> <tr> <td>是否为密码框</td> <td><input type="radio" name="setting[ispassword]" value="1"> 是 <input type="radio" name="setting[ispassword]" value="0" checked> 否</td> </tr> </table>
108wo
phpcms/modules/content/fields/text/field_add_form.inc.php
Hack
asf20
571
<?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>默认值</td> <td><input type="text" name="setting[defaultvalue]" value="<?php echo $setting['defaultvalue'];?>" size="40" class="input-text"></td> </tr> <tr> <td>是否为密码框</td> <td><input type="radio" name="setting[ispassword]" value="1" <?php if($setting['ispassword']) echo 'checked';?>> 是 <input type="radio" name="setting[ispassword]" value="0" <?php if(!$setting['ispassword']) echo 'checked';?>> 否</td> </tr> </table>
108wo
phpcms/modules/content/fields/text/field_edit_form.inc.php
PHP
asf20
799
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,$value,'name="'.$field.'[]" id="'.$field.'"','','120'); }
108wo
phpcms/modules/content/fields/groupid/form.inc.php
PHP
asf20
379
<?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 = 1; //是否允许值唯一 ?>
108wo
phpcms/modules/content/fields/groupid/config.inc.php
PHP
asf20
499
<table cellpadding="2" cellspacing="1" width="98%"> <tr> <td width="200">默认选择的会员组</td> <td><input type="text" name="setting[groupids]" value="" size="20" class="input-text"> 填写会员组ID,多个用 “|” 分开</td> </tr> </table>
108wo
phpcms/modules/content/fields/groupid/field_add_form.inc.php
Hack
asf20
277
<?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> </tr> </table>
108wo
phpcms/modules/content/fields/groupid/field_edit_form.inc.php
PHP
asf20
378
function groupid($field, $value) { if($value) $value = explode(',',$value); return $value; }
108wo
phpcms/modules/content/fields/groupid/output.inc.php
PHP
asf20
103
function groupid($field, $value) { $datas = ''; if(!empty($_POST[$field]) && is_array($_POST[$field])) { $datas = implode(',',$_POST[$field]); } return $datas; }
108wo
phpcms/modules/content/fields/groupid/input.inc.php
PHP
asf20
182
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] = $v[0]; } $values = explode(',',$value); $value = array(); foreach($values as $_k) { if($_k != '') $value[] = $_k; } $value = implode(',',$value); switch($this->fields[$field]['boxtype']) { case 'radio': $string = form::radio($option,$value,"name='info[$field]' $fieldinfo[formattribute]",$setting['width'],$field); break; case 'checkbox': $string = form::checkbox($option,$value,"name='info[$field][]' $fieldinfo[formattribute]",1,$setting['width'],$field); break; case 'select': $string = form::select($option,$value,"name='info[$field]' id='$field' $fieldinfo[formattribute]"); break; case 'multiple': $string = form::select($option,$value,"name='info[$field][]' id='$field ' size=2 multiple='multiple' style='height:60px;' $fieldinfo[formattribute]"); break; } return $string; }
108wo
phpcms/modules/content/fields/box/form.inc.php
PHP
asf20
1,196
<?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; //作为全站搜索信息 $field_allow_isunique = 0; //是否允许值唯一 ?>
108wo
phpcms/modules/content/fields/box/config.inc.php
PHP
asf20
495
<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:400px;">选项名称1|选项值1</textarea></td> </tr> <tr> <td>选项类型</td> <td> <input type="radio" name="setting[boxtype]" value="radio" checked onclick="$('#setcols').show();$('#setsize').hide();"/> 单选按钮 <input type="radio" name="setting[boxtype]" value="checkbox" onclick="$('#setcols').show();$('setsize').hide();"/> 复选框 <input type="radio" name="setting[boxtype]" value="select" onclick="$('#setcols').hide();$('setsize').show();" /> 下拉框 <input type="radio" name="setting[boxtype]" value="multiple" onclick="$('#setcols').hide();$('setsize').show();" /> 多选列表框 </td> </tr> <tr> <td>字段类型</td> <td> <select name="setting[fieldtype]" onchange="javascript:fieldtype_setting(this.value);"> <option value="varchar">字符 VARCHAR</option> <option value="tinyint">整数 TINYINT(3)</option> <option value="smallint">整数 SMALLINT(5)</option> <option value="mediumint">整数 MEDIUMINT(8)</option> <option value="int">整数 INT(10)</option> </select> <span id="minnumber" style="display:none"><input type="radio" name="setting[minnumber]" value="1" checked/> <font color='red'>正整数</font> <input type="radio" name="setting[minnumber]" value="-1" /> 整数</span> </td> </tr> <tbody id="setcols" style="display:"> <tr> <td>每列宽度</td> <td><input type="text" name="setting[width]" value="80" size="5" class="input-text"> px</td> </tr> </tbody> <tbody id="setsize" style="display:none"> <tr> <td>高度</td> <td><input type="text" name="setting[size]" value="1" size="5" class="input-text"> 行</td> </tr> </tbody> <tr> <td>默认值</td> <td><input type="text" name="setting[defaultvalue]" size="40" class="input-text"></td> </tr> <tr> <td>输出格式</td> <td> <input type="radio" name="setting[outputtype]" value="1" checked /> 输出选项值 <input type="radio" name="setting[outputtype]" value="0" /> 输出选项名称 </td> </tr> <tr> <td>是否作为筛选字段</td> <td> <input type="radio" name="setting[filtertype]" value="1"/> 是 <input type="radio" name="setting[filtertype]" value="0"/> 否 </td> </tr> </table> <SCRIPT LANGUAGE="JavaScript"> <!-- function fieldtype_setting(obj) { if(obj!='varchar') { $('#minnumber').css('display',''); } else { $('#minnumber').css('display','none'); } } //--> </SCRIPT>
108wo
phpcms/modules/content/fields/box/field_add_form.inc.php
Hack
asf20
2,744
<?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> </tr> <tr> <td>选项类型</td> <td> <input type="radio" name="setting[boxtype]" value="radio" <?php if($setting['boxtype']=='radio') echo 'checked';?> onclick="$('#setcols').show();$('#setsize').hide();"/> 单选按钮 <input type="radio" name="setting[boxtype]" value="checkbox" <?php if($setting['boxtype']=='checkbox') echo 'checked';?> onclick="$('#setcols').show();$('setsize').hide();"/> 复选框 <input type="radio" name="setting[boxtype]" value="select" <?php if($setting['boxtype']=='select') echo 'checked';?> onclick="$('#setcols').hide();$('setsize').show();" /> 下拉框 <input type="radio" name="setting[boxtype]" value="multiple" <?php if($setting['boxtype']=='multiple') echo 'checked';?> onclick="$('#setcols').hide();$('setsize').show();" /> 多选列表框 </td> </tr> <tr> <td>字段类型</td> <td> <select name="setting[fieldtype]" onchange="javascript:fieldtype_setting(this.value);"> <option value="varchar" <?php if($setting['fieldtype']=='varchar') echo 'selected';?>>字符 VARCHAR</option> <option value="tinyint" <?php if($setting['fieldtype']=='tinyint') echo 'selected';?>>整数 TINYINT(3)</option> <option value="smallint" <?php if($setting['fieldtype']=='smallint') echo 'selected';?>>整数 SMALLINT(5)</option> <option value="mediumint" <?php if($setting['fieldtype']=='mediumint') echo 'selected';?>>整数 MEDIUMINT(8)</option> <option value="int" <?php if($setting['fieldtype']=='int') echo 'selected';?>>整数 INT(10)</option> </select> <span id="minnumber" style="display:none"><input type="radio" name="setting[minnumber]" value="1" <?php if($setting['minnumber']==1) echo 'checked';?>/> <font color='red'>正整数</font> <input type="radio" name="setting[minnumber]" value="-1" <?php if($setting['minnumber']==-1) echo 'checked';?>/> 整数</span> </td> </tr> <tbody id="setcols" style="display:"> <tr> <td>每列宽度</td> <td><input type="text" name="setting[width]" value="<?php echo $setting['width'];?>" size="5" class="input-text"> px</td> </tr> </tbody> <tbody id="setsize" style="display:none"> <tr> <td>高度</td> <td><input type="text" name="setting[size]" value="<?php echo $setting['size'];?>" size="5" class="input-text"> 行</td> </tr> </tbody> <tr> <td>默认值</td> <td><input type="text" name="setting[defaultvalue]" size="40" class="input-text" value="<?php echo $setting['defaultvalue'];?>"></td> </tr> <tr> <td>输出格式</td> <td> <input type="radio" name="setting[outputtype]" value="1" <?php if($setting['outputtype']) echo 'checked';?> /> 输出选项值 <input type="radio" name="setting[outputtype]" value="0" <?php if(!$setting['outputtype']) echo 'checked';?> /> 输出选项名称 </td> </tr> <tr> <td>是否作为筛选字段</td> <td> <input type="radio" name="setting[filtertype]" value="1" <?php if($setting['filtertype']) echo 'checked';?> /> 是 <input type="radio" name="setting[filtertype]" value="0" <?php if(!$setting['filtertype']) echo 'checked';?>/> 否 </td> </tr> </table> <SCRIPT LANGUAGE="JavaScript"> <!-- function fieldtype_setting(obj) { if(obj!='varchar') { $('#minnumber').css('display',''); } else { $('#minnumber').css('display','none'); } } //--> </SCRIPT>
108wo
phpcms/modules/content/fields/box/field_edit_form.inc.php
PHP
asf20
3,756
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]; } $string = ''; switch($this->fields[$field]['boxtype']) { case 'radio': $string = $option[$value]; break; case 'checkbox': $value_arr = explode(',',$value); foreach($value_arr as $_v) { if($_v) $string .= $option[$_v].' 、'; } break; case 'select': $string = $option[$value]; break; case 'multiple': $value_arr = explode(',',$value); foreach($value_arr as $_v) { if($_v) $string .= $option[$_v].' 、'; } break; } return $string; } }
108wo
phpcms/modules/content/fields/box/output.inc.php
PHP
asf20
885
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) && count($value)>0) { $value = ','.implode(',', $value).','; return $value; } } else { return $value; } }
108wo
phpcms/modules/content/fields/box/input.inc.php
PHP
asf20
451
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($copyfrom_array)) { foreach($copyfrom_array as $_k=>$_v) { if($this->siteid==$_v['siteid']) $copyfrom_datas[$_k] = $_v['sitename']; } } return "<input type='text' name='info[$field]' value='$value' style='width: 400px;' class='input-text'>".form::select($copyfrom_datas,$value_data,"name='{$field}_data' "); }
108wo
phpcms/modules/content/fields/copyfrom/form.inc.php
PHP
asf20
646
<?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; //作为全站搜索信息 $field_allow_isunique = 0; //是否允许值唯一 ?>
108wo
phpcms/modules/content/fields/copyfrom/config.inc.php
PHP
asf20
499
<table cellpadding="2" cellspacing="1" width="98%"> <tr> <td>默认值</td> <td><input type="text" name="setting[defaultvalue]" value="" size="50" class="input-text"></td> </tr> </table>
108wo
phpcms/modules/content/fields/copyfrom/field_add_form.inc.php
Hack
asf20
209
<?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>
108wo
phpcms/modules/content/fields/copyfrom/field_edit_form.inc.php
PHP
asf20
314