您好,欢迎来到第一课堂学习网

第一课堂教师群: 309595573

Moodle开发群: 120310225

社区论坛
首页 >  Moodle专题 >  moodle常见问题 > 查看内容
一级分类:  moodle平台 moodle下载 moodle安装教程 moodle二次开发 moodle常见问题 在线教育cms平台 魔灯运营
moodle调用显示新闻的代码
更新时间:2014-9-26 14:25      访问量:1174次      发布人:yinge

if ($SITE->newsitems) { // Print forums only when needed
                    require_once($CFG->dirroot .'/mod/forum/lib.php');

                    if (! $newsforum = forum_get_course_forum($SITE->id, 'news')) {
                        error('Could not find or create a main news forum for the site');
                    }

                    if (!empty($USER->id)) {
                        $SESSION->fromdiscussion = $CFG->wwwroot;
                        $subtext = '';
                        if (forum_is_subscribed($USER->id, $newsforum)) {
                            if (!forum_is_forcesubscribed($newsforum)) {
                                $subtext = get_string('unsubscribe', 'forum');
                            }
                        } else {
                            $subtext = get_string('subscribe', 'forum');
                        }
                        print_heading_block($newsforum->name);
                        echo '

';
                    } else {
                        print_heading_block($newsforum->name);
                    }

                    forum_print_latest_discussions($SITE, $newsforum, $SITE->newsitems, 'header', 'p.modified DESC');
                }

 更多Moodle信息:http://www.aieln.com/system/moodle/