Forums / All Other Contributions/Addons / Event Calendar v3

Event Calendar v3

Locked

Views: 68,123

Results 241 to 260 of 500
This thread is locked. New replies are disabled.
3 Apr 2013, 5:43 AM
#241
lacamus avatar

lacamus

New Zenner

Join Date:
Mar 2013
Location:
New Orleans
Posts:
81
Plugin Contributions:
0

Event Calendar v3

DivaVocals:

I agree with your reasoning behind the image code and IMHO something like this SHOULD be incorporated into this module.. The whole purpose of the module Image Handler is to automate the re-sizing and optimization of the product and category images. This helps shopowners do something automatically they may not remember to do on their own.

IMHO, something similar SHOULD be a part of this module for ALL the reasons you stated.. Even with instructions in the readme, novice DIY shopowners are not always going to follow these instructions and the module should include some controls to help shopowners engage in best practices with regards to image management. Adding some "Image Handler" like image size/management features including admin controls to set the max image height and width AND using the Zen Cart option to re-size the images proportionally would do the trick.. This would enforce better image management practices, and give shopowners some measure of control over the image sizes..

Just from a quick scan it looks like this could work with minimal changes...just for the one overall max image file width (and height) setting. It appears that all zen cart admin file uploads are using the "upload" class (in admin/includes/classes/upload.php). When the "save" function is called it could all be handled there. The only code outside this script would be to add a global variable(s) for max image width (height).

I see that the save function also has an overwrite option, that makes some of my code in admin/events_manager.php redundant...don't want to add to the confusion so that's something we can tackle together in a later revision.

Thanks,
Rus

3 Apr 2013, 6:19 AM
#242
lacamus avatar

lacamus

New Zenner

Join Date:
Mar 2013
Location:
New Orleans
Posts:
81
Plugin Contributions:
0

Re: Event Calendar v3

dw08gm:

I recall seeing one instance of -1, but was not aware there were three places to look. Will have to revisit.

The -1 is in 1 place, but there are 2 places (soon to be 3) that have added javascript to blank out the manufacturer selection when choosing a category or product.

dw08gm:

ps. To make code changes easier to spot in the forum, may I suggest changing the color of relevent section of code to say red/blue = old/new.

I agree, should have thought of that, I'm thinking like I'm stuck in a coding editor...

Here's what I'll do:

gray = code that stayed the same, shown so you can reference/search
green = new code (including coded remarks)
red = code that was removed
blue = code that replaced removed code
purple = an additional file/script that is required
[B][I]black bold italic = instructions, line references (not coded remarks)[/I][/B]

For this message only I bolded in dark green those changes made yesterday.

I went back and compared your files to my latest, so line # references are actually from your ec_4_alpha.zip release.

Here's all the changes I have made (up to this moment) to admin/event_manager.php since downloading your alpha version:

(Additional Note: When testing the "upcoming products" javascript mod I came across a preexisting problem with the links not being created correctly. I traced it to line 355. There is an integer variable ($sep) that I could not find a reference to anywhere (that includes all files under the Zen Carts admin directory). I changed the code (in bold dark blue) so it works now.)

[B][I]--BEGIN Changes starting at line 11[/I][/B]
require('includes/application_top.php');

//** rus: start
//** rus: library/class to manipulate images (by Phil Brown: https://gist.github.com/philBrown/880506
  require('includes/classes/image_manipulator.php');
  define(EVENT_FILE_MAX_WIDTH, '600');        //** rus: for max image width in px, check on file uploads
  $file_to_delete = '';                       //** rus: no easy way to get rid of invalid file, so I delete this file (if set) at the end.
  define(FILENAME_DEFAULT_CATALOG, 'index');  //** rus: corrected 3/23/2013
//** rus: stop
//** rus: removed: define(FILENAME_DEFAULT_CATALOG, 'index.php');

  define(FILENAME_PRODUCT_INFO, 'product_info.php');
[B][I]--END Changes starting at line 11[/I]

[I]--BEGIN Changes starting at line 76[/I][/B]
//** rus: start: check to see if file is an image and if too wide
            $wf_parse = $working_file->parse();
