Cancorp
01-19-2005, 08:55 PM
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.
Cancorp
01-24-2005, 02:26 AM
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?!?
Cancorp
01-27-2005, 06:56 PM
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.
// ###################### 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;
}
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.