Elxis CMS Forum

Extensions => Components => Topic started by: CREATIVE Options on October 02, 2010, 10:10:14

Title: EventCalendar [SOLVED]
Post by: CREATIVE Options on October 02, 2010, 10:10:14
I have this 2 errors:

Code: [Select]
mysql Error [1054] : EXECUTE
URI: index.php?option=com_eventcalendar&catid=40+66+67+70&year=2010&month=10&task=dayview&day=14&Itemid=0
Message: Unknown column 'e.language' in 'where clause'
SELECT e.id, e.start_date, e.end_date FROM elx_eventcalendar e LEFT JOIN elx_categories c ON c.id = e.catid WHERE e.published = '1' AND c.published = '1' AND c.access IN (19,20,21,18,29,24,23,25,30) AND ( (e.language IS NULL) OR (e.language LIKE '%english%') ) AND ( (c.language IS NULL) OR (c.language LIKE '%english%') ) ORDER BY e.start_date ASC
PHP Error [Warning]
URI: index.php?option=com_eventcalendar&catid=40+66+67+70&year=2010&month=10&task=dayview&day=14&Itemid=0
Path: 2011/components/com_eventcalendar/eventcalendar.php
Line: 747
Invalid argument supplied for foreach()

Elxis 2009.2
EventCalendar 1.1

Thanks.
Title: Re: EventCalendar
Post by: apkoutsou on October 02, 2010, 12:28:04
It seems that no language column is created inside event calendar table (in database)... So it is one bug, affecting the following foreach statement...