//**rus: changed            if($working_file->parse() != false)
//**rus: changed {
            if($wf_parse != false) {
              //** valid image extensions 
              $validext = array('.jpg', '.jpeg', '.gif', '.png');
              $fileext = strtolower(strrchr($working_file->filename, "."));
              if (!in_array($fileext, $validext)) {
                $messageStack->add('Uploaded file ' . $working_file->filename . ' is not a jpg, jpeg, png, or gif.', 'error');
                $event_error = true;
                $success = false;
                $file_to_delete = $working_file->destination . $working_file->filename;
                [B]$_POST['no_image'] = 'on';[/B]
              } else {
                $eman = new ImageManipulator($working_file->tmp_filename);
                $ewid = $eman->getWidth();
                $ehei = $eman->getHeight();
                $nwid = 0;
                if ($ewid > EVENT_FILE_MAX_WIDTH) {
                  $nwid = EVENT_FILE_MAX_WIDTH;
                  $nhei = intval($ehei * ($nwid / $ewid));
                  $enew = $eman->resample($nwid, $nhei);
                }

                    $eufile = $working_file->destination . $working_file->filename;
//** rus: stop
                    // rename here if required
                    $working_file->set_filename($working_file->filename);

//** rus: start
//**            in a situation where a file was uploaded and resized then possibly uploaded again...
//**            code was overwriting resized file with newly uploaded (original) bigger image
//**            instead of chasing down why, I took the easy way out and just delete the image/file if it exists
//**            this worked in my scenario (12 to 20 events a year), user just uploads new image...
//**            if any old events used the same image filename then they would all now show the new image
                    if (file_exists($eufile)) {
                      unlink($eufile);
                    }
//** rus: stop
                    if ( !$working_file->save(false) == false)
                    { 
                        $upload_success = true;
//** rus: removed (redundant):                        $messageStack->add('File Uploaded', 'success');

//** rus: start: if we resized then delete original (that was just saved) and save new resized image
//**             more time consuming I know, but upload() function was generating $messageStack...
//**             errors when image changed before $working_file save.
                        if ($nwid > 0) {
                          unlink($eufile);
                          $messageStack->add('Image was resized from ' . $ewid . ' by ' . $ehei . ' to ' . $nwid . ' by ' . $nhei . '.', 'success');
                          $eman->save($eufile);
                          $working_file->file = $eman->file;
                        }                        
//** rus: stop

                    }else{
                        $messageStack->add('There was a problem saving your file -  perhaps you need to rename it', 'error');
                    }

                $uploaded_image = $working_file->filename;

              }  //** rus: end if from above

            }
            else
            {
                if($_POST['no_image'] == 'on' )
                {
                    // remove image
                    $uploaded_image = '';
                }
                else
                {
//** rus: start
                    $event_error = true;
                    $success = false;
                    [B]if ($_FILES['event_image']['error']!=UPLOAD_ERR_NO_FILE)[/B] $messageStack->add('There was an error uploading your image file (may be too large)', 'error');
//** rus: stop

                    // set it to the previous image 
                    $uploaded_image = $_POST['event_previous_image'];
                }
            }

            //==============================
            // eof deal with upload - Niccol
            //==============================
[B][I]--END Changes starting at line 76[/I]

[I]--BEGIN Changes starting at line 335[/I][/B]
           <?php
					// } // removed, see line 291
             if($_POST['manufacturers_id']!= ''){
//** rus: start
              if ($_POST['manufacturers_id']== '-1'){
               $ZC_link = '';
               $ZC_links = '';
              } else {
//** rus: stop
               $manufacturers = $db->Execute("select manufacturers_name from ". TABLE_MANUFACTURERS ." where manufacturers_id = '" . $_POST['manufacturers_id'] . "'");
               if ($manufacturers) {
                 $manufacturers_name = $manufacturers->fields['manufacturers_name'];
                 }
                 $ZC_link = zen_catalog_href_link(FILENAME_DEFAULT_CATALOG , 'manufacturers_id='. $_POST['manufacturers_id'] );
                 $ZC_links = '<a href='. $ZC_link .' target=_blank>'. $manufacturers_name .'</a>';
              }      //** rus: end if   *******************
             } elseif ($_POST['cPath']!= 0){
                $ZC_link = zen_catalog_href_link(FILENAME_DEFAULT_CATALOG , 'cPath='. $_POST['cPath'] );
                $ZC_links = '<a href='. $ZC_link .' target=_blank>'. zen_get_category_name($_POST['cPath'], $_SESSION['languages_id']) .'</a>';

             } elseif ($_POST['products_id'] != ''){
                $ZC_link = zen_catalog_href_link(FILENAME_PRODUCT_INFO , 'products_id='. $_POST['products_id'] );
//** rus: changed:                $ZC_links = '<a href='. $ZC_link .'>'. zen_get_products_name($_POST['products_id']) .'</a>';
                $ZC_links = '<a href='. $ZC_link .' target=_blank>'. zen_get_products_name($_POST['products_id']) .'</a>';

             } elseif ($_POST['upcoming'] != ''){
//** rus: changed:                $ZC_link = zen_catalog_href_link(FILENAME_PRODUCT_INFO , 'products_id='. substr($_POST['upcoming'],0,$sep) );
               [B] $ZC_link = zen_catalog_href_link(FILENAME_PRODUCT_INFO , 'products_id='. $_POST['upcoming']);[/B]
//** rus: changed:                $ZC_links = '<a href='. $ZC_link .'>'. zen_get_products_name($_POST['upcoming']) .'</a>';
                $ZC_links = '<a href='. $ZC_link .' target=_blank>'. zen_get_products_name($_POST['upcoming']) .'</a>';

             } else {
                $ZC_links = (($_POST['ZC_link']) ? $_POST['ZC_link'] : $events->fields['ZC_link']);
             }
           ?>

