Bluefin221
08-21-2015, 01:11 PM
Is it possible to pull an image from a calendar into a forums block. Right now I have the text displaying from a calendar entry into a forums block however I would like to add an image and have it pull the first image from the thread.
For an example of what I am doing have a look at the forums block on the right hand side where it says Tournaments & Sign Ups: http://www.clubsgaming.com/forums/forum.php
I am achieving this by adding the following code as a forum block:
// %d
$show_count = 5;
$query = sprintf("SELECT * FROM ".TABLE_PREFIX."event WHERE visible = 1 AND (dateline_from > '%d' || ( dateline_from < '%d' AND dateline_to > '%d' )) ORDER BY dateline_from ASC LIMIT %d",TIMENOW,TIMENOW,TIMENOW,$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",date('jS M Y',$event['dateline_from']));
} else {
$format = sprintf("From %s to %s",date('jS M Y',$event['dateline_from']),date('jS M Y',$event['dateline_to']));
}
$output_bits .= sprintf('
<div class = "cms_widget_post_bit"><h4 class="cms_widget_post_header"><a href="calendar.php?do=getinfo&e=%d">%s</a></h4>
<p class="cms_widget_post_content">%s</p>
</div>
',$event['eventid'],$event['title'],$format);
}
$output = $output_bits;
ob_end_clean();
return $output;
So say for example I wish to pull the image from this post http://www.clubsgaming.com/forums/showthread.php?157-Monday-Night-Football-1-05-10-2015 which is going directly to my calendar into the forums sideblock is this achievable?
For an example of what I am doing have a look at the forums block on the right hand side where it says Tournaments & Sign Ups: http://www.clubsgaming.com/forums/forum.php
I am achieving this by adding the following code as a forum block:
// %d
$show_count = 5;
$query = sprintf("SELECT * FROM ".TABLE_PREFIX."event WHERE visible = 1 AND (dateline_from > '%d' || ( dateline_from < '%d' AND dateline_to > '%d' )) ORDER BY dateline_from ASC LIMIT %d",TIMENOW,TIMENOW,TIMENOW,$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",date('jS M Y',$event['dateline_from']));
} else {
$format = sprintf("From %s to %s",date('jS M Y',$event['dateline_from']),date('jS M Y',$event['dateline_to']));
}
$output_bits .= sprintf('
<div class = "cms_widget_post_bit"><h4 class="cms_widget_post_header"><a href="calendar.php?do=getinfo&e=%d">%s</a></h4>
<p class="cms_widget_post_content">%s</p>
</div>
',$event['eventid'],$event['title'],$format);
}
$output = $output_bits;
ob_end_clean();
return $output;
So say for example I wish to pull the image from this post http://www.clubsgaming.com/forums/showthread.php?157-Monday-Night-Football-1-05-10-2015 which is going directly to my calendar into the forums sideblock is this achievable?