Was it a new installation or an update ?
Title: Re: EventCalendar
Post by: CREATIVE Options on October 02, 2010, 13:03:37
New :(
Title: Re: EventCalendar
Post by: CREATIVE Options on October 02, 2010, 13:05:23
hm... a flash idea!!!
The installation is new, but with the old database...

I will see the upgrade for the DB.

Thanks for the brainstorming!
Title: Re: EventCalendar [SOLVED]
Post by: apkoutsou on October 02, 2010, 15:40:13
Wait! What did you mean with "the upgrade for the DB"...??

You did a fresh installation of EventCalendar 1.1 and it produced that error, but when you upgraded the database the error was fixed ?? That is strange 'cause the schema file used to create event calendar table includes the 'language' column...

Please answer me - I want to see if there is something wrong...
Title: Re: EventCalendar [SOLVED]
Post by: CREATIVE Options on October 02, 2010, 18:13:52
I just alter the table with the missing data.
Code: [Select]
ALTER TABLE `elx_eventcalendar` ADD `language` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT 'english' AFTER `seotitle`
Title: Re: EventCalendar [SOLVED]
Post by: datahell on October 02, 2010, 21:38:56
"language" field better have NULL as the default value. "NULL" is translated by Elxis as "available for all languages".
Quote
ALTER TABLE `elx_eventcalendar` ADD COLUMN `language` VARCHAR( 255 ) DEFAULT NULL AFTER `seotitle`
Title: Re: EventCalendar [SOLVED]
Post by: CREATIVE Options on October 02, 2010, 21:42:33
Thanks, I will change it.
Title: Re: EventCalendar [SOLVED]
Post by: CREATIVE Options on October 02, 2010, 22:47:21
Oh something more:

at eventcalendar.html.php
line 542 - 544
Code: [Select]
                    <b><?php echo $objEventCalendar->lng->EDT_START ?>:</b> <?php echo date($objEventCalendar->params[&#39;com&#39;]->get(&#39;date_format&#39;, &#39;d-m-Y&#39;), strtotime($event->start_date)) ?> και ώρα <?php echo date("H:i:s"strtotime($event->start_date)) ?>
                    <br/>
                    <b><?php echo $objEventCalendar->lng->EDT_END ?>:</b> <?php echo date($objEventCalendar->params[&#39;com&#39;]->get(&#39;date_format&#39;, &#39;d-m-Y&#39;), strtotime($event->end_date)) ?> και ώρα <?php echo date("H:i:s"strtotime($event->end_date)) ?>
their are 2 times: "και ώρα" in hard code
i suggest to be load it via the language file.
Title: Re: EventCalendar [SOLVED]
Post by: babis1 on September 28, 2011, 15:55:15
i dont know if the problem solved with the words και ωρα in eventcalendar.html.php code, i make some changes (i havent used that com before) i put 2 lines in each files languages, for greek 
public $EDT_SHOUR = 'και ώρα';
public $EDT_EHOUR = 'και ώρα';
and for english file
public $EDT_SHOUR = 'at';
  public $EDT_EHOUR = 'at';

after i change the code in eventcalendar.html.php at line 542

 <b><?php echo $objEventCalendar->lng->EDT_START ?>:</b> <?php echo date($objEventCalendar->params['com']->get('date_format', 'd-m-Y'), strtotime($event->start_date)) ?> <?php echo $objEventCalendar->lng->EDT_SHOUR ?> <?php echo date("H:i:s", strtotime($event->start_date)) ?>

and at line 544

   <b><?php echo $objEventCalendar->lng->EDT_END ?>:</b> <?php echo date($objEventCalendar->params['com']->get('date_format', 'd-m-Y'), strtotime($event->end_date)) ?> <?php echo $objEventCalendar->lng->EDT_EHOUR ?> <?php echo date("H:i:s", strtotime($event->end_date)) ?>

also at line 543 the tag <br/> must change in <br />

for me work fine but if someone who use the com can check this and confirm it it will be nice
Title: Re: EventCalendar [SOLVED]
Post by: bully on February 03, 2012, 17:20:42
i dont know if the problem solved with the words και ωρα in eventcalendar.html.php code, i make some changes (i havent used that com before) i put 2 lines in each files languages, for greek 
public $EDT_SHOUR = 'και ώρα';
public $EDT_EHOUR = 'και ώρα';
and for english file
public $EDT_SHOUR = 'at';
  public $EDT_EHOUR = 'at';

after i change the code in eventcalendar.html.php at line 542

 <b><?php echo $objEventCalendar->lng->EDT_START ?>:</b> <?php echo date($objEventCalendar->params['com']->get('date_format', 'd-m-Y'), strtotime($event->start_date)) ?> <?php echo $objEventCalendar->lng->EDT_SHOUR ?> <?php echo date("H:i:s", strtotime($event->start_date)) ?>

and at line 544

   <b><?php echo $objEventCalendar->lng->EDT_END ?>:</b> <?php echo date($objEventCalendar->params['com']->get('date_format', 'd-m-Y'), strtotime($event->end_date)) ?> <?php echo $objEventCalendar->lng->EDT_EHOUR ?> <?php echo date("H:i:s", strtotime($event->end_date)) ?>

also at line 543 the tag <br/> must change in <br />

for me work fine but if someone who use the com can check this and confirm it it will be nice

Hello Habis, followed your instructions by the letter and it worked. It's a nice module and still some minor bits could be fixed. Maybe you have an idea - on how to approach.

1 issue: On weekly repeating event, at least Saturday and Sunday are mixed up (it is affecting only the display)
2 issue: We are located in Vietnam - no problem, despite all set to English, all public and private displayed calendar Items appear in Vietnamese, that is a bit of the bigger one.

Maybe you can assist on this matter?. My assumption is, it can be done like the  'και ώρα' thing, I am however to blind for that.

Even If you can't/wont, many thanks, as that was already  a big lot.
Title: Re: EventCalendar [SOLVED]
Post by: apkoutsou on February 29, 2012, 09:51:36
1. There is a known bug with the weekly display, that I'm going to fix with the next release (the beta version I have just released still does not solve this, but the final version will).

2. EventCalendar's language files extends the global Elxis admin language class. This is done for two reasons: first this is the built in way Elxis handles component's language file (if you place the language file inside the /administrator/language/[$alang] directory Elxis administration will automatically load it and component's language variables will be available through the $adminLanguage object, sparing the resources of a separate object) and second you do not have to write again some very common language variables.

The disadvantage is that if you do not have the language file that matches your administration language, the default english file will be load, but the common language variables will be displayed in the administration language.

This is a problem that most OSS projects have: incomplete translation. Please do translate the components you use to your language. This is the best way anyone can participate in OSS projects if he is not skilled to code.