[B][I]--END Changes starting at line 335[/I]

[I]--BEGIN Changes starting at end of file(line 667)[/I][/B]
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
<?php 
//** rus: start
//**            used this workaround to get rid of files that were not valid images since the...
//**            original code writes files even when error variables are set
  if ($file_to_delete != '') {
    unlink($file_to_delete);
  }
//** rus: stop
?>
[B][I]--END Changes at end of file[/I][/B]

Here's all the changes I have made (up to this moment) to admin/includes/events_manager_drop_dns.php since downloading your alpha version (including the new javascript changes for upcoming products):

[B][I]--BEGIN Changes starting at line 18[/I][/B]
<!-- bof manufacturers -->
<?php
$heading = array();
$heading[] = array('align' => 'left', 'text'  => TEXT_CHOOSE_MANUFACTURER);
$manufacturers_values = $db->Execute("select manufacturers_id, manufacturers_name from " . TABLE_MANUFACTURERS . " order by manufacturers_name");
//**rus: changed   $select_box = '<select name="manufacturers_id" onChange="submit();">';
   $select_box = '<select name="manufacturers_id" id="manufacturers_id_sel" onChange="submit();">';

//** rus: removed: if (MAX_MANUFACTURERS_LIST < 2) {
//** rus: removed:     $select_box .= '<option value="">Select</option>';
//** rus: removed: }

//** rus: start
  $select_box .= '<option value="-1">No Manufacturer</option>';
  $dum_pos = strpos($ZC_links,'manufacturers_id=');
  $manz_id = '';
  if ($dum_pos)  {
    $manz_id = substr($ZC_links,$dum_pos+17);
    $manz_id = current(explode(" ", $manz_id));
  }
  if (isset($_POST['manufacturers_id']) && $_POST['manufacturers_id']>0) {
    $man_cur = $_POST['manufacturers_id'];
  } else {
    if ($manufacturers) {
      $man_cur = $manufacturers->fields['manufacturers_id'];
    } else {
      $man_cur = '';
    }
  }
  if ($man_cur=='') $man_cur=$manz_id;
