04-14-2023, 02:16 PM
|
|
|
|
Join Date: Jul 2004
Posts: 813
Благодарил(а): 0 раз(а)
Поблагодарили:
0 раз(а) в 0 сообщениях
|
|
This day in History??
im adding a bunch of tour dates to my calendar and like them to be displayed in a sidebar block.
Not upcoming dates, put just the day like this day in history?
Quote:
ob_start();
global $db,$vbulletin;
function get_string_between($string, $start, $end){
$chunk = explode($start, $string, 2);
if(count($chunk)==1) return "1";
$chunk = explode($end, $chunk[1], 2);
if(count($chunk)==1) return "";
return $chunk[0];
}
$mydate = mktime(0, 0, 0, date("m"), date("d")-1, date("Y"));
$show_count = 10;
$query = sprintf(" SELECT * FROM ".TABLE_PREFIX."event
WHERE visible = 1
AND (dateline_from >= '$mydate' || (dateline_from >= '$mydate' AND dateline_to <= '$mydate' ) || ('$mydate' BETWEEN dateline_from AND dateline_to))
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("%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));
}
$gfx = get_string_between($event['event'], "");
if($gfx == "1"){
$output_bits .= sprintf('<div class = "cms_widget_post_bit"><a href="calendar.php?do=getinfo&e=%d">
<h4 class="cms_widget_post_header"><b>%s</b></a></h4>
<p class="cms_widget_post_content"><b>%s</b></p>
<BR/>
<center><img src="http://metallifukinca.com/forum/images/misc/hz-line.png" alt="Upcoming Event" ;"></center>
</div>
<BR/>',$event['eventid'],$event['title'],$format);
}
else
{
$output_bits .= sprintf('<div class = "cms_widget_post_bit"><a href="calendar.php?do=getinfo&e=%d">
<img src="%s" width="25" height="25" alt="Upcoming Event" HSPACE="7" VSPACE="3" align="left"/>
<h4 class="cms_widget_post_header"><b>%s</b></a></h4>
<p class="cms_widget_post_content"><b>%s</b></p>
<BR/>
<center><img src="http://metallifukinca.com/forum/images/misc/hz-line.png" alt="Upcoming Event" ;"></center>
</div>
<BR/>',$event['eventid'],$gfx,$event['title'],$format);
}
}
$output = $output_bits;
ob_end_clean();
|
is there a way for this code to only pull for upcoming this days in history?
|