예제 #1
0
// The right column, BEFORE the middle-column.
if (isloggedin() and !isguestuser()) {
    list($oublog, $oubloginstance) = oublog_get_personal_blog($USER->id);
    $blogeditlink = "<br /><a href=\"view.php\" class=\"oublog-links\">{$oubloginstance->name}</a>";
    $bc = new block_contents();
    $bc->attributes['id'] = 'oublog-links';
    $bc->attributes['class'] = 'oublog-sideblock block';
    $bc->title = format_string($oublog->name);
    $bc->content = $blogeditlink;
    $PAGE->blocks->add_fake_block($bc, BLOCK_POS_RIGHT);
}
if ($oublog->statblockon) {
    // 'Discovery' block.
    $stats = array();
    $stats[] = oublog_stats_output_participation($oublog, $cm, $oublogoutput, $course, true);
    $stats[] = oublog_stats_output_commentpoststats($oublog, $cm, $oublogoutput, false, true);
    $stats[] = oublog_stats_output_visitstats($oublog, $cm, $oublogoutput);
    $stats[] = oublog_stats_output_poststats($oublog, $cm, $oublogoutput);
    $stats[] = oublog_stats_output_commentstats($oublog, $cm, $oublogoutput);
    $stats = $oublogoutput->render_stats_container('allposts', $stats);
    $bc = new block_contents();
    $bc->attributes['id'] = 'oublog-discover';
    $bc->attributes['class'] = 'oublog-sideblock block';
    $bc->title = get_string('discovery', 'oublog', oublog_get_displayname($oublog, true));
    $bc->content = $stats;
    if (!empty($stats)) {
        $PAGE->blocks->add_fake_block($bc, BLOCK_POS_RIGHT);
    }
}
if ($feeds = oublog_get_feedblock($oublog, 'all', '', false, $cm)) {
    $bc = new block_contents();
예제 #2
0
     $PAGE->blocks->add_fake_block($bc, BLOCK_POS_RIGHT);
 }
 // Links.
 $links = oublog_get_links($oublog, $oubloginstance, $context);
 if ($links) {
     $bc = new block_contents();
     $bc->attributes['id'] = 'oublog-links';
     $bc->attributes['class'] = 'oublog-sideblock block';
     $bc->title = $strlinks;
     $bc->content = $links;
     $PAGE->blocks->add_fake_block($bc, BLOCK_POS_RIGHT);
 }
 // 'Discovery' block.
 $stats = array();
 $stats[] = oublog_stats_output_myparticipation($oublog, $cm, $oublogoutput, $course, $currentindividual, $oubloguser->id);
 $stats[] = oublog_stats_output_commentpoststats($oublog, $cm, $oublogoutput, false, false, $currentindividual, $oubloguser->id);
 if ($oublog->statblockon) {
     // Add to 'Discovery' block when enabled only.
     $stats[] = oublog_stats_output_visitstats($oublog, $cm, $oublogoutput);
     $stats[] = oublog_stats_output_poststats($oublog, $cm, $oublogoutput);
     $stats[] = oublog_stats_output_commentstats($oublog, $cm, $oublogoutput);
 }
 $stats = array_filter($stats);
 if (!empty($stats)) {
     $stats = $oublogoutput->render_stats_container('view', $stats, count($stats));
     $bc = new block_contents();
     $bc->attributes['id'] = 'oublog-discover';
     $bc->attributes['class'] = 'oublog-sideblock block';
     $bc->title = get_string('discovery', 'oublog', oublog_get_displayname($oublog, true));
     $bc->content = $stats;
     $PAGE->blocks->add_fake_block($bc, BLOCK_POS_RIGHT);