vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Calendar 15 & 45 times?!? (https://vborg.vbsupport.ru/showthread.php?t=74680)

Cancorp 01-19-2005 08:55 PM

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.

Cancorp 01-24-2005 02:26 AM

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?!?

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.

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;
}



All times are GMT. The time now is 06:24 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.01488 seconds
  • Memory Usage 1,739KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete