Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: A quick mod to re-enable some URLS on 1.4.21 and later  (Read 2140 times)

0 Members and 1 Guest are viewing this topic.

divestoclimb

  • Contributor
  • Coppermine newbie
  • ***
  • Offline Offline
  • Posts: 16
A quick mod to re-enable some URLS on 1.4.21 and later
« on: June 09, 2009, 06:40:54 pm »

I wasn't happy with URL's being disabled in BBcode in 1.4.21 because I was using one in an album description. I have a pretty good idea what the problem is but if I'm right it's only an issue when decoding user-submitted BBcode. I made a small modification so my album descriptions can still have URL's in them but users can't post URL's in their own descriptions or comments.

In include/functions.inc.php where the original line was commented out, I modified the function header for bb_decode:
Code: [Select]
function bb_decode($text, $decodelinks = false)
...then I put this block in place of the changed code:
Code: [Select]
if($decodelinks) {
    $bbcode_tpl['url']  = '<span class="bblink"><a href="{URL}" rel="external">{DESCRIPTION}</a></span>';
} else {
            $url_removed = '{URL}';  // put the image URL in the tooltip/mouse-over
    $bbcode_tpl['url']   = '{DESCRIPTION}<img src="images/descending.gif" alt="" title="' . $url_removed . '" />';
}
...then changed the line in index.php that prepares the album description (line 536 in v1.4.24):
Code: [Select]
            $alb_list[$alb_idx]['album_desc'] = bb_decode($alb_thumb['description'], true);

I hope this helps somebody else.
Logged

Ludo

  • Contributor
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 706
    • E+GiElle
Logged
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 19 queries.