//** rus: stop

    while (!$manufacturers_values->EOF) {
//** rus: removed:      $select_box .= '<option value="' . $manufacturers_values->fields['manufacturers_id'] . '"';
// if ($_POST['manufacturers_id'] == $manufacturers_values['manufacturers_id']) $select_box .= ' SELECTED';
//** rus: start: try this another way
      if ($manufacturers_values->fields['manufacturers_id'] == $man_cur) {
        $select_box .= '<option selected value="' . $manufacturers_values->fields['manufacturers_id'] . '"';
      } else {
        $select_box .= '<option value="' . $manufacturers_values->fields['manufacturers_id'] . '"';
      }
//** rus: stop
      $select_box .= '>' . substr($manufacturers_values->fields['manufacturers_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '</option>';
      $manufacturers_values->MoveNext();
}

$select_box .= "</select>";
[B][I]--END Changes starting at line 18[/I][/B]

[B][I]--BEGIN Changes starting at line 46[/I][/B]
!-- bof categories -->
<?php
    $heading = array();
    $heading[] = array('align' => 'left', 'text'  => TEXT_CHOOSE_CATEGORY);
    $info_box_contents = array();
//** rus: start
    $dum_oc = "document.getElementById('manufacturers_id_sel').value = ''; submit();";
    $info_box_contents[] = array('form'  => '', 'align' => 'left', 'text'  => zen_draw_pull_down_menu('cPath', zen_get_category_tree(), '', 'onChange="' . $dum_oc . '"'));
//** rus: replaced:    $info_box_contents[] = array('form'  => '', 'align' => 'left', 'text'  => zen_draw_pull_down_menu('cPath', zen_get_category_tree(), '', 'onChange="submit();"'));
//** rus: stop
    $box = new box;
echo $box->menuBox($heading, $info_box_contents);
?>
<!-- eof categories -->
[B][I]--END Changes starting at line 46[/I][/B]

[B][I]--BEGIN Changes starting at line 78[/I][/B]
  $listing_products->MoveNext();
  }

//** rus: start
  $info_box_contents[] = array('form' => '', 'align' => 'left', 'text' => zen_draw_pull_down_menu('products_id', $products_array, '','onChange="' . $dum_oc . '"'));
//** rus: replaced:  $info_box_contents[] = array('form' => '', 'align' => 'left', 'text' => zen_draw_pull_down_menu('products_id', $products_array, '','onChange="submit();"'));
//** rus: stop
  $box = new box;
  echo $box->menuBox($heading, $info_box_contents);
} else {
[B][I]--END Changes starting at line 78[/I][/B]

[B][I]
--This is the change you will need to make for "upcoming products".
--BEGIN Changes starting at line 109[/I][/B]
  //while ($upcoming_products = zen_db_fetch_array($upcoming_query))
  	while (!$upcoming_products->EOF) {
  $upcoming_array[] = array('id' => $upcoming_products->fields['products_id'], 'text' => $upcoming_products->fields['products_name'] .' |   expected: '. substr($upcoming_products->fields['products_date_available'],0,10));
  $upcoming_products->MoveNext();
  }
[B]//** rus: start
    $info_box_contents[] = array('form' => '', 'align' => 'left', 'text' => (zen_draw_pull_down_menu('upcoming', $upcoming_array, ' ','onChange="' . $dum_oc . '"')));  
//** rus: replaced:    $info_box_contents[] = array('form' => '', 'align' => 'left', 'text' => (zen_draw_pull_down_menu('upcoming', $upcoming_array, ' ','onChange="submit();"')));
//** rus: stop[/B]
    $box = new box;
    echo $box->menuBox($heading, $info_box_contents);

} else {
[B][I]--END Changes starting at line 109[/I][/B]

Here's all the changes I have made (up to this moment) to includes/templates/your_template/templates/tpl_events_calendar_default.php since downloading your alpha version:

[B][I]--BEGIN Changes starting at line 172[/I][/B]
<!-- bof event image - scales and fits images to outer div -->
<?php 
//** rus: added php block to stop trying to show image when there isn't one in db
  if ($event_array['image']!="") {
?>
  <div class="event_image_outer">
    <div class="event_image_inner">
	  <!-- Note: closing ' />' for <img> is located in function zen_image -->
	  <img class="c1" <?php echo zen_image(DIR_WS_IMAGES .'events_images/' . $event_array['image'], '', '', 'hspace="0" vspace="0"');?>
	</div>
    <div class="clearLeft"> </div>
  </div>
<?php 
//** rus: added php block
  }
?>
<!-- eof event image -->
[B][I]--END Changes starting at line 172[/I][/B]

[B][I]--BEGIN Changes starting at line 250[/I][/B]
        else if($_GET['view'] == 'all_events')
        {   //Show all Events from current date.
//** rus: start
//** rus: changed          $events_query_raw = "select *, DAYOFMONTH(start_date) AS event from ".TABLE_EVENTS_CALENDAR."
//** rus: changed            where (start_date >= '" . date('Y-m-d H:i:s') . "' or end_date >= '" . date('Y-m-d H:i:s') . "')"
//** rus: changed            . " and language_id = '" . $_SESSION['languages_id'] . "' order by start_date";
          $events_query_raw = "select *, DAYOFMONTH(start_date) AS event from ".TABLE_EVENTS_CALENDAR."
            where (start_date >= '" . date('Y-m-d') . "' or end_date >= '" . date('Y-m-d') . "')"
            . " and language_id = '" . $_SESSION['languages_id'] . "' order by start_date";
//** rus: stop
          $listingTitle = TEXT_FORTHCOMING_EVENTS;
          $displayPagingSuffix = NULL; // NULL or $listingTitle
          require(DIR_WS_MODULES . 'events_calendar_listing.php');
        }
[B][I]--END Changes starting at line 250[/I][/B]

So, just to reiterate, these are all of the changes I have made to the events calendar I have running (and working) on my box. Anything that was changed yesterday or this morning (since I uploaded the ...rus_alpha zip) is in either bold dark green or bold dark blue.

Let me know if you need anything else on this.

Thanks again for your efforts,
Rus

3 Apr 2013, 1:20 PM
#243
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Event Calendar v3

This is very cool watching you two whip this thing into shape.. :yes::smoke::thumbsup::cool:

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.

3 Apr 2013, 3:43 PM
#244
dw08gm avatar

dw08gm

Totally Zenned

Join Date:
Sep 2008
Location:
DownUnder, overlooking South Pole.
Posts:
1,018
Plugin Contributions:
2

Re: Event Calendar v3

Re: Image Handler. I found this mod kills the animation of animated gifs, which I use on occassion in event calendar and as category icons, but I have not tested IH with other animation file types (eg .swf or css3). I also find IH code way too complicated for my liking, and would not only make Events Calendar more complicated but considerably larger. However, if others want code similar to IH incorporated into mod, I feel it best treated as an option, as that type of code is not something I could support.

Color has gone from one extreme to another - now looks like a xmas tree LOL - but then much easier to read.

Cheers

3 Apr 2013, 4:24 PM
#245
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Event Calendar v3

dw08gm:

Re: Image Handler. I found this mod kills the animation of animated gifs, which I use on occassion in event calendar and as category icons, but I have not tested IH with other animation file types (eg .swf or css3). I also find IH code way too complicated for my liking, and would not only make Events Calendar more complicated but considerably larger. However, if others want code similar to IH incorporated into mod, I feel it best treated as an option, as that type of code is not something I could support.

Color has gone from one extreme to another - now looks like a xmas tree LOL - but then much easier to read.

Cheers

Re-read my post.. I really wasn't talking about integrating IH4 at all.. in fact I made the statement: "IMHO, something similar SHOULD be a part of this module for ALL the reasons you stated..".. I used IH4 as an example of what image management features brings to the table because of it's image resizing features.. Wasn't suggesting porting it over to this module at all..

*(OFF TOPIC ASIDE: As you know there IS a solution for animated GIFs with IH4.. It's NOT part of IH4 core because with the exception of you and maybe ONE other person asking after this, no one has really asked for this feature.:smile: The reason being is that "in general" animated GIFs are not recommended for product images. With regards to swf or other animation filetypes, that is NOT something in scope for a module who's stated purpose is "image management and optimization")

*
My point was that a set of user instructions on how to resize images is not enough for novice shopowners with regards to image sizing and management. Additionally if the concern is shopowner control, admin controls can be implemented so that shop owners can set their image sizing parameters. If the concern is for animated GIFs, then goodness build your code to cover that too. My point is that I think that Rus was on the right track in attempting to include some image management controls/features to this module. The reason I bring up IH4 is because it's resizing features actually resizes the images rather than using the browser height and width to resize images. Zen Cart already has a built in control for resizing images proportionally (which IH4 also uses in it's resizing code). Allowing shopowners to upload ridiculously large images without ANY controls is not a good idea and is NOT following best practices IMHO.. As I stated in my previous post "Even with instructions in the readme, novice DIY shopowners are not always going to follow these instructions and the module should include some controls to help shopowners engage in best practices with regards to image management."

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.

