PDA

View Full Version : This day in History??


oldfan
04-14-2023, 02:16 PM
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?


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'], "https://vborg.vbsupport.ru/");

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?

oldfan
04-15-2023, 03:58 PM
anyway to get this to show IE: april 15, 2023, april 15, 2022, april 15, 2021 on so on?

oldfan
04-21-2023, 06:50 PM
anyone please?