Custom Yahoo Calendar URL for localization

  • hide10
  • Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
3 years 2 months ago #141153 by hide10
Hello,

When I click on the "Save to ... Yahoo Calendar" button, it redirects me to "calendar.yahoo.com".
However, I need it to be "calendar.yahoo.co.jp".

I guess I need to edit /components/com_eventbooking/helper/html.php

But the modification will be lost when the component is updated.
Is it possible to create override file?

Thanks.

Please Log in or Create an account to join the conversation.

  • hide10
  • Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
3 years 2 months ago #141155 by hide10
Replied by hide10 on topic Custom Yahoo Calendar URL for localization
Hello again,

Actually, it would be nicer if it becomes language string.

That way, I can edit language string like
"calendar.yahoo.com" for English
"calendar.yahoo.xx" for other language

Just a thought.
Thanks.

Please Log in or Create an account to join the conversation.

  • hide10
  • Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
3 years 1 month ago #141224 by hide10
Replied by hide10 on topic Custom Yahoo Calendar URL for localization
Hello,

There is no way other than editing the following file?
/components/com_eventbooking/helper/html.php

Just want to make sure.
Thanks.

Please Log in or Create an account to join the conversation.

More
3 years 1 month ago #141239 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Custom Yahoo Calendar URL for localization
Hello

Better edit code in the file components/com_eventbooking/themes/default/common/save_calendar.php and move that modified file to PATH_TO_TEMPLATE/html/com_eventbooking/common folder so that the change won't be lost when you update to future releases of the extension

Tuan

Please Log in or Create an account to join the conversation.

More
3 years 1 month ago #141240 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Custom Yahoo Calendar URL for localization
To avoid changing the whole code, I would suggest you to use str_replace function to replace URL instead of re-write the whole code:

For example, change:
Code:
echo EventbookingHelperHtml::getAddToGoogleCalendarUrl($item);

To
Code:
echo str_replace('calendar.yahoo.com', 'calendar.yahoo.co.jp', EventbookingHelperHtml::getAddToGoogleCalendarUrl($item));

Hope this helps

Tuan

Please Log in or Create an account to join the conversation.

  • hide10
  • Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
3 years 1 month ago #141284 by hide10
Replied by hide10 on topic Custom Yahoo Calendar URL for localization
Hello Tuan,

Thank you! It was a great help.

I created a new language string EB_YAHOO_URL.
Then edited the override file of save_calendar.php as below:
Code:
echo str_replace('calendar.yahoo.com', JText::_('EB_YAHOO_URL'), EventbookingHelperHtml::getAddToYahooCalendarUrl($item));

It works according to the selected language.
Thanks.

Please Log in or Create an account to join the conversation.

More
3 years 1 month ago #141285 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Custom Yahoo Calendar URL for localization
Ah, OK. That's a good solution

Tuan

Please Log in or Create an account to join the conversation.