• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP get_forumcategory_information函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中get_forumcategory_information函数的典型用法代码示例。如果您正苦于以下问题:PHP get_forumcategory_information函数的具体用法?PHP get_forumcategory_information怎么用?PHP get_forumcategory_information使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: send_notification_mails

/**
 * This function sends the notification mails to everybody who stated that they wanted to be informed when a new post
 * was added to a given thread.
 *
 * @param array reply information
 * @return void
 *
 * @author Patrick Cool <[email protected]>, Ghent University
 * @version february 2006, dokeos 1.8
 */
function send_notification_mails($thread_id, $reply_info)
{
    $table = Database::get_course_table(TABLE_FORUM_MAIL_QUEUE);
    // First we need to check if
    // 1. the forum category is visible
    // 2. the forum is visible
    // 3. the thread is visible
    // 4. the reply is visible (=when there is)
    $current_thread = get_thread_information($thread_id);
    $current_forum = get_forum_information($current_thread['forum_id']);
    $current_forum_category = null;
    if (isset($current_forum['forum_category'])) {
        $current_forum_category = get_forumcategory_information($current_forum['forum_category']);
    }
    if ($current_thread['visibility'] == '1' && $current_forum['visibility'] == '1' && ($current_forum_category && $current_forum_category['visibility'] == '1') && $current_forum['approval_direct_post'] != '1') {
        $send_mails = true;
    } else {
        $send_mails = false;
    }
    // The forum category, the forum, the thread and the reply are visible to the user
    if ($send_mails) {
        if (isset($current_thread['forum_id'])) {
            send_notifications($current_thread['forum_id'], $thread_id);
        }
    } else {
        $table_notification = Database::get_course_table(TABLE_FORUM_NOTIFICATION);
        if (isset($current_forum['forum_id'])) {
            $sql = "SELECT * FROM {$table_notification}\n                    WHERE\n                        c_id = " . api_get_course_int_id() . " AND\n                        (\n                            forum_id = '" . intval($current_forum['forum_id']) . "' OR\n                            thread_id = '" . intval($thread_id) . "'\n                        ) ";
            $result = Database::query($sql);
            $user_id = api_get_user_id();
            while ($row = Database::fetch_array($result)) {
                $sql = "INSERT INTO {$table} (c_id, thread_id, post_id, user_id)\n                        VALUES (" . api_get_course_int_id() . ", '" . intval($thread_id) . "', '" . intval($reply_info['new_post_id']) . "', '{$user_id}' )";
                Database::query($sql);
            }
        }
    }
}
开发者ID:feroli1000,项目名称:chamilo-lms,代码行数:47,代码来源:forumfunction.inc.php


示例2: api_get_user_id

    $origin = Security::remove_XSS($_GET['origin']);
    $origin_string = '&amp;origin=' . $origin;
}
/* Including necessary files */
require 'forumconfig.inc.php';
require_once 'forumfunction.inc.php';
$userid = api_get_user_id();
/* MAIN DISPLAY SECTION */
$groupId = api_get_group_id();
$my_forum = isset($_GET['forum']) ? $_GET['forum'] : '';
// Note: This has to be validated that it is an existing forum.
$current_forum = get_forum_information($my_forum);
if (empty($current_forum)) {
    api_not_allowed();
}
$current_forum_category = get_forumcategory_information($current_forum['forum_category']);
$is_group_tutor = false;
if (!empty($groupId)) {
    //Group info & group category info
    $group_properties = GroupManager::get_group_properties($groupId);
    //User has access in the group?
    $user_has_access_in_group = GroupManager::user_has_access($userid, $groupId, GroupManager::GROUP_TOOL_FORUM);
    $is_group_tutor = GroupManager::is_tutor_of_group(api_get_user_id(), $groupId);
    //Course
    if (!api_is_allowed_to_edit(false, true) and ($current_forum_category && $current_forum_category['visibility'] == 0 or $current_forum['visibility'] == 0 or !$user_has_access_in_group)) {
        api_not_allowed();
    }
} else {
    //Course
    if (!api_is_allowed_to_edit(false, true) and ($current_forum_category && $current_forum_category['visibility'] == 0 or $current_forum['visibility'] == 0)) {
        api_not_allowed();
开发者ID:ragebat,项目名称:chamilo-lms,代码行数:31,代码来源:viewforum.php


示例3: get_thread_information

    $origin = Security::remove_XSS($_GET['origin']);
    $origin_string = '&origin=' . $origin;
}
/* Including necessary files */
require_once 'forumconfig.inc.php';
require_once 'forumfunction.inc.php';
/* MAIN DISPLAY SECTION */
/* Retrieving forum and forum categorie information */
// We are getting all the information about the current forum and forum category.
// Note pcool: I tried to use only one sql statement (and function) for this,
// but the problem is that the visibility of the forum AND forum cateogory are stored in the item_property table.
$current_thread = get_thread_information($_GET['thread']);
// Note: This has to be validated that it is an existing thread.
$current_forum = get_forum_information($current_thread['forum_id']);
// Note: This has to be validated that it is an existing forum.
$current_forum_category = get_forumcategory_information(Security::remove_XSS($current_forum['forum_category']));
/* Is the user allowed here? */
// The user is not allowed here if
// 1. the forumcategory, forum or thread is invisible (visibility==0
// 2. the forumcategory, forum or thread is locked (locked <>0)
// 3. if anonymous posts are not allowed
// The only exception is the course manager
// I have split this is several pieces for clarity.
//if (!api_is_allowed_to_edit() AND (($current_forum_category['visibility'] == 0 OR $current_forum['visibility'] == 0) OR ($current_forum_category['locked'] <> 0 OR $current_forum['locked'] <> 0 OR $current_thread['locked'] <> 0))) {
if (!api_is_allowed_to_edit(false, true) and ($current_forum_category && $current_forum_category['visibility'] == 0 or $current_forum['visibility'] == 0)) {
    api_not_allowed();
}
if (!api_is_allowed_to_edit(false, true) and ($current_forum_category && $current_forum_category['locked'] != 0 or $current_forum['locked'] != 0 or $current_thread['locked'] != 0)) {
    api_not_allowed();
}
if (!$_user['user_id'] and $current_forum['allow_anonymous'] == 0) {
开发者ID:KRCM13,项目名称:chamilo-lms,代码行数:31,代码来源:reply.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_forumimg函数代码示例发布时间:2022-05-15
下一篇:
PHP get_forum_type函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap