本文整理汇总了PHP中Forum类的典型用法代码示例。如果您正苦于以下问题:PHP Forum类的具体用法?PHP Forum怎么用?PHP Forum使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Forum类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: moveModal
/**
* Move thread (TODO: Should this be in Forums?)
*/
public function moveModal()
{
$id = $this->getVal('id');
$wm = WallMessage::newFromId($id);
if (empty($wm)) {
return true;
}
/** @var $mainWall WallMessage */
$mainWall = $wm->getWall();
if (!$this->wg->User->isAllowed('wallmessagemove')) {
$this->displayRestrictionError();
return false;
// skip rendering
}
$forum = new Forum();
$list = $forum->getListTitles(DB_SLAVE, NS_WIKIA_FORUM_BOARD);
$this->destinationBoards = array(array('value' => '', 'content' => wfMsg('forum-board-destination-empty')));
/** @var $title Title */
foreach ($list as $title) {
$value = $title->getArticleID();
if ($mainWall->getId() != $value) {
$wall = Wall::newFromTitle($title);
$this->destinationBoards[$value] = array('value' => $value, 'content' => htmlspecialchars($wall->getTitle()->getText()));
}
}
}
开发者ID:Tjorriemorrie,项目名称:app,代码行数:29,代码来源:WallExternalController.class.php
示例2: del
function del()
{
$model = new Forum();
$model->del();
if ($_GET['parent'] != 0) {
$this->redirect('/forum/' . $_GET['parent'] . '/');
} else {
$this->redirect('/forum/');
}
}
开发者ID:sov-20-07,项目名称:billing,代码行数:10,代码来源:ForumController.php
示例3: inserir
public function inserir(Forum $forum)
{
//Objetivo deste metodo é inserir um objeto no banco, fazendo-o ter persistencia.
//utilizaremos a abstracao do SQL da classe TsqlInstruction
//1. Foreach dos atributos . PRa cada existencia de atributo é um valor a ser adicionado.
$instrucao = new TSqlInsert();
$instrucao->setEntity("forum");
if ($forum->getId() != null) {
$instrucao->setRowData("id", $forum->getId());
}
if ($forum->getTitulo() != null) {
$instrucao->setRowData("titulo", $forum->getTitulo());
}
if ($forum->getCorpo() != null) {
$instrucao->setRowData("corpo", $forum->getCorpo());
}
if ($forum->getUsuario() != null) {
$instrucao->setRowData("usuario", $forum->getUsuario());
}
echo $instrucao->getInstruction();
if ($this->Conexao->query($instrucao->getInstruction())) {
return true;
} else {
return false;
}
}
开发者ID:joseolinda,项目名称:escritordesoftware,代码行数:26,代码来源:ForumDAO.class.php
示例4: Execute
public function Execute(Template $template, Session $session, $request)
{
$template = CreateAncestors($template, $template['L_ADMINPANEL']);
if ($session['user'] instanceof Member && $session['user']['perms'] & ADMIN) {
$forum = new Forum();
if ($forum->setForumpermissions(intval($request['forum_id']), $request)) {
header("Location: admin.php?act=permissions");
}
}
return TRUE;
}
开发者ID:BackupTheBerlios,项目名称:k4bb,代码行数:11,代码来源:permissions.class.php
示例5: delete
public function delete($id)
{
$db = new DB();
$this->delCartForUser($id);
$this->delUserCategoryExclusions($id);
$releases = new Releases();
$releases->deleteCommentsForUser($id);
$forum = new Forum();
$forum->deleteUser($id);
$db->query(sprintf("delete from users where ID = %d", $id));
}
开发者ID:nubzzz,项目名称:newznab,代码行数:11,代码来源:users.php
示例6: action
public function action()
{
$page = 1;
if (isset($_GET['page'])) {
$page = intval($_GET['page']);
}
$forum = new Forum();
$pages = ceil(Thread::getCount() / $forum->getItemsPerPage());
$this->threads = $forum->getThreadList($page);
$this->pageNumber = $pages;
$this->page = $page;
}
开发者ID:echurmanov,项目名称:php-simple-forum,代码行数:12,代码来源:Main.php
示例7: content
/**
* Render view.
*
* @return string
*/
public function content()
{
if (!$this->topics) {
return '';
}
ob_start();
?>
<ul class="list-unstyled">
<?php
foreach ($this->topics as $topic) {
?>
<li>
<?php
echo HTML::anchor(Route::model($topic, '?page=last#last'), Forum::topic($topic), array('title' => HTML::chars($topic->name)));
?>
</li>
<?php
}
?>
</ul>
<?php
return ob_get_clean();
}
开发者ID:anqh,项目名称:anqh,代码行数:32,代码来源:list.php
示例8: sys_checkpwd
/**
* check id pwd
* @param String $id
* @param String $pwd
* @param String $md5
* @param String $ip
* @return {v:true|false,pwd:}
*/
public function sys_checkpwd()
{
@($id = trim($this->params['url']['id']));
@($pwd = rawurldecode($this->params['url']['pwd']));
@($md5 = intval(trim($this->params['url']['md5'])));
@($ip = trim($this->params['url']['ip']));
$md5 = $md5 == 1 ? true : false;
$this->ByrSession->from = $ip == "" ? "0.0.0.0" : $ip;
if ($md5) {
if (Configure::read("cookie.encryption")) {
$pwd = $this->ByrSession->decrypt($pwd);
}
$pwd = base64_decode($pwd);
}
$ret = array();
if (Forum::checkPwd($id, $pwd, $md5, true)) {
$ret['v'] = true;
$pwd = base64_encode(User::getInstance($id)->md5passwd);
if (Configure::read("cookie.encryption")) {
$pwd = $this->ByrSession->encrypt($pwd);
}
$ret['pwd'] = rawurlencode($pwd);
} else {
$ret['v'] = false;
}
echo BYRJSON::encode($ret);
}
开发者ID:tilitala,项目名称:nForum,代码行数:35,代码来源:wsapi_controller.php
示例9: actionCreate
public function actionCreate($id)
{
$forum = Forum::model()->findByPk($id);
if (null == $forum) {
throw new CHttpException(404, 'Forum not found.');
}
if ($forum->is_locked && (Yii::app()->user->isGuest || !Yii::app()->user->isForumAdmin())) {
throw new CHttpException(403, 'Forum is locked.');
}
$model = new PostForm();
$model->setScenario('create');
// This makes subject required
if (isset($_POST['PostForm'])) {
if (!isset($_POST['YII_CSRF_TOKEN']) || $_POST['YII_CSRF_TOKEN'] != Yii::app()->getRequest()->getCsrfToken()) {
throw new CHttpException(400, 'Invalid request. Please do not repeat this request again.');
}
$model->attributes = $_POST['PostForm'];
if ($model->validate()) {
$thread = new Thread();
$thread->forum_id = $forum->id;
$thread->subject = $model->subject;
$thread->author_id = Yii::app()->user->id;
$thread->lastPost_user_id = Yii::app()->user->id;
$thread->lastPost_time = time();
$thread->save(false);
$post = new Post();
$post->author_id = Yii::app()->user->id;
$post->thread_id = $thread->id;
$post->content = $model->content;
$post->save(false);
$this->redirect($thread->url);
}
}
$this->render('newThread', array('forum' => $forum, 'model' => $model));
}
开发者ID:CrystReal,项目名称:Site_frontend,代码行数:35,代码来源:ThreadController.php
示例10: before
/**
* Construct controller
*/
public function before()
{
parent::before();
$this->page_title = __('Forum');
// Generic page actions
$this->page_actions['new-posts'] = array('link' => Route::url('forum'), 'text' => '<i class="icon-comment icon-white"></i> ' . __('New posts'));
// Forum areas dropdown
$groups = Model_Forum_Group::factory()->find_all();
$areas = array();
foreach ($groups as $group) {
$divider = false;
foreach ($group->areas() as $area) {
if (Permission::has($area, Model_Forum_Area::PERMISSION_READ, self::$user)) {
$divider = true;
$areas[] = array('link' => Route::model($area), 'text' => HTML::entities($area->name));
}
}
if ($divider) {
$areas[] = array('divider' => true);
}
}
array_pop($areas);
$this->page_actions['areas'] = array('link' => Route::url('forum_group'), 'text' => '<i class="icon-folder-open icon-white"></i> ' . __('Areas'));
$this->page_actions['area'] = array('link' => Route::url('forum_group'), 'text' => '', 'dropdown' => $areas);
if (self::$user) {
$this->page_actions['private-messages'] = array('link' => Forum::private_messages_url(), 'text' => '<i class="icon-envelope icon-white"></i> ' . __('Private messages'));
}
}
开发者ID:anqh,项目名称:forum,代码行数:31,代码来源:forum.php
示例11: forums
public function forums()
{
//Everyone has access to unrestricted forums.
$collection = Forum::with('category')->whereNotNull('category_id')->orderBy('position')->get();
$character = $this->activeCharacter();
$sect = $character ? $character->sect()->first() : null;
$clan = $character ? $character->clan()->first() : null;
if (!$this->isStoryteller()) {
foreach ($collection as $k => $c) {
$allowed = true;
if ($c->sect_id != 0) {
if ($sect) {
$sect_id = $sect->hidden_id ? $sect->hidden_id : $sect->sect_id;
if ($sect_id != $c->sect_id) {
$allowed = false;
}
} else {
$allowed = false;
}
}
if ($c->clan_id != null) {
if ($clan) {
$clan_id = $clan->hidden_id ? $clan->hidden_id : $clan->clan_id;
if ($clan_id != $c->clan_id) {
$allowed = false;
}
} else {
$allowed = false;
}
}
if ($c->background_id != null) {
if ($character == null) {
$allowed = false;
} else {
if ($character->backgrounds()->where('background_id', $c->background_id)->count() == 0) {
$allowed = false;
}
}
}
if ($c->read_permission != null) {
if (!$this->hasPermissionById($c->read_permission)) {
$allowed = false;
}
}
if ($c->is_private) {
if ($character == null) {
$allowed = false;
} else {
if (!ForumCharacterPermission::where(['forum_id' => $c->id, 'character_id' => $character->id])->exists()) {
$allowed = false;
}
}
}
if (!$allowed) {
$collection->forget($k);
}
}
}
return $collection;
}
开发者ID:AcceptableIce,项目名称:Larp3,代码行数:60,代码来源:User.php
示例12: run
/**
* Run Method.
*/
public function run()
{
Forum::connection()->query('SET FOREIGN_KEY_CHECKS = 0');
$faker = Faker\Factory::create('ru_RU');
// Заполнение разделов
$data = [];
for ($i = 0; $i < 15; $i++) {
$data[] = ['sort' => $i, 'parent_id' => $i < 4 ? 0 : rand(1, 4), 'title' => $faker->realText(rand(20, 30)), 'description' => $faker->realText(rand(30, 50)), 'closed' => $i % 5 ? 0 : 1, 'created_at' => $faker->dateTimeBetween('-1 month')->format('Y-m-d H:i:s')];
}
Forum::connection()->query('TRUNCATE forums');
$table = $this->table('forums');
$table->insert($data)->save();
// Заполнение тем
$data = [];
for ($i = 0; $i < 100; $i++) {
$data[] = ['forum_id' => rand(1, 15), 'user_id' => rand(1, 5), 'title' => $faker->realText(rand(25, 50)), 'note' => $i % 3 ? $faker->realText(rand(30, 100)) : '', 'closed' => $i % 5 ? 0 : 1, 'locked' => $i % 6 ? 0 : 1, 'created_at' => $faker->dateTimeBetween('-1 month')->format('Y-m-d H:i:s')];
}
Topic::connection()->query('TRUNCATE topics');
$table = $this->table('topics');
$table->insert($data)->save();
// Заполнение сообщений
$data = [];
for ($i = 0; $i < 1000; $i++) {
$data[] = ['forum_id' => rand(1, 15), 'topic_id' => rand(1, 50), 'user_id' => rand(1, 5), 'text' => $faker->realText(rand(50, 500)), 'ip' => $faker->ipv4, 'brow' => App::getUserAgent($faker->userAgent), 'created_at' => $faker->dateTimeBetween('-1 month')->format('Y-m-d H:i:s')];
}
Post::connection()->query('TRUNCATE posts');
$table = $this->table('posts');
$table->insert($data)->save();
Forum::connection()->query('SET FOREIGN_KEY_CHECKS = 1');
}
开发者ID:visavi,项目名称:rotorcms,代码行数:33,代码来源:ForumsSeeder.php
示例13: actionShow
/**
* Отобразить карточку форума
*
* @param string $alias - url форума
* @throws CHttpException
*
* @return void
*/
public function actionShow($alias = null)
{
$forum = Forum::model()->open()->findByAttributes(array('alias' => $alias));
if ($forum === null) {
throw new CHttpException(404, Yii::t('ForumModule.forum', 'Page was not found!'));
}
$this->render('show', array('forum' => $forum));
}
开发者ID:porem,项目名称:yupe-ext,代码行数:16,代码来源:ForumController.php
示例14: delete
public function delete($id)
{
$db = new DB();
$this->delCartForUser($id);
$this->delUserCategoryExclusions($id);
$this->delDownloadRequests($id);
$this->delApiRequests($id);
$rc = new ReleaseComments();
$rc->deleteCommentsForUser($id);
$um = new UserMovies();
$um->delMovieForUser($id);
$us = new UserSeries();
$us->delShowForUser($id);
$forum = new Forum();
$forum->deleteUser($id);
$db->exec(sprintf("DELETE from users where ID = %d", $id));
}
开发者ID:scriptzteam,项目名称:newzNZB-premium-indexer,代码行数:17,代码来源:users.php
示例15: load
/**
* Load your component.
*
* @param \Cx\Core\ContentManager\Model\Entity\Page $page The resolved page
*/
public function load(\Cx\Core\ContentManager\Model\Entity\Page $page)
{
global $_CORELANG, $objTemplate, $subMenuTitle;
switch ($this->cx->getMode()) {
case \Cx\Core\Core\Controller\Cx::MODE_FRONTEND:
$objForum = new Forum(\Env::get('cx')->getPage()->getContent());
\Env::get('cx')->getPage()->setContent($objForum->getPage());
// $moduleStyleFile = $this->getDirectory() . '/css/frontend_style.css';
break;
case \Cx\Core\Core\Controller\Cx::MODE_BACKEND:
$this->cx->getTemplate()->addBlockfile('CONTENT_OUTPUT', 'content_master', 'LegacyContentMaster.html');
$objTemplate = $this->cx->getTemplate();
\Permission::checkAccess(106, 'static');
$subMenuTitle = $_CORELANG['TXT_FORUM'];
$objForum = new ForumAdmin();
$objForum->getPage();
break;
}
}
开发者ID:Cloudrexx,项目名称:cloudrexx,代码行数:24,代码来源:ComponentController.class.php
示例16: listePosts
function listePosts($idFil, $numPage, &$vueForum)
{
$forum = new Forum();
$auth = new Auth();
//recuperation des infos pour le fil d'ariane
$fil = $forum->getFil($idFil);
$section = $forum->getSection($fil->get('idSection'));
$ariane = '
<ol class="breadcrumb">
<li><a href="./?mod=forum"> Forum </a></li>
<li><a href ="./?mod=forum&page=section&id=' . $section->get('id') . '"> ' . $section->get('nom') . ' </a></li>
<li>' . $fil->get('nom') . '</li>
</ol>';
$users = $auth->listerUsers();
//liste des différentes section (tableau !!)
$listePosts = $forum->listerPosts($idFil);
$fil = $forum->getFil($idFil);
$vueForum->setBreadCrumb($ariane);
$vueForum->listePosts($listePosts, $section, $fil, $users, $numPage);
}
开发者ID:selenith,项目名称:plasmide,代码行数:20,代码来源:root.php
示例17: restoreForum
public function restoreForum($id)
{
$forum = Forum::withTrashed()->find($id);
if ($forum) {
$forum->restore();
Cache::flush();
return Redirect::to('dashboard/storyteller/manage/forums');
} else {
return Response::json(['success' => false, 'message' => 'Unable to find forum.']);
}
}
开发者ID:AcceptableIce,项目名称:Larp3,代码行数:11,代码来源:StorytellerForumController.php
示例18: __construct
/**
* Default constructor.
*/
public function __construct()
{
parent::__construct();
$role = Users::ROLE_GUEST;
if ($this->userdata != null) {
$role = $this->userdata["role"];
}
$content = new Contents(['Settings' => $this->settings]);
$f = new Forum();
$menu = new Menu($this->settings);
$this->smarty->assign('menulist', $menu->get($role, $this->serverurl));
$this->smarty->assign('usefulcontentlist', $content->getForMenuByTypeAndRole(Contents::TYPEUSEFUL, $role));
$this->smarty->assign('articlecontentlist', $content->getForMenuByTypeAndRole(Contents::TYPEARTICLE, $role));
if ($this->userdata != null) {
$this->smarty->assign('recentforumpostslist', $f->getRecentPosts($this->settings->getSetting('showrecentforumposts')));
}
$this->smarty->assign('main_menu', $this->smarty->fetch('mainmenu.tpl'));
$this->smarty->assign('useful_menu', $this->smarty->fetch('usefullinksmenu.tpl'));
$this->smarty->assign('article_menu', $this->smarty->fetch('articlesmenu.tpl'));
$category = new Category(['Settings' => $content->pdo]);
if ($this->userdata != null) {
$parentcatlist = $category->getForMenu($this->userdata["categoryexclusions"]);
} else {
$parentcatlist = $category->getForMenu();
}
$this->smarty->assign('parentcatlist', $parentcatlist);
$searchStr = '';
if ($this->page == 'search' && isset($_REQUEST["id"])) {
$searchStr = (string) $_REQUEST["id"];
}
$this->smarty->assign('header_menu_search', $searchStr);
if (isset($_REQUEST["t"])) {
$this->smarty->assign('header_menu_cat', $_REQUEST["t"]);
} else {
$this->smarty->assign('header_menu_cat', '');
}
$header_menu = $this->smarty->fetch('headermenu.tpl');
$this->smarty->assign('header_menu', $header_menu);
}
开发者ID:RickDB,项目名称:newznab-tmux,代码行数:42,代码来源:Page.php
示例19: content
/**
* Render view.
*
* @return string
*/
public function content()
{
ob_start();
// Title
if ($this->area->description) {
echo $this->area->description . '<hr>';
}
if ($this->area->topic_count) {
// Area has topics
$last_topic = $this->area->last_topic();
$last_poster = $last_topic->last_post()->author();
?>
<div class="media">
<div class="pull-left">
<?php
echo HTML::avatar($last_poster ? $last_poster['avatar'] : null, $last_poster ? $last_poster['username'] : null, false);
?>
</div>
<div class="media-body">
<small class="ago"><?php
echo HTML::time(Date::short_span($last_topic->last_posted, true, true), $last_topic->last_posted);
?>
</small>
<?php
echo $last_poster ? HTML::user($last_poster) : HTML::chars($last_topic->last_poster);
?>
<br>
<?php
echo HTML::anchor(Route::model($last_topic, '?page=last#last'), Forum::topic($last_topic), array('title' => HTML::chars($last_topic->name)));
?>
<br />
</div>
</div>
<small class="stats muted">
<i class="icon-comments"></i> <?php
echo Num::format($this->area->topic_count, 0);
?>
<i class="icon-comment"></i> <?php
echo Num::format($this->area->post_count, 0);
?>
</small>
<?php
} else {
// Empty area
echo __('No topics yet.');
}
return ob_get_clean();
}
开发者ID:anqh,项目名称:anqh,代码行数:56,代码来源:hovercard.php
示例20: RenderContent
protected function RenderContent()
{
?>
<div class="Panel">
<h3 class="PanelTitle">Forums</h3>
<div class="PanelContent">
<div class="ProfilePage">
<div class="ProfileTitle">
<?php
$forums = Forum::Get();
$count = count($forums);
?>
<span class="ProfileUserName">
<?php
echo "There ";
if ($count == 1) {
echo "is ";
} else {
echo "are ";
}
echo $count;
if ($count == 1) {
echo " forum";
} else {
echo " forums";
}
echo ".";
?>
</span>
<span class="ProfileControlBox">
<a href="<?php
echo System::ExpandRelativePath("~/community/forums/create.mmo");
?>
" onclick="ForumCreateDialog.Show();">Create Forum</a>
</span>
</div>
<div class="ProfileContent">
<?php
$grpForums = new WebButtonGroupControl("grpForums");
foreach ($forums as $item) {
$grpForums->Items[] = new WebButtonGroupButton("~/community/forums/" . $item->Name, $item->Title, "~/community/forums/" . $item->Name . "/images/avatar/thumbnail.png", "ForumInformationDialog.ShowDialog(" . $item->ID . ");");
}
$grpForums->Render();
?>
</div>
</div>
</div>
</div>
<?php
}
开发者ID:alcexhim,项目名称:PhoenixSNS,代码行数:50,代码来源:Browse.inc.php
注:本文中的Forum类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论