本文整理汇总了PHP中forum_rss_delete_file函数的典型用法代码示例。如果您正苦于以下问题:PHP forum_rss_delete_file函数的具体用法?PHP forum_rss_delete_file怎么用?PHP forum_rss_delete_file使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了forum_rss_delete_file函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: require_capability
require_capability('mod/forum:startdiscussion', $destinationctx);
if (!forum_move_attachments($discussion, $forum->id, $forumto->id)) {
echo $OUTPUT->notification("Errors occurred while moving attachment directories - check your file permissions");
}
$DB->set_field('forum_discussions', 'forum', $forumto->id, array('id' => $discussion->id));
$DB->set_field('forum_read', 'forumid', $forumto->id, array('discussionid' => $discussion->id));
$params = array('context' => $destinationctx, 'objectid' => $discussion->id, 'other' => array('fromforumid' => $forum->id, 'toforumid' => $forumto->id));
$event = \mod_forum\event\discussion_moved::create($params);
$event->add_record_snapshot('forum_discussions', $discussion);
$event->add_record_snapshot('forum', $forum);
$event->add_record_snapshot('forum', $forumto);
$event->trigger();
// Delete the RSS files for the 2 forums to force regeneration of the feeds
require_once $CFG->dirroot . '/mod/forum/rsslib.php';
forum_rss_delete_file($forum);
forum_rss_delete_file($forumto);
redirect($return . '&moved=-1&sesskey=' . sesskey());
}
$params = array('context' => $modcontext, 'objectid' => $discussion->id);
$event = \mod_forum\event\discussion_viewed::create($params);
$event->add_record_snapshot('forum_discussions', $discussion);
$event->add_record_snapshot('forum', $forum);
$event->trigger();
unset($SESSION->fromdiscussion);
if ($mode) {
set_user_preference('forum_displaymode', $mode);
}
$displaymode = get_user_preferences('forum_displaymode', $CFG->forum_displaymode);
if ($parent) {
// If flat AND parent, then force nested display this time
if ($displaymode == FORUM_MODE_FLATOLDEST or $displaymode == FORUM_MODE_FLATNEWEST) {
开发者ID:sumitnegi933,项目名称:Moodle_lms_New,代码行数:31,代码来源:discuss.php
示例2: notify
notify("Errors occurred while moving attachment directories - check your file permissions");
}
set_field("forum_discussions", "forum", $forum->id, "id", $discussion->id);
$discussion->forum = $forum->id;
if ($cm = get_coursemodule_from_instance("forum", $forum->id, $course->id)) {
add_to_log($course->id, "forum", "move discussion", "discuss.php?d={$discussion->id}", "{$discussion->id}", $cm->id);
} else {
add_to_log($course->id, "forum", "move discussion", "discuss.php?d={$discussion->id}", "{$discussion->id}");
}
$discussionmoved = true;
require_once 'rsslib.php';
require_once $CFG->libdir . '/rsslib.php';
// Delete the RSS files for the 2 forums because we want to force
// the regeneration of the feeds since the discussions have been
// moved.
if (!forum_rss_delete_file($forum) || !forum_rss_delete_file($sourceforum)) {
notify('Could not purge the cached RSS feeds for the source and/or' . 'destination forum(s) - check your file permissionsforums');
}
} else {
error('You can\'t move to that forum - it doesn\'t exist!');
}
}
$logparameters = "d={$discussion->id}";
if ($parent) {
$logparameters .= "&parent={$parent}";
}
if ($cm = get_coursemodule_from_instance("forum", $forum->id, $course->id)) {
add_to_log($course->id, "forum", "view discussion", "discuss.php?{$logparameters}", "{$discussion->id}", $cm->id);
} else {
add_to_log($course->id, "forum", "view discussion", "discuss.php?{$logparameters}", "{$discussion->id}");
}
开发者ID:njorth,项目名称:marginalia,代码行数:31,代码来源:discuss.php
示例3: forum_delete_post
/**
* Deletes a single forum post.
*
* @global object
* @param object $post Forum post object
* @param mixed $children Whether to delete children. If false, returns false
* if there are any children (without deleting the post). If true,
* recursively deletes all children. If set to special value 'ignore', deletes
* post regardless of children (this is for use only when deleting all posts
* in a disussion).
* @param object $course Course
* @param object $cm Course-module
* @param object $forum Forum
* @param bool $skipcompletion True to skip updating completion state if it
* would otherwise be updated, i.e. when deleting entire forum anyway.
* @return bool
*/
function forum_delete_post($post, $children, $course, $cm, $forum, $skipcompletion = false)
{
global $DB, $CFG;
require_once $CFG->libdir . '/completionlib.php';
$context = context_module::instance($cm->id);
if ($children !== 'ignore' && ($childposts = $DB->get_records('forum_posts', array('parent' => $post->id)))) {
if ($children) {
foreach ($childposts as $childpost) {
forum_delete_post($childpost, true, $course, $cm, $forum, $skipcompletion);
}
} else {
return false;
}
}
// Delete ratings.
require_once $CFG->dirroot . '/rating/lib.php';
$delopt = new stdClass();
$delopt->contextid = $context->id;
$delopt->component = 'mod_forum';
$delopt->ratingarea = 'post';
$delopt->itemid = $post->id;
$rm = new rating_manager();
$rm->delete_ratings($delopt);
// Delete attachments.
$fs = get_file_storage();
$fs->delete_area_files($context->id, 'mod_forum', 'attachment', $post->id);
$fs->delete_area_files($context->id, 'mod_forum', 'post', $post->id);
// Delete cached RSS feeds.
if (!empty($CFG->enablerssfeeds)) {
require_once $CFG->dirroot . '/mod/forum/rsslib.php';
forum_rss_delete_file($forum);
}
if ($DB->delete_records("forum_posts", array("id" => $post->id))) {
forum_tp_delete_read_records(-1, $post->id);
// Just in case we are deleting the last post
forum_discussion_update_last_post($post->discussion);
// Update completion state if we are tracking completion based on number of posts
// But don't bother when deleting whole thing
if (!$skipcompletion) {
$completion = new completion_info($course);
if ($completion->is_enabled($cm) == COMPLETION_TRACKING_AUTOMATIC && ($forum->completiondiscussions || $forum->completionreplies || $forum->completionposts)) {
$completion->update_state($cm, COMPLETION_INCOMPLETE, $post->userid);
}
}
return true;
}
return false;
}
开发者ID:abhilash1994,项目名称:moodle,代码行数:65,代码来源:lib.php
示例4: print_error
if (!coursemodule_visible_for_user($cmto)) {
print_error('cannotmovenotvisible', 'forum', $return);
}
require_capability('mod/forum:startdiscussion', get_context_instance(CONTEXT_MODULE, $cmto->id));
if (!forum_move_attachments($discussion, $forum->id, $forumto->id)) {
echo $OUTPUT->notification("Errors occurred while moving attachment directories - check your file permissions");
}
$DB->set_field('forum_discussions', 'forum', $forumto->id, array('id' => $discussion->id));
$DB->set_field('forum_read', 'forumid', $forumto->id, array('discussionid' => $discussion->id));
add_to_log($course->id, 'forum', 'move discussion', "discuss.php?d={$discussion->id}", $discussion->id, $cmto->id);
require_once $CFG->libdir . '/rsslib.php';
require_once 'rsslib.php';
// Delete the RSS files for the 2 forums because we want to force
// the regeneration of the feeds since the discussions have been
// moved.
if (!forum_rss_delete_file($forum) || !forum_rss_delete_file($forumto)) {
print_error('cannotpurgecachedrss', 'forum', $return);
}
redirect($return . '&moved=-1&sesskey=' . sesskey());
}
$logparameters = "d={$discussion->id}";
if ($parent) {
$logparameters .= "&parent={$parent}";
}
add_to_log($course->id, 'forum', 'view discussion', "discuss.php?{$logparameters}", $discussion->id, $cm->id);
unset($SESSION->fromdiscussion);
if ($mode) {
set_user_preference('forum_displaymode', $mode);
}
$displaymode = get_user_preferences('forum_displaymode', $CFG->forum_displaymode);
if ($parent) {
开发者ID:ajv,项目名称:Offline-Caching,代码行数:31,代码来源:discuss.php
注:本文中的forum_rss_delete_file函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论