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.');
$show_header = 1;
include $this->admin_tpl('header', 'admin');
?>
<form method="post" action="?m=formguide&c=formguide&a=setting" id="myform" name="myform">
<table width="100%" cellpadding="0" cellspacing="1" class="table_form">
<tr>
<th width="130"><?php echo L('allows_more_ip')?>:</th>
<td><input type='radio' name='setting[allowmultisubmit]' value='1' <?php if($allowmultisubmit == 1) {?>checked<?php }?>> <?php echo L('yes')?>
<input type='radio' name='setting[allowmultisubmit]' value='0' <?php if($allowmultisubmit == 0) {?>checked<?php }?>> <?php echo L('no')?></td>
</tr>
<tr id="setting" style="<?php if ($allowmultisubmit == 0) {?>dispaly:none<?php }?>">
<th width="130"><?php echo L('interval')?>:</th>
<td><input type="text" value="<?php echo $interval?>" name="setting[interval]" size="10" class="input-text"> <?php echo L('minute')?></td>
</tr>
<tr>
<th><?php echo L('allowunreg')?>:</th>
<td><input type='radio' name='setting[allowunreg]' value='1' <?php if($allowunreg == 1) {?>checked<?php }?>> <?php echo L('yes')?>
<input type='radio' name='setting[allowunreg]' value='0' <?php if($allowunreg == 0) {?>checked<?php }?>> <?php echo L('no')?></td>
</tr>
<tr>
<th><?php echo L('mailmessage')?>:</th>
<td><textarea cols="50" rows="6" id="mailmessage" name="setting[mailmessage]"><?php echo $mailmessage?></textarea></td>
</tr>
<tr style="display:none">
<td> </td>
<td><input type="submit" name="dosubmit" id="dosubmit" class="dialog" value=" <?php echo L('ok')?> "> <input type="reset" class="dialog" value=" <?php echo L('clear')?> "></td>
</tr>
</table>
</form>
</body>
</html>
<script type="text/javascript">
$("input:radio[name='setting[allowmultisubmit]']").click(function (){
if($("input:radio[name='setting[allowmultisubmit]'][checked]").val()==0) {
$("#setting").hide();
} else if($("input:radio[name='setting[allowmultisubmit]'][checked]").val()==1) {
$("#setting").show();
}
});
</script>
|
108wo
|
phpcms/modules/formguide/templates/setting.tpl.php
|
PHP
|
asf20
| 2,128
|
<?php
defined('IN_PHPCMS') or exit('No permission resources.');
pc_base::load_app_class('admin','admin',0);
pc_base::load_sys_class('form', '', '');
class formguide extends admin {
private $db, $tablename, $m_db, $M;
public function __construct() {
parent::__construct();
$this->tablename = '';
$setting = new_html_special_chars(getcache('formguide', 'commons'));
$this->M = $setting[$this->get_siteid()];
$this->db = pc_base::load_model('sitemodel_model');
}
//表单向导列表
public function init() {
$page = max(intval($_GET['page']), 1);
$data = $this->db->listinfo(array('type' => 3, 'siteid'=>$this->get_siteid()), '`modelid` DESC', $page);
$big_menu = array('javascript:window.top.art.dialog({id:\'add\',iframe:\'?m=formguide&c=formguide&a=add\', title:\''.L('formguide_add').'\', width:\'700\', height:\'500\', lock:true}, function(){var d = window.top.art.dialog({id:\'add\'}).data.iframe;var form = d.document.getElementById(\'dosubmit\');form.click();return false;}, function(){window.top.art.dialog({id:\'add\'}).close()});void(0);', L('formguide_add'));
include $this->admin_tpl('formguide_list');
}
/**
* 添加表单向导
*/
public function add() {
if (isset($_POST['dosubmit'])) {
if ($_POST['setting']['starttime']) {
$_POST['setting']['starttime'] = strtotime($_POST['setting']['starttime']);
}
if ($_POST['setting']['endtime']) {
$_POST['setting']['endtime'] = strtotime($_POST['setting']['endtime']);
}
$_POST['info'] = $this->check_info($_POST['info']);
$_POST['info']['setting'] = array2string($_POST['setting']);
$_POST['info']['siteid'] = $this->get_siteid();
$_POST['info']['addtime'] = SYS_TIME;
$_POST['info']['js_template'] = $_POST['info']['show_js_template'];
$_POST['info']['type'] = 3;
unset($_POST['info']['show_js_template']);
$this->tablename = $_POST['info']['tablename'];
$formid = $this->db->insert($_POST['info'], true);
define('MODEL_PATH',PC_PATH.'modules'.DIRECTORY_SEPARATOR.'formguide'.DIRECTORY_SEPARATOR.'fields'.DIRECTORY_SEPARATOR);
$create_sql = file_get_contents(MODEL_PATH.'create.sql');
$this->m_db = pc_base::load_model('sitemodel_field_model');
$this->sql_execute($create_sql);
$form_public_field_array = getcache('form_public_field_array', 'model');
if (is_array($form_public_field_array)) {
foreach ($form_public_field_array as $k => $v) {
$v['info']['modelid'] = $formid;
$this->m_db->insert($v['info']);
$sql = str_replace('formguide_table', $this->m_db->db_tablepre.'form_'.$_POST['info']['tablename'], $v['sql']);
$this->m_db->query($sql);
}
}
showmessage(L('add_success'), '?m=formguide&c=formguide_field&a=init&formid='.$formid, '', 'add');
} else {
$siteid = $this->get_siteid();
$template_list = template_list($siteid, 0);
$site = pc_base::load_app_class('sites','admin');
$info = $site->get_by_id($siteid);
foreach ($template_list as $k=>$v) {
$template_list[$v['dirname']] = $v['name'] ? $v['name'] : $v['dirname'];
unset($template_list[$k]);
}
$formid = intval($_GET['formid']);
pc_base::load_sys_class('form', '', false);
$show_header = $show_validator = $show_scroll = 1;
include $this->admin_tpl('formguide_add');
}
}
/**
* 编辑表单向导
*/
public function edit() {
if (!isset($_GET['formid']) || empty($_GET['formid'])) {
showmessage(L('illegal_operation'), HTTP_REFERER);
}
$formid = intval($_GET['formid']);
if (isset($_POST['dosubmit'])) {
if ($_POST['setting']['starttime']) {
$_POST['setting']['starttime'] = strtotime($_POST['setting']['starttime']);
}
if ($_POST['setting']['endtime']) {
$_POST['setting']['endtime'] = strtotime($_POST['setting']['endtime']);
}
$_POST['info'] = $this->check_info($_POST['info'], $formid);
$_POST['info']['setting'] = array2string($_POST['setting']);
$_POST['info']['js_template'] = $_POST['info']['show_js_template'];
unset($_POST['info']['show_js_template']);
$this->db->update($_POST['info'], array('modelid'=>$formid));
showmessage(L('update_success'), '?m=formguide&c=formguide&a=init&formid='.$formid, '', 'edit');
} else {
$siteid = $this->get_siteid();
$template_list = template_list($siteid, 0);
$site = pc_base::load_app_class('sites','admin');
$info = $site->get_by_id($siteid);
foreach ($template_list as $k=>$v) {
$template_list[$v['dirname']] = $v['name'] ? $v['name'] : $v['dirname'];
unset($template_list[$k]);
}
$data = $this->db->get_one(array('modelid'=>$formid));
$data['setting'] = string2array($data['setting']);
pc_base::load_sys_class('form', '', false);
$show_header = $show_validator = $show_scroll = 1;
include $this->admin_tpl('formguide_edit');
}
}
/**
* 表单向导禁用、开启
*/
public function disabled() {
if (!isset($_GET['formid']) || empty($_GET['formid'])) {
showmessage(L('illegal_operation'), HTTP_REFERER);
}
$formid = intval($_GET['formid']);
$val = $_GET['val'] ? intval($_GET['val']) : 0;
$this->db->update(array('disabled'=>$val), array('modelid'=>$formid, 'siteid'=>$this->get_siteid()));
showmessage(L('operation_success'), HTTP_REFERER);
}
/**
* 预览
*/
public function public_preview() {
if (!isset($_GET['formid']) || empty($_GET['formid'])) {
showmessage(L('illegal_operation'), HTTP_REFERER);
}
$formid = intval($_GET['formid']);
$f_info = $this->db->get_one(array('modelid'=>$formid, 'siteid'=>$this->get_siteid()), 'name');
define('CACHE_MODEL_PATH',PHPCMS_PATH.'caches'.DIRECTORY_SEPARATOR.'caches_model'.DIRECTORY_SEPARATOR.'caches_data'.DIRECTORY_SEPARATOR);
require CACHE_MODEL_PATH.'formguide_form.class.php';
$formguide_form = new formguide_form($formid);
$forminfos_data = $formguide_form->get();
$show_header = 1;
include $this->admin_tpl('formguide_preview');
}
/**
* ajax 检测表是重复
*/
public function public_checktable() {
if (isset($_GET['formid']) && !empty($_GET['formid'])) {
$formid = intval($_GET['formid']);
}
$r = $this->db->get_one(array('tablename'=>$_GET['tablename']), 'tablename, modelid');
if (!$r['modelid']) {
exit('1');
} elseif ($r['modelid'] && ($r['modelid']==$formid)) {
exit('1');
} else {
exit('0');
}
}
/**
* 判断表单数据合法性
* @param array $data 表单数组
* @param intval $formid 表单id
*/
private function check_info($data = array(), $formid = 0) {
if (empty($data) || $data['name']=='') {
showmessage(L('input_form_title'), HTTP_REFERER);
}
if ($data['tablename']=='') {
showmessage(L('please_input_tallename'), HTTP_REFERER);
}
$r = $this->db->get_one(array('tablename'=>$data['tablename']), 'tablename, modelid');
if ($r['modelid'] && (($r['modelid']!=$formid) || !$formid)) {
showmessage(L('tablename_existed'), HTTP_REFERER);
}
return $data;
}
/**
* 删除表单向导
*/
public function delete() {
$siteid = $this->get_siteid();
if (isset($_GET['formid']) && !empty($_GET['formid'])) {
$formid = intval($_GET['formid']);
$m_db = pc_base::load_model('sitemodel_field_model');
$m_db->delete(array('modelid'=>$formid, 'siteid'=>$siteid));
$m_info = $this->db->get_one(array('modelid'=>$formid), 'tablename');
$tablename = $m_db->db_tablepre.'form_'.$m_info['tablename'];
$m_db->query("DROP TABLE `$tablename`");
$this->db->delete(array('modelid'=>$formid, 'siteid'=>$siteid));
showmessage(L('operation_success'), HTTP_REFERER);
} elseif (isset($_POST['formid']) && !empty($_POST['formid'])) {
$m_db = pc_base::load_model('sitemodel_field_model');
$m_db->delete(array('modelid'=>$formid, 'siteid'=>$siteid));
if (is_array($_POST['formid'])) {
foreach ($_POST['formid'] as $fid) {
$m_info = $this->db->get_one(array('modelid'=>$fid), 'tablename');
$tablename = $m_db->db_tablepre.'form_'.$m_info['tablename'];
$m_db->query("DROP TABLE `$tablename`");
$this->db->delete(array('modelid'=>$fid, 'siteid'=>$siteid));
}
}
showmessage(L('operation_success'), HTTP_REFERER);
} else {
showmessage(L('illegal_operation'), HTTP_REFERER);
}
}
/**
* 统计
*/
public function stat() {
if (!isset($_GET['formid']) || empty($_GET['formid'])) {
showmessage(L('illegal_operation'), HTTP_REFERER);
}
$formid = intval($_GET['formid']);
$fields = getcache('formguide_field_'.$formid, 'model');
$f_info = $this->db->get_one(array('modelid'=>$formid, 'siteid'=>$this->get_siteid()), 'tablename');
$tablename = 'form_'.$f_info['tablename'];
$m_db = pc_base::load_model('sitemodel_field_model');
$result = $m_db->select(array('modelid'=>$formid, 'formtype'=>'box'), 'field, setting');
$m_db->change_table($tablename);
$datas = $m_db->select(array(), '*');
$total = count($datas);
include $this->admin_tpl('formguide_stat');
}
/**
* 模块配置
*/
public function setting() {
if (isset($_POST['dosubmit'])) {
$setting = getcache('formguide', 'commons');
$setting[$this->get_siteid()] = $_POST['setting'];
setcache('formguide', $setting, 'commons'); //设置缓存
$m_db = pc_base::load_model('module_model'); //调用模块数据模型
$setting = array2string($_POST['setting']);
$m_db->update(array('setting'=>$setting), array('module'=>ROUTE_M)); //将配置信息存入数据表中
showmessage(L('setting_updates_successful'), HTTP_REFERER, '', 'setting');
} else {
@extract($this->M);
include $this->admin_tpl('setting');
}
}
/**
* 执行sql文件,创建数据表等
* @param string $sql sql语句
*/
private function sql_execute($sql) {
$sqls = $this->sql_split($sql);
if (is_array($sqls)) {
foreach ($sqls as $sql) {
if (trim($sql) != '') {
$this->m_db->query($sql);
}
}
} else {
$this->m_db->query($sqls);
}
return true;
}
/**
* 处理sql语句,执行替换前缀都功能。
* @param string $sql 原始的sql,将一些大众的部分替换成私有的
*/
private function sql_split($sql) {
$database = pc_base::load_config('database');
$dbcharset = $database['default']['charset'];
if($this->m_db->version() > '4.1' && $dbcharset) {
$sql = preg_replace("/TYPE=(InnoDB|MyISAM|MEMORY)( DEFAULT CHARSET=[^; ]+)?/", "ENGINE=\\1 DEFAULT CHARSET=".$dbcharset, $sql);
}
$sql = str_replace("phpcms_form_table", $this->m_db->db_tablepre.'form_'.$this->tablename, $sql);
$ret = array();
$num = 0;
$queriesarray = explode(";\n", trim($sql));
unset($sql);
foreach ($queriesarray as $query) {
$ret[$num] = '';
$queries = explode("\n", trim($query));
$queries = array_filter($queries);
foreach ($queries as $query) {
$str1 = substr($query, 0, 1);
if($str1 != '#' && $str1 != '-') $ret[$num] .= $query;
}
$num++;
}
return $ret;
}
}
?>
|
108wo
|
phpcms/modules/formguide/formguide.php
|
PHP
|
asf20
| 11,147
|
<?php
defined('IN_PHPCMS') or exit('No permission resources.');
define('CACHE_MODEL_PATH',PHPCMS_PATH.'caches'.DIRECTORY_SEPARATOR.'caches_model'.DIRECTORY_SEPARATOR.'caches_data'.DIRECTORY_SEPARATOR);
class index {
private $db, $m_db, $M;
function __construct() {
$this->db = pc_base::load_model('sitemodel_model');
$this->m_db = pc_base::load_model('sitemodel_field_model');
$this->M = new_html_special_chars(getcache('formguide', 'commons'));
$this->siteid = get_siteid();
}
/**
* 表单向导首页
*/
public function index() {
$SEO = seo($this->siteid, '', L('formguide_list'));
$page = max(intval($_GET['page']), 1);
$r = $this->db->get_one(array('siteid'=>$this->siteid, 'type'=>3, 'disabled'=>0), 'COUNT(`modelid`) AS sum');
$total = $r['sum'];
$pages = pages($total, $page, 20);
$offset = ($page-1)*20;
$datas = $this->db->select(array('siteid'=>$this->siteid, 'type'=>3, 'disabled'=>0), 'modelid, name, addtime', $offset.',20', '`modelid` DESC');
include template('formguide', 'index');
}
/**
* 表单展示
*/
public function show() {
if (!isset($_GET['formid']) || empty($_GET['formid'])) {
$_GET['action'] ? exit : showmessage(L('form_no_exist'), HTTP_REFERER);
}
$formid = intval($_GET['formid']);
$r = $this->db->get_one(array('modelid'=>$formid, 'siteid'=>$this->siteid, 'disabled'=>0), 'tablename, setting');
if (!$r) {
$_GET['action'] ? exit : showmessage(L('form_no_exist'), HTTP_REFERER);
}
$setting = string2array($r['setting']);
if ($setting['enabletime']) {
if ($setting['starttime']>SYS_TIME || ($setting['endtime']+3600*24)<SYS_TIME) {
$_GET['action'] ? exit : showmessage(L('form_expired'), APP_PATH.'index.php?m=formguide&c=index&a=index');
}
}
$userid = param::get_cookie('_userid');
if ($setting['allowunreg']==0 && !$userid && $_GET['action']!='js') showmessage(L('please_login_in'), APP_PATH.'index.php?m=member&c=index&a=login&forward='.urlencode(HTTP_REFERER));
if (isset($_POST['dosubmit'])) {
$tablename = 'form_'.$r['tablename'];
$this->m_db->change_table($tablename);
$data = array();
require CACHE_MODEL_PATH.'formguide_input.class.php';
$formguide_input = new formguide_input($formid);
$data = $formguide_input->get($_POST['info']);
$data['userid'] = $userid;
$data['username'] = param::get_cookie('_username');
$data['datetime'] = SYS_TIME;
$data['ip'] = ip();
$dataid = $this->m_db->insert($data, true);
if ($dataid) {
if ($setting['sendmail']) {
pc_base::load_sys_func('mail');
$mails = explode(',', $setting['mails']);
if (is_array($mails)) {
foreach ($mails as $m) {
sendmail($m, L('tips'), $this->M['mailmessage']);
}
}
}
$this->db->update(array('items'=>'+=1'), array('modelid'=>$formid, 'siteid'=>$this->siteid));
}
showmessage(L('thanks'), APP_PATH);
} else {
if ($setting['allowunreg']==0 && !$userid && $_GET['action']=='js') {
$no_allowed = 1;
}
pc_base::load_sys_class('form', '', '');
$f_info = $this->db->get_one(array('modelid'=>$formid, 'siteid'=>$this->siteid));
extract($f_info);
$tablename = 'form_'.$r['tablename'];
$this->m_db->change_table($tablename);
$ip = ip();
$where = array();
if ($userid) $where = array('userid'=>$userid);
else $where = array('ip'=>$ip);
$re = $this->m_db->get_one($where, 'datetime');
$setting = string2array($setting);
if (($setting['allowmultisubmit']==0 && $re['datetime']) || ((SYS_TIME-$re['datetime'])<$this->M['interval']*60)) {
$_GET['action'] ? exit : showmessage(L('had_participate'), APP_PATH.'index.php?m=formguide&c=index&a=index');
}
require CACHE_MODEL_PATH.'formguide_form.class.php';
$formguide_form = new formguide_form($formid, $no_allowed);
$forminfos_data = $formguide_form->get();
$SEO = seo($this->siteid, L('formguide'), $name);
if (isset($_GET['action']) && $_GET['action']=='js') {
if(!function_exists('ob_gzhandler')) ob_clean();
ob_start();
}
$template = ($_GET['action']=='js') ? $js_template : $show_template;
include template('formguide', $template, $default_style);
if (isset($_GET['action']) && $_GET['action']=='js') {
$data=ob_get_contents();
ob_clean();
exit(format_js($data));
}
}
}
}
?>
|
108wo
|
phpcms/modules/formguide/index.php
|
PHP
|
asf20
| 4,416
|
<?php
defined('IN_PHPCMS') or exit('No permission resources.');
//模型原型存储路径
define('MODEL_PATH',PC_PATH.'modules'.DIRECTORY_SEPARATOR.'formguide'.DIRECTORY_SEPARATOR.'fields'.DIRECTORY_SEPARATOR);
//模型缓存路径
define('CACHE_MODEL_PATH',PHPCMS_PATH.'caches'.DIRECTORY_SEPARATOR.'caches_model'.DIRECTORY_SEPARATOR.'caches_data'.DIRECTORY_SEPARATOR);
/**
* 更新form表单模型类
* @author
*
*/
class formguide {
public function __construct() {
}
/**
* 更新模型缓存方法
*/
public function public_cache() {
require MODEL_PATH.'fields.inc.php';
//更新内容模型类:表单生成、入库、更新、输出
$classtypes = array('form','input','update','output');
foreach($classtypes as $classtype) {
$cache_data = file_get_contents(MODEL_PATH.'formguide_'.$classtype.'.class.php');
$cache_data = str_replace('}?>','',$cache_data);
foreach($fields as $field=>$fieldvalue) {
if(file_exists(MODEL_PATH.$field.DIRECTORY_SEPARATOR.$classtype.'.inc.php')) {
$cache_data .= file_get_contents(MODEL_PATH.$field.DIRECTORY_SEPARATOR.$classtype.'.inc.php');
}
}
$cache_data .= "\r\n } \r\n?>";
file_put_contents(CACHE_MODEL_PATH.'formguide_'.$classtype.'.class.php',$cache_data);
@chmod(CACHE_MODEL_PATH.'formguide_'.$classtype.'.class.php',0777);
}
return true;
}
}
?>
|
108wo
|
phpcms/modules/formguide/classes/formguide.class.php
|
PHP
|
asf20
| 1,395
|
<?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']['decimaldigits']) ? $_POST['setting']['decimaldigits'] : '';
switch($field_type) {
case 'varchar':
if(!$maxlength) $maxlength = 255;
$maxlength = min($maxlength, 255);
$sql = "ALTER TABLE `$tablename` ADD `$field` VARCHAR( $maxlength ) NOT NULL DEFAULT '$defaultvalue'";
if (!$unrunsql) $this->db->query($sql);
break;
case 'tinyint':
if(!$maxlength) $maxlength = 3;
$minnumber = intval($minnumber);
$defaultvalue = intval($defaultvalue);
$sql = "ALTER TABLE `$tablename` ADD `$field` TINYINT( $maxlength ) ".($minnumber >= 0 ? 'UNSIGNED' : '')." NOT NULL DEFAULT '$defaultvalue'";
if (!$unrunsql) $this->db->query($sql);
break;
case 'number':
$minnumber = intval($minnumber);
$defaultvalue = $decimaldigits == 0 ? intval($defaultvalue) : floatval($defaultvalue);
$sql = "ALTER TABLE `$tablename` ADD `$field` ".($decimaldigits == 0 ? 'INT' : 'FLOAT')." ".($minnumber >= 0 ? 'UNSIGNED' : '')." NOT NULL DEFAULT '$defaultvalue'";
if (!$unrunsql) $this->db->query($sql);
break;
case 'smallint':
$minnumber = intval($minnumber);
$sql = "ALTER TABLE `$tablename` ADD `$field` SMALLINT ".($minnumber >= 0 ? 'UNSIGNED' : '')." NOT NULL";
if (!$unrunsql) $this->db->query($sql);
break;
case 'int':
$minnumber = intval($minnumber);
$defaultvalue = intval($defaultvalue);
$sql = "ALTER TABLE `$tablename` ADD `$field` INT ".($minnumber >= 0 ? 'UNSIGNED' : '')." NOT NULL DEFAULT '$defaultvalue'";
if (!$unrunsql) $this->db->query($sql);
break;
case 'mediumint':
$minnumber = intval($minnumber);
$defaultvalue = intval($defaultvalue);
$sql = "ALTER TABLE `$tablename` ADD `$field` INT ".($minnumber >= 0 ? 'UNSIGNED' : '')." NOT NULL DEFAULT '$defaultvalue'";
if (!$unrunsql) $this->db->query($sql);
break;
case 'mediumtext':
$sql = "ALTER TABLE `$tablename` ADD `$field` MEDIUMTEXT NOT NULL";
if (!$unrunsql) $this->db->query($sql);
break;
case 'text':
$sql = "ALTER TABLE `$tablename` ADD `$field` TEXT NOT NULL";
if (!$unrunsql) $this->db->query($sql);
break;
case 'date':
$sql = "ALTER TABLE `$tablename` ADD `$field` DATE NULL";
if (!$unrunsql) $this->db->query($sql);
break;
case 'datetime':
$sql = "ALTER TABLE `$tablename` ADD `$field` DATETIME NULL";
if (!$unrunsql) $this->db->query($sql);
break;
case 'timestamp':
$sql = "ALTER TABLE `$tablename` ADD `$field` TIMESTAMP NOT NULL";
if (!$unrunsql) $this->db->query($sql);
break;
//特殊自定义字段
case 'pages':
$this->db->query("ALTER TABLE `$tablename` ADD `paginationtype` TINYINT( 1 ) NOT NULL DEFAULT '0'");
$this->db->query("ALTER TABLE `$tablename` ADD `maxcharperpage` MEDIUMINT( 6 ) NOT NULL DEFAULT '0'");
break;
case 'readpoint':
$defaultvalue = intval($defaultvalue);
$this->db->query("ALTER TABLE `$tablename` ADD `readpoint` smallint(5) unsigned NOT NULL default '$defaultvalue'");
$this->db->query("ALTER TABLE `$tablename` ADD `paytype` tinyint(1) unsigned NOT NULL default '0'");
break;
}
?>
|
108wo
|
phpcms/modules/formguide/fields/add.sql.php
|
PHP
|
asf20
| 3,390
|
<?php
class formguide_input {
var $formid;
var $fields;
var $data;
function __construct($formid) {
$this->formid = $formid;
$this->fields = getcache('formguide_field_'.$formid, 'model');
$this->siteid = get_siteid();
//初始化附件类
pc_base::load_sys_class('attachment','',0);
$this->siteid = param::get_cookie('siteid');
$this->attachment = new attachment('formguide','0',$this->siteid);
$this->site_config = getcache('sitelist','commons');
$this->site_config = $this->site_config[$this->siteid];
}
function get($data,$isimport = 0) {
$this->data = $data;
$info = array();
foreach($this->fields as $field) {
//if(!isset($this->fields[$field]) || check_in($_roleid, $this->fields[$field]['unsetroleids']) || check_in($_groupid, $this->fields[$field]['unsetgroupids'])) continue;
$name = $field['name'];
$minlength = $field['minlength'];
$maxlength = $field['maxlength'];
$pattern = $field['pattern'];
$errortips = $field['errortips'];
$value = $data[$field['field']];
if(empty($errortips)) $errortips = $name.' '.L('not_meet_the_conditions');
$length = is_array($value) ? (empty($value) ? 0 : 1) : strlen($value);
if($minlength && $length < $minlength) {
if($isimport) {
return false;
} else {
showmessage($name.' '.L('not_less_than').' '.$minlength.L('characters'));
}
}
if($maxlength && $length > $maxlength) {
if($isimport) {
$value = str_cut($value,$maxlength,'');
} else {
showmessage($name.' '.L('not_more_than').' '.$maxlength.L('characters'));
}
} elseif($maxlength) {
$value = str_cut($value,$maxlength,'');
}
if($pattern && $length && !preg_match($pattern, $value) && !$isimport) showmessage($errortips);
$func = $field['formtype'];
if(method_exists($this, $func)) $value = $this->$func($field['field'], $value);
$info[$field['field']] = $value;
//颜色选择为隐藏域 在这里进行取值
if ($_POST['style_color']) $info['style'] = $_POST['style_color'];
if($_POST['style_font_weight']) $info['style'] = $info['style'].';'.strip_tags($_POST['style_font_weight']);
}
return $info;
}
}?>
|
108wo
|
phpcms/modules/formguide/fields/formguide_input.class.php
|
PHP
|
asf20
| 2,220
|
<?php
$fields = array('text'=>'单行文本',
'textarea'=>'多行文本',
'editor'=>'编辑器',
'box'=>'选项',
'image'=>'图片',
'images'=>'多图片',
'number'=>'数字',
'datetime'=>'日期和时间',
'linkage'=>'联动菜单',
);
//不允许删除的字段,这些字段讲不会在字段添加处显示
$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/formguide/fields/fields.inc.php
|
PHP
|
asf20
| 1,018
|
function linkage($field, $value, $fieldinfo) {
$setting = string2array($fieldinfo['setting']);
$linkageid = $setting['linkageid'];
return menu_linkage($linkageid,$field,$value);
}
|
108wo
|
phpcms/modules/formguide/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/formguide/fields/linkage/config.inc.php
|
PHP
|
asf20
| 500
|
<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
</td></tr>
<tr>
<td>路径分隔符</td>
<td><input type="text" name="setting[space]" value="" size="5" class="input-text"> 显示完整路径时生效</td>
</tr>
</table>
|
108wo
|
phpcms/modules/formguide/fields/linkage/field_add_form.inc.php
|
Hack
|
asf20
| 943
|
<?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
</td></tr>
<tr>
<td>路径分隔符</td>
<td><input type="text" name="setting[space]" value="<?php echo $setting['space'];?>" size="5" class="input-text"> 显示完整路径时生效</td>
</tr>
</table>
|
108wo
|
phpcms/modules/formguide/fields/linkage/field_edit_form.inc.php
|
PHP
|
asf20
| 1,218
|
function linkage($field, $value) {
$setting = string2array($this->fields[$field]['setting']);
$datas = getcache($setting['linkageid'],'linkage');
$infos = $datas['data'];
if($setting['showtype']==1) {
$result = get_linkage($value, $setting['linkageid'], $setting['space'], 1);
} elseif($setting['showtype']==2) {
$result = $value;
} else {
$result = get_linkage($value, $setting['linkageid'], $setting['space'], 2);
}
return $result;
}
|
108wo
|
phpcms/modules/formguide/fields/linkage/output.inc.php
|
PHP
|
asf20
| 478
|
<?php
class formguide_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/formguide/fields/formguide_update.class.php
|
PHP
|
asf20
| 545
|
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{$_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{$_k}')\">".L('remove')."</a></li>";
}
}
} else {
//$list_str .= "<input type='hidden' name='{$field}_url[]' value='0'>";
$list_str .= "<center><div class='onShow' id='nameTip'>".L('max_upload_num')." <font color='red'>{$upload_number}</font> ".L('zhang')."</div></center>";
}
$string = '<input name="info['.$field.']" type="hidden" value="1">
<fieldset class="blue pad-10">
<legend>'.L('picutre_list').'</legend>';
$string .= $list_str;
$string .= '<ul id="'.$field.'" class="picList"></ul>
</fieldset>
<div class="bk10"></div>
';
if(!defined('IMAGES_INIT')) {
$str = '<script type="text/javascript" src="'.JS_PATH.'swfupload/swf2ckeditor.js"></script><script language="javascript" type="text/javascript" src="'.JS_PATH.'content_addtop.js"></script>';
define('IMAGES_INIT', 1);
} else {
$str = '';
}
$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}','formguide','','{$authkey}')\"/> ".L('select_picture')." </a></div>";
return $string;
}
|
108wo
|
phpcms/modules/formguide/fields/images/form.inc.php
|
Hack
|
asf20
| 1,850
|
function images($field, $value) {
return string2array($value);
}
|
108wo
|
phpcms/modules/formguide/fields/images/ouput.inc.php
|
PHP
|
asf20
| 72
|
<?php
defined('IN_ADMIN') or exit('No permission resources.');
$field_type = 'mediumtext'; //字段数据库类型
$field_allow_index = 0; //是否允许建立索引
$field_minlength = 0; //字符长度默认最小值
$field_maxlength = ''; //字符长度默认最大值
$field_allow_search = 0; //作为搜索条件
$field_allow_isunique = 0; //是否允许值唯一
?>
|
108wo
|
phpcms/modules/formguide/fields/images/config.inc.php
|
PHP
|
asf20
| 388
|
<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/formguide/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/formguide/fields/images/field_edit_form.inc.php
|
PHP
|
asf20
| 840
|
function images($field, $value) {
return string2array($value);
}
|
108wo
|
phpcms/modules/formguide/fields/images/output.inc.php
|
PHP
|
asf20
| 72
|
function images($field, $value) {
//取得图片列表
$pictures = $_POST[$field.'_url'];
//取得图片说明
$pictures_alt = $_POST[$field.'_alt'];
$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/formguide/fields/images/input.inc.php
|
PHP
|
asf20
| 420
|
<?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/formguide/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;
return "<textarea name='info[{$field}]' id='$field' style='width:{$width}%;height:{$height}px;' $formattribute $css $this->no_allowed>{$value}</textarea>";
}
|
108wo
|
phpcms/modules/formguide/fields/textarea/form.inc.php
|
PHP
|
asf20
| 675
|
<?php
$db->query("ALTER TABLE `$tablename` DROP `$field`");
?>
|
108wo
|
phpcms/modules/formguide/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/formguide/fields/textarea/search_form.inc.php
|
PHP
|
asf20
| 110
|
<?php
defined('IN_ADMIN') or exit('No permission resources.');
$field_type = 'mediumtext'; //字段数据库类型
$field_allow_index = 0; //是否允许建立索引
$field_minlength = 0; //字符长度默认最小值
$field_maxlength = ''; //字符长度默认最大值
$field_allow_search = 0; //作为搜索条件
$field_allow_isunique = 0; //是否允许值唯一
?>
|
108wo
|
phpcms/modules/formguide/fields/textarea/config.inc.php
|
PHP
|
asf20
| 390
|
<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/formguide/fields/textarea/field_add_form.inc.php
|
Hack
|
asf20
| 762
|
function text($field, $value)
{
return $value === '' ? '' : " `$field` LIKE '%$value%' ";
}
|
108wo
|
phpcms/modules/formguide/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 $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/formguide/fields/textarea/field_edit_form.inc.php
|
PHP
|
asf20
| 1,029
|
function textarea($field, $value) {
if(!$this->fields[$field]['enablehtml']) $value = strip_tags($value);
return $value;
}
|
108wo
|
phpcms/modules/formguide/fields/textarea/input.inc.php
|
PHP
|
asf20
| 133
|
function number($field, $value, $fieldinfo) {
extract($fieldinfo);
if(!$value) $value = $defaultvalue;
$errortips = $this->fields[$field]['errortips'];
if($errortips) $this->formValidator .= '$("#'.$field.'").formValidator({onshow:"'.$errortips.'",onfocus:"'.$errortips.'"}).inputValidator({min:'.$minnumber.',max:'.$maxnumber.',onerror:"'.$errortips.'"}).regexValidator({regexp:"num",datatype:"enum",onerror:"'.$errortips.'"});';
return "<input type='text' name='info[$field]' id='$field' value='$value' size='$size' $this->no_allowed class='input-text' {$formattribute} {$css}>";
}
|
108wo
|
phpcms/modules/formguide/fields/number/form.inc.php
|
PHP
|
asf20
| 603
|
<?php
defined('IN_ADMIN') or exit('No permission resources.');
$field_type = 'number'; //字段数据库类型
$field_allow_index = 1; //是否允许建立索引
$field_minlength = 0; //字符长度默认最小值
$field_maxlength = ''; //字符长度默认最大值
$field_allow_search = 1; //作为搜索条件
$field_allow_isunique = 1; //是否允许值唯一
?>
|
108wo
|
phpcms/modules/formguide/fields/number/config.inc.php
|
PHP
|
asf20
| 384
|
<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="<?=$defaultvalue?>" size="40" class="input-text"></td>
</tr>
</table>
|
108wo
|
phpcms/modules/formguide/fields/number/field_add_form.inc.php
|
PHP
|
asf20
| 849
|
<?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>
</table>
|
108wo
|
phpcms/modules/formguide/fields/number/field_edit_form.inc.php
|
PHP
|
asf20
| 1,582
|
function editor($field, $value, $fieldinfo) {
//是否允许用户上传附件 ,后台管理员开启此功能
extract($fieldinfo);
extract(string2array($setting));
$allowupload = defined('IN_ADMIN') ? 1 : 0;
if(!$value) $value = $defaultvalue;
if($minlength || $pattern) $allow_empty = '';
if($errortips) $this->formValidator .= '$("#'.$field.'").formValidator({'.$allow_empty.'onshow:"",onfocus:"'.$errortips.'"}).inputValidator({min:1,onerror:"'.$errortips.'"});';
return "<div id='{$field}_tip'></div>".'<textarea name="info['.$field.']" id="'.$field.'" boxid="'.$field.'">'.$value.'</textarea>'.form::editor($field,$toolbar,'member','','',$allowupload,1,'',300);
}
|
108wo
|
phpcms/modules/formguide/fields/editor/form.inc.php
|
PHP
|
asf20
| 700
|
<?php
defined('IN_ADMIN') or exit('No permission resources.');
$field_type = 'mediumtext'; //字段数据库类型
$field_allow_index = 0; //是否允许建立索引
$field_minlength = 0; //字符长度默认最小值
$field_maxlength = ''; //字符长度默认最大值
$field_allow_search = 0; //作为搜索条件
$field_allow_isunique = 0; //是否允许值唯一
?>
|
108wo
|
phpcms/modules/formguide/fields/editor/config.inc.php
|
PHP
|
asf20
| 388
|
<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>
</table>
|
108wo
|
phpcms/modules/formguide/fields/editor/field_add_form.inc.php
|
Hack
|
asf20
| 475
|
<?php defined('IN_PHPCMS') or exit('No permission resources.');?>
<table cellpadding="2" cellspacing="1" width="98%">
<tr>
<td width="100">编辑器样式:</td>
<td><input type="radio" name="setting[toolbar]" value="basic" <?php if($setting['toolbar']=='basic') echo 'checked';?>> <?php echo $setting['toolbar'];?>简洁型 <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>
</table>
|
108wo
|
phpcms/modules/formguide/fields/editor/field_edit_form.inc.php
|
PHP
|
asf20
| 718
|
function editor($field, $value) {
return $value;
}
|
108wo
|
phpcms/modules/formguide/fields/editor/output.inc.php
|
PHP
|
asf20
| 58
|
function editor($field, $value) {
$setting = string2array($this->fields[$field]['setting']);
$enablesaveimage = $setting['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/formguide/fields/editor/input.inc.php
|
PHP
|
asf20
| 379
|
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><script language="javascript" type="text/javascript" src="'.JS_PATH.'content_addtop.js"></script>';
define('IMAGES_INIT', 1);
}
$authkey = upload_key("1,$upload_allowext,$isselectimage,$images_width,$images_height");
if($show_type) {
$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:;' onclick=\"javascript:flashupload('{$field}_images', '".L('attachment_upload')."','{$field}',thumb_images,'1,$upload_allowext,$isselectimage,$images_width,$images_height','member','','{$authkey}')\">
<img src='$preview_img' id='{$field}_preview' width='135' height='113' style='cursor:hand' /></a></div>";
} else {
return $str."<input type='text' name='info[$field]' id='$field' value='$value' size='$size' $this->no_allowed class='input-text' /> <input type='button' class='button' $this->no_allowed onclick=\"javascript:flashupload('{$field}_images', '".L('attachment_upload')."','{$field}',submit_images,'1,{$upload_allowext},$isselectimage,$images_width,$images_height','member','','{$authkey}')\"/ value='".L('image_upload')."'>";
}
}
|
108wo
|
phpcms/modules/formguide/fields/image/form.inc.php
|
Hack
|
asf20
| 1,466
|
<?php
defined('IN_ADMIN') or exit('No permission resources.');
$field_type = 'varchar'; //字段数据库类型
$field_allow_index = 0; //是否允许建立索引
$field_minlength = 0; //字符长度默认最小值
$field_maxlength = ''; //字符长度默认最大值
$field_allow_search = 0; //作为搜索条件
$field_allow_isunique = 0; //是否允许值唯一
?>
|
108wo
|
phpcms/modules/formguide/fields/image/config.inc.php
|
PHP
|
asf20
| 385
|
<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[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">px 高 <input type="text" name="setting[images_height]" value="" size="3">px</td>
</tr>
</table>
|
108wo
|
phpcms/modules/formguide/fields/image/field_add_form.inc.php
|
Hack
|
asf20
| 1,192
|
<?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[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">px 高 <input type="text" name="setting[images_height]" value="<?php echo $setting['images_height'];?>" size="3">px</td>
</tr>
</table>
|
108wo
|
phpcms/modules/formguide/fields/image/field_edit_form.inc.php
|
PHP
|
asf20
| 1,880
|
<?php
class formguide_form {
var $formid;
var $fields;
var $id;
var $formValidator;
function __construct($formid, $no_allowed = 0) {
$this->formid = $formid;
$this->no_allowed = $no_allowed ? 'disabled=""' : '';
$this->fields = getcache('formguide_field_'.$formid, '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();
$info = array();
if (is_array($this->fields)) {
foreach($this->fields as $field=>$v) {
$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) {
$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/formguide/fields/formguide_form.class.php
|
PHP
|
asf20
| 1,248
|
<?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/formguide/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'];
$regexp = $pattern ? '.regexValidator({regexp:"'.substr($pattern,1,-1).'",onerror:"'.$errortips.'"})' : '';
if($errortips) $this->formValidator .= '$("#'.$field.'").formValidator({onshow:"'.$errortips.'",onfocus:"'.$errortips.'"}).inputValidator({min:'.$minlength.',max:'.$maxlength.',onerror:"'.$errortips.'"})'.$regexp.';';
return '<input type="text" name="info['.$field.']" id="'.$field.'" size="'.$size.'" value="'.$value.'" '.$this->no_allowed.' class="input-text" '.$formattribute.' '.$css.'>';
}
|
108wo
|
phpcms/modules/formguide/fields/text/form.inc.php
|
PHP
|
asf20
| 788
|
<?php
$db->query("ALTER TABLE `$tablename` DROP `$field`");
?>
|
108wo
|
phpcms/modules/formguide/fields/text/field_delete.inc.php
|
PHP
|
asf20
| 65
|
<?php
defined('IN_ADMIN') or exit('No permission resources.');
$field_type = 'varchar'; //字段数据库类型
$field_allow_index = 1; //是否允许建立索引
$field_minlength = 1; //字符长度默认最小值
$field_maxlength = ''; //字符长度默认最大值
$field_allow_search = 1; //作为搜索条件
$field_allow_isunique = 1; //是否允许值唯一
?>
|
108wo
|
phpcms/modules/formguide/fields/text/config.inc.php
|
PHP
|
asf20
| 385
|
<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/formguide/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/formguide/fields/text/field_edit_form.inc.php
|
PHP
|
asf20
| 799
|
<?php
class formguide_output {
var $fields;
var $data;
function __construct($formid) {
$this->formid = $formid;
$this->fields = getcache('formguide_field_'.$formid, 'model');
$this->siteid = get_siteid();
}
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/formguide/fields/formguide_output.class.php
|
PHP
|
asf20
| 642
|
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]'",$setting['width'],$field);
break;
case 'checkbox':
$string = form::checkbox($option,$value,"name='info[$field][]'",1,$setting['width'],$field);
break;
case 'select':
$string = form::select($option,$value,"name='info[$field]' id='$field'");
break;
case 'multiple':
$string = form::select($option,$value,"name='info[$field][]' id='$field' size=2 multiple='multiple' style='height:60px;'");
break;
}
return $string;
}
|
108wo
|
phpcms/modules/formguide/fields/box/form.inc.php
|
PHP
|
asf20
| 1,089
|
<?php
defined('IN_ADMIN') or exit('No permission resources.');
$field_type = 'int'; //字段数据库类型
$field_allow_index = 1; //是否允许建立索引
$field_minlength = 1; //字符长度默认最小值
$field_maxlength = ''; //字符长度默认最大值
$field_allow_search = 1; //作为搜索条件
$field_allow_isunique = 0; //是否允许值唯一
?>
|
108wo
|
phpcms/modules/formguide/fields/box/config.inc.php
|
PHP
|
asf20
| 381
|
<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[cols]" value="5" size="5" class="input-text"> 每行显示的选项个数</td>
</tr>
<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>
</table>
<SCRIPT LANGUAGE="JavaScript">
<!--
function fieldtype_setting(obj) {
if(obj!='varchar') {
$('#minnumber').css('display','');
} else {
$('#minnumber').css('display','none');
}
}
//-->
</SCRIPT>
|
108wo
|
phpcms/modules/formguide/fields/box/field_add_form.inc.php
|
Hack
|
asf20
| 2,449
|
<?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[cols]" value="<?php echo $setting['cols'];?>" size="5" class="input-text"> 每行显示的选项个数</td>
</tr>
<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>
</table>
<SCRIPT LANGUAGE="JavaScript">
<!--
function fieldtype_setting(obj) {
if(obj!='varchar') {
$('#minnumber').css('display','');
} else {
$('#minnumber').css('display','none');
}
}
//-->
</SCRIPT>
|
108wo
|
phpcms/modules/formguide/fields/box/field_edit_form.inc.php
|
PHP
|
asf20
| 3,293
|
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/formguide/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)>1) {
$value = implode(',', $value);
return $value;
}
} else {
return $value;
}
}
|
108wo
|
phpcms/modules/formguide/fields/box/input.inc.php
|
PHP
|
asf20
| 435
|
<?php
defined('IN_ADMIN') or exit('No permission resources.');
$this->db->query("ALTER TABLE `$tablename` DROP `$field`");
?>
|
108wo
|
phpcms/modules/formguide/fields/delete.sql.php
|
PHP
|
asf20
| 130
|
<?php
defined('IN_ADMIN') or exit('No permission resources.');
$defaultvalue = isset($_POST['setting']['defaultvalue']) ? $_POST['setting']['defaultvalue'] : '';
$minnumber = isset($_POST['setting']['minnumber']) ? $_POST['setting']['minnumber'] : 1;
$decimaldigits = isset($_POST['setting']['decimaldigits']) ? $_POST['setting']['decimaldigits'] : '';
switch($field_type) {
case 'varchar':
if(!$maxlength) $maxlength = 255;
$maxlength = min($maxlength, 255);
$fieldtype = $issystem ? 'CHAR' : 'VARCHAR';
$sql = "ALTER TABLE `$tablename` CHANGE `$oldfield` `$field` $fieldtype( $maxlength ) NOT NULL DEFAULT '$defaultvalue'";
if (!$unrunsql) $this->db->query($sql);
break;
case 'tinyint':
$minnumber = intval($minnumber);
$defaultvalue = intval($defaultvalue);
$sql = "ALTER TABLE `$tablename` CHANGE `$oldfield` `$field` TINYINT ".($minnumber >= 0 ? 'UNSIGNED' : '')." NOT NULL DEFAULT '$defaultvalue'";
if (!$unrunsql) $this->db->query($sql);
break;
case 'number':
$minnumber = intval($minnumber);
$defaultvalue = $decimaldigits == 0 ? intval($defaultvalue) : floatval($defaultvalue);
$sql = "ALTER TABLE `$tablename` CHANGE `$oldfield` `$field` ".($decimaldigits == 0 ? 'INT' : 'FLOAT')." ".($minnumber >= 0 ? 'UNSIGNED' : '')." NOT NULL DEFAULT '$defaultvalue'";
if (!$unrunsql) $this->db->query($sql);
break;
case 'smallint':
$minnumber = intval($minnumber);
$defaultvalue = intval($defaultvalue);
$sql = "ALTER TABLE `$tablename` CHANGE `$oldfield` `$field` SMALLINT ".($minnumber >= 0 ? 'UNSIGNED' : '')." NOT NULL DEFAULT '$defaultvalue'";
if (!$unrunsql) $this->db->query($sql);
break;
case 'mediumint':
$minnumber = intval($minnumber);
$defaultvalue = intval($defaultvalue);
$sql = "ALTER TABLE `$tablename` CHANGE `$oldfield` `$field` MEDIUMINT ".($minnumber >= 0 ? 'UNSIGNED' : '')." NOT NULL DEFAULT '$defaultvalue'";
if (!$unrunsql) $this->db->query($sql);
break;
case 'int':
$minnumber = intval($minnumber);
$defaultvalue = intval($defaultvalue);
$sql = "ALTER TABLE `$tablename` CHANGE `$oldfield` `$field` INT ".($minnumber >= 0 ? 'UNSIGNED' : '')." NOT NULL DEFAULT '$defaultvalue'";
if (!$unrunsql) $this->db->query($sql);
break;
case 'mediumtext':
$sql = "ALTER TABLE `$tablename` CHANGE `$oldfield` `$field` MEDIUMTEXT NOT NULL";
if (!$unrunsql) $this->db->query($sql);
break;
case 'text':
$sql = "ALTER TABLE `$tablename` CHANGE `$oldfield` `$field` TEXT NOT NULL";
if (!$unrunsql) $this->db->query($sql);
break;
case 'date':
$sql = "ALTER TABLE `$tablename` CHANGE `$oldfield` `$field` DATE NULL";
if (!$unrunsql) $this->db->query($sql);
break;
case 'datetime':
$sql = "ALTER TABLE `$tablename` CHANGE `$oldfield` `$field` DATETIME NULL";
if (!$unrunsql) $this->db->query($sql);
break;
case 'timestamp':
$sql = "ALTER TABLE `$tablename` CHANGE `$oldfield` `$field` TIMESTAMP NOT NULL";
if (!$unrunsql) $this->db->query($sql);
break;
//特殊自定义字段
case 'pages':
break;
case 'readpoint':
$defaultvalue = intval($defaultvalue);
$this->db->query("ALTER TABLE `$tablename` CHANGE `$oldfield` `readpoint` smallint(5) unsigned NOT NULL default '$defaultvalue'");
break;
}
?>
|
108wo
|
phpcms/modules/formguide/fields/edit.sql.php
|
PHP
|
asf20
| 3,305
|
function datetime($field, $value, $fieldinfo) {
extract(string2array($fieldinfo['setting']));
$isdatetime = 0;
if($fieldtype=='int') {
if(!$value) $value = SYS_TIME;
$format_txt = $format == 'm-d' ? 'm-d' : $format;
$value = date($format_txt,$value);
$isdatetime = strlen($format) > 6 ? 1 : 0;
} elseif($fieldtype=='datetime') {
$isdatetime = 1;
}
return form::date("info[$field]",$value,$isdatetime,1);
}
|
108wo
|
phpcms/modules/formguide/fields/datetime/form.inc.php
|
PHP
|
asf20
| 448
|
<?php
defined('IN_ADMIN') or exit('No permission resources.');
$field_type = 'int'; //字段数据库类型
$field_allow_index = 1; //是否允许建立索引
$field_minlength = 1; //字符长度默认最小值
$field_maxlength = ''; //字符长度默认最大值
$field_allow_search = 1; //作为搜索条件
$field_allow_isunique = 0; //是否允许值唯一
?>
|
108wo
|
phpcms/modules/formguide/fields/datetime/config.inc.php
|
PHP
|
asf20
| 381
|
<table cellpadding="2" cellspacing="1" bgcolor="#ffffff">
<tr>
<td><strong>时间格式:</strong></td>
<td>
<input type="radio" name="setting[fieldtype]" value="date" checked>日期(<?php echo date('Y-m-d')?>)<br />
<input type="radio" name="setting[fieldtype]" value="datetime">日期+时间(<?php echo date('Y-m-d H:i:s')?>)<br />
<input type="radio" name="setting[fieldtype]" value="int">整数 显示格式:
<select name="setting[format]">
<option value="Y-m-d H:i:s"><?php echo date('Y-m-d H:i:s')?></option>
<option value="Y-m-d H:i"><?php echo date('Y-m-d H:i')?></option>
<option value="Y-m-d"><?php echo date('Y-m-d')?></option>
<option value="m-d"><?php echo date('m-d')?></option>
</select>
</td>
</tr>
<tr>
<td><strong>默认值:</strong></td>
<td>
<input type="radio" name="setting[defaulttype]" value="0" checked/>无<br />
</td>
</tr>
</table>
|
108wo
|
phpcms/modules/formguide/fields/datetime/field_add_form.inc.php
|
PHP
|
asf20
| 964
|
<?php defined('IN_PHPCMS') or exit('No permission resources.');?>
<table cellpadding="2" cellspacing="1" bgcolor="#ffffff">
<tr>
<td><strong>时间格式:</strong></td>
<td>
<input type="radio" name="setting[fieldtype]" value="date" <?php if($setting['fieldtype']=='date') echo 'checked';?>>日期(<?=date('Y-m-d')?>)<br />
<input type="radio" name="setting[fieldtype]" value="datetime" <?php if($setting['fieldtype']=='datetime') echo 'checked';?>>日期+时间(<?=date('Y-m-d H:i:s')?>)<br />
<input type="radio" name="setting[fieldtype]" value="int" <?php if($setting['fieldtype']=='int') echo 'checked';?>>整数 显示格式:
<select name="setting[format]">
<option value="Y-m-d H:i:s" <?php if($setting['format']=='Y-m-d H:i:s') echo 'selected';?>><?php echo date('Y-m-d H:i:s')?></option>
<option value="Y-m-d H:i" <?php if($setting['format']=='Y-m-d H:i') echo 'selected';?>><?php echo date('Y-m-d H:i')?></option>
<option value="Y-m-d" <?php if($setting['format']=='Y-m-d') echo 'selected';?>><?php echo date('Y-m-d')?></option>
<option value="m-d" <?php if($setting['format']=='m-d') echo 'selected';?>><?php echo date('m-d')?></option>
</select>
</td>
</tr>
<tr>
<td><strong>默认值:</strong></td>
<td>
<input type="radio" name="setting[defaulttype]" value="0" checked/>无<br />
</td>
</tr>
</table>
|
108wo
|
phpcms/modules/formguide/fields/datetime/field_edit_form.inc.php
|
PHP
|
asf20
| 1,420
|
function datetime($field, $value) {
$setting = string2array($this->fields[$field]['setting']);
extract($setting);
if($fieldtype=='date' || $fieldtype=='datetime') {
return $value;
} else {
$format_txt = $format;
}
if(strlen($format_txt)<6) {
$isdatetime = 0;
} else {
$isdatetime = 1;
}
if(!$value) $value = SYS_TIME;
$value = date($format_txt,$value);
return $value;
}
|
108wo
|
phpcms/modules/formguide/fields/datetime/output.inc.php
|
PHP
|
asf20
| 423
|
function datetime($field, $value) {
$setting = string2array($this->fields[$field]['setting']);
if($setting['fieldtype']=='int') {
$value = strtotime($value);
}
return $value;
}
|
108wo
|
phpcms/modules/formguide/fields/datetime/input.inc.php
|
PHP
|
asf20
| 197
|
<?php
defined('IN_PHPCMS') or exit('Access Denied');
defined('INSTALL') or exit('Access Denied');
?>
|
108wo
|
phpcms/modules/formguide/install/model.php
|
PHP
|
asf20
| 106
|
{template "content","header"}
<!--main-->
<div class="main">
<div class="col-left">
<div class="crumbs"><a href="{siteurl($siteid)}">首页</a><span> > </span>表单向导 列表</div>
<ul class="list lh24 f14">
{loop $datas $r}
<li><span class="rt">{date('Y-m-d H:i:s',$r[addtime])}</span>·<a href="{APP_PATH}index.php?m=formguide&c=index&a=show&formid={$r['modelid']}" target="_blank">{$r[name]}</a></li>
{if $n%5==0}<li class="bk20 hr"></li>{/if}
{/loop}
</ul>
<div id="pages" class="text-c">{$pages}</div>
</div>
<div class="col-auto">
<div class="box">
<h5 class="title-2">频道总排行</h5>
{pc:content action="hits" catid="$catid" num="10" order="views DESC"}
<ul class="content digg">
{loop $data $r}
<li><a href="{$r[url]}" target="_blank">{$r[title]}</a></li>
{/loop}
</ul>
{/pc}
</div>
<div class="bk10"></div>
<div class="box">
<h5 class="title-2">频道本月排行</h5>
{pc:content action="hits" catid="$catid" num="8" order="monthviews DESC"}
<ul class="content rank">
{loop $data $r}
<li><span>{number_format($r[monthviews])}</span><a href="{$r[url]}"{title_style($r[style])} class="title" title="{$r[title]}">{str_cut($r[title],56,'...')}</a></li>
{/loop}
</ul>
{/pc}
</div>
</div>
</div>
{template "content","footer"}
|
108wo
|
phpcms/modules/formguide/install/templates/index.html
|
HTML
|
asf20
| 1,506
|
{template "content","header"}
<link href="{CSS_PATH}table_form.css" rel="stylesheet" type="text/css" />
<link href="{CSS_PATH}dialog.css" rel="stylesheet" type="text/css" />
<div class="main">
<div class="col-left">
<div class="crumbs"><a href="{siteurl($siteid)}">首页</a><span> > </span><a href="{APP_PATH}index.php?m=formguide&c=index&a=index">表单向导</a> <span> > </span> {$name}</div>
<div id="Article">
<h1>{$name}</h1>
<div class="content">
<form method="post" action="?m=formguide&c=index&a=show&formid={$formid}" name="myform" id="myform">
<table class="table_form" width="100%" cellspacing="0">
<tbody>
{loop $forminfos_data $field $info}
{if $info['formtype']=='omnipotent'}
{loop $forminfos_data $_fm $_fm_value}
{if $_fm_value['iscomnipotent']}
{php $info['form'] = str_replace('{'.$_fm.'}',$_fm_value['form'],$info['form']);}
{/if}
{/loop}
{/if}
<tr>
<th width="80">{if $info['star']} <font color="red">*</font>{/if} {$info['name']}
</th>
<td>{$info['form']} {$info['tips']}</td>
</tr>
{/loop}
</tbody>
</table>
<input type="submit" name="dosubmit" id="dosubmit" value=" 提交 "> <input type="reset" value=" 取消 ">
</form>
</div>
</div>
<div class="bk10"></div>
</div>
<div class="col-auto">
<div class="box">
<h5 class="title-2">频道总排行</h5>
<ul class="content digg">
{pc:content action="hits" catid="$catid" num="10" order="views DESC" cache="3600"}
{loop $data $r}
<li><a href="{$r[url]}" target="_blank" title="{$r[title]}">{str_cut($r[title], 28, '')}</a></li>
{/loop}
{/pc}
</ul>
</div>
<div class="bk10"></div>
<div class="box">
<h5 class="title-2">频道本月排行</h5>
<ul class="content rank">
{pc:content action="hits" catid="$catid" num="10" order="monthviews DESC" cache="3600"}
{loop $data $r}
<li><span>{number_format($r[monthviews])}</span><a href="{$r[url]}"{title_style($r[style])} class="title" title="{$r[title]}">{str_cut($r[title],56,'...')}</a></li>
{/loop}
{/pc}
</ul>
</div>
</div>
</div>
<script type="text/javascript">
<!--
function show_ajax(obj) {
var keywords = $(obj).text();
var offset = $(obj).offset();
var jsonitem = '';
$.getJSON("{APP_PATH}index.php?m=content&c=index&a=json_list&type=keyword&modelid={$modelid}&id={$id}&keywords="+encodeURIComponent(keywords),
function(data){
var j = 1;
var string = "<div class='point key-float'><div style='position:relative'><div class='arro'></div>";
string += "<a href='JavaScript:;' onclick='$(this).parent().parent().remove();' hidefocus='true' class='close'><span>关闭</span></a><div class='contents f12'>";
if(data!=0) {
$.each(data, function(i,item){
j = i+1;
jsonitem += "<a href='"+item.url+"' target='_blank'>"+j+"、"+item.title+"</a><BR>";
});
string += jsonitem;
} else {
string += '没有找到相关的信息!';
}
string += "</div><span class='o1'></span><span class='o2'></span><span class='o3'></span><span class='o4'></span></div></div>";
$(obj).after(string);
$('.key-float').mouseover(
function (){
$(this).siblings().css({"z-index":0})
$(this).css({"z-index":1001});
}
)
$(obj).next().css({ "left": +offset.left-100, "top": +offset.top+$(obj).height()+12});
});
}
function add_favorite(title) {
$.getJSON('{APP_PATH}api.php?op=add_favorite&title='+title+'&url='+encodeURIComponent(location.href)+'&'+Math.random()+'&callback=?', function(data){
if(data.status==1) {
$("#favorite").html('收藏成功');
} else {
alert('请登录');
}
});
}
$(function(){
$('#Article .content img').LoadImage(true, 660, 660,'{IMG_PATH}s_nopic.gif');
})
//-->
</script>
<script language="JavaScript" src="{APP_PATH}api.php?op=count&id={$id}&modelid={$modelid}"></script>
{template "content","footer"}
|
108wo
|
phpcms/modules/formguide/install/templates/show.html
|
HTML
|
asf20
| 4,146
|
<script language="javascript" type="text/javascript" src="{JS_PATH}dialog.js"></script>
<link href="{CSS_PATH}table_form.css" rel="stylesheet" type="text/css" />
<link href="{CSS_PATH}dialog.css" rel="stylesheet" type="text/css" />
<div class="box">
<h5>表单向导</h5>
<div class="content">
<form method="post" action="{APP_PATH}index.php?m=formguide&c=index&a=show&formid={$formid}"{if $no_allowed} target="member_login"{/if} name="myform" id="myform">
<table class="table_form" width="100%" cellspacing="0">
<tbody>
{loop $forminfos_data $field $info}
{if $info['formtype']=='omnipotent'}
{loop $forminfos_data $_fm $_fm_value}
{if $_fm_value['iscomnipotent']}
{php $info['form'] = str_replace('{'.$_fm.'}',$_fm_value['form'],$info['form']);}
{/if}
{/loop}
{/if}
<tr>
<th width="80">{if $info['star']} <font color="red">*</font>{/if} {$info['name']}
</th>
<td>{$info['form']} {$info['tips']}</td>
</tr>
{/loop}
<tr>
<td></td>
<td><div class="submit ib"><input type="submit"{if $no_allowed} disabled=""{/if} name="dosubmit" id="dosubmit" value=" 提交 "></div> {if $no_allowed}您还没有<a href="{APP_PATH}index.php?m=member&c=index&alogin&forward={urlencode(HTTP_REFERER)}" style="color:red">登录</a>或<a href="" style="color:red">注册</a>网站,请登录后提交表单{/if}</td>
</tr>
</tbody>
</table>
</form>
</div>
</div>
|
108wo
|
phpcms/modules/formguide/install/templates/show_js.html
|
HTML
|
asf20
| 1,429
|
<?php
error_reporting(E_ALL);
defined('IN_PHPCMS') or exit('Access Denied');
defined('INSTALL') or exit('Access Denied');
$parentid = $menu_db->insert(array('name'=>'formguide', 'parentid'=>29, 'm'=>'formguide', 'c'=>'formguide', 'a'=>'init', 'data'=>'', 'listorder'=>0, 'display'=>'1'), true);
$menu_db->insert(array('name'=>'formguide_add', 'parentid'=>$parentid, 'm'=>'formguide', 'c'=>'formguide', 'a'=>'add', 'data'=>'', 'listorder'=>0, 'display'=>'0'));
$menu_db->insert(array('name'=>'formguide_edit', 'parentid'=>$parentid, 'm'=>'formguide', 'c'=>'formguide', 'a'=>'edit', 'data'=>'', 'listorder'=>0, 'display'=>'0'));
$menu_db->insert(array('name'=>'form_info_list', 'parentid'=>$parentid, 'm'=>'formguide', 'c'=>'formguide_info', 'a'=>'init', 'data'=>'', 'listorder'=>0, 'display'=>'0'));
$menu_db->insert(array('name'=>'formguide_disabled', 'parentid'=>$parentid, 'm'=>'formguide', 'c'=>'formguide', 'a'=>'disabled', 'data'=>'', 'listorder'=>0, 'display'=>'0'));
$menu_db->insert(array('name'=>'formguide_delete', 'parentid'=>$parentid, 'm'=>'formguide', 'c'=>'formguide', 'a'=>'delete', 'data'=>'', 'listorder'=>0, 'display'=>'0'));
$menu_db->insert(array('name'=>'formguide_stat', 'parentid'=>$parentid, 'm'=>'formguide', 'c'=>'formguide', 'a'=>'stat', 'data'=>'', 'listorder'=>0, 'display'=>'0'));
$menu_db->insert(array('name'=>'add_public_field', 'parentid'=>$parentid, 'm'=>'formguide', 'c'=>'formguide_field', 'a'=>'add', 'data'=>'', 'listorder'=>0, 'display'=>'1'));
$menu_db->insert(array('name'=>'list_public_field', 'parentid'=>$parentid, 'm'=>'formguide', 'c'=>'formguide_field', 'a'=>'init', 'data'=>'', 'listorder'=>0, 'display'=>'1'));
$menu_db->insert(array('name'=>'module_setting', 'parentid'=>$parentid, 'm'=>'formguide', 'c'=>'formguide', 'a'=>'setting', 'data'=>'', 'listorder'=>0, 'display'=>'0'));
$language = array('formguide'=>'表单向导', 'formguide_add'=>'添加表单向导', 'formguide_edit'=>'修改表单向导', 'form_info_list'=>'信息列表', 'formguide_disabled'=>'禁用表单', 'formguide_delete'=>'删除表单', 'formguide_stat'=>'表单统计', 'add_public_field'=>'添加公共字段', 'list_public_field'=>'管理公共字段', 'module_setting'=>'模块配置');
?>
|
108wo
|
phpcms/modules/formguide/install/extention.inc.php
|
PHP
|
asf20
| 2,241
|
<?php
defined('IN_PHPCMS') or exit('Access Denied');
defined('INSTALL') or exit('Access Denied');
$module = 'formguide';
$modulename = '表单向导模块';
$introduce = '独立模块';
$author = 'phpcms Team';
$authorsite = 'http://www.phpcms.cn';
$authoremail = '';
?>
|
108wo
|
phpcms/modules/formguide/install/config.inc.php
|
PHP
|
asf20
| 282
|
<?php
/*Language Format:
Add a new file(.lang.php) with your module name at /phpcms/languages/
translation save at the array:$LANG
*/
//add field
$LANG['formguide'] = '表单向导';
$LANG['input_form_title'] = '请输入表单向导名称!';
$LANG['title_min_3_chars'] = '表单向导至少3个汉字以上';
$LANG['right'] = '输入正确!';
$LANG['title_cannot_empty'] = '表单向导名称不能为空';
$LANG['field_manage'] = '字段管理';
$LANG['add_field'] = '添加字段';
$LANG['manage_field'] = '表单向导字段管理';
$LANG['priview_modelfield'] = '预览';
$LANG['fieldname'] = '字段名';
$LANG['cnames'] = '别名';
$LANG['type'] = '类型';
$LANG['system'] = '系统';
$LANG['must_input'] = '必填';
$LANG['search'] = '搜索';
$LANG['listorder'] = '排序';
$LANG['contribute'] = '投稿';
$LANG['field_enabled'] = '<font color="red"> 启用</font>';
$LANG['field_disabled'] = '禁用';
$LANG['fieldname'] = '字段类型';
$LANG['between_1_to_20'] = '长度必须为1-20位';
$LANG['fieldname_was_wrong'] = '字段名称不正确';
$LANG['already_exist'] = '已经存在';
$LANG['connecting_please_wait'] = '正在连接...请稍等';
$LANG['select_fieldtype'] = '请选择字段类型';
$LANG['input_nickname'] = '请输入别名';
$LANG['nickname_empty'] = '字段别名不能为空';
$LANG['input_right'] = '输入正确';
$LANG['field_type'] = '字段类型';
$LANG['fieldname_tips'] = '只能由英文字母、数字和下划线组成,并且仅能字母开头,不以下划线结尾';
$LANG['field_nickname'] = '字段别名';
$LANG['nickname_tips'] = '例如:文章标题';
$LANG['field_tip'] = '字段提示';
$LANG['field_tips'] = '显示在字段别名下方作为表单输入提示';
$LANG['relation_parm'] = '相关参数';
$LANG['relation_parm_tips'] = '设置表单相关属性';
$LANG['form_attr'] = '表单附加属性';
$LANG['form_attr_tips'] = '可以通过此处加入javascript事件';
$LANG['form_css_name'] = '表单样式名';
$LANG['form_css_name_tips'] = '定义表单的CSS样式名';
$LANG['string_size'] = '字符长度取值范围';
$LANG['string_size_tips'] = '系统将在表单提交时检测数据长度范围是否符合要求,如果不想限制长度请留空';
$LANG['minlength'] = '最小值';
$LANG['maxlength'] = '最大值';
$LANG['data_preg'] = '数据校验正则';
$LANG['data_preg_tips'] = '系统将通过此正则校验表单提交的数据合法性,如果不想校验数据请留空';
$LANG['often_preg'] = '常用正则';
$LANG['figure'] = '数字';
$LANG['integer'] = '整数';
$LANG['letter'] = '字母';
$LANG['integer_letter'] = '数字+字母';
$LANG['hyperlink'] = '超级链接';
$LANG['mobile_number'] = '手机号码';
$LANG['tel_number'] = '电话号码';
$LANG['zip'] = '邮政编码';
$LANG['data_passed_msg'] = '数据校验未通过的提示信息';
$LANG['unique'] = '值唯一';
$LANG['as_search_field'] = '作为搜索条件';
$LANG['disabled_groups_field'] = '禁止设置字段值的会员组';
$LANG['edit_field'] = '修改字段';
$LANG['public_field_manage'] = '管理公共字段';
$LANG['fields'] = '字段';
$LANG['picutre_list'] = '图片列表';
$LANG['max_upload_num'] = '您最多可以同时上传';
$LANG['zhang'] = '张';
$LANG['attachment_upload'] = '附件上传';
$LANG['select_picture'] = '选择图片';
//add formguide
$LANG['select_stardate'] = '启用时间限制时,请选择开始时间';
$LANG['select_downdate'] = '启用时间限制时,请选择结束时间';
$LANG['select_style'] = '选择风格';
$LANG['name'] = '名称';
$LANG['tablename'] = '表名';
$LANG['introduction'] = '简介';
$LANG['time_limit'] = '时间限制';
$LANG['enable'] = '启用';
$LANG['unenable'] = '不启用';
$LANG['start_time'] = '开始时间';
$LANG['end_time'] = '结束时间';
$LANG['allowed_send_mail'] = '允许发送邮件';
$LANG['e-mail_address'] = '接受邮件的地址';
$LANG['multiple_with_commas'] = '多个地址请用逗号隔开';
$LANG['optional_style'] = '可选风格';
$LANG['template_selection'] = '模板选择';
$LANG['please_input_tallename'] = '请填写表名';
$LANG['standard'] = '以字母开头,字母或数字或下划线构成';
$LANG['tablename_no_empty'] = '表名不能为空';
$LANG['edit_formguide'] = '编辑表单';
$LANG['public'] = '公共';
$LANG['stat_num'] = '统计数';
$LANG['thumb_shi'] = '图示';
$LANG['selects'] = '名称';
$LANG['values'] = '内容';
$LANG['tablename_existed'] = '数据表已存在';
$LANG['tablename_was_wrong'] = '表名输入错误';
//formguide list
$LANG['remove_all_selected'] = '删除选中';
$LANG['affirm_delete'] = '您确定要删除吗?';
$LANG['formguide_add'] = '添加表单向导';
$LANG['name_items'] = '名称(信息数)';
$LANG['create_time'] = '创建时间';
$LANG['call'] = '调用';
$LANG['visit_front'] = '访问前台';
$LANG['info_list'] = '信息列表';
$LANG['field_add'] = '添加字段';
$LANG['field_manage'] = '管理字段';
$LANG['preview'] = '预览';
$LANG['modify'] = '修改';
$LANG['stat'] = '统计';
$LANG['form_preview'] = '表单预览';
$LANG['return_list'] = '返回表单向导列表';
//formguide info
$LANG['username'] = '用户名';
$LANG['userip'] = '用户ip';
$LANG['times'] = '时间';
$LANG['operation'] = '操作';
$LANG['check'] = '查看';
$LANG['del'] = '删除';
$LANG['form_details'] = '表单详情';
$LANG['submit_info'] = '提交的信息';
$LANG['stat_formguide'] = '表单统计';
//setting
$LANG['formguide_setting'] = '表单向导模块配置';
$LANG['allows_more_ip'] = '允许同一IP多次提交';
$LANG['allowunreg'] = '允许游客提交表单';
$LANG['mailmessage'] = '发送邮件的内容';
$LANG['not_meet_the_conditions'] = '不符合要求';
$LANG['not_less_than'] = '不得少于';
$LANG['not_more_than'] = '不得多于';
$LANG['the_value_must_not_repeat'] = '的值不得重复!';
$LANG['interval'] = '两次提交间隔时间';
$LANG['minute'] = '分';
//index
$LANG['formguide_list'] = '表单向导列表';
$LANG['please_login_in'] = '请先登录网站!';
$LANG['form_no_exist'] = '此表单不存在或者已被删除!';
$LANG['form_expired'] = '表单已过期,感谢您的关注!';
$LANG['tips'] = '用户提交表单数据提醒';
$LANG['thanks'] = '感谢您的参与!';
$LANG['had_participate'] = '您已经参与过了!';
?>
|
108wo
|
phpcms/modules/formguide/install/languages/zh-cn/formguide.lang.php
|
PHP
|
asf20
| 6,942
|
<?php
defined('IN_PHPCMS') or exit('Access Denied');
defined('UNINSTALL') or exit('Access Denied');
?>
|
108wo
|
phpcms/modules/cnzz/uninstall/extention.inc.php
|
PHP
|
asf20
| 106
|
<?php
defined('IN_PHPCMS') or exit('No permission resources.');
pc_base::load_app_class('admin', 'admin', 0);
class index extends admin {
private $config;
public function __construct() {
$this->config = getcache('cnzz', 'commons');
}
public function init() {
if (empty($this->config)) {
showmessage(L('reg_msg'));
} else {
$config =& $this->config;
header('location:http://wss.cnzz.com/user/companion/phpcms_login.php?site_id='.$config['siteid'].'&password='.$config['password']);
}
}
public function public_regcnzz() {
if (empty($this->config)) {
$key = md5(APP_PATH.'F0dkYYtw');
if ($data = @file_get_contents('http://wss.cnzz.com/user/companion/phpcms.php?domain='.APP_PATH.'&key='.$key.'&cms=phpcms')) {
//失败
if (substr($data, 0, 1) == '-') {
showmessage(L('application_fails'));
} else {
$data = explode('@', $data);
$data['siteid'] = $data[0];
$data['password'] = $data[1];
unset($data[0], $data[1]);
setcache('cnzz', $data, 'commons');
showmessage(L('success'), '?m=cnzz&c=index&a=init');
}
} else {
showmessage(L('donot_connect_server'));
}
} else {
showmessage(L('has_been_registered'));
}
}
}
|
108wo
|
phpcms/modules/cnzz/index.php
|
PHP
|
asf20
| 1,250
|
<?php
defined('IN_PHPCMS') or exit('Access Denied');
defined('INSTALL') or exit('Access Denied');
return false;
?>
|
108wo
|
phpcms/modules/cnzz/install/model.php
|
PHP
|
asf20
| 120
|
<?php
defined('IN_PHPCMS') or exit('Access Denied');
defined('INSTALL') or exit('Access Denied');
$menu_db->insert(array('name'=>'cnzz', 'parentid'=>'977', 'm'=>'cnzz', 'c'=>'index', 'a'=>'init', 'data'=>'', 'listorder'=>16, 'display'=>'1'));
$language = array('cnzz'=>'CNZZ统计');
?>
|
108wo
|
phpcms/modules/cnzz/install/extention.inc.php
|
PHP
|
asf20
| 293
|
<?php
defined('IN_PHPCMS') or exit('Access Denied');
defined('INSTALL') or exit('Access Denied');
$module = 'cnzz';
$modulename = 'cnzz统计';
$introduce = '由国内领先的统计提供商cnzz,提供的全景统计。';
$author = 'phpcms team';
$authorsite = 'http://www.phpcms.cn';
$authoremail = '';
?>
|
108wo
|
phpcms/modules/cnzz/install/config.inc.php
|
PHP
|
asf20
| 319
|
<?php
$LANG['reg_msg'] = '您还的网站还没有申请CNZZ统计,是否现在申请?<br><br><input type="button" onclick="location.href=\'?m=cnzz&c=index&a=public_regcnzz\'" value=" 马 上 开 通 "> <input type="button" onclick="history.back();" value=" 暂 不 开 通 ">';
$LANG['application_fails'] = '申请失败,请稍候再试。';
$LANG['donot_connect_server'] = '无法成功连接cnzz服务器。';
$LANG['has_been_registered'] = '已经注册过。';
|
108wo
|
phpcms/modules/cnzz/install/languages/zh-cn/cnzz.lang.php
|
PHP
|
asf20
| 475
|
<?php
defined('IN_PHPCMS') or exit('Access Denied');
defined('UNINSTALL') or exit('Access Denied');
return array('wap');
?>
|
108wo
|
phpcms/modules/wap/uninstall/model.php
|
PHP
|
asf20
| 130
|
<?php
defined('IN_PHPCMS') or exit('Access Denied');
defined('UNINSTALL') or exit('Access Denied');
?>
|
108wo
|
phpcms/modules/wap/uninstall/extention.inc.php
|
PHP
|
asf20
| 108
|
<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header', 'admin');
?>
<div class="pad-10">
<form action="?m=wap&c=wap_admin&a=add" method="post" id="myform">
<input type="hidden" value='<?php echo $siteid?>' name="siteid">
<fieldset>
<legend><?php echo L('basic_config')?></legend>
<table width="100%" class="table_form">
<tr>
<th width="120"><?php echo L('wap_sel_site')?></th>
<td class="y-bg"><?php echo form::select($sitelist,self::get_siteid(),'name="siteid"')?></td>
</tr>
<tr>
<th width="120"><?php echo L('wap_sitename')?></th>
<td class="y-bg"><input type="text" class="input-text" name="sitename" id="sitename" size="30" value=""/></td>
</tr>
<tr>
<th width="120"><?php echo L('wap_logo')?></th>
<td class="y-bg"><input type="text" class="input-text" name="logo" id="logo" size="30" value=""/></td>
</tr>
<tr>
<th width="120"><?php echo L('wap_domain')?></th>
<td class="y-bg"><input type="text" class="input-text" name="domain" id="domain" size="30" value=""/> </td>
</tr>
</table>
</fieldset>
<div class="bk10"></div>
<fieldset>
<legend><?php echo L('parameter_config')?></legend>
<table width="100%" class="table_form">
<tr>
<th width="120"><?php echo L('wap_listnum')?></th>
<td class="y-bg"><input type="text" class="input-text" name="setting[listnum]" id="listnum" size="10" value="10"/> 条</td>
</tr>
<tr>
<th width="120"><?php echo L('wap_thumb')?></th>
<td class="y-bg"><input type="text" class="input-text" name="setting[thumb_w]" id="thumb_w" size="5" value="220"/>px * <input type="text" class="input-text" name="setting[thumb_h]" id="thumb_h" size="5" value="0"/>px</td>
</tr>
<tr>
<th width="120"><?php echo L('wap_content_page')?></th>
<td class="y-bg"><input type="text" class="input-text" name="setting[c_num]" id="c_num" size="10" value="1000"/></td>
</tr>
<tr>
<th width="120"><?php echo L('wap_index_tpl')?></th>
<td class="y-bg"><input type="text" class="input-text" name="setting[index_template]" id="index_template" size="20" value="index"/>.html</td>
</tr>
<tr>
<th width="120"><?php echo L('wap_cat_tpl')?></th>
<td class="y-bg"><input type="text" class="input-text" name="setting[category_template]" id="category_template" size="20" value="category"/>.html</td>
</tr>
<tr>
<th width="120"><?php echo L('wap_list_tpl')?></th>
<td class="y-bg"><input type="text" class="input-text" name="setting[list_template]" id="list_template" size="20" value="list"/>.html</td>
</tr>
<tr>
<th width="120"><?php echo L('wap_show_tpl')?></th>
<td class="y-bg"><input type="text" class="input-text" name="setting[show_template]" id="show_template" size="20" value="show"/>.html</td>
</tr>
<tr>
<th width="120"><?php echo L('wap_hotword')?></th>
<td class="y-bg"> <textarea style="height: 100px; width: 200px;" id="options" cols="20" rows="2" name="setting[hotwords]"><?php echo $hotwords?></textarea> <?php echo L('wap_hotword_desc')?></td>
</tr>
</table>
<div class="bk15"></div>
<input type="submit" id="dosubmit" name="dosubmit" class="dialog" value="<?php echo L('submit')?>" />
</fieldset>
</form>
</div>
</body>
</html>
|
108wo
|
phpcms/modules/wap/templates/m_add.tpl.php
|
PHP
|
asf20
| 3,431
|
<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header','admin');?>
<div class="pad-lr-10">
<form name="myform2" action="?m=wap&c=wap_admin&a=type_manage&siteid=<?php echo $siteid?>" method="post">
<table width="100%" cellspacing="0" class="search-form">
<tbody>
<tr>
<td><div class="explain-col"> <?php echo L('listorder')?> <input type="text" value="0" class="input-text" name="info[listorder]" size="5"> <?php echo L('wap_type_name')?> <input type="text" value="" class="input-text" name="info[typename]"> <?php echo L('wap_bound_type')?> <?php echo form::select_category('category_content_'.$siteid,$parentid,'name="info[cat]"',L('wap_type_bound'),0,0,0,$siteid);?><input type="submit" value="<?php echo L('wap_toptype_add')?>" class="button" name="dosubmit">
</div>
</td>
</tr>
</tbody>
</table>
</form>
<div class="table-list">
<form name="myform" action="" method="post" >
<table width="100%" cellspacing="0">
<thead>
<tr>
<th width="5%"><input type="checkbox" onclick="selectall('ids[]');" id="check_box" value=""></th>
<th width="10%" align="center"><?php echo L('listorder')?></th>
<th width="10%" align='center'>TYPEID</th>
<th width="40%" align="left"><?php echo L('wap_type_name')?></th>
<th width="20%"><?php echo L('wap_bound_type')?></th>
</tr>
</thead>
<tbody>
<?php echo $wap_type?>
</tbody>
</table>
<div class="btn">
<input type="submit" class="button" name="dosubmit" value="<?php echo L('submit')?>"
onclick="document.myform.action='?m=wap&c=wap_admin&a=type_edit&siteid=<?php echo $siteid?>';"/>
<input type="submit" class="button" name="dosubmit" value="<?php echo L('delete');?>" onclick="document.myform.action='?m=wap&c=wap_admin&a=type_delete&dosubmit=1';return confirm_delete()"/>
</div>
</form>
</div>
</div>
</div>
</body>
<a href="javascript:edit(<?php echo $v['siteid']?>, '<?php echo $v['name']?>')">
</html>
<script type="text/javascript">
function add_tr(obj,parentid,siteid) {
$(obj).parent().parent().after('<tr><td width="5%" align="center"></td><td width="10%" align="center"><input type="text" class="input-text" value="0" size="3" name="addorder['+parentid+']"></td><td width="10%" align="center"></td><td width="" align="left"> ├─ <input type="text" value="" class="input-text" name="addtype['+parentid+'][]" size="10" ></td><td width="20%" align="center" id="td_'+parentid+'"></td></tr>');
$("#td_"+parentid).load('?m=wap&c=wap_admin&a=public_show_cat_ajx&parentid='+parentid+'&siteid='+siteid);
};
function confirm_delete(){
if(confirm('<?php echo L('confirm_delete');?>')) $('#myform').submit();
}
</script>
|
108wo
|
phpcms/modules/wap/templates/type_manage.tpl.php
|
PHP
|
asf20
| 2,864
|
<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header','admin');?>
<div class="pad-lr-10">
<div class="table-list">
<table width="100%" cellspacing="0">
<thead>
<tr>
<th width="10%" align="left">SITEID</th>
<th width=""><?php echo L('wap_sitename')?></th>
<th width="20%"><?php echo L('status')?></th>
<th width="15%"><?php echo L('operations_manage')?></th>
</tr>
</thead>
<tbody>
<?php
if(is_array($infos)){
foreach($infos as $info){
?>
<tr>
<td width="10%"><?php echo $info['siteid']?></td>
<td width="" align="center"><a href="<?php echo APP_PATH?>index.php?m=wap&siteid=<?php echo $info['siteid']?>" target="_blank"><?php echo $info['sitename']?></a></td>
<td width="20%" align="center"><a href="?m=wap&c=wap_admin&a=public_status&siteid=<?php echo $info['siteid']?>&status=<?php echo $info['status']==0 ? 1 : 0?>"><?php echo $info['status']==0 ? L('wap_close') : L('wap_open')?></a></td>
<td width="15%" align="center">
<a href="javascript:edit(<?php echo $info['siteid']?>, '<?php echo new_addslashes($info['sitename'])?>')"><?php echo L('edit')?></a> | <a href="?m=wap&c=wap_admin&a=type_manage&siteid=<?php echo $info['siteid']?>&menuid=<?php echo $_GET['menuid']?>"><?php echo L('wap_type_manage')?></a> |
<a href="javascript:confirmurl('?m=wap&c=wap_admin&a=delete&siteid=<?php echo $info['siteid']?>', '<?php echo L('wap_del_cofirm')?>')"><?php echo L('delete')?></a>
</td>
</tr>
<?php
}
}
?>
</tbody>
</table>
</div>
<div id="pages"> <?php echo $pages?></div>
</div>
</div>
</body>
<a href="javascript:edit(<?php echo $v['siteid']?>, '<?php echo $v['name']?>')">
</html>
<script type="text/javascript">
<!--
function edit(siteid, name) {
window.top.art.dialog({title:'<?php echo L('edit')?>--'+name, id:'edit', iframe:'?m=wap&c=wap_admin&a=edit&siteid='+siteid ,width:'400px',height:'550px'}, function(){var d = window.top.art.dialog({id:'edit'}).data.iframe;
var form = d.document.getElementById('dosubmit');form.click();return false;}, function(){window.top.art.dialog({id:'edit'}).close()});
}
//-->
</script>
|
108wo
|
phpcms/modules/wap/templates/m_list.tpl.php
|
PHP
|
asf20
| 2,247
|
<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header', 'admin');
?>
<div class="pad-10">
<form action="?m=wap&c=wap_admin&a=edit" method="post" id="myform">
<input type="hidden" value='<?php echo $siteid?>' name="siteid">
<fieldset>
<legend><?php echo L('basic_config')?></legend>
<table width="100%" class="table_form">
<tr>
<th width="120"><?php echo L('wap_belong_site')?></th>
<td class="y-bg"><?php echo $sitelist[$siteid]['name']?></td>
</tr>
<tr>
<th width="120"><?php echo L('wap_sitename')?></th>
<td class="y-bg"><input type="text" class="input-text" name="sitename" id="sitename" size="30" value="<?php echo $sitename?>"/></td>
</tr>
<tr>
<th width="120"><?php echo L('wap_logo')?></th>
<td class="y-bg"><input type="text" class="input-text" name="logo" id="logo" size="30" value="<?php echo $logo?>"/></td>
</tr>
<tr>
<th width="120"><?php echo L('wap_domain')?></th>
<td class="y-bg"><input type="text" class="input-text" name="domain" id="domain" size="30" value="<?php echo $domain?>"/></td>
</tr>
</table>
</fieldset>
<div class="bk10"></div>
<fieldset>
<legend><?php echo L('parameter_config')?></legend>
<table width="100%" class="table_form">
<tr>
<th width="120"><?php echo L('wap_listnum')?></th>
<td class="y-bg"><input type="text" class="input-text" name="setting[listnum]" id="listnum" size="10" value="<?php echo $listnum?>"/> 条</td>
</tr>
<tr>
<th width="120"><?php echo L('wap_thumb')?></th>
<td class="y-bg"><input type="text" class="input-text" name="setting[thumb_w]" id="thumb_w" size="5" value="<?php echo $thumb_w?>"/>px * <input type="text" class="input-text" name="setting[thumb_h]" id="thumb_h" size="5" value="<?php echo $thumb_h?>"/>px</td>
</tr>
<tr>
<th width="120"><?php echo L('wap_content_page')?></th>
<td class="y-bg"><input type="text" class="input-text" name="setting[c_num]" id="c_num" size="10" value="<?php echo $c_num?>"/></td>
</tr>
<tr>
<th width="120"><?php echo L('wap_index_tpl')?></th>
<td class="y-bg"><input type="text" class="input-text" name="setting[index_template]" id="index_template" size="20" value="<?php echo $index_template?>"/>.html</td>
</tr>
<tr>
<th width="120"><?php echo L('wap_cat_tpl')?></th>
<td class="y-bg"><input type="text" class="input-text" name="setting[category_template]" id="category_template" size="20" value="<?php echo $category_template?>"/>.html</td>
</tr>
<tr>
<th width="120"><?php echo L('wap_list_tpl')?></th>
<td class="y-bg"><input type="text" class="input-text" name="setting[list_template]" id="list_template" size="20" value="<?php echo $list_template?>"/>.html</td>
</tr>
<tr>
<th width="120"><?php echo L('wap_show_tpl')?></th>
<td class="y-bg"><input type="text" class="input-text" name="setting[show_template]" id="show_template" size="20" value="<?php echo $show_template?>"/>.html</td>
</tr>
<tr>
<th width="120"><?php echo L('wap_hotword')?></th>
<td class="y-bg">
<textarea style="height: 100px; width: 200px;" id="options" cols="20" rows="2" name="setting[hotwords]"><?php echo $hotwords?></textarea> <?php echo L('wap_hotword_desc')?>
</td>
</tr>
</table>
<div class="bk15"></div>
<input type="submit" id="dosubmit" name="dosubmit" class="dialog" value="<?php echo L('submit')?>" />
</fieldset>
</form>
</div>
</body>
</html>
|
108wo
|
phpcms/modules/wap/templates/m_edit.tpl.php
|
PHP
|
asf20
| 3,630
|
<?php
defined('IN_PHPCMS') or exit('No permission resources.');
pc_base::load_app_func('global');
pc_base::load_sys_class('format', '', 0);
class index {
function __construct() {
$this->db = pc_base::load_model('content_model');
$this->siteid = isset($_GET['siteid']) && (intval($_GET['siteid']) > 0) ? intval(trim($_GET['siteid'])) : (param::get_cookie('siteid') ? param::get_cookie('siteid') : 1);
param::set_cookie('siteid',$this->siteid);
$this->wap_site = getcache('wap_site','wap');
$this->types = getcache('wap_type','wap');
$this->wap = $this->wap_site[$this->siteid];
define('WAP_SITEURL', $this->wap['domain'] ? $this->wap['domain'].'index.php?' : APP_PATH.'index.php?m=wap&siteid='.$this->siteid);
if($this->wap['status']!=1) exit(L('wap_close_status'));
}
//展示首页
public function init() {
$WAP = $this->wap;
$TYPE = $this->types;
$WAP_SETTING = string2array($WAP['setting']);
$GLOBALS['siteid'] = $siteid = max($this->siteid,1);
$template = $WAP_SETTING['index_template'] ? $WAP_SETTING['index_template'] : 'index';
include template('wap', $template);
}
//展示列表页
public function lists() {
$parentids = array();
$WAP = $this->wap;
$TYPE = $this->types;
$WAP_SETTING = string2array($WAP['setting']);
$GLOBALS['siteid'] = $siteid = max($this->siteid,1);
$typeid = intval($_GET['typeid']);
if(!$typeid) exit(L('parameter_error'));
$catid = $this->types[$typeid]['cat'];
$siteids = getcache('category_content','commons');
$siteid = $siteids[$catid];
$CATEGORYS = getcache('category_content_'.$siteid,'commons');
if(!isset($CATEGORYS[$catid])) exit(L('parameter_error'));
$CAT = $CATEGORYS[$catid];
$siteid = $GLOBALS['siteid'] = $CAT['siteid'];
extract($CAT);
foreach($TYPE as $_t) $parentids[] = $_t['parentid'];
$template = ($TYPE[$typeid]['parentid']==0 && in_array($typeid,array_unique($parentids))) ? $WAP_SETTING['category_template'] : $WAP_SETTING['list_template'];
$MODEL = getcache('model','commons');
$modelid = $CAT['modelid'];
$tablename = $this->db->table_name = $this->db->db_tablepre.$MODEL[$modelid]['tablename'];
$total = $this->db->count(array('status'=>'99','catid'=>$catid));
$page = isset($_GET['page']) && intval($_GET['page']) ? intval($_GET['page']) : 1;
$pagesize = $WAP_SETTING['listnum'] ? intval($WAP_SETTING['listnum']) : 20 ;
$offset = ($page - 1) * $pagesize;
$list = $this->db->select(array('status'=>'99','catid'=>$catid), '*', $offset.','.$pagesize,'inputtime DESC');
//构造wap url规则
define('URLRULE', 'index.php?m=wap&c=index&a=lists&typeid={$typeid}~index.php?m=wap&c=index&a=lists&typeid={$typeid}&page={$page}');
$GLOBALS['URL_ARRAY'] = array('typeid'=>$typeid);
$pages = wpa_pages($total, $page, $pagesize);
include template('wap', $template);
}
//展示内容页
public function show() {
$WAP = $this->wap;
$WAP_SETTING = string2array($WAP['setting']);
$TYPE = $this->types;
$GLOBALS['siteid'] = $siteid = max($this->siteid,1);
$typeid = $type_tmp = intval($_GET['typeid']);
$catid = $_GET['catid'];
$id = intval($_GET['id']);
if(!$catid || !$id) exit(L('parameter_error'));
$siteids = getcache('category_content','commons');
$siteid = $siteids[$catid];
$CATEGORYS = getcache('category_content_'.$siteid,'commons');
$page = intval($_GET['page']);
$page = max($page,1);
if(!isset($CATEGORYS[$catid]) || $CATEGORYS[$catid]['type']!=0) exit(L('information_does_not_exist','','content'));
$this->category = $CAT = $CATEGORYS[$catid];
$this->category_setting = $CAT['setting'] = string2array($this->category['setting']);
$siteid = $GLOBALS['siteid'] = $CAT['siteid'];
$MODEL = getcache('model','commons');
$modelid = $CAT['modelid'];
$tablename = $this->db->table_name = $this->db->db_tablepre.$MODEL[$modelid]['tablename'];
$r = $this->db->get_one(array('id'=>$id));
if(!$r || $r['status'] != 99) showmessage(L('info_does_not_exists'),'blank');
$this->db->table_name = $tablename.'_data';
$r2 = $this->db->get_one(array('id'=>$id));
$rs = $r2 ? array_merge($r,$r2) : $r;
//再次重新赋值,以数据库为准
$catid = $CATEGORYS[$r['catid']]['catid'];
$modelid = $CATEGORYS[$catid]['modelid'];
require_once CACHE_MODEL_PATH.'content_output.class.php';
$content_output = new content_output($modelid,$catid,$CATEGORYS);
$data = $content_output->get($rs);
extract($data);
$typeid = $type_tmp;
if(strpos($content, '[/page]')!==false) {
$content = preg_replace("|\[page\](.*)\[/page\]|U", '', $content);
} elseif (strpos($content, '[page]')!==false) {
$content = str_replace('[page]', '', $content);
}
//根据设置字节数对文章加入分页标记
if($maxcharperpage < 10) $maxcharperpage = $WAP_SETTING['c_num'];
$contentpage = pc_base::load_app_class('contentpage','content');
$content = $contentpage->get_data($content,$maxcharperpage);
$isshow = 1;
if($pictureurls) {
$pictureurl = pic_pages($pictureurls);
$isshow = 0;
//进行图片分页处理
$PIC_POS = strpos($pictureurl, '[page]');
if($PIC_POS !== false) {
$this->url = pc_base::load_app_class('wap_url', 'wap');
$pictureurls = array_filter(explode('[page]', $pictureurl));
$pagenumber = count($pictureurls);
if (strpos($pictureurl, '[/page]')!==false && ($CONTENT_POS<7)) {
$pagenumber--;
}
for($i=1; $i<=$pagenumber; $i++) {
$pageurls[$i] = $this->url->show($id, $i, $catid, $typeid);
}
$END_POS = strpos($pictureurl, '[/page]');
if($END_POS !== false) {
if(preg_match_all("|\[page\](.*)\[/page\]|U", $pictureurl, $m, PREG_PATTERN_ORDER)) {
foreach($m[1] as $k=>$v) {
$p = $k+1;
$titles[$p]['title'] = strip_tags($v);
$titles[$p]['url'] = $pageurls[$p][0];
}
}
}
//当不存在 [/page]时,则使用下面分页
$pages = content_pages($pagenumber,$page, $pageurls, 0);
//判断[page]出现的位置是否在第一位
if($CONTENT_POS<7) {
$pictureurl = $pictureurls[$page];
} else {
if ($page==1 && !empty($titles)) {
$pictureurl = $title.'[/page]'.$pictureurls[$page-1];
} else {
$pictureurl = $pictureurls[$page-1];
}
}
}
}
//进行自动分页处理
$CONTENT_POS = strpos($content, '[page]');
if($CONTENT_POS !== false) {
$this->url = pc_base::load_app_class('wap_url', 'wap');
$contents = array_filter(explode('[page]', $content));
$pagenumber = count($contents);
if (strpos($content, '[/page]')!==false && ($CONTENT_POS<7)) {
$pagenumber--;
}
for($i=1; $i<=$pagenumber; $i++) {
$pageurls[$i] = $this->url->show($id, $i, $catid, $typeid);
}
$END_POS = strpos($content, '[/page]');
if($END_POS !== false) {
if(preg_match_all("|\[page\](.*)\[/page\]|U", $content, $m, PREG_PATTERN_ORDER)) {
foreach($m[1] as $k=>$v) {
$p = $k+1;
$titles[$p]['title'] = strip_tags($v);
$titles[$p]['url'] = $pageurls[$p][0];
}
}
}
//当不存在 [/page]时,则使用下面分页
$pages = content_pages($pagenumber,$page, $pageurls);
//判断[page]出现的位置是否在第一位
if($CONTENT_POS<7) {
$content = $contents[$page];
} else {
if ($page==1 && !empty($titles)) {
$content = $title.'[/page]'.$contents[$page-1];
} else {
$content = $contents[$page-1];
}
}
if($_GET['remains']=='true') {
$content = $pages ='';
for($i=$page;$i<=$pagenumber;$i++) {
$content .=$contents[$i-1];
}
}
}
$content = content_strip(wml_strip($content));
$template = $WAP_SETTING['show_template'] ? $WAP_SETTING['show_template'] : 'show';
include template('wap', $template);
}
//提交评论
function comment() {
$WAP = $this->wap;
$TYPE = $this->types;
if($_POST['dosumbit']) {
$comment = pc_base::load_app_class('comment','comment');
pc_base::load_app_func('global','comment');
$username = $this->wap['sitename'].L('phpcms_friends');
$userid = param::get_cookie('_userid');
$catid = intval($_POST['catid']);
$typeid = intval($_POST['typeid']);
$contentid = intval($_POST['id']);
$msg = trim($_POST['msg']);
$commentid = trim($_POST['commentid']);
$title = $_POST['title'];
$url = $_POST['url'];
//通过API接口调用数据的标题、URL地址
if (!$data = get_comment_api($commentid)) {
exit(L('parameter_error'));
} else {
$title = $data['title'];
$url = $data['url'];
unset($data);
}
$data = array('userid'=>$userid, 'username'=>$username, 'content'=>$msg);
$comment->add($commentid, $this->siteid, $data, $id, $title, $url);
echo L('wap_guestbook').'<br/><a href="'.show_url($catid,$contentid,$typeid).'">'.L('wap_goback').'</a>';
}
}
//评论列表页
function comment_list() {
$WAP = $this->wap;
$TYPE = $this->types;
$comment = pc_base::load_app_class('comment','comment');
pc_base::load_app_func('global','comment');
$typeid = intval($_GET['typeid']);
$GLOBALS['siteid'] = max($this->siteid,1);
$commentid = isset($_GET['commentid']) && trim(urldecode($_GET['commentid'])) ? trim(urldecode($_GET['commentid'])) : exit('参数错误');
list($modules, $contentid, $siteid) = decode_commentid($commentid);
list($module, $catid) = explode('_', $modules);
$comment_setting_db = pc_base::load_model('comment_setting_model');
$setting = $comment_setting_db->get_one(array('siteid'=>$this->siteid));
//通过API接口调用数据的标题、URL地址
if (!$data = get_comment_api($commentid)) {
exit('参数错误');
} else {
$title = $data['title'];
$url = $data['url'];
unset($data);
}
include template('wap', 'comment_list');
}
//导航页
function maps() {
$WAP = $this->wap;
$TYPE = $this->types;
$WAP_SETTING = string2array($WAP['setting']);
$GLOBALS['siteid'] = max($this->siteid,1);
include template('wap', 'maps');
}
//展示大图
function big_image() {
$WAP = $this->wap;
$TYPE = $this->types;
$WAP_SETTING = string2array($WAP['setting']);
$GLOBALS['siteid'] = max($this->siteid,1);
$url=base64_decode(trim($_GET['url']));
$width = $_GET['w'] ? trim(intval($_GET['w'])) : 320 ;
$new_url = thumb($url,$width,0);
include template('wap', 'big_image');
}
}
?>
|
108wo
|
phpcms/modules/wap/index.php
|
PHP
|
asf20
| 10,711
|
<?php
defined('IN_PHPCMS') or exit('No permission resources.');
class wap_url{
private $urlrules,$categorys,$html_root;
public function __construct() {
self::set_siteid();
}
/**
* WAP内容页链接
*/
public function show($id, $page = 0, $catid = 0, $typeid = 0, $prefix = '',$data = '',$action = 'edit') {
$page = max($page,1);
$urls = '';
$urlrules = 'index.php?m=wap&c=index&a=show&catid={$catid}&typeid={$typeid}&id={$id}|index.php?m=wap&c=index&a=show&catid={$catid}&typeid={$typeid}&id={$id}&page={$page}';
$urlrules_arr = explode('|',$urlrules);
if($page==1) {
$urlrule = $urlrules_arr[0];
} else {
$urlrule = $urlrules_arr[1];
}
$urls = str_replace(array('{$catid}','{$typeid}','{$id}','{$page}'),array($catid,$typeid,$id,$page),$urlrule);
$url_arr[0] = $url_arr[1] = APP_PATH.$urls;
return $url_arr;
}
/**
* 设置站点id
*/
private function set_siteid() {
if(defined('IN_ADMIN')) {
$this->siteid = get_siteid();
} else {
param::get_cookie('siteid');
$this->siteid = param::get_cookie('siteid');
}
}
}
|
108wo
|
phpcms/modules/wap/classes/wap_url.class.php
|
PHP
|
asf20
| 1,113
|
<?php
class wap_tag {
//数据库连接
private $db;
public function __construct() {
$this->db = pc_base::load_model('content_model');
$this->position = pc_base::load_model('position_data_model');
}
/**
* 初始化模型
* @param $catid 栏目id
*/
public function set_modelid($catid) {
$siteids = getcache('category_content','commons');
$siteid = $siteids[$catid];
$this->category = getcache('category_content_'.$siteid,'commons');
$this->modelid = $this->category[$catid]['modelid'];
$this->db->set_model($this->modelid);
$this->tablename = $this->db->table_name;
}
/**
* 分页统计
* @param $data
*/
public function count($data) {
if($data['action'] == 'lists') {
if(isset($data['where'])) {
$sql = $data['where'];
} else {
$TYPES = getcache('wap_type','wap');
$TYPE = $TYPES[$data['typeid']];
$catid = intval($TYPE['cat']);
$this->set_modelid($catid);
if(!$this->category[$catid]) return false;
if($this->category[$catid]['child']) {
$catids_str = $this->category[$catid]['arrchildid'];
$pos = strpos($catids_str,',')+1;
$catids_str = substr($catids_str, $pos);
$sql = "status=99 AND catid IN ($catids_str)";
} else {
$sql = "status=99 AND catid='$catid'";
}
}
return $this->db->count($sql);
}
}
/**
* 分类标签
* @param $data
*/
public function type($data) {
$siteid = $data['siteid'] = intval(trim($data['siteid']))!== 0 ? intval(trim($data['siteid'])) : 1;
$TYPES = getcache('wap_type','wap');
$i = 1;
if(is_array($TYPES) && !empty($TYPES)) {
foreach ($TYPES as $typeid=>$type) {
if($i>$data['limit']) break;
if($siteid && $type['siteid']!=$siteid) continue;
if($type['parentid']==$data['typeid']) {
$array[$typeid] = $type;
$i++;
}
}
}
return $array;
}
/**
* 列表页标签
* @param $data
*/
public function lists($data) {
$data['siteid'] = intval(trim($data['siteid']))!== 0 ? intval(trim($data['siteid'])) : 1;
$TYPES = getcache('wap_type','wap');
$TYPE = $TYPES[$data['typeid']];
if(isset($data['where'])) {
$sql = $data['where'];
} else {
$child = subtype($data['typeid']);
$catid = intval($TYPE['cat']);
$this->set_modelid($catid);
//var_dump($this->category);
if(!$this->category[$catid]) return false;
if(is_array($child) && count($child) >0 ) {
foreach ($child as $_k) $catids_str .= ','.$_k['cat'];
$pos = strpos($catids_str,',')+1;
$catids_str = substr($catids_str, $pos);
$sql = "status=99 AND catid IN ($catids_str)".$thumb;
} else {
$sql = "status=99 AND catid='$catid'".$thumb;
}
}
$order = $data['order'];
$return = $this->db->select($sql, '*', $data['limit'], $order, '', 'id');
//调用副表的数据
if (isset($data['moreinfo']) && intval($data['moreinfo']) == 1) {
$ids = array();
foreach ($return as $v) {
if (isset($v['id']) && !empty($v['id'])) {
$ids[] = $v['id'];
} else {
continue;
}
}
if (!empty($ids)) {
$this->db->table_name = $this->db->table_name.'_data';
$ids = implode('\',\'', $ids);
$r = $this->db->select("`id` IN ('$ids')", '*', '', '', '', 'id');
if (!empty($r)) {
foreach ($r as $k=>$v) {
if (isset($return[$k])) $return[$k] = array_merge($v, $return[$k]);
}
}
}
}
return $return;
}
/**
* 推荐位标签
* @param $data
*/
public function position($data) {
$sql = '';
$array = array();
$posid = intval($data['posid']);
$order = $data['order'];
$thumb = (empty($data['thumb']) || intval($data['thumb']) == 0) ? 0 : 1;
$siteid = $GLOBALS['siteid'] ? $GLOBALS['siteid'] : 1;
$catid = (empty($data['catid']) || $data['catid'] == 0) ? '' : intval($data['catid']);
//if(!$this->category[$catid]) return false;
if($catid && $this->category[$catid]['child']) {
$catids_str = $this->category[$catid]['arrchildid'];
$pos = strpos($catids_str,',')+1;
$catids_str = substr($catids_str, $pos);
$sql = "`catid` IN ($catids_str) AND ";
} elseif($catid && !$this->category[$catid]['child']) {
$sql = "`catid` = '$catid' AND ";
}
if($thumb) $sql .= "`thumb` = '1' AND ";
$sql .= "`posid` = '$posid' AND `siteid` = '".$siteid."'";
$pos_arr = $this->position->select($sql, '*', $data['limit'],$order);
if(!empty($pos_arr)) {
foreach ($pos_arr as $info) {
$key = $info['catid'].'-'.$info['id'];
$array[$key] = string2array($info['data']);
$array[$key]['url'] = show_url($info['catid'],$info['id']);
}
}
return $array;
}
}
|
108wo
|
phpcms/modules/wap/classes/wap_tag.class.php
|
PHP
|
asf20
| 4,732
|
<?php
defined('IN_PHPCMS') or exit('Access Denied');
defined('INSTALL') or exit('Access Denied');
return array('wap');
?>
|
108wo
|
phpcms/modules/wap/install/model.php
|
PHP
|
asf20
| 128
|
{template "wap","min_header"}
<div class="wrap" id="hd">
<div class="adds">{wap_pos($typeid)}</div>
<div>
{loop $list $v}
<a href="{show_url($v[catid],$v[id],$typeid)}" title="{$v['title']}">{str_cut($v['title'],26,'')}</a><br/>
{/loop}
</div>
<div class="pages">{$pages}</div>
{template "wap","min_footer"}
|
108wo
|
phpcms/modules/wap/install/templates/list.html
|
HTML
|
asf20
| 319
|
{template "wap","header"}
<h2><a href="#" class="cat">焦点推荐</a> <span style="color:#999; font-size:12px; font-weight:100;">{date('Y-m-d',SYS_TIME)}</span></h2>
<div>
{pc:wap action="position" posid="12" order="listorder DESC" num="6"}
{loop $data $r}
<a href="{$r[url]}">{str_cut($r['title'],26,'')}</a><br/>
{/loop}
{/pc}
</div>
<div class="ad1"><a href="#"><img src="{IMG_PATH}wap/ad220x26.gif" alt="phpcms手机网建站利器" width="220" height="26" /></a></div>
{loop subtype(0) $s}
{php $typeid=$s[typeid]}
{pc:wap action="lists" typeid="$typeid" num="10" order="id DESC" return="info"}
<h2><a href="{list_url($typeid)}" class="cat">{$s['typename']}</a>
{loop subtype($typeid) $_s}<a href="{list_url($_s[typeid])}">{$_s[typename]}</a>{/loop}
</h2>
<div>
{loop $info $i}
<a href="{show_url($i[catid],$i[id])}">{str_cut($i['title'],26,'')}</a><br/>
{/loop}
</div>
{/pc}
{/loop}
{template "wap","footer"}
|
108wo
|
phpcms/modules/wap/install/templates/index.html
|
HTML
|
asf20
| 976
|
{template "wap","min_header"}
<div class="wrap" id="hd">
<div class="adds">{wap_pos($typeid)}</div>
<h1>{$title}</h1>
<div class="tm">作者:{$username} 日期:{date('m-d',strtotime($inputtime))}<br/>来源:{$copyfrom}</div>
<div class="content">
{if $pictureurl}{$pictureurl}<br>{$pages}{/if}
{$content}
</div>
{if !$pictureurl}<div class="pages">{$pages}</div>{/if}
{php $commentid=id_encode('content_'.$catid,$id,$siteid)}
{pc:comment action="get_comment" commentid="$commentid"}
{php $comment = $data;}
{/pc}
<div class="mg_b6"><a href="{APP_PATH}index.php?m=wap&c=index&a=comment_list&commentid={$commentid}&typeid={$typeid}">网友评论({if $comment[total]}{$comment[total]}{else}0{/if})</a></div>
<form action="{APP_PATH}index.php?m=wap&c=index&a=comment" method="post">
<div class="comment">
<textarea name="msg" rows="2"></textarea>
<input type="hidden" name="commentid" value="{id_encode('content_'.$catid,$id,$siteid)}" />
<input type="hidden" name="typeid" value="{$typeid}" />
<input type="hidden" name="catid" value="{$catid}" />
<input type="hidden" name="id" value="{$id}" />
<input type="hidden" name="title" value="{urlencode(($comment[title] ? $comment[title] : $title))}">
<input type="hidden" name="url" value="{urlencode(show_url($catid,$typeid,$id))}">
<br/>
<input type="submit" value="发言" name="dosumbit" class="ipt"/>
</div>
</form>
{template "wap","min_footer"}
|
108wo
|
phpcms/modules/wap/install/templates/show.html
|
HTML
|
asf20
| 1,465
|
<div class="tc"><a href="#hd"><img src="{IMG_PATH}wap/top.gif" alt="" width="46" height="16" /></a></div>
<div class="ft">
<a href="{WAP_SITEURL}">{$WAP['sitename']}</a>-<a href="{APP_PATH}index.php?m=wap&c=index&a=maps">导航</a>
</div>
</div>
</body>
</html>
|
108wo
|
phpcms/modules/wap/install/templates/footer.html
|
HTML
|
asf20
| 292
|
{php wmlHeader();}
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Cache-Control" content="no-cache"/>
<meta name="viewport" content="width=device-width; initial-scale=1.3; minimum-scale=1.0; maximum-scale=2.0"/>
<meta name="MobileOptimized" content="240"/>
<meta name="format-detection" content="telephone=no" />
<title></title>
<style type="text/css">
body,div,p,table,textarea,form,h2,h3,h4,h5,ul,li{margin:0; padding:0; color:#303030;line-height:160%;}
select, input, img{vertical-align:middle; border:none;}
body{background:#FFF;-webkit-user-select:none;-webkit-text-size-adjust:none;}
a{text-decoration:none;color:#09c;}
.wrap{padding:3px 3px 0px; line-height:130%; font-size:14px;}
.tc{text-align:center; margin:10px 0px;}
h2{background:#efefef; color:#666; margin:6px 0px; padding:2px 6px; font-size:14px;}
h2 a{margin-left:0.5em; font-size:12px; font-weight:100; color:#666; text-decoration:underline;}
h2 a.cat{font-weight:bold; font-size:14px; margin-left:0px; color:#09c; margin-right:4px; text-decoration:none;}
.ft,.catlist{ background:#efefef; text-align:center; padding:10px 0px;}
.adds{background:#efefef; color:#666; padding:2px 6px; margin-bottom:6px; font-size:14px;}
.catlist a{margin:0px 2px;}
.b_adds{ border:1px solid #efefef;}
.pages{margin:10px 0px;border:1px solid #efefef;}
.pages a{ margin:0px 10px; color:#00F;}
h1{ font-size:16px; margin-bottom:0px;}
.tm{ text-align:center; color:#CCC; font-size:12px;}
.content p{ text-indent:2em;}
.mg_b6{ margin-bottom:6px;}
.yk{color:#999;}
.lists{background:#F2F6FA;}
.gap{ background:none;}
.w98{width:98%; font-size:12px;}
.mod{ margin:10px 0px;}
.ipt{color:#FFF; background:#09c; padding:2px 6px; cursor:pointer;}
</style>
</head>
<body>
|
108wo
|
phpcms/modules/wap/install/templates/min_header.html
|
HTML
|
asf20
| 2,024
|
{template "wap","min_header"}
<div class="wrap" id="hd">
<div class="content">
<img src="{$new_url}"><br>
图片下载选择:
<a href="{bigimg_url($url,320)}">高清(320x480)</a>.<a href="{bigimg_url($url,240)}">大(240x320)</a>.<a href="{bigimg_url($url,176)}">中(176x220)</a>.<a href="{bigimg_url($url,128)}">小(128x160)</a>
</div>
{template "wap","min_footer"}
|
108wo
|
phpcms/modules/wap/install/templates/big_image.html
|
HTML
|
asf20
| 376
|
<div class="catlist">
{loop subtype($TYPE[$typeid]['parentid']) $s}<a href="{list_url($s[typeid])}">{$s[typename]}</a>|{if $n%4==0}<br/>{/if}{/loop}
</div>
<div class="tc"><a href="#hd"><img src="{IMG_PATH}wap/top.gif" alt="" width="46" height="16" /></a></div>
<div class="b_adds" id="hd">{wap_pos($typeid)}</div>
<div class="ft">
<a href="{WAP_SITEURL}">{$WAP['sitename']}</a>-<a href="{APP_PATH}index.php?m=wap&c=index&a=maps">导航</a>
</div>
</div>
</body>
</html>
|
108wo
|
phpcms/modules/wap/install/templates/min_footer.html
|
HTML
|
asf20
| 521
|
{template "wap","header"}
<div class="adds" id="hd">{wap_pos($typeid)}</div>
{loop subtype($typeid) $type}
{pc:wap action="lists" typeid="$type[typeid]" num="10" order="id DESC" return="info"}
<h2><a href="{list_url($type['typeid'])}" class="cat">{$type['typename']}</a></h2>
<div>
{loop $info $v}
<a href="{show_url($v[catid],$v[id],$type['typeid'])}" title="{$v['title']}">{str_cut($v['title'],26,'')}</a><br/>
{/loop}
</div>
{/pc}
{/loop}
{template "wap","footer"}
|
108wo
|
phpcms/modules/wap/install/templates/category.html
|
HTML
|
asf20
| 488
|
{template "wap","min_header"}
<body>
<div class="wrap">
<div class="adds" id="hd">{wap_pos($typeid)}</div>
<h1><a href="{show_url($catid,$contentid,$typeid)}">{$title}</a></h1>
<div class="b_adds">网友评论:</div>
{pc:comment action="lists" commentid="$commentid" siteid="$siteid" page="$_GET[page]" hot="$hot" num="25"}
{loop $data $r}
<div class="lists {if $n%2==0}gap{/if}">
<p class="yk">[{$r[username]}]{format::date($r[creat_at], 1)}</p>
<p>{$r[content]}</p>
</div>
{/loop}
<a href="{show_url($catid,$contentid,$typeid)}">返回文章</a>
{/pc}
{template "wap","min_footer"}
|
108wo
|
phpcms/modules/wap/install/templates/comment_list.html
|
HTML
|
asf20
| 653
|
{php wmlHeader();}
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Cache-Control" content="no-cache"/>
<meta name="viewport" content="width=device-width; initial-scale=1.3; minimum-scale=1.0; maximum-scale=2.0"/>
<meta name="MobileOptimized" content="240"/>
<meta name="format-detection" content="telephone=no" />
<title>{$WAP['sitename']}</title>
<style type="text/css">
body,div,p,table,textarea,form,h2,h3,h4,h5,ul,li{margin:0; padding:0; color:#303030;line-height:160%;}
select, input, img{vertical-align:middle; border:none;}
body{background:#FFF;-webkit-user-select:none;-webkit-text-size-adjust:none;}
a{text-decoration:none;color:#09c;}
.wrap{padding:3px 3px 0px; line-height:130%; font-size:14px;}
.tc{text-align:center; margin:10px 0px;}
.nav_logo{line-height:26px; margin-bottom:4px; color:#999; font-weight:bold;}
.nav_logo img{margin-right:10px;}
.hot{color:#ff0; background:#09c; padding:3px;}
.hot a{text-decoration:underline; color:#fff;}
h2{background:#efefef; color:#666; margin:6px 0px; padding:2px 6px; font-size:14px;}
h2 a{margin-left:0.5em; font-size:12px; font-weight:100; color:#666; text-decoration:underline;}
h2 a.cat{font-weight:bold; font-size:14px; margin-left:0px; color:#09c; margin-right:4px; text-decoration:none;}
.ft{ background:#efefef; text-align:center; padding:10px 0px;}
</style>
</head>
<body>
<div class="wrap">
<div class="nav_logo" id="hd">
<span><a href="{WAP_SITEURL}"><img src="{$WAP['logo']}" width="70" height="50" alt="phpcms" align="left" /></a></span>
{pc:wap action="type" typeid="0" num="10" siteid="$siteid" }
{loop $data $k $v}
<a href="{list_url($v[typeid])}">{$v[typename]}</a>
{if $n%2!=0} | {else}<br/>{/if}
{/loop}
{/pc}
</div>
<div class="hot">
热词:{hotword()}
</div>
|
108wo
|
phpcms/modules/wap/install/templates/header.html
|
HTML
|
asf20
| 2,083
|
{template "wap","min_header"}
<div class="wrap">
<div class="adds" id="hd">{$WAP['sitename']} - 导航</div>
<div class="cts">
{php $i=1}
{loop subtype(0) $s}
<a href="{list_url($s[typeid])}">[{$s[typename]}]</a>
{loop subtype($s[typeid]) $r}
<a href="{list_url($r[typeid])}">{$r[typename]}</a>
{if $i%4==0}<br />{/if}
{php $i++}
{/loop}
<br />
{/loop}
</div>
{template "wap","min_footer"}
|
108wo
|
phpcms/modules/wap/install/templates/maps.html
|
HTML
|
asf20
| 438
|
<?php
defined('IN_PHPCMS') or exit('Access Denied');
defined('INSTALL') or exit('Access Denied');
$parentid = $menu_db->insert(array('name'=>'wap', 'parentid'=>29, 'm'=>'wap', 'c'=>'wap_admin', 'a'=>'init', 'data'=>'', 'listorder'=>0, 'display'=>'1'), true);
$menu_db->insert(array('name'=>'wap_add', 'parentid'=>$parentid, 'm'=>'wap', 'c'=>'wap_admin', 'a'=>'add', 'data'=>'', 'listorder'=>0, 'display'=>'0'));
$menu_db->insert(array('name'=>'wap_edit', 'parentid'=>$parentid, 'm'=>'wap', 'c'=>'wap_admin', 'a'=>'edit', 'data'=>'', 'listorder'=>0, 'display'=>'0'));
$menu_db->insert(array('name'=>'wap_delete', 'parentid'=>$parentid, 'm'=>'wap', 'c'=>'wap_admin', 'a'=>'delete', 'data'=>'', 'listorder'=>0, 'display'=>'0'));
$menu_db->insert(array('name'=>'wap_type_manage', 'parentid'=>$parentid, 'm'=>'wap', 'c'=>'wap_admin', 'a'=>'type_manage', 'data'=>'', 'listorder'=>0, 'display'=>'0'));
$menu_db->insert(array('name'=>'wap_type_edit', 'parentid'=>$parentid, 'm'=>'wap', 'c'=>'wap_admin', 'a'=>'type_edit', 'data'=>'', 'listorder'=>0, 'display'=>'0'));
$menu_db->insert(array('name'=>'wap_type_delete', 'parentid'=>$parentid, 'm'=>'wap', 'c'=>'wap_admin', 'a'=>'type_delete', 'data'=>'', 'listorder'=>0, 'display'=>'0'));
$language = array('wap'=>'手机门户','wap_add'=>'添加','wap_edit'=>'修改','wap_delete'=>'删除','wap_type_manage'=>'分类管理','wap_type_edit'=>'分类编辑','wap_type_delete'=>'分类删除',);
?>
|
108wo
|
phpcms/modules/wap/install/extention.inc.php
|
PHP
|
asf20
| 1,451
|