Login or create new account.

By registering on joomprod.com, you will have immediate access to all our free products and to the public side of our support forum.

Enjoy our subscriptions.

Each of our subscriptions allow you to enjoy the private side of the support forum and all the update of our products for a period ranging from 3 months to 1 year.

Payment And immediate download.

After subscribing to one of our subscription, the products are immediately downloadable.

Login

Or Register
Accueil / forum / Public Forum / Main Forum / [RESOLVED] Hyperlinks In description (TestArea)

Support Availability Because we must sleep sometimes

Working days: Monday to Friday.
Reply time: Depending on the complexity of your support issue it's usually between a few hours to 48 hours.

Support is only guaranteed to paid subscribers

AdsManager - End of life

It is with great regrets that we have chosen to end the developpement of Adsmanager and its other associated components.

AdsManager is born 10 years ago and, as of today, the number of new subscriptions and downloads have fallen and we cannot maintain the component anymore.

All active subscribers will be able to continue enjoying support until the end of their subscription.

The components will be free and no support will be provided anymore for the other users.

×

Notice

The forum is in read only mode.

× OLD Forum post could be checked here : forum.joomprod.com

[RESOLVED] Hyperlinks In description (TestArea)

More
10 years 6 months ago - 10 years 6 months ago #7216 by ilinear
Hi,

I had read this topic, www.joomprod.com/forum/adsmanager-suppor...cription-fields#1718

and trying to implement this solution.

However, after I copy and paste all the code in field.php, and inserted a hyperlinks in one of my description field (testarea), seems like not working, the outcome just showing a plain text. (example: http:// + www.lexispd.com/Location/Nearby-Attraction?lang= )

For your information , the code I had copy and pasted is show as below:

function array_field($ar, $field) {
$a = array();
foreach($ar as $r) array_push($a, $r[$field]);
return $a;
}
function absolute_url($uri, $external=false, $param=false) {
if(!preg_match("#^https?://#i", $uri)) {
$uri = "http://$uri";
}
return $uri;
}

function htmlize_links($s) {
preg_match_all("#(?!<=\S)(https?://)?(www\.)?[a-z0-9\.\-]+\.(com|org|edu|net|us|gov|uk|name|info|gl)(/\S*)?#i", $s, $matches, PREG_SET_ORDER);
if($matches) {
$links = $this->array_field($matches, 0);
foreach($links as $i => $link) $links[$i] = preg_replace('/[\)\]]+$/', '', $link);
$links = array_unique($links);
foreach($links as $l) {
$url = $this->absolute_url($l);
$link = "<a href='$url' target='_blank'>$l</a>";
$regexp = "|(?!<=\S)".preg_quote($l, '|')."(?=[\s\)])|";
$s = preg_replace($regexp, $link, $s);
}
}
return $s;
}

Please advice.

Thanks for your support.

Best Regards,
Alan
Last edit: 10 years 6 months ago by loic.
The following user(s) said Thank You: adarr
More
10 years 6 months ago #7224 by loic
Hello,

Did you updated the code in helper field.php ?

Please use the code formatting option when posting some code, it made it more readable for us.

Best regards.
The following user(s) said Thank You: adarr
More
10 years 6 months ago #7226 by ilinear
Hi loic,

Thanks for your reply.

I had update the code in components/com_adsmanager/helpers/field.php

Sorry for the inconvenience.

Best regards,
Alan
The following user(s) said Thank You: adarr
More
10 years 6 months ago #7238 by ilinear
Dear loic,

I'm still having the same problem, the link I inserted in description field ( testarea ) still unable auto detect.

just appearing as a plain text.

Please advice.

Thanks and Best Regards,
Alan
The following user(s) said Thank You: adarr
More
10 years 6 months ago #7246 by loic
Hello,

I will make some test tomorrow on this issue.

Please, be aware that this solution is provided by an user and we don't usually do any support on that.

But I will do my best to help you :).

Best regards.
The following user(s) said Thank You: adarr
More
10 years 6 months ago #7248 by ilinear
Hello loic,

Thank you very much.

Appreciating your help and support.

Best Regards,
Alan
The following user(s) said Thank You: adarr
Moderators: perry
Time to create page: 0.132 seconds
Powered by Kunena Forum