Im trying to have this block/widget out the info with the user avatar, posted by, etc... Similar the Recent Threads output
I included the template and block/widget code.
thanks
PHP Code:
<li>
<div class="block smaller">
<div class="blocksubhead">
<a class="collapse" id="collapse_block_html_{vb:raw blockinfo.blockid}" href="{vb:raw relpath}#top"><img alt="" src="{vb:stylevar imgdir_button}/collapse_40b.png" id="collapseimg_html_{vb:raw blockinfo.blockid}"/></a><img src="{vb:stylevar imgdir_cms}/widget-forum.png" alt="" />
<span class="blocktitle">{vb:raw blockinfo.title}</span>
</div>
<div class="widget_content blockbody floatcontainer">
<div id="block_html_{vb:raw blockinfo.blockid}" class="blockrow">
{vb:raw content}
</div>
</div>
</div>
<div class="underblock"></div>
</li>​
PHP Code:
ob_start();
global $db, $vbulletin;
$show_count = 10;
$query = sprintf("SELECT * FROM " . TABLE_PREFIX . "event
WHERE visible = 1
AND (
(MONTH(FROM_UNIXTIME(dateline_from)) = MONTH(NOW()) AND DAY(FROM_UNIXTIME(dateline_from)) = DAY(NOW()))
OR
(MONTH(FROM_UNIXTIME(dateline_to)) = MONTH(NOW()) AND DAY(FROM_UNIXTIME(dateline_to)) = DAY(NOW()))
)
ORDER BY dateline_from ASC LIMIT $show_count");
$event_get = vB::$db->query_read($query);
$output_bits = "";
while ($event = vB::$db->fetch_array($event_get)) {
if ($event["dateline_to"] == 0) {
$format = sprintf(
"On %s",
vbdate(
"D M jS Y",
$event["dateline_from"],
false,
true,
false,
true
)
);
} else {
$format = sprintf(
"From %s to %s",
vbdate(
"D M jS Y",
$event["dateline_from"],
false,
true,
false,
true
),
vbdate("jS M Y", $event["dateline_to"], false, true, false, true)
);
}
$output_bits .= sprintf("
<div class='noavatarcontent floatcontainer widget_post_bit'>
<div class='widget_post_userinfo'></div>
<div class='smallavatartext widget_post_comment_noavatar'>
<h5 class='widget_post_header'>
<a href='calendar.php?do=getinfo&e=%d' class='title'>%s</a>
</h5>
<div class='meta'>%s</div>
</div>
</div>",
$event["eventid"],
$event["title"],
$format
);
}
$output = $output_bits;
ob_end_clean();​