Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

URL button in Forum Threads

Asked Modified Viewed 1,630 times
E
eskindian
E
  • Junior Member, joined since
  • Contributed 22 posts on the community forums.
  • Started 7 threads in the forums
  • Started this discussions
asked
Junior Member

I have been trying all day to figure out how to change the URL button in the Forum Thread text editor. What I would like to do is when someone posts a URL in a forum thread that it will convert to a Text Link like "Link" or "Click Me!". It currently does this in the Shoutbox and FAQ sections. The reason why I'd like to do this is to reduce the lengthy urls that are sometimes posted.

I currently run PHP Version 5.2.1 and PHPFusion 6.01.

Thank you all in advance.

-Carla

http://portal.thepatternofeverything.org
Edited by eskindian on 03-01-2008 22:16,
0 replies

2 posts

D
DubSev
D
DubSev 10
......................................
let's go f***ing mental! la la la la...
  • Senior Member, joined since
  • Contributed 285 posts on the community forums.
  • Started 5 threads in the forums
answered
Senior Member

You could try and edit maincore.php


$text =  reg_replace('#\[url\]([\r\n]*)(http://|ftp://|https://|ftps://)([^\s\'\";\+]*?)([\r\n]*)\[/url\]#si', '<a href=\'\2\3\' target=\'_blank\'>[color=#ff0000]\2\3[/color]</a>', $text);
$text = preg_replace('#\[url\]([\r\n]*)([^\s\'\";\+]*?)([\r\n]*)\[/url\]#si', '<a href=\'http://\2\' target=\'_blank\'>[color=#ff0000]\2[/color]</a>', $text);


in the first line replace the LAST \2\3, in the second line replace \2

IF working (no warranty whatsoever) this would affect ALL url's put in bbcode, except those which are in the url= bbcode, if you get what I mean
0 replies
— 1 month later —
B
Bombastic
B
  • Member, joined since
  • Contributed 67 posts on the community forums.
  • Started 7 threads in the forums
answered
Member

W7daEikel,

That was really helpful and just what I was looking for, thanks. I fiddled around with it and (As you will know) you can make it bold, italicised or a different colour also if you wanted. (I've just made mine bold)

si', '<a href=\'\2\3\' target=\'_blank\'>[color=#cc0033]<b>LINK</b>[/color]</a>', $text);
   $text = preg_replace('#\[url\]([\r\n]*)([^\s\'\";\+]*?)([\r\n]*)\[/url\]#si', '<a href=\'http://\2\' target=\'_blank\'>[color=#cc0000]<b>LINK</b>[/color]</a>', $text);
0 replies

Labels

None yet

Statistics

  • Views 0 views
  • Posts 2 posts
  • Votes 0 votes
  • Topic users 3 members

0 participants

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet