Contribute to JEvents

Importing iCal URLs

We are looking for developers, forum moderators and translators for this project.

If you would like to help out then please add a message in this forum.

Postby Celos » Tue Sep 11, 2012 10:15 am

Currently, imported events with URLs are saved as html entities (ie. <a href="URL">URL</a>) in the database. This seems very weird to me. Wouldn't it be much more prudent to save the data (ie. the URL) in the database and then build the link as requested on the front end? This would greatly increase compatibility with other components and also allow us to modify the link text as well.

On the importing side, the issue is with line 347 of the iCalImport.php file:
Code: Select all
$value = preg_replace('@(https?://([w-.]+)+(:d+)?(/([w/_.]*(?S+)?)?)?)@', '<a href="$1">$1</a>', $value);
Celos
 
Posts: 4
Joined: Fri Aug 31, 2012 12:36 pm

Postby Tonyp » Wed Sep 12, 2012 11:00 pm

Why would it cause issues? Do you mean when exporting into other calendar apps?

As it would technically require one less routine every time the page is loaded, this way it just outputs what's called rather than calling, preging then outputting.

Regards
Tiny
---------------------------------------
Feel free to PM me if you would like Custom Installs or Joomla! related work for a competitive quote.

User avatar
Tonyp
Team Staff
 
Posts: 23834
Joined: Tue Oct 12, 2010 9:12 pm
Location: Isle of Man

Postby Celos » Mon Sep 17, 2012 5:19 pm

You need to get the URL from the DB anyway, so there is no difference between something like
Code: Select all
print $URL
and
Code: Select all
print '<a href="'.$URL.'"'>'.$URL.'</a>'
I'm not sure where preging comes into it.

This doesn't really create issues when showing the URL, but the other way would allow for more customizing in the templates. For example, showing text instead of the URL, like:
Code: Select all
'<a href="'.$URL.'"'>This is a link!</a>'


In my case, I'm using jEvents to manage multiple sources and need to have some of those sources redirect to their specific components. Without altering the above mentioned line, I could only get very ugly listings (full URLs instead of linked titles for example).
Celos
 
Posts: 4
Joined: Fri Aug 31, 2012 12:36 pm

Postby carcam » Tue Sep 18, 2012 5:33 am

Hi Celos,
if I'm not too wrong, the pregging is to ensure that we get always full urls as for 99% ical imports, the URL will not be an internal link, but an external link. The point is that if you take a look at JEvents fields out of the box, there is no specific field for a link, so these URLs are stored in the extra info or the contact link (cannot remember exactly) field of the database. Storing it as a full HTML link makes them to be shown exactly as a link, otherwise they will be presented as simple text.
¿Sabías que tenemos soporte en español para los miembros del Club de JEvents? ¡ÚNETE AHORA!
User avatar
carcam
Team Staff
 
Posts: 7114
Joined: Wed Aug 06, 2008 7:50 pm
Location: Almería

Postby Celos » Tue Sep 18, 2012 7:31 am

The URL is saved under "#__jevents_vevdetail" in the field "url", so it definitely has it's own field in the DB.
Celos
 
Posts: 4
Joined: Fri Aug 31, 2012 12:36 pm

Postby carcam » Fri Sep 21, 2012 6:31 am

You are right, but it's not possible to edit that field from the event editor, although it's present in the layout defaults so I guess it has something to do with it.

Probably Geraint can give you a better answer.
¿Sabías que tenemos soporte en español para los miembros del Club de JEvents? ¡ÚNETE AHORA!
User avatar
carcam
Team Staff
 
Posts: 7114
Joined: Wed Aug 06, 2008 7:50 pm
Location: Almería

Postby Geraint » Fri Sep 21, 2012 8:51 am

If this is important to you then change line 345 to read
Code: Select all
if (is_string($value) && $key!="UID" && $key!="URL"){
and keep a note of it for when you upgrade JEvents
JEvents Club members can get priority forum support at the Support Forum. As well as access to a variety of custom JEvents addons and benefits. Join the JEvents club today!
User avatar
Geraint
 
Posts: 42850
Joined: Fri Feb 15, 2008 6:14 pm

Postby Celos » Wed Oct 31, 2012 5:08 pm

Sorry for picking up an old subject, but I was unable to check back for a while.

It's not that much of an issue for me personally. I was already using a plugin to handle importing the ical files and I just changed it to also strip out the HTML around the URL (so as not to have an extra step to do every time I update something).

I'm just wondering if there's any specific reason to doing things this way? I'll give you a use case that made me aware of the issue:

Using multiple event components. For my client it's CiviCRM (a CRM targeted for civic-sector organisations) and jEvents. Since jEvents already has such well built front-end options, it's very tempting to use it to publish the CiviCRM events as well (since it itself has very few). However if you want to import the event to show on calendars and search results (but show the actual event info in the other component with it's registration etc fields), the only option available for templating is {{Title:TITLE}} - {{URL:URL}} or something of the like, resulting in ugly URLs.

Obviously it's not the concern of jEvents to handle these kinds of situations, but it'd be nice to have the freedom to be able to do that.
Celos
 
Posts: 4
Joined: Fri Aug 31, 2012 12:36 pm

Postby Geraint » Thu Nov 01, 2012 8:58 am

With the club addons we import events from jomsocial and community builder using a special script that allows auto redirection to the source system from the event details. This would be a good option with CiviCRM too.

Creating a content plugin to redirect to the CiviCRM event detail page should be fairly straightforward.
JEvents Club members can get priority forum support at the Support Forum. As well as access to a variety of custom JEvents addons and benefits. Join the JEvents club today!
User avatar
Geraint
 
Posts: 42850
Joined: Fri Feb 15, 2008 6:14 pm

Postby WORDtransfast » Thu Jan 10, 2013 12:56 pm

It's really nice tips of iCal URL's. This discussion some of point is very useful for me thanks for sharing
WORDtransfast
 
Posts: 3
Joined: Wed Dec 05, 2012 2:18 pm


Return to Contribute to JEvents

  • Who is online
  • View new posts
  • View unanswered posts
  • In total there are 0 users online :: 0 registered and 0 hidden (based on users active over the past 5 minutes)
  • Most users ever online was 94 on Tue Sep 01, 2009 12:33 am
  • Users browsing this forum: No registered users