本文整理汇总了PHP中forum_print_posts_nested函数的典型用法代码示例。如果您正苦于以下问题:PHP forum_print_posts_nested函数的具体用法?PHP forum_print_posts_nested怎么用?PHP forum_print_posts_nested使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了forum_print_posts_nested函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: forum_print_posts_nested
/**
* @todo Document this function
* @global object
* @global object
* @return void
*/
function forum_print_posts_nested($course, &$cm, $forum, $discussion, $parent, $reply, $forumtracked, $posts) {
global $USER, $CFG;
$link = false;
if (!empty($posts[$parent->id]->children)) {
$posts = $posts[$parent->id]->children;
foreach ($posts as $post) {
echo '<div class="indent">';
if (!isloggedin()) {
$ownpost = false;
} else {
$ownpost = ($USER->id == $post->userid);
}
$post->subject = format_string($post->subject);
$postread = !empty($post->postread);
forum_print_post($post, $discussion, $forum, $cm, $course, $ownpost, $reply, $link,
'', '', $postread, true, $forumtracked);
forum_print_posts_nested($course, $cm, $forum, $discussion, $post, $reply, $forumtracked, $posts);
echo "</div>\n";
}
}
}
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:33,代码来源:lib.php
示例2: forum_set_return
// User just asked to delete something
forum_set_return();
$PAGE->navbar->add(get_string('delete', 'forum'));
$PAGE->set_title($course->shortname);
$PAGE->set_heading($course->fullname);
if ($replycount) {
if (!has_capability('mod/forum:deleteanypost', $modcontext)) {
print_error("couldnotdeletereplies", "forum", forum_go_back_to("discuss.php?d={$post->discussion}"));
}
echo $OUTPUT->header();
echo $OUTPUT->confirm(get_string("deletesureplural", "forum", $replycount + 1), "post.php?delete={$delete}&confirm={$delete}", $CFG->wwwroot . '/mod/forum/discuss.php?d=' . $post->discussion . '#p' . $post->id);
forum_print_post($post, $discussion, $forum, $cm, $course, false, false, false);
if (empty($post->edit)) {
$forumtracked = forum_tp_is_tracked($forum);
$posts = forum_get_all_discussion_posts($discussion->id, "created ASC", $forumtracked);
forum_print_posts_nested($course, $cm, $forum, $discussion, $post, false, false, $forumtracked, $posts);
}
} else {
echo $OUTPUT->header();
echo $OUTPUT->confirm(get_string("deletesure", "forum", $replycount), "post.php?delete={$delete}&confirm={$delete}", $CFG->wwwroot . '/mod/forum/discuss.php?d=' . $post->discussion . '#p' . $post->id);
forum_print_post($post, $discussion, $forum, $cm, $course, false, false, false);
}
}
echo $OUTPUT->footer();
die;
} else {
if (!empty($prune)) {
// Pruning
if (!($post = forum_get_post_full($prune))) {
print_error('invalidpostid', 'forum');
}
开发者ID:njorth,项目名称:marginalia,代码行数:31,代码来源:post.php
示例3: forum_set_return
// User just asked to delete something
forum_set_return();
if ($replycount) {
if (!has_capability('mod/forum:deleteanypost', $modcontext)) {
error(get_string("couldnotdeletereplies", "forum"), forum_go_back_to("discuss.php?d={$post->discussion}"));
}
print_header();
notice_yesno(get_string("deletesureplural", "forum", $replycount + 1), "post.php?delete={$delete}&confirm={$delete}&sesskey=" . sesskey(), $CFG->wwwroot . '/mod/forum/discuss.php?d=' . $post->discussion . '#p' . $post->id);
forum_print_post($post, $course->id, $ownpost = false, $reply = false, $link = false);
if (empty($post->edit)) {
if (forum_tp_can_track_forums($forum) && forum_tp_is_tracked($forum)) {
$user_read_array = forum_tp_get_discussion_read_records($USER->id, $discussion->id);
} else {
$user_read_array = array();
}
forum_print_posts_nested($post->id, $course->id, false, false, $user_read_array, $forum->id);
}
} else {
print_header();
notice_yesno(get_string("deletesure", "forum", $replycount), "post.php?delete={$delete}&confirm={$delete}&sesskey=" . sesskey(), $CFG->wwwroot . '/mod/forum/discuss.php?d=' . $post->discussion . '#p' . $post->id);
forum_print_post($post, $forum->course, $ownpost = false, $reply = false, $link = false);
}
}
print_footer($course);
die;
} else {
if (!empty($prune)) {
// Pruning
if (!($post = forum_get_post_full($prune))) {
error("Post ID was incorrect");
}
开发者ID:veritech,项目名称:pare-project,代码行数:31,代码来源:post.php
示例4: forum_print_posts_nested
function forum_print_posts_nested($course, &$cm, $forum, $discussion, $parent, $reply, $forumtracked, $posts, $parentid = 0, $count = 1, $flag = 0)
{
global $USER, $CFG, $DB;
$link = false;
$modcontext = context_module::instance($cm->id);
if (!empty($posts[$parent->id]->children)) {
$posts = $posts[$parent->id]->children;
foreach ($posts as $post) {
if ((show_discussion($parentid, $forum) and $post->userid != $USER->id and !$flag) && !has_capability('mod/forum:editanypost', $modcontext)) {
continue;
} else {
$flag = 1;
}
echo '<div class="indent">';
if (!isloggedin()) {
$ownpost = false;
} else {
$ownpost = $USER->id == $post->userid;
}
$post->subject = format_string($post->subject);
$postread = !empty($post->postread);
if ($forum->type == 'collaborate' and $post->parent == $parentid) {
$regionid = 'forum-questionview' . $count;
print_collapsible_region_start('', $regionid, get_string('questionview', 'forum'));
forum_print_post($post, $discussion, $forum, $cm, $course, $ownpost, $reply, false, '', '', $postread, true, $forumtracked, false, $parentid);
} else {
forum_print_post($post, $discussion, $forum, $cm, $course, $ownpost, $reply, false, '', '', $postread, true, $forumtracked, false, $parentid);
}
if ($forum->type == 'collaborate') {
$n = $DB->count_records('forum_posts', array('parent' => $post->id));
if ($n == 0) {
print_collapsible_region_end();
}
}
forum_print_posts_nested($course, $cm, $forum, $discussion, $post, $reply, $forumtracked, $posts, $parentid, $count + 1, $flag);
$flag = 0;
echo "</div>\n";
$count = $count + 1;
}
}
}
开发者ID:Gavinthisisit,项目名称:Moodle,代码行数:41,代码来源:lib.php
注:本文中的forum_print_posts_nested函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论