Page 37 of 50 FirstFirst ... 27353637383947 ... LastLast
Results 361 to 370 of 500
  1. #361
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,021
    Plugin Contributions
    32

    Default Re: Event Calendar

    Quote Originally Posted by DivaVocals View Post
    that said I did not include the month defines (wanna look at the best way how to make that an admin option to support a choice between the long and short array).
    So I'm looking at the code in includes/templates/custom_template/templates/tpl_events_calendar_include_default.php. Around line #64 I found this code:

    Code:
                    $monthShort = explode(",", MONTHS_SHORT_ARRAY);
                    $month = date('m');
                    while (list($key, $value) = each($monthShort))
    I'm considering that perhaps I could do something similar to the code I added to includes/templates/custom_template/templates/tpl_events_calendar_default.php

    Code:
    <?php if (EVENTS_DISPLAY_IMAGE_WIDTH_HEIGHT == 'true') { ?>
        <?php echo event_flink_small($event_array['image'], $event_array['title'], 'class="event_calendar_image"', true); ?>
    <?php } else { ?>
        <?php echo event_flink_small($event_array['image'], $event_array['title'], 'class="event_calendar_image"'); ?>
    <?php } ?>
    So to the tpl_events_calendar_include_default.php file just below that other block (which starts at line #64) I could add something like this:
    Code:
                    $monthLong = explode(",", MONTHS_LONG_ARRAY);
                    $month = date('m');
                    while (list($key, $value) = each($monthLong))
    With a conditional statement around this whole block tied to an admin configuration setting where if you choose one option you will use the long months and if you choose the other it will give you the short months. (with the default being the short months of course). The admin month defines would remain where they are, (with the LONG months options now uncommented) and this admin option simply allows you to choose one or the other.. If something like this works, I am not sure what this will LOOK like in the sidebox.. (I believe these are the months in the sidebox dropdown??) Will be playing around with this tonight unless I'm dead wrong here and Rus has a BETTER idea how to include these month options as an admin setting..
    Last edited by DivaVocals; 16 Apr 2013 at 10:35 PM.
    My Site - Zen Cart & WordPress integration specialist
    I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

  2. #362
    Join Date
    Sep 2008
    Location
    DownUnder, overlooking South Pole.
    Posts
    984
    Plugin Contributions
    6

    Default Re: Event Calendar

    Hi Diva

    includes/templates/custom_template/templates/tpl_events_calendar_include_default.php addresses the sidebox. These months are best kept in their short form to keep the sidebox compact. Another option could be to provide numbered months, although I would prefer the short form.

    cheers

  3. #363
    Join Date
    Mar 2013
    Location
    New Orleans
    Posts
    81
    Plugin Contributions
    0

    Default Re: Event Calendar

    Quote Originally Posted by DivaVocals View Post
    So I'm looking at the code in includes/templates/custom_template/templates/tpl_events_calendar_include_default.php. Around line #64 I found this code:

    Code:
                    $monthShort = explode(",", MONTHS_SHORT_ARRAY);
                    $month = date('m');
                    while (list($key, $value) = each($monthShort))
    I'm considering that perhaps I could do something similar to the code I added to includes/templates/custom_template/templates/tpl_events_calendar_default.php

    Code:
    <?php if (EVENTS_DISPLAY_IMAGE_WIDTH_HEIGHT == 'true') { ?>
        <?php echo event_flink_small($event_array['image'], $event_array['title'], 'class="event_calendar_image"', true); ?>
    <?php } else { ?>
        <?php echo event_flink_small($event_array['image'], $event_array['title'], 'class="event_calendar_image"'); ?>
    <?php } ?>
    So to the tpl_events_calendar_include_default.php file just below that other block (which starts at line #64) I could add something like this:
    Code:
                    $monthLong = explode(",", MONTHS_LONG_ARRAY);
                    $month = date('m');
                    while (list($key, $value) = each($monthLong))
    With a conditional statement around this whole block tied to an admin configuration setting where if you choose one option you will use the long months and if you choose the other it will give you the short months. (with the default being the short months of course). The admin month defines would remain where they are, (with the LONG months options now uncommented) and this admin option simply allows you to choose one or the other.. If something like this works, I am not sure what this will LOOK like in the sidebox.. (I believe these are the months in the sidebox dropdown??) Will be playing around with this tonight unless I'm dead wrong here and Rus has a BETTER idea how to include these month options as an admin setting..
    That program is for creating the side box and those month names are for the drop down...I tried it with the long and it fits for my scenario. But you could write it like this (keep in mind $monthShort is just an array, once you set it to the exploded define there's no need to follow it, its just a name, meaning there is no need to change that 3rd line.)....this is and example if you called the define variable EVENTS_LONG_MONTH_SELECT ("true" meaning use long month names):
    in tpl_events_calendar_include_default.php
    Code:
                   $monthShort = explode(",", (EVENTS_LONG_MONTH_SELECT ? MONTHS_LONG_ARRAY : MONTHS_SHORT_ARRAY));
    in the defines
    Code:
    // Month defines in sidebox month drop-down
    define('MONTHS_SHORT_ARRAY', 'JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,NOV,DEC');
    define('MONTHS_LONG_ARRAY', 'January,February,March,April,May,June,July,August,September,October,November,December');
    define('EVENTS_LONG_MONTH_SELECT',true);
    Maybe we should stick EVENTS_ in front of those define names...I searched and tpl_events_calendar_include_default.php is the only program to use it.

    Another thing to consider would be to use the month names already defined with the base package of zen carts, that way it only has to be changed once...plus if someone already has another language in place and drops this module in then they are good as far as months. I'm not a language expert, but does every language use the 1st 3 letters for the short version of month names? If so we could create the short month just by cutting the rest.

    Last thing: If they want the option of long/short names for the drop down, do you think they want them for the side calendar and the yearly views too? If you make the following change to tpl_events_calendar_include_default.php and tpl_events_calendar_default.php it will change all of them...
    Just add the line below after "$cal = new Calendar;" in both files:
    Code:
    $cal = new Calendar;
    $cal->setMonthNames(explode(",", (EVENTS_LONG_MONTH_SELECT ? MONTHS_LONG_ARRAY : MONTHS_SHORT_ARRAY)));  //**rus: via diva: add
    Maybe there should be a separate define (EVENTS_LONG_MONTH_TITLES) for that, up to you guys.

    Thanks,
    Rus

  4. #364
    Join Date
    Mar 2013
    Location
    New Orleans
    Posts
    81
    Plugin Contributions
    0

    Default Re: Event Calendar

    Just thinking we(maybe mostly me) are making this more complicated then it needs to be. Why not just have 2 fields:
    Code:
    define('EVENTS_MONTHS_DROP_DOWNS', 'JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,NOV,DEC');
    define('EVENTS_MONTHS_TITLES', 'January,February,March,April,May,June,July,August,September,October,November,December');
    Then in tpl_events_calendar_default.php after "$cal = new Calendar;":
    Code:
    $cal = new Calendar;
    $cal->setMonthNames(explode(",", EVENTS_MONTHS_TITLES));  //**rus: via diva: add
    Then in tpl_events_calendar_default.php
    after "$cal = new Calendar;":
    Code:
    $cal = new Calendar;
    $cal->setMonthNames(explode(",", EVENTS_MONTHS_TITLES));  //**rus: via diva: add
    and for the drop downs:
    Code:
                    $monthShort = explode(",",EVENTS_MONTHS_DROP_DOWNS);
                    $month = date('m');
                    while (list($key, $value) = each($monthShort))
    Simple, now anyone can come in, see what they are, and change to whatever, numbers, short, long, etc.

    Rus
    Last edited by LaCamus; 17 Apr 2013 at 05:54 AM.

  5. #365
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,021
    Plugin Contributions
    32

    Default Re: Event Calendar

    Quote Originally Posted by dw08gm View Post
    Hi Diva

    includes/templates/custom_template/templates/tpl_events_calendar_include_default.php addresses the sidebox. These months are best kept in their short form to keep the sidebox compact. Another option could be to provide numbered months, although I would prefer the short form.

    cheers
    Understood.. again the idea here is to make this flexible and provide folks options that they can select for their individual store preferences. If you like the short form, then there's nothing to do since it will be the default, but for folks who would like the longer form, they can easily configure that in the module's admin settings.. This way everyone gets what they want..
    My Site - Zen Cart & WordPress integration specialist
    I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

  6. #366
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,021
    Plugin Contributions
    32

    Default Re: Event Calendar

    Quote Originally Posted by LaCamus View Post
    That program is for creating the side box and those month names are for the drop down...I tried it with the long and it fits for my scenario. But you could write it like this (keep in mind $monthShort is just an array, once you set it to the exploded define there's no need to follow it, its just a name, meaning there is no need to change that 3rd line.)....this is and example if you called the define variable EVENTS_LONG_MONTH_SELECT ("true" meaning use long month names):
    in tpl_events_calendar_include_default.php
    Code:
                   $monthShort = explode(",", (EVENTS_LONG_MONTH_SELECT ? MONTHS_LONG_ARRAY : MONTHS_SHORT_ARRAY));
    in the defines
    Code:
    // Month defines in sidebox month drop-down
    define('MONTHS_SHORT_ARRAY', 'JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,NOV,DEC');
    define('MONTHS_LONG_ARRAY', 'January,February,March,April,May,June,July,August,September,October,November,December');
    define('EVENTS_LONG_MONTH_SELECT',true);
    Maybe we should stick EVENTS_ in front of those define names...I searched and tpl_events_calendar_include_default.php is the only program to use it.

    Another thing to consider would be to use the month names already defined with the base package of zen carts, that way it only has to be changed once...plus if someone already has another language in place and drops this module in then they are good as far as months. I'm not a language expert, but does every language use the 1st 3 letters for the short version of month names? If so we could create the short month just by cutting the rest.

    Last thing: If they want the option of long/short names for the drop down, do you think they want them for the side calendar and the yearly views too? If you make the following change to tpl_events_calendar_include_default.php and tpl_events_calendar_default.php it will change all of them...
    Just add the line below after "$cal = new Calendar;" in both files:
    Code:
    $cal = new Calendar;
    $cal->setMonthNames(explode(",", (EVENTS_LONG_MONTH_SELECT ? MONTHS_LONG_ARRAY : MONTHS_SHORT_ARRAY)));  //**rus: via diva: add
    Maybe there should be a separate define (EVENTS_LONG_MONTH_TITLES) for that, up to you guys.

    Thanks,
    Rus
    Quote Originally Posted by LaCamus View Post
    Just thinking we(maybe mostly me) are making this more complicated then it needs to be. Why not just have 2 fields:
    Code:
    define('EVENTS_MONTHS_DROP_DOWNS', 'JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,NOV,DEC');
    define('EVENTS_MONTHS_TITLES', 'January,February,March,April,May,June,July,August,September,October,November,December');
    Then in tpl_events_calendar_default.php after "$cal = new Calendar;":
    Code:
    $cal = new Calendar;
    $cal->setMonthNames(explode(",", EVENTS_MONTHS_TITLES));  //**rus: via diva: add
    Then in tpl_events_calendar_default.php
    after "$cal = new Calendar;":
    Code:
    $cal = new Calendar;
    $cal->setMonthNames(explode(",", EVENTS_MONTHS_TITLES));  //**rus: via diva: add
    and for the drop downs:
    Code:
                    $monthShort = explode(",",EVENTS_MONTHS_DROP_DOWNS);
                    $month = date('m');
                    while (list($key, $value) = each($monthShort))
    Simple, now anyone can come in, see what they are, and change to whatever, numbers, short, long, etc.

    Rus
    thanks for setting me straight on the correct code. as you know I am a software BA, not a developer.. (I just play with them at work..) Okay so the first post I totally understood.. but the second one ya lost me.. kinda.. I'm trying to figure out how that second one ties into an admin setting for selecting long versus short months.. and I am HELLA confused.. To quote Denzel from the movie "Philadelphia",

    "Can ya explain it to me like I'm a 3 year old"
    My Site - Zen Cart & WordPress integration specialist
    I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

  7. #367
    Join Date
    Mar 2013
    Location
    New Orleans
    Posts
    81
    Plugin Contributions
    0

    Default Re: Event Calendar

    Notta problem....
    Actually if you want to make it admin menu configurable then we need to do it the first way. I was thinking that this would most likely be set once at setup, and didn't need to be in the admin menu configs. But it doesn't matter either way to me. It could be argued both ways. The second way lets them choose one define for titles at the top of calendars, the other for the drop down (which is currently the short names). If you want both long then just type the full month names in both defines. When dw08 mentioned possibly using #'s for the short version I figured just have the 2 defines and let them change either. The 1st way I setup lets them flip ALL month names to short or long, titles and drop down the same.

    But like I said, let me know....I am finished the cookies...scratch that, session variables mod to keep month, day, year throughout the users stay. As soon as you tell me option 1 or 2 (for month names) I can put in the code changes and upload the front side programs again.

    BTW, I had to put in another define for the first letter of each day name:
    Code:
    define('EVENTS_WEEKDAY_FIRST_CHARS', 'S,M,T,W,T,F,S');
    the calendar class that events calendar was using had two static defines, one for month long names and one for the 1st letter of each day. I changed the tpl_ scripts to update the class so it will use our defines now.

    Something to add to our list:
    The Calendar class is very inefficient. It hits the sql server for every single day while building the monthly calendars...that's a minimum of 28 hits to the db every time you update your page (if using the side box calendar). When you click on a year that's 390+ hits to the db. It should hit it once per month calendar at most and then once when looking at the year. Something to keep in mind.

    Thanks,
    Rus

  8. #368
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,021
    Plugin Contributions
    32

    Default Re: Event Calendar

    Quote Originally Posted by LaCamus View Post
    Notta problem....
    Actually if you want to make it admin menu configurable then we need to do it the first way. I was thinking that this would most likely be set once at setup, and didn't need to be in the admin menu configs. But it doesn't matter either way to me. It could be argued both ways. The second way lets them choose one define for titles at the top of calendars, the other for the drop down (which is currently the short names). If you want both long then just type the full month names in both defines. When dw08 mentioned possibly using #'s for the short version I figured just have the 2 defines and let them change either. The 1st way I setup lets them flip ALL month names to short or long, titles and drop down the same.

    But like I said, let me know....I am finished the cookies...scratch that, session variables mod to keep month, day, year throughout the users stay. As soon as you tell me option 1 or 2 (for month names) I can put in the code changes and upload the front side programs again.

    BTW, I had to put in another define for the first letter of each day name:
    Code:
    define('EVENTS_WEEKDAY_FIRST_CHARS', 'S,M,T,W,T,F,S');
    the calendar class that events calendar was using had two static defines, one for month long names and one for the 1st letter of each day. I changed the tpl_ scripts to update the class so it will use our defines now.

    Something to add to our list:
    The Calendar class is very inefficient. It hits the sql server for every single day while building the monthly calendars...that's a minimum of 28 hits to the db every time you update your page (if using the side box calendar). When you click on a year that's 390+ hits to the db. It should hit it once per month calendar at most and then once when looking at the year. Something to keep in mind.

    Thanks,
    Rus
    Like the software I typically spec out requirements for in my day gig, I am a fan of highly configurable software options for end users where it makes sense to do so.. I am also not a fan of novice shopowners having to modify PHP pages in order to setup options they want to use in their shops.. So I like to move these kinds of options to the admin settings page so that the shopowner can select the option they want and the code handles the rest..

    Now I understand why I didn't understand the second post..

    Okay so that said I do like the idea of having multiple options for both the month titles at the top of the calendar as well as the dropdowns.. What code would we need to achieve this using a define that the shopowner can use to chose his option for the month title and his option for the month dropdowns??
    My Site - Zen Cart & WordPress integration specialist
    I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

  9. #369
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,021
    Plugin Contributions
    32

    Default Re: Event Calendar

    Quote Originally Posted by DivaVocals View Post
    Like the software I typically spec out requirements for in my day gig, I am a fan of highly configurable software options for end users where it makes sense to do so.. I am also not a fan of novice shopowners having to modify PHP pages in order to setup options they want to use in their shops.. So I like to move these kinds of options to the admin settings page so that the shopowner can select the option they want and the code handles the rest..

    Now I understand why I didn't understand the second post..

    Okay so that said I do like the idea of having multiple options for both the month titles at the top of the calendar as well as the dropdowns.. What code would we need to achieve this using a define that the shopowner can use to chose his option for the month title and his option for the month dropdowns??
    Nevermind this.. It appears that the answer was in your other post.. **LOL** (see in red.. are these the right changes to make??)

    Quote Originally Posted by LaCamus View Post
    That program is for creating the side box and those month names are for the drop down...I tried it with the long and it fits for my scenario. But you could write it like this (keep in mind $monthShort is just an array, once you set it to the exploded define there's no need to follow it, its just a name, meaning there is no need to change that 3rd line.)....this is and example if you called the define variable EVENTS_LONG_MONTH_SELECT ("true" meaning use long month names):
    in tpl_events_calendar_include_default.php
    Code:
    $monthShort = explode(",", (EVENTS_LONG_MONTH_DROPDOWNS ? EVENTS_MONTHS_LONG_ARRAY : EVENTS_MONTHS_SHORT_ARRAY));
    in the defines
    Code:
    // Month defines in sidebox month drop-down
    define('EVENTS_MONTHS_SHORT_ARRAY', 'JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,NOV,DEC');
    define('EVENTS_MONTHS_LONG_ARRAY', 'January,February,March,April,May,June,July,August,September,October,November,December');
    define('EVENTS_LONG_MONTH_DROPDOWNS',true);
    define('EVENTS_LONG_MONTH_TITLES',true);
    Maybe we should stick EVENTS_ in front of those define names...I searched and tpl_events_calendar_include_default.php is the only program to use it.

    Another thing to consider would be to use the month names already defined with the base package of zen carts, that way it only has to be changed once...plus if someone already has another language in place and drops this module in then they are good as far as months. I'm not a language expert, but does every language use the 1st 3 letters for the short version of month names? If so we could create the short month just by cutting the rest.

    Last thing: If they want the option of long/short names for the drop down, do you think they want them for the side calendar and the yearly views too? If you make the following change to tpl_events_calendar_include_default.php and tpl_events_calendar_default.php it will change all of them...
    Just add the line below after "$cal = new Calendar;" in both files:
    Code:
    $cal = new Calendar;
    $cal->setMonthNames(explode(",", (EVENTS_LONG_MONTH_TITLES ? EVENTS_MONTHS_LONG_ARRAY : EVENTS_MONTHS_SHORT_ARRAY)));  //**rus: via diva: add
    Maybe there should be a separate define (EVENTS_LONG_MONTH_TITLES) for that, up to you guys.

    Thanks,
    Rus
    Last edited by DivaVocals; 17 Apr 2013 at 05:02 PM.
    My Site - Zen Cart & WordPress integration specialist
    I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

  10. #370
    Join Date
    Mar 2013
    Location
    New Orleans
    Posts
    81
    Plugin Contributions
    0

    Default Re: Event Calendar

    Quote Originally Posted by DivaVocals View Post
    Nevermind this.. It appears that the answer was in your other post.. **LOL** (see in red.. are these the right changes to make??)
    Wait, here's the new files....I put in two options, one for dropdowns and 1 for titles...this also has the mod so the month/year stay selected throughout the users session:
    ec_4_alpha_rus_alpha.03b-store-side.zip

    Here's the fix for the image manipulator, just copy over the old in your_admin/includes/classes/
    events_manager_image_manipulator.zip

    Thanks,
    Rus

 

 
Page 37 of 50 FirstFirst ... 27353637383947 ... LastLast

Similar Threads

  1. Timeslot Booking Event Calendar
    By escapis in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 31 Jan 2014, 12:45 AM
  2. Multiple Choices error with Event Booking Calendar addon
    By FukienMan in forum All Other Contributions/Addons
    Replies: 9
    Last Post: 16 Feb 2012, 12:17 AM
  3. Help with Event Calendar add-on
    By blabay in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 24 Mar 2010, 01:34 PM
  4. Event Calendar Broken - take out of download section!
    By Asmodai in forum All Other Contributions/Addons
    Replies: 3
    Last Post: 10 Nov 2007, 07:22 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg