if (class_exists('ouflags') && ou_get_is_mobile() && $blogdets == 'show') {
    ou_print_mobile_navigation(null, $blogdets, $postid);
}
print '</div>';
if (class_exists('ouflags') && ou_get_is_mobile() && $blogdets == 'show') {
    print_footer($course);
    exit;
}
// Print blog posts
if (class_exists('ouflags') && ou_get_is_mobile()) {
    echo '<div id="middle-column">';
    ou_print_mobile_navigation(null, $blogdets, $postid);
} else {
    echo '<div id="middle-column" class="has-right-column">';
}
oublog_print_post($cm, $oublog, $post, $returnurl, $blogtype, $canmanageposts, $canaudit, false);
if (!empty($post->comments)) {
    echo "<h2>{$strcomments}</h2>";
    foreach ($post->comments as $comment) {
        $extraclasses = $comment->deletedby ? 'oublog-deleted' : '';
        if ($CFG->oublog_showuserpics) {
            $extraclasses .= ' oublog-hasuserpic';
        }
        ?>
            <div class="oublog-comment <?php 
        print $extraclasses;
        ?>
"><?php 
        if ($comment->deletedby) {
            $deluser = new stdClass();
            $deluser->firstname = $comment->delfirstname;
} else {
    print '<div id="middle-column">';
}
print skip_main_destination();
// Print blog posts
if ($posts) {
    echo '<div id="oublog-posts">';
    if ($offset > 0) {
        if ($offset - OUBLOG_POSTS_PER_PAGE == 0) {
            echo "<a href=\"{$returnurl}\">{$strnewposts}</a>";
        } else {
            echo "<a href=\"{$returnurl}&amp;offset=" . ($offset - OUBLOG_POSTS_PER_PAGE) . "\">{$strnewposts}</a>";
        }
    }
    foreach ($posts as $post) {
        oublog_print_post(null, $oublog, $post, $returnurl, $blogtype, $canmanageposts, $canaudit);
    }
    if ($recordcount - $offset > OUBLOG_POSTS_PER_PAGE) {
        echo "<a href=\"{$returnurl}&amp;offset=" . ($offset + OUBLOG_POSTS_PER_PAGE) . "\">{$strolderposts}</a>";
    }
    echo '</div>';
}
// Print information allowing the user to log in if necessary, or letting
// them know if there are no posts in the blog
if (!isloggedin() || isguestuser()) {
    print '<p class="oublog_loginnote">' . get_string('maybehiddenposts', 'oublog', 'bloglogin.php') . '</p>';
} else {
    if (!$posts) {
        print '<p class="oublog_noposts">' . get_string('noposts', 'oublog') . '</p>';
    }
}
/**
 * Print a detailed representation of what a user has done with
 * a given particular instance of this module, for user activity reports.
 *
 * @param object $course
 * @param object $user
 * @param object $mod
 * @param object $oublog
 * @return object containing a time and info properties
 */
function oublog_user_complete($course, $user, $mod, $oublog)
{
    global $CFG;
    include_once 'locallib.php';
    $baseurl = $CFG->wwwroot . '/mod/oublog/view.php?id=' . $mod->id;
    $sql = "SELECT p.*\r\n            FROM {$CFG->prefix}oublog_posts p\r\n                INNER JOIN {$CFG->prefix}oublog_instances i ON p.oubloginstancesid = i.id\r\n            WHERE p.deletedby IS NULL AND i.userid = {$user->id} AND oublogid = {$mod->instance} ";
    if ($posts = get_records_sql($sql)) {
        foreach ($posts as $post) {
            $postdata = oublog_get_post($post->id);
            oublog_print_post($mod, $oublog, $postdata, $baseurl, 'course');
        }
    } else {
        echo get_string('noblogposts', 'oublog');
    }
    return null;
}