Buy Now
Sign in

BBCode - URL bug (Fixed)

warriorgov79 , November 01 2008, 13:57
W
warriorgov79 34
November 01 2008, 13:57 #16370
Just installed ChronoComments on my Joomla 1.5.7 sandbox site - love it! I have a problem, however, with URLs not pointing to the correct link.

Link: http://sandbox.farringtonhighschool.org/the-news/1-welcome-to-joomla.html#commentID1

I'm not well-versed in PHP, just basic HTML/CSS and Joomla 1.0.x; but good at following instructions and copying/pasting. Any help for a Chrono noob is deeply appreciated. Aloha!

Edit: Firebug reveals "http" protocol is missing in href attribute of anchor tags.

<a target="_blank" rel="nofollow" href="/farringtonhighschool.org">farringtonhighschool.org</a>
<a target="_blank" rel="nofollow" href="/farringtonhighschool.org">Link to main website</a>
admin 32
November 01 2008, 22:59 #16390
Hi warriorgov79,

What do you enter as a URL so the problem occurs ?

Cheers
Max
W
warriorgov79 34
November 01 2008, 23:27 #16401
Hi Max,

Just mydomain.com for both links. I tried adding the http protocol, but I end up getting broken open tags. Adding quotes around the url makes it worse. "Convert to HTML" is turned on in the backend.

I've been away from forums and haven't used BBcode in quite a while, but I believe I have it constructed properly? Please advise. Thanks for your help.

[ url ]mydomain.com[ /url ]
[ url=mydomain.com ]Link to main site[ /url ]
admin 32
November 02 2008, 08:46 #16411
Hi, see if you have this option enabled at the parameters: Convert URLs

if its enabled please disable it and retry, I think there is some conflict and should be fixed!

Max
W
warriorgov79 34
November 02 2008, 11:24 #16423
Thanks for working with me on this...

Turned off Convert URLs in parameters and Joomla SEF, Apache mod-rewrite & Add Suffix to URLs in backend global config. Posted another test comment. Same result. SandboxURL.com/pointingdomain.com appears in the status bar when I hover over the links. Clicking on the links return Page Not Found errors.

Aloha,
warriorgov79
W
warriorgov79 34
November 02 2008, 12:00 #16425
Hi Max,

Follow-up test made on Chrono demo page. Same result. My posts are on comments page 12.

Aloha,
warriorgov79
admin 32
November 02 2008, 20:30 #16436
Hi, try this in your comment:



FORUM POST


what do you get ?
W
warriorgov79 34
November 03 2008, 02:54 #16446
Hi Max,

Prior to your latest post, I was hoping the following fix would work:

In "$htmlcode = array" of /components/com_chronocomments/chronocomments.php Change the following lines:
"<a href=\"$1\" rel=\"nofollow\" target=\"_blank\">$2</a>",
"<a href=\"$1\" rel=\"nofollow\" target=\"_blank\">$1</a>",

to
"<a href=\"http://$1\" rel=\"nofollow\" target=\"_blank\">$2</a>",
"<a href=\"http://$1\" rel=\"nofollow\" target=\"_blank\">$1</a>",


Same could be done for /modules/mod_chronomments/helper.php. It worked only temporarily. If page is refreshed, links revert back to original problem.

I edited previous comments in backend, your solution works great! Still, links break if Convert URLs is turned on. Will leave it off. Would like to find a permanent fix since most of my visitors will tend to enter a URL without the http protocol.

Thanks again!

Aloha,
warriorgov79
admin 32
November 03 2008, 13:10 #16462
Hi warriorgov79,

you can put here some combinations which fails at your site and I will test and fix them all and put a patch when ready!

Regards,
Max
W
warriorgov79 34
November 12 2008, 01:09 #16932
"admin":
Hi warriorgov79,

you can put here some combinations which fails at your site and I will test and fix them all and put a patch when ready!

Regards,
Max

Hi Max,

Found the third file to edit. It's /plugins/content/ChronoComments.php . Apply fix to all 3 files and it should work. Just need to edit the alt tag for the URL button and I think you can remove the javascript warning for improper URL. Tested only with Convert URLs off.

Aloha,
warriorgov79
admin 32
November 12 2008, 11:32 #16949
great news!

Regards,
Max
W
warriorgov79 34
November 12 2008, 12:49 #16967
Even better news... I got it working with Convert URLs on! Users just need to add the "http" prefix to any URL entered without the BBCode. 8)

(Edit) To everyone applying this fix: it will break links in previous comments if "http" prefix was entered in BBCode. URLs may need to be edited manually in backend.

Aloha, warriorgov79 out!