Welcome, Guest
Username: Password: Remember me

TOPIC: Problem with the links

Problem with the links 8 years 5 months ago #2803

  • Tim Stöhr
  • Tim Stöhr's Avatar
  • OFFLINE
  • Junior Member
  • Posts: 32
  • Karma: 0
Hi mate,

The links that are in the event description are not taken over (on Munich site). Could you please tell me how to do it again?

I would need people to be able to click on links in the description of the event.

Thanks

Tim
The administrator has disabled public write access.

Problem with the links 8 years 5 months ago #2812

  • Super User
  • Super User's Avatar
  • OFFLINE
  • Administrator
  • Posts: 3519
  • Thank you received: 278
  • Karma: 65
Hello Tim
In file module/mod_jo_facebook_events_pro/tmpl/default.php line 150

echo nl2br($fbevent["description"]);

Please help me changed to

$reg_exUrl = "/((((http|https|ftp|ftps)\:\/\/)|www\.)[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,4}(\/\S*)?)/";
$text = nl2br($fbevent["description"]);
if(preg_match($reg_exUrl, $text, $url)) {
echo preg_replace($reg_exUrl, '<a href="'.$url[0].'" target="_blank">'.$url[0].'</a>', $text);
} else {
echo $text;
}

Best regards
Bach Pham
The administrator has disabled public write access.

Problem with the links 7 years 7 months ago #4044

Hi - thanks for that. I've made that change but the code seems slightly incorrect as it adds a /> to the end of the hyperlink coming from facebook - and all the following text is hyperlinked too.
Any ideas?

Example ..... pasted from the screen.....
For full information click here - www.meetup.com/positivelivingnetworkdublin/events/230796429/ />
• Would you like to be more attentive to your life?
The administrator has disabled public write access.

Problem with the links 7 years 7 months ago #4045

  • Super User
  • Super User's Avatar
  • OFFLINE
  • Administrator
  • Posts: 3519
  • Thank you received: 278
  • Karma: 65
Hello Eoin Scolard
Please help me changed to code below and check it

$text = $fbevent["description"];
$reg_exUrl = "/(http|https|ftp|ftps)\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?/";
preg_match_all($reg_exUrl, $text, $matches);
$usedPatterns = array();
foreach($matches[0] as $pattern){
if(!array_key_exists($pattern, $usedPatterns)){
$usedPatterns[$pattern]=true;
$text = str_replace ($pattern, '<a href="'.$pattern.'" target="_blank">'.$pattern.'</a>', $text);
}
}
echo nl2br($text);

Best regards
Bach Pham
Last Edit: 7 years 7 months ago by Super User.
The administrator has disabled public write access.

Problem with the links 7 years 7 months ago #4046

Thanks so much - what a speedy response! All working perfectly :)

be well
Eoin
The administrator has disabled public write access.

Problem with the links 7 years 7 months ago #4047

  • Super User
  • Super User's Avatar
  • OFFLINE
  • Administrator
  • Posts: 3519
  • Thank you received: 278
  • Karma: 65
Hello Eoin
Thank you for using our products
Best regards
Bach Pham
The administrator has disabled public write access.
Time to create page: 0.059 seconds