3 Apr 2013, 4:50 PM
#246
lacamus avatar

lacamus

New Zenner

Join Date:
Mar 2013
Location:
New Orleans
Posts:
81
Plugin Contributions:
0

Re: Event Calendar v3

One important thing to remember is that the image is not touched at all if the width is equal to or less than the defined max setting. But I'm guessing that people who create their own animated images would be savvy enough to just size them correctly before upload.

Also in the next revision we can put in code to check to see if the max width is 0 or not defined...then don't resize.

3 Apr 2013, 4:57 PM
#247
lacamus avatar

lacamus

New Zenner

Join Date:
Mar 2013
Location:
New Orleans
Posts:
81
Plugin Contributions:
0

Re: Event Calendar v3

LaCamus:

One important thing to remember is that the image is not touched at all if the width is equal to or less than the defined max setting. But I'm guessing that people who create their own animated images would be savvy enough to just size them correctly before upload.

Also in the next revision we can put in code to check to see if the max width is 0 or not defined...then don't resize.

Heck, just thinking here after writing that message....but we can just put a checkbox and width field in the event creation form. The width field would default to our defined max width and the checkbox could be unchecked (default would be on) to not resize at all...graceful solution. I could probably pump this out pretty quick, just let me know.

3 Apr 2013, 5:10 PM
#248
lacamus avatar

lacamus

New Zenner

Join Date:
Mar 2013
Location:
New Orleans
Posts:
81
Plugin Contributions:
0

Re: Event Calendar v3

dw08gm:

Color has gone from one extreme to another - now looks like a xmas tree LOL - but then much easier to read.

Cheers

