Hello,
First let me thank you for the job you did on the events calendar...thanks!
I installed your ec_4_alpha.zip with zen cart v1.5.1 (LAMP Centos 6.4 x86_64), and it appears to be working fine. I ran into some problems, (probably old ones or zen cart 1.5.1 induced) and made some changes to a few of the programs. I am just getting involved with zen carts and if I'm stepping on toes or am not following protocol I apologize...I just figured that the changes I made could help someone somewhere.
If you are looking to see what I cut/changed/added then look for remarks in the php files with the word "rus" in them.
First I made 2 changes to:
.../your_www/includes/templates/your_template/templates/tpl_events_calendar_default.php
1) I altered the view all_events query to not look at H:i:s: since the dates when written to the events table had no time. This defaults the times to midnight (00:00:00) which means you would never see events that ended today (because your current date & time would always be greater, unless you clicked exactly at midnight).
2) Put in a simple change to not create html code for an event image if none existed in the db events table.
-------------
Next I made a number of changes to the following programs:
.../your_www/your_zen_admin/events_manager.php
.../your_www/your_zen_admin/includes/events_manager_drop_dns.php
1) I noticed that any file type could be uploaded when attaching images. If a client doesn't know what they are doing and they upload certain file types that could be a security risk. So I check for jpg, jpeg, gif, and png and if the file is not any of these it shows an error.
2) When you go to review an added event the file appears to be written regardless of which error flag is set. The only way to easily (without chasing down the code) avoid writing the image would be to blank the _POST image variable and reload the script. To avoid that I put in a workaround that deletes the file at the end of the script if an error was flagged.
3) I put in a define (EVENT_FILE_MAX_WIDTH) at the beginning of events_manager.php (it is currently set to 600) that is used to check against the width of the uploaded file, if it is greater then the image is reduced to 600 px wide...height is proportionate.
4) In my scenario I could think of no good reason not to overwrite an existing file. Perhaps it would have been better to use a popup and ask to overwrite the image...instead I just check for the old, remove it and save the new. This means any pre-existing event that used the old image will now use the new image.
5) changed FILENAME_DEFAULT_CATALOG to reflect "index" instead of "index.php" when creating links to manufacturers/categories/products. This may be a zen 1.5.1 thing that was missed.
6) I was having an issue with the manufacturer always overriding the categories and products when ceating a shop link. I added some javascript changes and a new manufacturer select box option ("No Manufacturer") that will remove the shop link. Perhaps a checkbox in the future would be cleaner, this works, a little ugly...for instance to remove a category or product shop link you have to select a manufacturer first then select "No Manufacturer" to remove the link.
7) Since the manufacturer isn't saved to the db event table I pull the manufacturer id from the shop link so that the correct manufacturer remains highlighted ("selected") in the select box. I may eventually do this for categories and products but it would require not using zen cart's "box" class and I hadn't researched it enough (yet) to know what kind of dependencies I might be affecting.
8) On a parsing error when file is uploaded no error was being reported, it does now.
9) The manufacturer created links would open a new tab, categories and products would not, now they all act the same way (by opening a new tab).
-------------
Finally I added:
.../your_www/your_zen_admin/includes/classes/image_manipulator.php
This is Phil Brown's image manipulator class (
https://gist.github.com/philBrown/880506) used to resize uploaded images.
-------------
Zip is attached.
ec_4_alpha_rus_alpha.zip
After installing ec_4_alpha.zip from previous message just put the 4 files in the appropriate directories.
Thanks again and I hope this helps,
Rus Camus