Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
  #1  
Old 04-14-2023, 02:16 PM
oldfan's Avatar
oldfan oldfan is offline
 
Join Date: Jul 2004
Posts: 813
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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?
Reply With Quote
  #2  
Old 04-15-2023, 03:58 PM
oldfan's Avatar
oldfan oldfan is offline
 
Join Date: Jul 2004
Posts: 813
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

anyway to get this to show IE: april 15, 2023, april 15, 2022, april 15, 2021 on so on?
Reply With Quote
  #3  
Old 04-21-2023, 06:50 PM
oldfan's Avatar
oldfan oldfan is offline
 
Join Date: Jul 2004
Posts: 813
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

anyone please?
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:36 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03594 seconds
  • Memory Usage 2,174KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (3)post_thanks_box
  • (3)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (3)post_thanks_postbit_info
  • (3)postbit
  • (3)postbit_onlinestatus
  • (3)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete