当前位置: 首页>>代码示例>>PHP>>正文


PHP forum::canCreate方法代码示例

本文整理汇总了PHP中forum::canCreate方法的典型用法代码示例。如果您正苦于以下问题:PHP forum::canCreate方法的具体用法?PHP forum::canCreate怎么用?PHP forum::canCreate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在forum的用法示例。


在下文中一共展示了forum::canCreate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1:

									<li><a href="viewforum.php?forum=<?php 
echo $f . '&page=' . $next;
?>
">next &gt;</a></li>
									<li><a href="viewforum.php?forum=<?php 
echo $f . '&page=' . $pages;
?>
">last &gt;&gt;</a></li>
								</ul>
							</form>
						</td>
						<td class="commands">
							<ul class="flat">
								<li><a href=""><img src="../img/forum/refresh.gif" alt=""> Refresh</a></li>
								<?php 
if ($user->isLoggedIn() && $forum->canCreate($f, $rank) && !$user->checkMute($username)) {
    echo '<li><a href="create.php?forum=' . $f . '"><img src="../img/forum/new_thread.gif" alt=""> Create a New Thread</a></li>';
}
?>
															</ul>
						</td>
					</tr>
				</tbody>
			</table>
		</div>
			<div id="content" class="border">
				<table id="t_holder">
					<tr height="20px">
						<td width="63%"></td>
						<td width="15%" class="title num">Posts</td>
						<td width="22%" class="title">Last Post</td>
开发者ID:Vubot,项目名称:RuneScapeCommunityScript,代码行数:31,代码来源:viewforum.php

示例2: database

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);
$user->updateLastActive();
//make sure the user is logged in and required data is set
if (!ctype_digit($_REQUEST['forum']) || !$user->isLoggedIn()) {
    $base->redirect('index.php');
}
//set some variables that are used a lot throughout the page
$username = $user->getUsername($_COOKIE['user'], 2);
$rank = $user->getRank($username);
$f = $_REQUEST['forum'];
//make sure they are posting in a forum where they have permission
if ($user->checkMute($username) || !$forum->canView($f, $rank) || !$forum->canCreate($f, $rank)) {
    $base->redirect('index.php');
}
//floodlimit time
$flood_limit = $database->processQuery("SELECT `floodlimit` FROM `config` LIMIT 1", array(), true);
//get the user's last post (time)
$last_post = $database->processQuery("SELECT `lastpost` FROM `users` WHERE `username` = ? LIMIT 1", array($username), true);
if (isset($_POST['cancel'])) {
    $base->redirect('viewforum.php?forum=' . $f);
}
if (isset($_POST['message']) && isset($_POST['title'])) {
    $message = nl2br($_POST['message']);
    $title = $_POST['title'];
    //make sure the title and message meet the standards
    if (strlen($message) > 2000 && $rank < 3) {
        $content = '<div class="frame e">Your post can\'t be larger than 2000 characters.</div>';
开发者ID:Vubot,项目名称:RuneScapeCommunityScript,代码行数:31,代码来源:create.php


注:本文中的forum::canCreate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。