<input type="hidden" name="a" value="public_search_content"> <table width="100%" class="table_form"> <tr> <td width="80"><?php echo L('category'); ?> :</td> <td><?php if (isset($_GET['dosubmit'])) { ?> <div class="rt"><a href="javascript:void(0)" onclick="$('#search').toggle()"><?php echo L('folded_up_in_search_of'); ?> </a></div><?php } echo form::select_category('category_content_' . $this->siteid, $catid, 'name="catid" id="catid"', '', '', '0', 1); ?> </td> </tr> <tbody id="search" <?php if (isset($_GET['dosubmit'])) { echo 'style="display:none"'; } ?> > <tr> <td><?php echo L('posterize_time'); ?> :</td> <td><?php
<fieldset> <legend><?php echo L('the_new_publication_solutions'); ?> </legend> <form name="myform" action="?" method="get" id="myform"> <table width="100%" class="table_form"> <tr> <td width="120"><?php echo L('category'); ?> :</td> <td> <?php echo form::select_category('', '', 'name="catid"', L('please_choose'), 0, 0, 1); ?> </td> </tr> </table> <input type="hidden" name="m" value="collection"> <input type="hidden" name="c" value="node"> <input type="hidden" name="a" value="import_program_add"> <input type="hidden" name="nodeid" value="<?php if (isset($nodeid)) { echo $nodeid; } ?> "> <input type="hidden" name="type" value="<?php echo $type;
echo 'selected'; } ?> ><?php echo L('description'); ?> </option> <option value='id' <?php if ($_GET['field'] == 'id') { echo 'selected'; } ?> >ID</option> </select> <?php echo form::select_category('', $catid, 'name="catid"', L('please_select_category'), $modelid, 0, 1); ?> <input name="keywords" type="text" value="<?php echo stripslashes($_GET['keywords']); ?> " style="width:330px;" class="input-text" /> <input type="submit" name="dosubmit" class="button" value="<?php echo L('search'); ?> " /> </div> </td> </tr> </tbody> </table> </form>
/** * 按照模型搜索 */ public function init() { $grouplist = getcache('grouplist', 'member'); $_groupid = param::get_cookie('_groupid'); if (!$_groupid) { $_groupid = 8; } if (!$grouplist[$_groupid]['allowsearch']) { if ($_groupid == 8) { showmessage(L('guest_not_allowsearch')); } else { showmessage(''); } } if (!isset($_GET['catid'])) { showmessage(L('missing_part_parameters')); } $catid = intval($_GET['catid']); $siteids = getcache('category_content', 'commons'); $siteid = $siteids[$catid]; $this->categorys = getcache('category_content_' . $siteid, 'commons'); if (!isset($this->categorys[$catid])) { showmessage(L('missing_part_parameters')); } if (isset($_GET['info']['catid']) && $_GET['info']['catid']) { $catid = intval($_GET['info']['catid']); } else { $_GET['info']['catid'] = 0; } $modelid = $this->categorys[$catid]['modelid']; $modelid = intval($modelid); if (!$modelid) { showmessage(L('illegal_parameters')); } //搜索间隔 $minrefreshtime = getcache('common', 'commons'); $minrefreshtime = intval($minrefreshtime['minrefreshtime']); $minrefreshtime = $minrefreshtime ? $minrefreshtime : 5; if (param::get_cookie('search_cookie') && param::get_cookie('search_cookie') > SYS_TIME - 2) { showmessage(L('search_minrefreshtime', array('min' => $minrefreshtime)), 'index.php?m=content&c=search&catid=' . $catid, $minrefreshtime * 1280); } else { param::set_cookie('search_cookie', SYS_TIME + 2); } //搜索间隔 $CATEGORYS = $this->categorys; //产生表单 pc_base::load_sys_class('form', '', 0); $fields = getcache('model_field_' . $modelid, 'model'); $forminfos = array(); foreach ($fields as $field => $r) { if ($r['issearch']) { if ($r['formtype'] == 'catid') { $r['form'] = form::select_category('', $_GET['info']['catid'], 'name="info[catid]"', L('please_select_category'), $modelid, 0, 1); } elseif ($r['formtype'] == 'number') { $r['form'] = "<input type='text' name='{$field}_start' id='{$field}_start' value='' size=5 class='input-text'/> - <input type='text' name='{$field}_end' id='{$field}_start' value='' size=5 class='input-text'/>"; } elseif ($r['formtype'] == 'datetime') { $r['form'] = form::date("info[{$field}]"); } elseif ($r['formtype'] == 'box') { $options = explode("\n", $r['options']); foreach ($options as $_k) { $v = explode("|", $_k); $option[$v[1]] = $v[0]; } switch ($r['boxtype']) { case 'radio': $string = form::radio($option, $value, "name='info[{$field}]' id='{$field}'"); break; case 'checkbox': $string = form::radio($option, $value, "name='info[{$field}]' id='{$field}'"); break; case 'select': $string = form::select($option, $value, "name='info[{$field}]' id='{$field}'"); break; case 'multiple': $string = form::select($option, $value, "name='info[{$field}]' id='{$field}'"); break; } $r['form'] = $string; } elseif ($r['formtype'] == 'typeid') { $types = getcache('type_content', 'commons'); $types_array = array(L('no_limit')); foreach ($types as $_k => $_v) { if ($modelid == $_v['modelid']) { $types_array[$_k] = $_v['name']; } } $r['form'] = form::select($types_array, 0, "name='info[{$field}]' id='{$field}'"); } elseif ($r['formtype'] == 'linkage') { $setting = string2array($r['setting']); $value = $_GET['info'][$field]; $r['form'] = menu_linkage($setting['linkageid'], $field, $value); } elseif (in_array($r['formtype'], array('text', 'keyword', 'textarea', 'editor', 'title', 'author', 'omnipotent'))) { $value = safe_replace($_GET['info'][$field]); $r['form'] = "<input type='text' name='info[{$field}]' id='{$field}' value='" . $value . "' class='input-text search-text'/>"; } else { continue; } $forminfos[$field] = $r; } } //----------- if (isset($_GET['dosubmit'])) { $siteid = $this->categorys[$catid]['siteid']; $siteurl = siteurl($siteid); $this->db->set_model($modelid); $tablename = $this->db->table_name; $page = max(intval($_GET['page']), 1); $sql = "SELECT * FROM `{$tablename}` a,`{$tablename}_data` b WHERE a.id=b.id AND a.status=99"; $sql_count = "SELECT COUNT(*) AS num FROM `{$tablename}` a,`{$tablename}_data` b WHERE a.id=b.id AND a.status=99"; //构造搜索SQL $where = ''; foreach ($fields as $field => $r) { if ($r['issearch']) { $table_nickname = $r['issystem'] ? 'a' : 'b'; if ($r['formtype'] == 'catid') { if ($_GET['info']['catid']) { $where .= " AND {$table_nickname}.catid='{$catid}'"; } } elseif ($r['formtype'] == 'number') { $start = "{$field}_start"; $end = "{$field}_end"; if ($_GET[$start]) { $start = intval($_GET[$start]); $where .= " AND {$table_nickname}.{$field}>'{$start}'"; } if ($_GET[$end]) { $end = intval($_GET[$end]); $where .= " AND {$table_nickname}.{$field}<'{$end}'"; } } elseif ($r['formtype'] == 'datetime') { if ($_GET['info'][$field]) { $start = strtotime($_GET['info'][$field]); if ($start) { $where .= " AND {$table_nickname}.{$field}>'{$start}'"; } } } elseif ($r['formtype'] == 'box') { if ($_GET['info'][$field]) { $field_value = safe_replace($_GET['info'][$field]); switch ($r['boxtype']) { case 'radio': $where .= " AND {$table_nickname}.`{$field}`='{$field_value}'"; break; case 'checkbox': $where .= " AND {$table_nickname}.`{$field}` LIKE '%,{$field_value},%'"; break; case 'select': $where .= " AND {$table_nickname}.`{$field}`='{$field_value}'"; break; case 'multiple': $where .= " AND {$table_nickname}.`{$field}` LIKE '%,{$field_value},%'"; break; } } } elseif ($r['formtype'] == 'typeid') { if ($_GET['info'][$field]) { $typeid = intval($_GET['info'][$field]); $where .= " AND {$table_nickname}.`{$field}`='{$typeid}'"; } } elseif ($r['formtype'] == 'linkage') { if ($_GET['info'][$field]) { $linkage = intval($_GET['info'][$field]); $where .= " AND {$table_nickname}.`{$field}`='{$linkage}'"; } } elseif (in_array($r['formtype'], array('text', 'keyword', 'textarea', 'editor', 'title', 'author', 'omnipotent'))) { if ($_GET['info'][$field]) { $keywords = safe_replace($_GET['info'][$field]); $where .= " AND {$table_nickname}.`{$field}` LIKE '%{$keywords}%'"; } } else { continue; } } } //----------- if ($where == '') { showmessage(L('please_enter_content_to_search')); } $pagesize = 20; $offset = intval($pagesize * ($page - 1)); $sql_count .= $where; $this->db->query($sql_count); $total = $this->db->fetch_array(); $total = $total[0]['num']; if ($total != 0) { $sql .= $where; $order = ''; $order = $_GET['orderby'] == 'a.id DESC' ? 'a.id DESC' : 'a.id ASC'; $sql .= ' ORDER BY ' . $order; $sql .= " LIMIT {$offset},{$pagesize}"; $this->db->query($sql); $datas = $this->db->fetch_array(); $pages = pages($total, $page, $pagesize); } else { $datas = array(); $pages = ''; } } $SEO = seo($siteid, $catid, $keywords); include template('content', 'search'); }
' <?php if ($_GET['siteid'] == $tmp_siteid) { echo 'selected'; } ?> ><?php echo $v['name']; ?> </option> <?php } ?> </select> <span id="select_category" name="catid"> <?php echo form::select_category('', $_GET['catid'], 'name="catid"', L('please_select_category'), 0, -1, 0, $siteid, 0); ?> </span> <p></p> <select name="field"> <option value='title' <?php if ($_GET['field'] == 'title') { echo 'selected'; } ?> ><?php echo L('title'); ?> </option> <option value='keywords' <?php
?> <div class="pad-lr-10"> <form name="searchform" action="" method="get" > <input type="hidden" value="mood" name="m"> <input type="hidden" value="mood_admin" name="c"> <input type="hidden" value="init" name="a"> <table width="100%" cellspacing="0" class="search-form"> <tbody> <tr> <td> <div class="explain-col"> <?php echo L('category'); ?> £º<?php echo form::select_category('', $catid, 'name="catid"', L('please_select'), '', 0, 1); ?> <?php echo L('time'); ?> £º<?php echo form::select(array('1' => L('today'), '2' => L('yesterday'), '3' => L('this_week'), '4' => L('this_month'), '5' => L('all')), $datetype, 'name="datetype"'); ?> <?php echo L('sort'); ?> £º<?php echo form::select($order_list, $order, 'name="order"'); ?>
<td><?php echo L('posid_modelid'); ?> </td> <td><?php echo form::select($modelinfo, $modelid, 'name="info[modelid]" onchange="category_load(this);"', L('choose_model')); ?> </td> </tr> <tr> <td><?php echo L('posid_catid'); ?> </td> <td id="load_catid"><?php echo form::select_category('', $catid, 'name="info[catid]"', L('please_select_parent_category')); ?> </td> </tr> <tr> <td><?php echo L('listorder'); ?> </td> <td><input type="text" name="info[listorder]" class="input-text" size="5" value="<?php echo $listorder; ?> "></input></td> </tr> <tr>
continue; } $model_datas[$_v['modelid']] = $_v['name']; } echo form::select($model_datas, $modelid, 'name="info[modelid]" id="modelid" onchange="change_tpl(this.value)"', L('select_model')); ?> </td> </tr> <tr> <th width="200"><?php echo L('parent_category'); ?> £º</th> <td> <?php echo form::select_category('category_content_' . $this->siteid, $parentid, 'name="info[parentid]" id="parentid"', L('please_select_parent_category'), 0, -1); ?> </td> </tr> <tr> <th><?php echo L('catname'); ?> £º</th> <td> <span id="normal_add"><input type="text" name="info[catname]" id="catname" class="input-text" value=""></span> <span id="batch_add" style="display:none"> <table width="100%" class="sss"><tr><td width="310"><textarea name="batch_add" maxlength="255" style="width:300px;height:60px;"></textarea></td> <td align="left"> <?php
<input type="hidden" name="a" value="public_search_content"> <table width="100%" class="table_form"> <tr> <td width="80"><?php echo L('category'); ?> :</td> <td><?php if (isset($_GET['dosubmit'])) { ?> <div class="rt"><a href="javascript:void(0)" onclick="$('#search').toggle()"><?php echo L('folded_up_in_search_of'); ?> </a></div><?php } echo form::select_category('category_content', $catid, 'name="catid" id="catid"', '', '', '0', 1); ?> </td> </tr> <tbody id="search" <?php if (isset($_GET['dosubmit'])) { echo 'style="display:none"'; } ?> > <tr> <td><?php echo L('posterize_time'); ?> :</td> <td><?php
?> " 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>
public function public_show_cat_ajx() { $parentid = intval($_GET['parentid']); $siteid = intval($_GET['siteid']); echo form::select_category('', 0, 'name="addcat[' . $parentid . '][]"', L('wap_type_bound'), 0, 0, 0, $siteid); }
<?php defined('IN_ADMIN') or exit('No permission resources.'); include $this->admin_tpl('header', 'zl_admin'); ?> <div class="pad_10"> <form action="?" method="get"> <input type="hidden" name="m" value="block"> <input type="hidden" name="c" value="block_admin"> <input type="hidden" name="a" value="public_search_content"> <table width="100%" class="table_form"> <tr> <td width="80"><?php echo L('category')?>:</td> <td><?php if(isset($_GET['dosubmit'])){?><div class="rt"><a href="javascript:void(0)" onclick="$('#search').toggle()"><?php echo L('folded_up_in_search_of')?></a></div><?php } echo form::select_category('category_content_'.$this->siteid, $catid, 'name="catid" id="catid"', '', '', '0', 1)?> </td> </tr> <tbody id="search" <?php if(isset($_GET['dosubmit'])) echo 'style="display:none"';?>> <tr> <td><?php echo L('posterize_time')?>:</td> <td><?php echo form::date('start_time', $start_time ? date('Y-m-d', $start_time) : '')?> - <?php echo form::date('end_time', $end_time ? date('Y-m-d',$end_time) : '')?></td> </tr> <tr> <td><?php echo L('recommend')?>:</td> <td> <?php echo form::select(array(''=>L('all'), '1'=>L('recommend'), '2'=>L('not_recommend')), $posids, 'name="posids"')?> </td> </tr> <tr> <td><?php echo L('search_mode')?>:</td> <td> <?php echo form::select(array('1'=>L('title'), '2'=>L('desc'), '3'=>L('username'), '4'=>'ID'), $searchtype, 'name="searchtype"')?> </td> </tr>
/** * 推荐位添加栏目加载 */ public function public_category_load() { import('ORG.Util.Form'); $modelid = intval($_GET['modelid']); $category = form::select_category('', '', 'name="info[catid]"', '≡ 作为一级栏目 ≡', $modelid); echo $category; }
<div class="pad_10"> <div class="common-form"> <form name="myform" action="?m=zl_admin&c=position&a=edit" method="post" id="myform"> <input type="hidden" name="posid" value="<?php echo $posid?>"></input> <table width="100%" class="table_form"> <tr> <td width="80"><?php echo L('posid_name')?></td> <td><input type="text" name="info[name]" class="input-text" value="<?php echo $name?>" id="name"></input></td> </tr> <tr> <td><?php echo L('posid_modelid')?></td> <td><?php echo form::select($modelinfo,$modelid,'name="info[modelid]" onchange="category_load(this);"', L('choose_model'));?></td> </tr> <tr> <td><?php echo L('posid_catid')?></td> <td id="load_catid"><?php echo form::select_category('',$catid,'name="info[catid]"',L('please_select_parent_category'));?></td> </tr> <tr> <td><?php echo L('listorder')?></td> <td><input type="text" name="info[listorder]" class="input-text" size="5" value="<?php echo $listorder?>"></input></td> </tr> <tr> <td><?php echo L('maxnum')?></td> <td><input type="text" name="info[maxnum]" id="maxnum" class="input-text" size="5" value="<?php echo $maxnum?>"></input><?php echo L('posid_num')?></td> </tr> <tr> <td><?php echo L('extention_name')?></td> <td><input type="text" name="info[extention]" id="extention" class="input-text" size="30" value="<?php echo $extention?>"></input></td> </tr> <tr>
/** * 推荐位添加栏目加载 */ public function public_category_load() { $modelid = intval($_GET['modelid']); pc_base::load_sys_class('form'); $category = form::select_category('', '', 'name="info[catid]"', L('please_select_parent_category'), $modelid); echo $category; }
/** * 生成标签选项 * @param $id HTML ID号 * @param $data 生成条件 * @param $value 当前值 * @param $op 操作名 * @return html 返回HTML代码 */ function creat_form($id, $data, $value = '', $op = '') { pc_base::load_sys_class('form', '', 0); if (empty($value)) $value = $data['defaultvalue']; $str = $ajax = ''; if($data['ajax']['name']) { if($data['ajax']['m']) { $url = '$.get(\'?m=content&c=push&a=public_ajax_get\', {html: this.value, id:\''.$data['ajax']['id'].'\', action: \''.$data['ajax']['action'].'\', module: \''.$data['ajax']['m'].'\', pc_hash: \''.$_SESSION['pc_hash'].'\'}, function(data) {$(\'#'.$id.'_td\').html(data)});'; } else { $url = '$.get(\'?m=template&c=file&a=public_ajax_get\', { html: this.value, id:\''.$data['ajax']['id'].'\', action: \''.$data['ajax']['action'].'\', op: \''.$op.'\', style: \'default\', pc_hash: \''.$_SESSION['pc_hash'].'\'}, function(data) {$(\'#'.$id.'_td\').html(data)});'; } } switch ($data['htmltype']) { case 'input': if($data['ajax']['name']) { $ajax = 'onblur="'.$url.'"'; } $str .= '<input type="text" name="'.$id.'" id="'.$id.'" value="'.$value.'" size="30" />'; break; case 'select': if($data['ajax']['name']) { $ajax = 'onchange="'.$url.'"'; } $str .= form::select($data['data'], $value, "name='$id' id='$id' $ajax"); break; case 'checkbox': if($data['ajax']['name']) { $ajax = ' onclick="'.$url.'"'; } if (is_array($value)) implode(',', $value); $str .= form::checkbox($data['data'], $value, "name='".$id."[]'".$ajax, '', '120'); break; case 'radio': if($data['ajax']['name']) { $ajax = ' onclick="'.$url.'"'; } $str .= form::radio($data['data'], $value, "name='$id'$ajax", '', '120'); break; case 'input_select': if($data['ajax']['name']) { $ajax = ';'.$url; } $str .= '<input type="text" name="'.$id.'" id="'.$id.'" value="'.$value.'" size="30" />'.form::select($data['data'], $value, "name='select_$id' id='select_$id' onchange=\"$('#$id').val(this.value);$ajax\""); break; case 'input_select_category': if($data['ajax']['name']) { $ajax = ';'.$url; } $str .= '<input type="text" name="'.$id.'" id="'.$id.'" value="'.$value.'" size="30" />'.form::select_category('', $value, "name='select_$id' id='select_$id' onchange=\"$('#$id').val(this.value);$ajax\"", '', (isset($data['data']['modelid']) ? $data['data']['modelid'] : 0), (isset($data['data']['type']) ? $data['data']['type'] : -1), (isset($data['data']['onlysub']) ? $data['data']['onlysub'] : 0)); break; case 'select_yp_model': if($data['ajax']['name']) { $ajax = ';'.$url; } $yp_models = getcache('yp_model', 'commons'); $d = array(L('please_select')); if (is_array($yp_models) && !empty($yp_models)) { foreach ($yp_models as $k =>$v) { $d[$k] = $v['name']; } } $str .= '<input type="text" name="'.$id.'" id="'.$id.'" value="'.$value.'" size="30" />'.form::select($d, $value, "name='select_$id' id='select_$id' onchange=\"$('#$id').val(this.value);$ajax\""); break; } if (!empty($data['validator'])) { $str .= '<script type="text/javascript">$(function(){$("#'.$id.'").formValidator({onshow:"'.L('input').$data['name'].'。",onfocus:"'.L('input').$data['name'].'。"'.($data['empty'] ? ',empty:true' : '').'})'; if ($data['htmltype'] != 'select' && (isset($data['validator']['min']) || isset($data['validator']['max']))) { $str .= ".inputValidator({".(isset($data['validator']['min']) ? 'min:'.$data['validator']['min'].',' : '').(isset($data['validator']['max']) ? 'max:'.$data['validator']['max'].',' : '')." onerror:'".$data['name'].L('should', '', 'template').(isset($data['validator']['min']) ? ' '.L('is_greater_than', '', 'template').$data['validator']['min'].L('lambda', '', 'template') : '').(isset($data['validator']['max']) ? ' '.L('less_than', '', 'template').$data['validator']['max'].L('lambda', '', 'template') : '')."。'})"; } if ($data['htmltype'] != 'checkbox' && $data['htmltype'] != 'radio' && isset($data['validator']['reg'])) { $str .= '.regexValidator({regexp:"'.$data['validator']['reg'].'"'.(isset($data['validator']['reg_param']) ? ",param:'".$data['validator']['reg_param']."'" : '').(isset($data['validator']['reg_msg']) ? ',onerror:"'.$data['validator']['reg_msg'].'"' : '').'})'; } $str .=";});</script>"; } return $str; }
/** * 按模型ID列出模型下的栏目 */ public function public_categorys_list() { if (!isset($_GET['modelid']) || empty($_GET['modelid'])) { exit(''); } $modelid = intval($_GET['modelid']); exit(form::select_category('', $_GET['catid'], 'name="catid" id="catid"', L('please_select'), $modelid, 0, 1)); }
:</th> <td><input type="text" name="info[url]" id="url" class="input-text" size="50" value="<?php if (preg_match('/^http:\\/\\/([a-z0-9\\-\\.]+)\\/$/i', $url)) { echo $url; } ?> "></td> </tr> <!-- 4.1 增加跳转到其他栏目功能 --> <tr id="linkto"> <th><?php echo '跳转到其他栏目'; ?> :</th> <td><?php echo form::select_category('category_content_' . $this->siteid, $linkto, 'name="info[linkto]"', '不跳转', 0, -1); ?> </td> </tr> <!-- 4.1 增加跳转到其他栏目功能 --> </table> </div> <div id="div_setting_3" class="contentList pad-10 hidden"> <table width="100%" class="table_form "> <tr> <th width="200"><?php echo L('available_styles'); ?> :</th> <td> <?php
public function public_relation_cate_list() { $siteid = isset($_GET['siteid']) ? $_GET['siteid'] : $this->get_siteid(); $str = form::select_category('', $catid = 0, 'name="catid"', L('please_select_category'), 0, -1, 0, $siteid, 0); $return['page_template'] = $str; echo json_encode($return); }