Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 01-19-2005, 08:55 PM
Cancorp Cancorp is offline
 
Join Date: Feb 2003
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Calendar 15 & 45 times?!?

I searched for this here and couldn't find anything. Over at vBull.com they say it will be in a "future release" but I kind of need it now....

When booking an event on the calendar, we currently only have the options of 30 minute intervals.

I checked the templates and the hard code where I could think to look and couldn't find for the life of me where to edit this.

I am running 3.0.5

Ideas anyone?

Let me add to this:

Ultimately we would love to be able to enter whatever start and end time we wanted. That would be our ideal. Second ideal would be 10 minute incraments. At the very least we need 15 & 45 time slots.

Jake over at vBull looked into it and says that it would take some hacking of the code so I should ask over here. There are several people over at vBull looking for this flexability, so it would not go unappreciated.
Reply With Quote
  #2  
Old 01-24-2005, 02:26 AM
Cancorp Cancorp is offline
 
Join Date: Feb 2003
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Cancorp
I searched for this here and couldn't find anything. Over at vBull.com they say it will be in a "future release" but I kind of need it now....

When booking an event on the calendar, we currently only have the options of 30 minute intervals.

I checked the templates and the hard code where I could think to look and couldn't find for the life of me where to edit this.

I am running 3.0.5

Ideas anyone?

Let me add to this:

Ultimately we would love to be able to enter whatever start and end time we wanted. That would be our ideal. Second ideal would be 10 minute incraments. At the very least we need 15 & 45 time slots.

Jake over at vBull looked into it and says that it would take some hacking of the code so I should ask over here. There are several people over at vBull looking for this flexability, so it would not go unappreciated.

Nobody has any ideas on this? I am not that familiar with coding, so I can't seem to find where this needs to be done. I am thinking it is in the "hard code" and not a template mod, but surely someone here can point me in the right direction?!?
Reply With Quote
  #3  
Old 01-27-2005, 06:56 PM
Cancorp Cancorp is offline
 
Join Date: Feb 2003
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This, I assume (dangerous I know) should be the code that needs to be tinkered with. I have played with it a bit, but I can only get it to change from showing :15 or :30 or :45 and not all 3. This is taken from "functions_calendar.php" in the includes folder of 3.05.

Can anyone get this to work so that our users can choose from :15 and :30 and :45 past the hour? Ideally, we would love to be able to enter our own custom times and not have to choose an interval from the dropdown box at all, but the :15 incriments are better than what we have now.

TIA for anyone who can help.

Code:
// ###################### Start fetch time options #######################
function fetch_time_options($giAH, $use24hour = false)
{
	global $vboptions, $stylevar, $vbphrase;
	static $timearray;

	if (!is_array($timearray))
	{
		$timearray = array();

		if ($use24hour)
		{
			for ($hour = 0; $hour < 24; $hour++)
			{
				for ($mins = 0; $mins <= 30; $mins += 30)
				{
					$hh = str_pad($hour, 2, 0, STR_PAD_LEFT);
					$mm = str_pad($mins, 2, 0, STR_PAD_LEFT);
					$timearray["{$hour}_{$mm}"] = "$hh:$mm";
				}
			}
			$timearray['0_00'] = $vbphrase['midnight'];
			$timearray['12_00'] = $vbphrase['midday'];
		}
		else
		{
			$ampm_array = array(
				'AM' => 'am',
				'PM' => 'pm'
			);
			$hour_array = array(
				12, 1, 2, 3,
				4, 5, 6, 7,
				8, 9, 10, 11
			);
			foreach ($ampm_array AS $AMPM => $ampm)
			{
				foreach ($hour_array AS $hour)
				{
					for ($mins = 0; $mins <= 30; $mins += 30)
					{
						$hh = str_pad($hour, 2, 0, STR_PAD_LEFT);
						$mm = str_pad($mins, 2, 0, STR_PAD_LEFT);
						$timearray["{$hour}_{$mm}_{$AMPM}"] = "$hh:$mm $ampm";
					}
				}
			}
			$timearray['12_00_AM'] = $vbphrase['midnight'];
			$timearray['12_00_PM'] = $vbphrase['midday'];
		}
	}

	if (true OR is_array($giAH))
	{
		switch($giAH[1])
		{
			case '15': $giAH[1] = '00'; break;
			case '45': $giAH[1] = '30'; break;
		}
		if ($use24hour)
		{
			$selectedindex = intval($giAH[3]) . '_' . $giAH[1];
		}
		else
		{
			$selectedindex = intval($giAH[0]) . '_' . $giAH[1] . '_' . $giAH[2];
		}
	}
	else
	{
		$selectedindex = false;
	}

	$output = '';
	foreach ($timearray AS $optionvalue => $optiontitle)
	{
		$optionselected = iif($optionvalue == $selectedindex, HTML_SELECTED, '');
		eval('$output .= "' . fetch_template('option') . '";');
	}

	return $output;
}
Reply With Quote
Reply


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 10:12 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03139 seconds
  • Memory Usage 2,183KB
  • Queries Executed 13 (?)
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_code
  • (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