dw08gm:
Except for one minor problem:
Store Side:
Because images larger than the encapsulating divs would not automatically shrink to within the encapsulating divs, nor shrink in proportion, I had to change Line 205 in \includes\templates\amanita\templates\tpl_events_calendar_default.php
from
<?php echo event_flink_small($event_array['image'], $event_array['title'], 'class="c1" hspace="0" vspace="0"',
true); ?>
> to
> ```
<?php echo event_flink_small($event_array['image'], $event_array['title'], 'class="c1" hspace="0" vspace="0"', false); ?>
while the following also worked
<?php echo event_flink_small($event_array['image'], $event_array['title'], 'class="c1"
', false); ?>
>
>
> I found it made no difference toggling through the following Admin > Images settings:
> Calculate Image Size = True (default)
> Image - Use Proportional Images on Products and Categories = 1 (default)
>
> or switching zen_image_OLD with zen_image in \includes\functions\extra_functions\events_calendar_functions.php (Line 70).
> ```
$dumi = ($usew ? zen_image_OLD($wf, $alt, '', '', $params) : ('<img src="'.$wf.'" alt="'.$alt.'" title=" '.$alt.' " '.$params.' />'));
While I remain unclear what that true/false setting in tpl_events_calendar_default.php is intended to do exactly, I have not yet found any other way to fix this problem.
As I contemplate re-writing the readme, I am wondering how to explain this setting, and whether or not the changing of this setting can or should be placed in a language file or elsewhere.
Has anyone else experienced the same or similar problem with images larger than the encapsulating divs?
With regards to this, please see the posts below.. this is the JIST of the conversation that Rus and I had on this feature, including the final answer/code, and how I turned this into an ADMIN CONFIGURABLE option for shopowners so that EVERYONE gets what they need out of this module.. :smile:
**==================================================================================
**> LaCamus:
Good I'm glad that's working...the second link, with "TRUE" as the last parameter, uses the old (default)** zen_image function which imbeds the image's native height and width in the IMG tag**.
DivaVocals:
I've got this working and I included changes to the SQL file to support this. In support of this I made several changes to some of the admin extra_datafiles files to align things up a little more consistently (moved defines out of the admin extra_definitions database definition file for example)
// Moved to YOUR_ADMIN/includes/languages/english/extra_definitions/events_manager.php
//define('BOX_EXTRAS_EVENTS_MANAGER', 'Events Manager');
//define('FILENAME_EVENTS_MANAGER', 'events_manager.php');
>
> and YOUR_ADMIN/includes/languages/english/extra_definitions/events_manager.php now includes:
> ```
define('BOX_CONFIGURATION_EVENTS_CALENDAR', 'Events Calendar Settings');
define('BOX_EXTRAS_EVENTS_MANAGER', 'Events Manager');
define('FILENAME_EVENTS_MANAGER', 'events_manager.php');
Also I found this and commented it out:
// define('BOX_TOOLS_EVENTS_MANAGER', 'Events Manager'); //removed because as far as I can tell this is not being used
>
> In the configuration settings, I included defines from the store side extra_definitions file, and I also modified the SQL so that the Events Calendar page key is now called **eventsCalendar** and the configuration options page key is **configEventsCalendar**. This makes the SQL and page keys for this module consistent with how other default Zen Cart page keys are set up (particularly the ones for configuration menu options)
>
> 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). I also did not include the filetypes from the admin or store side in the Event Calendar configuration settings. Not sure if that should be an admin option.. thoughts on this everyone??
>
> The following settings are included in the Events Calendar configuration setting menu and commented out in the defines files:
>
> ```
// define(EVENTS_FILE_MAX_WIDTH, '800'); //** rus.02: for max image width in px, check on uploads, change on review
// define(EVENTS_FILE_MAX_HEIGHT,'600'); //** rus.02: for max image height in px, check on uploads, change on review
// define(EVENTS_FILE_RESIZE, true); //** rus.02: for image resizing, set to false to do/show no resizing
// define(EVENTS_MAX_RECURS,'52'); //** rus.03: max possible # of recurring events to add to db at one time
// First day of the week in calendar, eg 0=Sunday, 1=Monday, etc;
//define('FIRST_DAY_OF_WEEK', 0);
// No of years to be shown in sidebox year drop-down
//define('NUMBER_OF_YEARS', 5);
// 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');
//**rus.03: when query returns only 1 event, jump over the event list (false=always show list on single day click)
//define(EVENTS_SINGLE_JUMP, true);
//**rus.03: use long dates (includes day of week) when displaying events
//define(EVENTS_LONG_DATES, true);
**Actually it does support both, but only if one removes the "true" from the code as dw08gm did. So I added an additional admin option that allows the shopowner to chose which option they want without having to edit the code directly at all as follows:
**[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 } ?>
[/CODE]
**This way BOTH options are supported.. (should make everyone happy and keep novice shopowners out of the code)
**I agree.. I made this change and replaced "c1" class with "event_calendar_image". The "c1" class is a bit vaguely named, and this is a LOT more explicit..
Gonna post the files I am working off of in a moment.. I need a bio break and a stretch..:smile:
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.