Example #1
0
    <TD rowspan=3 width=15 bgcolor="#E6EBEF"><img src="images/space.gif" width=15></TD>
  </TR>
  <TR>
    <TD colspan=3 height=1 width=748 bgcolor="#DBDBDB"><img src="images/space.gif"></TD>
  </TR>
  <TR>
<?php 
if (!$no_left_side) {
    ?>
<!--left side starts-->
    <TD width=125 valign=top>
<TABLE cellSpacing=0 cellPadding=0 width=125 border=0 bgcolor="#FFFFFF">
  <?php 
    # Put the rows for showing the discussion
    if ($this_page == 'xnews' || $this_page == 'poll' || $this_page == 'letters') {
        show_discussion();
    }
    ?>
  <?php 
    # Put the rows for showing career
    if ($this_page == 'xmec' || $this_page == 'univ' || $this_page == 'vision' || $this_page == 'mecnews') {
        show_career();
    }
    ?>
  <?php 
    # Put the rows for showing gallery
    if ($this_page == 'xmec' || $this_page == 'chapters' || $this_page == 'college' || $this_page == 'login' || $this_page == 'contact') {
        show_gallery();
    }
    ?>
  <?php 
Example #2
0
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;
        }
    }
}