本文整理汇总了PHP中forum类的典型用法代码示例。如果您正苦于以下问题:PHP forum类的具体用法?PHP forum怎么用?PHP forum使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了forum类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: dofpower
function dofpower()
{
$rs = iCMS_DB::getRow("SELECT * FROM `#iCMS@__members` WHERE `uid`='" . intval($_GET['uid']) . "'");
$forum = new forum();
$forum->allArray();
include admincp::tpl("account.fpower");
}
开发者ID:idreamsoft,项目名称:iCMS5.1,代码行数:7,代码来源:account.mo.php
示例2: dofpower
function dofpower()
{
$rs = iCMS_DB::getRow("SELECT * FROM `#iCMS@__group` WHERE `gid`='" . intval($_GET['groupid']) . "'");
admincp::head();
$forum = new forum();
$forum->allArray();
include admincp::tpl();
}
开发者ID:idreamsoft,项目名称:iCMS5.1,代码行数:8,代码来源:groups.mo.php
示例3: dofpower
function dofpower()
{
include_once iPATH . 'include/forum.class.php';
$rs = iCMS_DB::getRow("SELECT * FROM `#iCMS@__admin` WHERE `uid`='" . intval($_GET['uid']) . "'");
$forum = new forum();
$forum->allArray();
include admincp::tpl("account.fpower");
}
开发者ID:idreamsoft,项目名称:iCMS5.0,代码行数:8,代码来源:account.mo.php
示例4: doUpdate
function doUpdate()
{
include_once iPATH . 'include/forum.class.php';
if ($_POST['forum']) {
$forum = new forum();
$forum->cache();
}
if ($_POST['adm']) {
include_once iPATH . 'admin/advertise.mo.php';
$rs = iCMS_DB::getArray("SELECT * FROM `#iCMS@__advertise`", OBJECT);
$_count = count($rs);
for ($i = 0; $i < $_count; $i++) {
adm($rs[$i]);
}
}
$_POST['tpl'] && $this->iCMS->clear_compiled_tpl();
$_POST['iCMS_list'] && FS::rmdir(iPATH . 'cache/list');
$_POST['iCMS_forum'] && FS::rmdir(iPATH . 'cache/forum');
$_POST['iCMS_tag'] && FS::rmdir(iPATH . 'cache/tags');
if ($_POST['iCMS_ALL']) {
FS::rmdir(iPATH . 'cache/list');
FS::rmdir(iPATH . 'cache/forum');
FS::rmdir(iPATH . 'cache/tags');
}
$_POST['keywords'] && keywords_cache();
$_POST['tags'] && tags_cache();
if ($_POST['model']) {
include iPATH . 'include/model.class.php';
model::cache();
}
$_POST['field'] && field_cache();
$_POST['config'] && CreateConfigFile();
if ($_POST['Re-Article-Count']) {
$rs = iCMS_DB::getArray("SELECT fid FROM `#iCMS@__forum`");
$_count = count($rs);
for ($i = 0; $i < $_count; $i++) {
$c = iCMS_DB::getValue("SELECT count(*) FROM #iCMS@__article where `fid`='" . $rs[$i]['fid'] . "' LIMIT 1 ");
iCMS_DB::query("UPDATE `#iCMS@__forum` SET `count` ='{$c}' WHERE `fid` ='" . $rs[$i]['fid'] . "' LIMIT 1 ");
}
}
if ($_POST['Re-Tag-Count']) {
include_once iPATH . 'include/forum.class.php';
$rs = iCMS_DB::getArray("SELECT id FROM `#iCMS@__tags`");
$_count = count($rs);
for ($i = 0; $i < $_count; $i++) {
$_count = iCMS_DB::getValue("SELECT count(*) FROM `#iCMS@__taglist` WHERE `tid`='" . $rs[$i]['id'] . "'");
iCMS_DB::query("UPDATE `#iCMS@__tags` SET `count` = '{$_count}' WHERE `id` ='" . $rs[$i]['id'] . "'");
tags_cache($rs[$i]['id']);
}
}
javascript::dialog("执行完毕!", 'url:1');
}
开发者ID:idreamsoft,项目名称:iCMS5.0,代码行数:52,代码来源:cache.mo.php
示例5: finish
function finish($postid, $cloneid, $url, $fromform, $uploadfolder, $ajaxdata = '')
{
// Clear out used playspace and/or uploadfolder
if (isset($fromform->attachmentplayspace)) {
// Unless we're keeping it, wipe the playspace
forum::delete_attachment_playspace($fromform->attachmentplayspace, optional_param('keepplayspace', 0, PARAM_INT));
}
// Get rid of temporary upload folder
if ($uploadfolder) {
remove_dir($uploadfolder);
}
global $ajax;
if ($ajax) {
if ($ajaxdata) {
// Print AJAX data if specified
header('Content-Type: text/plain');
print $ajaxdata;
exit;
} else {
// Default otherwise is to print post
forum_post::print_for_ajax_and_exit($postid, $cloneid, array(forum_post::OPTION_DISCUSSION_SUBJECT => true));
}
}
redirect($url);
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:25,代码来源:editpost.php
示例6: doarticle
function doarticle()
{
$forum = new forum();
$callback = $_GET['callback'];
$fid = (int) $_GET['fid'];
$sql = " where ";
$sql .= $_GET['type'] == 'draft' ? "`status` ='0'" : "`status` ='1'";
$sql .= $act == 'user' ? " AND `postype`='0'" : " AND `postype`='1'";
$_GET['keywords'] && ($sql .= " AND CONCAT(title,keywords,description) REGEXP '{$_GET['keywords']}'");
$fid = member::CP($fid) ? $fid : "0";
if ($fid) {
if (isset($_GET['sub'])) {
$sql .= " AND ( fid IN(" . $forum->fid($fid) . $fid . ")";
} else {
$sql .= " AND ( fid ='{$fid}'";
}
$sql .= " OR `vlink` REGEXP '[[:<:]]" . preg_quote($fid, '/') . "[[:>:]]')";
} else {
member::$cpower && ($sql .= " AND fid IN(" . implode(',', member::$cpower) . ")");
}
isset($_GET['keyword']) && ($uri .= '&keyword=' . $_GET['keyword']);
$maxperpage = 8;
$total = $page == 1 || empty($_GET['rowNum']) ? iCMS_DB::getValue("SELECT count(*) FROM `#iCMS@__article` {$sql}") : (int) $_GET['rowNum'];
page($total, $maxperpage, "篇文章");
$rs = iCMS_DB::getArray("SELECT * FROM `#iCMS@__article`{$sql} order by id DESC LIMIT {$this->firstcount} , {$maxperpage}");
$_count = count($rs);
include admincp::tpl();
}
开发者ID:idreamsoft,项目名称:iCMS5.1,代码行数:28,代码来源:dialog.mo.php
示例7: display
public function display($forum)
{
$params = $forum->get_link_params_array();
if ($forum->get_group_mode()) {
$params['group'] = forum::get_activity_group($forum->get_course_module());
}
return parent::get_button($forum, get_string('markallread', 'forumng'), 'markread.php', true, $params);
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:8,代码来源:markallread_forum_feature.php
示例8: display
public function display($forum)
{
// Work out current status
$manualmark = !forum::mark_read_automatically();
$current = get_string($manualmark ? 'manualmark_manual' : 'manualmark_auto', 'forumng');
// Make a help button
$change = get_string('manualmark_change', 'forumng');
$helpbutton = helpbutton('manualmark', $change, 'forumng', true, false, '', true);
// Get the button form
$params = $forum->get_link_params_array();
return parent::get_button($forum, $change, 'feature/manualmark/change.php', true, $params, $helpbutton, 'forumng-manualmark', $current . ' ', 'forumng-button-to-link');
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:12,代码来源:manualmark_forum_feature.php
示例9: exit
<?php
if (!defined('IN_ROSTER')) {
exit('Detected invalid access to this file!');
}
include $addon['dir'] . 'inc/function.lib.php';
$functions = new forum();
include ROSTER_LIB . 'install.lib.php';
$installer = new Install();
if (isset($_POST['type']) && !empty($_POST['type'])) {
$op = isset($_POST['op']) ? $_POST['op'] : '';
$id = isset($_POST['id']) ? $_POST['id'] : '';
switch ($_POST['type']) {
case 'deactivate':
processActive($id, 0);
break;
case 'activate':
processActive($id, 1);
break;
case 'unlock':
processLock($id, 0);
break;
case 'lock':
processLock($id, 1);
break;
case 'delete':
deleteForum();
break;
case 'add':
echo 'add forum';
//processPage();
开发者ID:Sajaki,项目名称:wowroster,代码行数:31,代码来源:forum.php
示例10: database
<?php
require '../includes/config.php';
require '../structure/base.php';
require '../structure/forum.php';
require '../structure/forum.index.php';
require '../structure/forum.thread.php';
require '../structure/forum.post.php';
require '../structure/database.php';
require '../structure/user.php';
$database = new database($db_host, $db_name, $db_user, $db_password);
$base = new base($database);
$user = new user($database);
$forum = new forum($database);
$forum_index = new forum_index($database);
$thread = new thread($database);
$post = new post($database);
$user->updateLastActive();
//get config
$config = $base->loadConfig();
//set some variables that are used a lot throughout the page
$username = $user->getUsername($_COOKIE['user'], 2);
$rank = $user->getRank($username);
$f = $_GET['forum'];
$i = $_GET['id'];
//preform basic checks
if (!ctype_digit($f) || !ctype_digit($i) || !$thread->checkExistence($i) || !$thread->canView($i, $username, $rank)) {
$base->redirect('index.php');
}
//if the GOTO field is set, let's skip to the selected post
if (ctype_digit($_GET['goto'])) {
开发者ID:Vubot,项目名称:RuneScapeCommunityScript,代码行数:31,代码来源:viewthread.php
示例11: exit
/**
* WoWRoster.net WoWRoster
*
* @copyright 2002-2011 WoWRoster.net
* @license http://www.gnu.org/licenses/gpl.html Licensed under the GNU General Public License v3.
* @version SVN: $Id$
* @link http://www.wowroster.net
* @package News
*/
if (!defined('IN_ROSTER')) {
exit('Detected invalid access to this file!');
}
if (!$roster->auth->getAuthorized($addon['config']['forum_start_topic'])) {
echo $roster->auth->getLoginForm($addon['config']['forum_start_topic']);
return;
//To the addon framework
}
include $addon['dir'] . 'inc/function.lib.php';
$functions = new forum();
$x = $functions->getCrumbsa($_GET['id']);
// Assign template vars
$roster->tpl->assign_vars(array('S_ADD_TOPIC' => false, 'CRUMB' => $x, 'U_BACK' => makelink('guild-forum'), 'S_HTML_ENABLE' => false, 'S_TOPIC_HTML' => $addon['config']['forum_html_posts'], 'S_POSTER' => $_COOKIE['roster_user'], 'S_TOPIC_ACCESS' => $roster->auth->rosterAccess(array('name' => 'access', 'value' => '0')), 'U_FORMACTION' => makelink('guild-forum-forum&id=' . $_GET['id'])));
if ($addon['config']['forum_html_posts'] >= 0) {
$roster->tpl->assign_var('S_HTML_ENABLE', true);
}
if ($addon['config']['forum_nicedit'] > 0) {
roster_add_js('js/nicEdit.js');
roster_add_js('bkLib.onDomLoaded(function() { nicEditors.allTextAreas({xhtml : true, fullPanel : true, iconsPath : \'' . $roster->config['img_url'] . 'nicEditorIcons.gif\'}) });', 'inline', 'header', false, false);
}
$roster->tpl->set_filenames(array('topic' => $addon['basename'] . '/topic_new.html'));
$roster->tpl->display('topic');
开发者ID:Sajaki,项目名称:wowroster,代码行数:31,代码来源:addtopic.php
示例12: print_discussion_page
/**
* Displays the discussion page.
* @param forum_discussion $discussion Discussion
*/
public function print_discussion_page($discussion)
{
$previousread = (int) $discussion->get_time_read();
// 'Read date' option (used when viewing all posts so that they keep
// their read/unread colouring)
$timeread = optional_param('timeread', 0, PARAM_INT);
if ($timeread) {
$discussion->pretend_time_read($timeread);
$previousread = $timeread;
}
// 'Expand all' option (always chosen for non-JS browsers)
$expandall = optional_param('expand', 0, PARAM_INT) || forum_utils::is_bad_browser();
// 'Expand all' option (always chosen for non-JS browsers)
$collapseall = optional_param('collapse', 0, PARAM_INT);
// Magic expand tracker (for use in JS only, never set server-side).
// This tracks expanded posts, and makes the Back button 'work' in
// the sense that it will expand these posts again.
print '<form method="post" action="."><div>' . '<input type="hidden" id="expanded_posts" name="expanded_posts" ' . 'value="" /></div></form>';
// Get content for all posts in the discussion
$options = array();
if ($expandall) {
$options[forum_post::OPTION_CHILDREN_EXPANDED] = true;
}
if ($collapseall) {
$options[forum_post::OPTION_CHILDREN_COLLAPSED] = true;
}
$content = $this->display_discussion($discussion, $options);
// Some post display options use the read time to construct links
// (usually for non-JS version) so that unread state is maintained.
$options[forum_post::OPTION_READ_TIME] = $previousread;
// Display expand all option if there are any 'Expand' links in content
$fakedate = '&timeread=' . $previousread;
print '<div id="forumng-expandall">';
$showexpandall = preg_match('~<a [^>]*href="discuss\\.php\\?d=[0-9]+[^"]*&expand=1#p[0-9]+">~', $content);
$showcollapseall = preg_match('~<div class="forumng-post forumng-full.*<div class="forumng-post forumng-full~s', $content);
if ($showexpandall) {
print '<a href="' . $discussion->get_url(forum::PARAM_HTML) . '&expand=1' . $fakedate . '">' . get_string('expandall', 'forumng') . '</a>';
if ($showcollapseall) {
print ' • ';
}
}
if ($showcollapseall) {
print '<a href="' . $discussion->get_url(forum::PARAM_HTML) . '&collapse=1' . $fakedate . '">' . get_string('collapseall', 'forumng') . '</a> ';
}
print '</div>';
// Display content
print $content;
// Print reply/edit forms for AJAX
print $this->display_ajax_forms($discussion->get_forum());
// Link back to forum
print $discussion->display_link_back_to_forum();
// Display discussion features (row of buttons)
print $discussion->display_discussion_features();
// Display the subscription options to this disucssion if available
print $discussion->display_subscribe_options();
// Atom/RSS links
print $discussion->display_feed_links();
// Set read data [shouldn't this logic be somewhere else as it is not
// part of display?]
if (forum::mark_read_automatically()) {
$discussion->mark_read();
}
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:67,代码来源:general_forum_type.php
示例13: optional_param
$draftid = optional_param('draft', 0, PARAM_INT);
if ($draftid) {
$draft = forum_draft::get_from_id($draftid);
if (!$draft->is_reply() || $draft->get_discussion_id() != $discussionid) {
print_error('draft_mismatch', 'forumng', $forum->get_url(forum::PARAM_HTML));
}
$root = $discussion->get_root_post();
$inreplyto = $root->find_child($draft->get_parent_post_id(), false);
if (!$inreplyto || !$inreplyto->can_reply($whynot) || !$discussion->can_view()) {
print_error('draft_cannotreply', 'forumng', $forum->get_url(forum::PARAM_HTML), get_string($whynot, 'forumng'));
}
$inreplyto->force_expand();
$draftplayspaceid = 0;
if ($draft->has_attachments()) {
$draftplayspaceid = forum::create_attachment_playspace();
$target = forum::get_attachment_playspace_folder($draftplayspaceid);
$source = $draft->get_attachment_folder();
foreach ($draft->get_attachment_names() as $name) {
forum_utils::copy("{$source}/{$name}", "{$target}/{$name}");
}
}
}
// Check that discussion can be viewed [Handles all other permissions]
$discussion->require_view();
// Search form for header
$buttontext = $forum->display_search_form();
// Atom header meta tag
$feedtype = $forum->get_effective_feed_option();
if ($feedtype == forum::FEEDTYPE_ALL_POSTS) {
$atomurl = $discussion->get_feed_url(forum::FEEDFORMAT_ATOM);
$meta = '<link rel="alternate" type="application/atom+xml" ' . 'title="Atom feed" href="' . htmlspecialchars($atomurl) . '" />';
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:31,代码来源:discuss.php
示例14: required_param
$id = required_param('id', PARAM_INT);
// On the view page ONLY we allow a default for the clone parameter that won't
// cause an error if it's omitted. All other pages have default 0, which will
// show up any errors caused if the parameter is omitted somewhere.
$cloneid = optional_param('clone', forum::CLONE_DIRECT, PARAM_INT);
try {
// Construct forum variable (will check id is valid)
$forum = forum::get_from_cmid($id, $cloneid);
$course = $forum->get_course();
$cm = $forum->get_course_module();
// If this is a clone, redirect to original
if ($forum->is_clone()) {
$forum->redirect_to_original();
}
// Check that forum can be viewed [Handles all other permissions]
$groupid = forum::get_activity_group($cm, true);
$forum->require_view($groupid, 0, true);
// Get update button, if allowed for current user
$strforum = get_string("modulename", "forum");
$buttontext = $forum->display_search_form();
// Atom header meta tag
$feedtype = $forum->get_effective_feed_option();
if ($feedtype == forum::FEEDTYPE_DISCUSSIONS || $feedtype == forum::FEEDTYPE_ALL_POSTS && $forum->can_view_discussions()) {
$atomurl = $forum->get_feed_url(forum::FEEDFORMAT_ATOM, $groupid);
$meta = '<link rel="alternate" type="application/atom+xml" ' . 'title="Atom feed" href="' . htmlspecialchars($atomurl) . '" />';
} else {
$meta = '';
}
// Initialize $PAGE, compute blocks
require_once $CFG->dirroot . '/mod/forumng/pagelib.php';
global $CURRENTFORUM;
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:31,代码来源:view.php
示例15: dolist
function dolist()
{
$id = (int) $_GET['id'];
$fid = (int) $_GET['fid'];
$tagName = iCMS_DB::getValue("SELECT name FROM #iCMS@__tags WHERE id='{$id}'");
$forum = new forum();
$sql = '#iCMS@__article.id = `indexId`';
$_GET['keywords'] && ($sql .= " AND `title` REGEXP '{$_GET['keywords']}'");
isset($_GET['nopic']) && ($sql .= " AND `isPic` ='0'");
$_GET['starttime'] && ($sql .= " and `pubdate`>='" . strtotime($_GET['starttime']) . "'");
$_GET['endtime'] && ($sql .= " and `pubdate`<='" . strtotime($_GET['endtime']) . "'");
isset($_GET['at']) && $_GET['at'] != '-1' && ($sql .= " AND `type` ='" . $_GET['at'] . "'");
isset($_GET['keyword']) && ($uri .= '&keyword=' . $_GET['keyword']);
$fid = Admin::CP($fid) ? $fid : "0";
if ($fid) {
$cidIN = $forum->fid($fid) . $fid;
if (isset($_GET['sub']) && strstr($cidIN, ',')) {
$sql .= " AND fid IN(" . $cidIN . ")";
} else {
$sql .= " AND fid ='{$fid}'";
}
} else {
Admin::$cpower && ($sql .= " AND fid IN(" . implode(',', (array) Admin::$cpower) . ")");
}
$maxperpage = (int) $_GET['perpage'] > 0 ? $_GET['perpage'] : 20;
$total = $page == 1 || empty($_GET['rowNum']) ? iCMS_DB::getValue("SELECT count(#iCMS@__article.id) FROM `#iCMS@__article`,`#iCMS@__taglist` WHERE `tid`='" . $id . "' AND {$sql}") : (int) $_GET['rowNum'];
page($total, $maxperpage, "篇文章");
$rs = iCMS_DB::getArray("SELECT #iCMS@__article.* FROM `#iCMS@__article`,`#iCMS@__taglist` WHERE `tid`='" . $id . "' AND {$sql} ORDER BY #iCMS@__taglist.indexId DESC LIMIT {$this->firstcount} , {$maxperpage}");
$_count = count($rs);
include admincp::tpl('tag.list');
}
开发者ID:idreamsoft,项目名称:iCMS5.0,代码行数:31,代码来源:tag.mo.php
示例16: database
<?php
require '../includes/config.php';
require '../structure/database.php';
require '../structure/base.php';
require '../structure/user.php';
require '../structure/forum.php';
$database = new database($db_host, $db_name, $db_user, $db_password);
$base = new base($database);
$user = new user($database);
$forum = new forum($database);
$user->updateLastActive();
$username = $user->getUsername($_COOKIE['user'], 2);
$rank = $user->getRank($username);
if ($rank < 4) {
$base->redirect('../index.php');
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns:IE>
<head>
<meta http-equiv="Expires" content="0">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
<meta name="MSSmartTagsPreventParsing" content="TRUE">
<title><?php
echo $data['wb_title'];
?>
</title>
<link href="../css/basic-3.css" rel="stylesheet" type="text/css" media="all">
<link href="../css/admin.css" rel="stylesheet" type="text/css" media="all">
开发者ID:Vubot,项目名称:RuneScapeCommunityScript,代码行数:31,代码来源:index.php
示例17: 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>
//.........这里部分代码省略.........
开发者ID:idreamsoft,项目名称:iCMS5.1,代码行数:101,代码来源:from.fun.php
示例18: forum
<?php
include $addon['dir'] . 'inc/function.lib.php';
$functions = new forum();
if (isset($_POST['type']) && !empty($_POST['type'])) {
$op = isset($_POST['op']) ? $_POST['op'] : '';
$id = isset($_POST['id']) ? $_POST['id'] : $_GET['id'];
switch ($_POST['type']) {
case 'newTopic':
createTopic();
break;
case 'unlock':
processLock($id, 0);
break;
case 'lock':
processLock($id, 1);
break;
default:
break;
}
}
function processLock($id, $mode)
{
global $roster, $addon, $installer;
$query = "UPDATE `" . $roster->db->table('forums', $addon['basename']) . "` SET `locked` = '{$mode}' WHERE `forum_id` = '" . $id . "';";
$result = $roster->db->query($query);
if (!$result) {
$roster->set_message('Database Error: ' . $roster->db->error() . '<br />SQL: ' . $query);
} else {
if ($mode == 1) {
$roster->set_message($roster->locale->act['f_lock']);
开发者ID:Sajaki,项目名称:wowroster_dev,代码行数:31,代码来源:forum.php
示例19: exit
<?php
/**
* WoWRoster.net WoWRoster
*
* @copyright 2002-2011 WoWRoster.net
* @license http://www.gnu.org/licenses/gpl.html Licensed under the GNU General Public License v3. * @package News
*/
if (!defined('IN_ROSTER')) {
exit('Detected invalid access to this file!');
}
if (!$roster->auth->getAuthorized($addon['config']['forum_reply_post'])) {
echo $roster->auth->getLoginForm($addon['config']['forum_reply_post']);
return;
//To the addon framework
}
include $addon['dir'] . 'inc/function.lib.php';
$functions = new forum();
$x = $functions->getCrumbsb($_GET['tid']);
// Assign template vars
$roster->tpl->assign_vars(array('S_ADD_TOPIC' => false, 'CRUMB' => $x, 'U_BACK' => makelink('guild-' . $addon['basename'] . '-topic_reply&tid=' . $_GET['tid']), 'S_HTML_ENABLE' => false, 'S_TOPIC_HTML' => $addon['config']['forum_html_posts'], 'S_POSTER' => $_COOKIE['roster_user'], 'U_FORMACTION' => makelink('guild-' . $addon['basename'] . '-topic&tid=' . $_GET['tid'])));
if ($addon['config']['forum_html_posts'] >= 0) {
$roster->tpl->assign_var('S_HTML_ENABLE', true);
if ($addon['config']['forum_nicedit'] > 0) {
roster_add_js('js/nicEdit.js');
roster_add_js('bkLib.onDomLoaded(function() { nicEditors.allTextAreas({xhtml : true, fullPanel : true, iconsPath : \'' . $roster->config['img_url'] . 'nicEditorIcons.gif\'}) });', 'inline');
}
}
$roster->tpl->set_filenames(array('topic' => $addon['basename'] . '/post_reply.html'));
$roster->tpl->display('topic');
开发者ID:Sajaki,项目名称:wowroster_dev,代码行数:30,代码来源:topic_reply.php
示例20: database
<?php
require '../includes/config.php';
require '../structure/database.php';
require '../structure/base.php';
require '../structure/forum.php';
require '../structure/forum.index.php';
require '../structure/user.php';
$database = new database($db_host, $db_name, $db_user, $db_password);
$base = new base($database);
$forum = new forum($database);
$forum_index = new forum_index($database);
$user = new user($database);
$user->updateLastActive();
$username = $user->getUsername($_COOKIE['user'], 2);
$rank = $user->getRank($username);
if ($rank < 4) {
$base->redirect('../index.php');
}
if (!isset($_REQUEST['cat'])) {
$content = '
<form action="editcat.php" method="POST">
<select name="cat" class="button">';
foreach ($forum_index->retrieveCategories($rank) as $category) {
$content .= '<option value="' . $category['id'] . '">' . $category['title'] . '</option>';
}
$content .= '<input type="submit" value="Edit"></select></form>';
} else {
//make sure it exists
if (!$forum->catExists($_REQUEST['cat'])) {
$content = 'No category exists with the given ID.';
开发者ID:Vubot,项目名称:RuneScapeCommunityScript,代码行数:31,代码来源:editcat.php
注:本文中的forum类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论