I can use whatever colors you want, just let me know. I was trying to setup an easy way to track the changes and for you to match them up with your existing code (I know you said the fixes to the link creation weren't working for you). I could have saved a lot of time just using 2 colors. I went step by step through yours and my code to find the differences and to make sure that I didn't miss remarking one of my changes. That 1 post took almost as long to write as the initial code:wink:.

Thanks,
Rus

3 Apr 2013, 5:12 PM
#249
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Event Calendar v3

LaCamus:

Heck, just thinking here after writing that message....but we can just put a checkbox and width field in the event creation form. The width field would default to our defined max width and the checkbox could be unchecked (default would be on) to not resize at all...graceful solution. I could probably pump this out pretty quick, just let me know.

Sounds like a great idea!:yes:

LaCamus:

One important thing to remember is that the image is not touched at all if the width is equal to or less than the defined max setting. **But I'm guessing that people who create their own animated images would be savvy enough to just size them correctly before upload.

**Also in the next revision we can put in code to check to see if the max width is 0 or not defined...then don't resize.Exactly..
:yes:

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.

4 Apr 2013, 2:28 PM
#250
dw08gm avatar

dw08gm

Totally Zenned

Join Date:
Sep 2008
Location:
DownUnder, overlooking South Pole.
Posts:
1,018
Plugin Contributions:
2

Re: Event Calendar v3

LaCamus:

One important thing to remember is that the image is not touched at all if the width is equal to or less than the defined max setting. But I'm guessing that people who create their own animated images would be savvy enough to just size them correctly before upload.

Also in the next revision we can put in code to check to see if the max width is 0 or not defined...then don't resize.

My website was setup three years ago to be fluid and flexible, so that it caters to a diversity of screen sizes, as per the code for the display of images in tpl_events_calendar_default.php and stylesheet_events_calendar.css. As such my website does not need the dimensions of any images to be specified exactly, even though I usually set maximums for large images to 800x600px at 96 dpi or around 400kb. While I recognise that others may not have setup their websites in this way, the writing has been on the wall since mobile phones and tablets could access the internet. While it remains to be seen whether the next release of zencart will revamp the standard template to be fluid and flexible, I am convinced fluid and flexible design is an inevitability for future releases.

I believe the problem of image size will be largely limited to those who blindly adopt other's images without a thought to tailoring same for their website. In this day and age, store owners/developers should know better.

Re-read my post.. I really wasn't talking about integrating IH4 at all.

Diva, I accept this, however, my only intention was to bring Rus up to speed regarding IH.

Cheers

4 Apr 2013, 3:50 PM
#251
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Event Calendar v3

dw08gm:

My website was setup three years ago to be fluid and flexible, so that it caters to a diversity of screen sizes, as per the code for the display of images in tpl_events_calendar_default.php and stylesheet_events_calendar.css. As such my website does not need the dimensions of any images to be specified exactly, even though I usually set maximums for large images to 800x600px at 96 dpi or around 400kb. While I recognise that others may not have setup their websites in this way, the writing has been on the wall since mobile phones and tablets could access the internet. While it remains to be seen whether the next release of zencart will revamp the standard template to be fluid and flexible, I am convinced fluid and flexible design is an inevitability for future releases.The roadmap for 1.6 includes a re-vamped responsive default template. That said, not everyone is going to have a fluid or responsive template in place, and if they are using this module there really needs to be features in place to protect shopowevers from engaging in bad habits.. Just because YOU know better doesn't mean that EVERYONE using this module will.. The features need to be GLOBAL not based on a specific setup.. Sure user education will help some, but sadly NOT the majority.. So the module does need some more global controls/features in place to ensure that best practices are followed.. All of this can be made completely flexible so that shopowners who don't need protection from themselves can operate their shops the way they want to..

dw08gm:

I believe the problem of image size will be largely limited to those who blindly adopt other's images without a thought to tailoring same for their website. In this day and age, store owners/developers should know better.Developers perhpas.. the average DIY shopowner (a LARGE part of the open source community) umm... not so much.. The assumption that DIY shopowners will come to the table with the SAME knowledge as a developer is a faulty assumption and it should not drive the features of any module.. In fact to a certain degree the module (like any other app development) must assume that the user will NOT know all the technical things we THINK/ASSUME they should know about technology and "how it works".

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.

4 Apr 2013, 5:11 PM
#252
dw08gm avatar

dw08gm

Totally Zenned

Join Date:
Sep 2008
Location:
DownUnder, overlooking South Pole.
Posts:
1,018
Plugin Contributions:
2

Re: Event Calendar v3

Diva

Respectfully, the code is already fully flexible and compact. The only thing shopowners will do if they upload large images is cost themselves and their customers a little extra in bandwidth. No big deal in the greater scheme.

If stupid is as stupid does, let the storeowner bear the brunt of the customer - seriously.

Cheers

4 Apr 2013, 5:28 PM
#253
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Event Calendar v3

dw08gm:

Diva

Respectfully, the code is already fully flexible and compact. The only thing shopowners will do if they upload large images is cost themselves and their customers a little extra in bandwidth. No big deal in the greater scheme.

**If stupid is as stupid does, let the storeowner bear the brunt of the customer - seriously.

**CheersSorry but I respectfully disagree with this POV, and I certainly wasn't talking about "bloating" the code for this module.. but ya'll do what you think is best.. I like Rus' direction because it minimizes "stupid is as stupid does". I think it's the right direction.. You disagree.. shrug we'll just have to agree to disagree then..

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.

4 Apr 2013, 8:21 PM
#254
lacamus avatar

lacamus

New Zenner

Join Date:
Mar 2013
Location:
New Orleans
Posts:
81
Plugin Contributions:
0

Re: Event Calendar v3

dw08gm:

...I usually set maximums for large images to 800x600px at 96 dpi or around 400kb. While I recognise that others may not have setup their websites in this way, the writing has been on the wall since mobile phones and tablets could access the internet. While it remains to be seen whether the next release of zencart will revamp the standard template to be fluid and flexible, I am convinced fluid and flexible design is an inevitability for future releases.

I think we are in agreement on the major points here. A resizing of all images to a maximum allowable size should be global and built into the core release of Zen Carts. But I don't have access as a developer to the Zen Carts core, I was just doing what I thought was right for this module since I was there working inside the code at the time. My initial reason for being there was because of an error when uploading images using the same name. As I posted in my initial message, I'm looking to help and don't want to step on toes.

As you just stated you "usually set maximums", if that feature was configured into zen through variable settings in the admin menus it would be nice. For those who want to be more hands on set the vars to 0 and no resizing will be done, nice and easy. For those who don't (or are electronically challenged) you snap the photo of your product, upload, done. There would be no need to resize using a 3rd party product (irfanview, paint, etc.)...it just cuts out an exta step. Plus when your resizing in another program the control is all with you, you have to get it right... did you set the right width? height? Was that 800 or 640? Once you set it in zen carts it is done and you don't have to worry about getting it right...every single time.

dw08gm:

I believe the problem of image size will be largely limited to those who blindly adopt other's images without a thought to tailoring same for their website. In this day and age, store owners/developers should know better.

When the store owner took a photo of one of his products (he does not adopt other's images) and uploaded it in admin, then refreshed the store side page and the image took over the screen, at the time, he did not know better. He does now. Even with his list of image dimensions posted on the wall next to the monitor it doesn't mean it won't happen again, it probably will. But wasn't the reason we humans created these hunks of electronic parts controlled by 1's and 0's to make our lives easier and limit the mistakes? To err is human after all.

For the time being I'll hang back and check for updates from time to time...just let me know if I can help.

I guess, at least, we got rid of the bugs when deleting/copying images and also with the creation of the manufacturer/category/product links...that's something.

Rus

4 Apr 2013, 10:02 PM
#255
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Event Calendar v3

LaCamus:

I think we are in agreement on the major points here. A resizing of all images to a maximum allowable size should be global and built into the core release of Zen Carts. But I don't have access as a developer to the Zen Carts core, I was just doing what I thought was right for this module since I was there working inside the code at the time. My initial reason for being there was because of an error when uploading images using the same name. As I posted in my initial message, I'm looking to help and don't want to step on toes.

As you just stated you "usually set maximums", if that feature was configured into zen through variable settings in the admin menus it would be nice. For those who want to be more hands on set the vars to 0 and no resizing will be done, nice and easy. For those who don't (or are electronically challenged) you snap the photo of your product, upload, done. There would be no need to resize using a 3rd party product (irfanview, paint, etc.)...it just cuts out an exta step. Plus when your resizing in another program the control is all with you, you have to get it right... did you set the right width? height? Was that 800 or 640? Once you set it in zen carts it is done and you don't have to worry about getting it right...every single time.

When the store owner took a photo of one of his products (he does not adopt other's images) and uploaded it in admin, then refreshed the store side page and the image took over the screen, at the time, he did not know better. He does now. Even with his list of image dimensions posted on the wall next to the monitor it doesn't mean it won't happen again, it probably will. But wasn't the reason we humans created these hunks of electronic parts controlled by 1's and 0's to make our lives easier and limit the mistakes? To err is human after all.Nods in agreement with all of this..:yes:

Training should be a means to teach users how to USE an application and not simply a means to prevent issues. Training is not always a good substitute for correcting what might require a usability solution. There are plenty of examples I can site where issue prevention can often easily be built into application functionality.

In my career as a Business Analyst/Project Manager/Solutions Specialist, I find that apps that are HIGHLY configurable can best serve the widest audiences/user groups possible.. Not all shopowners come to the table with the same needs, knowledge, or even skillsets.. Application features need to take into account ALL of these considerations and not simply solve usability issue with more user docs and training..

Not trying to change anyone's mindset.. Folks are free to disagree.. I am just simply contributing my three cents to the conversation..

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.

5 Apr 2013, 6:06 AM
#256
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Event Calendar v3

So I uploaded and tried Rus' code in whole.. I LIKE IT!! The image management features are pretty nice.. That said I have a few issues as follows:

  • Sidebox doesn't work.. Dunno why.. I have it running on a local server and I wonder if that is part of the issue..
  • I cannot link a product or category to an event. When I select a category or product from the dropdowns, they simply revert to the dropdown default. I can link a manufacturer..

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.

5 Apr 2013, 6:22 AM
#257
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Event Calendar v3

DivaVocals:

So I uploaded and tried Rus' code in whole.. I LIKE IT!! The image management features are pretty nice.. That said I have a few issues as follows:

  • Sidebox doesn't work.. Dunno why.. I have it running on a local server and I wonder if that is part of the issue..
  • I cannot link a product or category to an event. When I select a category or product from the dropdowns, they simply revert to the dropdown default. I can link a manufacturer..

Okay confirmed my event sidebox doesn't work.. It looks like it is trying to display the whole site homepage inside the sidebox.. Remind me why again this sidebox is using an iframe to display the events??

http://zentestcart(dot)overthehillweb(dot)com/

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.

5 Apr 2013, 9:02 AM
#258
lacamus avatar

lacamus

New Zenner

Join Date:
Mar 2013
Location:
New Orleans
Posts:
81
Plugin Contributions:
0

Re: Event Calendar v3

DivaVocals:

Okay confirmed my event sidebox doesn't work.. It looks like it is trying to display the whole site homepage inside the sidebox.. Remind me why again this sidebox is using an iframe to display the events??

http://zentestcart(dot)overthehillweb(dot)com/

Real quick:
Is the event sidebox working with the original ec_4_alpha.zip version but not mine?
The select boxes aren't working even after what I sent you?

Is it possible to get admin access to that site? If not can you go to an event in the admin and "view source" and send me a copy?

Thanks,
Rus

5 Apr 2013, 9:07 AM
#259
lacamus avatar

lacamus

New Zenner

Join Date:
Mar 2013
Location:
New Orleans
Posts:
81
Plugin Contributions:
0

Re: Event Calendar v3

DivaVocals:

Okay confirmed my event sidebox doesn't work.. It looks like it is trying to display the whole site homepage inside the sidebox.. Remind me why again this sidebox is using an iframe to display the events??

Also is that version 1.5.1?

5 Apr 2013, 12:11 PM
#260
lacamus avatar

lacamus

New Zenner

Join Date:
Mar 2013
Location:
New Orleans
Posts:
81
Plugin Contributions:
0

Re: Event Calendar v3

DivaVocals:

Okay confirmed my event sidebox doesn't work.. It looks like it is trying to display the whole site homepage inside the sidebox.. Remind me why again this sidebox is using an iframe to display the events??[/URL]

I see why iframes is being used...it is a quick ajax substitute. It works fine for me, but not for you. I went to your page and saw why...it is not pulling the main page in, it is pulling the calendar table for the current month and year, but it is pulling it in with all of the headers, footers and side boxes attached. Again, I am very new to Zen Carts, but based on what I read here (http://www.zen-cart.com/showthread.php?188673-Remove-header-sidebars-etc-when-using-iframe-to-show-EZpages) you may be able to set the page "index.php?main_page=events_calendar_include" up in ezpages and then remove the header/footer/etc. through the ezpage settings. You can also create a separate main page that includes only the center column (require($body_code);) and then add it with ezpages and again use the settings to remove the header/footer/etc.


Just thinking though...hold up...

...did you add the required code to includes/templates/your_template/common/tpl_main_page.php?

The following is required at the beginning of the file:

<?php
  if (isset($_GET['eventmode']) && $_GET['eventmode'] == 'eventframe') {
  $_SESSION['navigation']->remove_current_page();
  require($body_code);
  } else {
?> 

and this is required at the end of the file:

<?php
}
?>

You would need to do this for all of your templates that use the event calendar.

If you added this and it still isn't working please send me a copy of the above file so I can see if some other variable is being used (or possibly none at all).

Rus