phpcms推荐位修改

时间:2022-10-22 13:30:43
推荐位长度太短,可以修改一下 

如下关联文件

 

推荐位修改
ALTER TABLE `phpcms_position` CHANGE `name` `name` VARCHAR( 100 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL


ALTER TABLE `cms_position`  CHANGE COLUMN `name` `name` VARCHAR(300) NOT NULL AFTER `posid`;


position_add.tpl.php
<th><font color="red">*</font> <strong>推荐位名称</strong></th>
      <td><input type="text" name="info[name]" size="30" require="true" datatype="limit" min="2" max="300" msg="不得少于2个字符超过300个字符"></td>
   position_edit.tpl.php
   
   
    <caption>修改推荐位</caption>
 <tr>
      <th><font color="red">*</font> <strong>推荐位名称</strong></th>
      <td><input type="text" name="info[name]" value="<?=$name?>" size="30" require="true" datatype="limit" min="2" max="300" msg="不得少于2个字符超过300个字符"></td>

form.class.php
function select_pos($name = 'posid', $id ='', $posids = '', $cols = 1, $width = 300)
 {
  global $db,$priv_role, $POS;
  if(!$id) $id = $name;
  $pos = array();
  foreach($POS as $posid=>$posname)
  {
   if($priv_role->check('posid', $posid)) $pos[$posid] = str_cut($posname, 300, '');
  }
  return form::checkbox($pos, $name, $id, $posids, $cols, '', '', $width);
 }