本文整理汇总了PHP中forum::select方法的典型用法代码示例。如果您正苦于以下问题:PHP forum::select方法的具体用法?PHP forum::select怎么用?PHP forum::select使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类forum
的用法示例。
在下文中一共展示了forum::select方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: doAdd
function doAdd($isNoCopy = true)
{
Admin::MP(array("menu_index_article_add", "menu_article_add"));
$forum = new forum();
$id = (int) $_GET['id'];
$rs = array();
$id && ($rs = iCMS_DB::getRow("SELECT a.*,ad.tpl,ad.body,ad.subtitle FROM `#iCMS@__article` a LEFT JOIN `#iCMS@__article_data` ad ON a.id=ad.aid WHERE a.id='{$id}'", ARRAY_A));
$rs['pubdate'] = empty($id) ? get_date('', "Y-m-d H:i:s") : get_date($rs['pubdate'], 'Y-m-d H:i:s');
$fid = empty($rs['fid']) ? intval($_GET['fid']) : $rs['fid'];
$cata_option = $forum->select($fid);
empty($rs['editor']) && ($rs['editor'] = empty(Admin::$Rs->name) ? Admin::$Rs->username : Admin::$Rs->name);
empty($rs['userid']) && ($rs['userid'] = Admin::$uId);
$rs['body'] = dhtmlspecialchars(str_replace('<!--iCMS.PageBreak-->', '<div style="page-break-after: always"><span style="display: none"> </span></div>', $rs['body']));
$strpos = strpos(__REF__, '?');
$REFERER = $strpos === false ? '' : substr(__REF__, $strpos);
include admincp::tpl("article.add");
}
示例2: form
function form($A, $rs = array(), $isUser = false)
{
$id = $A['field'];
$val = $rs[$id] ? $rs[$id] : '';
$mId = $rs['mid'];
$mName = $rs['mName'];
$option = unserialize($A['option']);
$optStr = $option[$A['type']];
if ($optStr) {
$_optArray = explode("\n", $optStr);
foreach ($_optArray as $k => $optA) {
list($index, $choice) = explode("=", $optA);
$optArray[trim($index)] = trim($choice);
}
}
if ($A['hidden']) {
$FORM['hidden'] = '<input type="hidden" name="content[' . $id . ']" id="' . $id . '" value="' . $val . '" />';
} else {
//判读是否为特殊字段
if (in_array($A['field'], array('fid', 'type', 'vlink'))) {
switch ($A['field']) {
case "fid":
$forum = new forum();
$cata_option = $isUser ? $forum->user_select($val, 0, 1, 1, $mId) : $forum->select($val, 0, 1, NULL, $mId);
if ($cata_option) {
$html = '<select name="content[fid]" id="fid" style="width:auto;">';
$html .= '<option value="0"> == 请选择所属栏目 == </option>';
$html .= $cata_option;
} else {
if ($isUser) {
$html = '<select name="content[fid]" id="fid">';
$html .= '<option value="0"> == 暂无栏目 == </option>';
} else {
$html = '<select name="content[fid]" id="fid" onclick="window.location.replace(\'' . __ADMINCP__ . '=forums&do=add\');">';
$html .= '<option value="0"> == 暂无栏目请先添加 == </option>';
}
}
$html .= '</select>';
break;
case "type":
$html = '<select name="content[type]"id="type">';
$html .= '<option value="0">默认属性[type=\'0\']</option>';
$html .= contentype($mName, $val);
$html .= '</select>';
break;
case "vlink":
$forum = new forum();
$html = '<select name="content[vlink][]" size="10" multiple="multiple" id="vlink">';
$html .= $isUser ? $forum->user_select($val, 0, 1, 1, $mId) : $forum->select($val, 0, 1, 'all', $mId);
$html .= '</select>';
$html .= selected($val, 'vlink', 'js');
break;
// case in_array($A['field'],array('hits','digg','comments','status','postype')): break;
}
} else {
switch ($A['type']) {
case in_array($A['type'], array('number', 'text', 'email', 'url')):
$html = '<input type="text" name="content[' . $id . ']" class="txt" id="' . $id . '" value="' . $val . '" />';
break;
case "radio":
foreach ((array) $optArray as $value => $text) {
$checked = $value == $val ? ' checked="checked"' : '';
$html .= ' <input type="radio" name="content[' . $id . ']" class="radio" id="' . $id . '" value="' . $value . '" /> ' . $text;
}
break;
case "checkbox":
$valArray = explode(',', $val);
foreach ((array) $optArray as $value => $text) {
$checked = in_array($value, $valArray) ? ' checked="checked"' : '';
$html .= ' <input type="checkbox" name="content[' . $id . '][]" class="checkbox" id="' . $id . '.' . $value . '" value="' . $value . '" ' . $checked . '/> ' . $text;
}
break;
case "textarea":
$html = '<textarea name="content[' . $id . ']" id="' . $id . '" onKeyUp="textareasize(this)" class="tarea">' . $val . '</textarea>';
break;
// case "editor":
// $html='<script type="text/javascript" src="editor/fckeditor.js"></script>
//<script type="text/javascript" src="admin/js/plus_format_fck.js"></script><select class="BP">
// <option value="1">第 1 页</option>
// </select><input type="button" value="新增一页" onClick="newBody();" class="button">
//<iframe id="rtf" style="width: 0px; height: 0px;" marginwidth="0" marginheight="0" src="about:blank" scrolling="no"></iframe>
// <label for="x_paste"></label>
// <script>rtf.document.designMode="On";</script>
// <input type="button" name="formatbutton" value="粘贴排版" onclick="trans(iCMS.eId);" class="button">
// <input type="button" name="formatbutton_img" value="自动排版" onClick="FormatImages(iCMS.eId)" class="button">
// <input type="button" value="批量上传" onClick="multiUpload();" class="button">
// <input type="button" value="插入图片" onClick="iCMS.showDialog(\''.__ADMINCP__.'=dialog&do=file&click=file&type=gif,jpg,png,bmp,jpeg&from=editor\',\'iCMSEDITOR\',\'从网站选择\');" class="button">
//<div id="iBody_1" class="nb">
// <textarea id="iEditor_1" name="content['.$id.'][]" cols="80" rows="20" style="display:none">'.$val.'</textarea>
// <input type="hidden" id="iEditor_1___Config" value="" style="display:none" />
// <iframe id="iEditor_1___Frame" src="./editor/fckeditor.html?InstanceName=iEditor_1&Toolbar=Default" width="100%" height="500" frameborder="0" scrolling="no"></iframe>
// </div>';
// break;
// case "editor":
// $html='<script type="text/javascript" src="editor/fckeditor.js"></script>
//<script type="text/javascript" src="admin/js/plus_format_fck.js"></script><select class="BP">
// <option value="1">第 1 页</option>
// </select><input type="button" value="新增一页" onClick="newBody();" class="button">
//<iframe id="rtf" style="width: 0px; height: 0px;" marginwidth="0" marginheight="0" src="about:blank" scrolling="no"></iframe>
// <label for="x_paste"></label>
//.........这里部分代码省略.........