Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Supporting non http:// links such as magnet, edonkey, ..  (Read 3029 times)

0 Members and 1 Guest are viewing this topic.

Chribu

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Supporting non http:// links such as magnet, edonkey, ..
« on: February 09, 2005, 02:28:41 am »

I'd like to upload screenshots of videos with the relative p2p download link, such as:
magnet:?xt=urn:tree:tiger:HROOEAT4TKPVS227BFB5VUNYKNAUPKJFKZ46LMQ&dn=Myhomevideo1.avi
but if i put it as [ url=magnet:?xt=urn:tree:tiger:HROOEAT4TKPVS227BFB5VUNYKNAUPKJFKZ46LMQ&dn=Myhomevideo1.avi ]link[/url] i get a link pointing to http://magnet:?xt=urn:tree:tiger:HROOEAT4TKPVS227BFB5VUNYKNAUPKJFKZ46LMQ&dn=Myhomevideo1.avi

The easiest thing to have would be forcing one of the custom fields to show its content as a link
e.g. i add custom field hash, in there i can just type magnet:?xt=urn:tree:tiger:HROOEAT4TKPVS227BFB5VUNYKNAUPKJFKZ46LMQ&dn=Myhomevideo1.avi and it automatically comes printed as a link.
Would it be simple to do just changing something in the code?
Any suggestions?

Thanks in advance
Chribu
Logged

Chribu

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: Supporting non http:// links such as magnet, edonkey, ..
« Reply #1 on: February 12, 2005, 06:32:51 pm »

kinda solved by modifying
/include/functions.inc.php

and changing lines

            // $bbcode_tpl['url2'] = str_replace('{URL}', 'http://\\1', $bbcode_tpl['url']);
               // $bbcode_tpl['url2'] = str_replace('{DESCRIPTION}', '\\1', $bbcode_tpl['url2']);
      $bbcode_tpl['url2'] = str_replace('{URL}', 'magnet:?xt=urn:tree:tiger:\\1', $bbcode_tpl['url']);
               $bbcode_tpl['url2'] = str_replace('{DESCRIPTION}', '\\1', $bbcode_tpl['url2']);
           //     $patterns[2] = "#\[url\]([a-z0-9\-\.,\?!%\*_\#:;~\\&$@\/=\+\(\)]+)\[/url\]#si";
           //     $replacements[2] = $bbcode_tpl['url2'];
                $patterns[2] = "#\[cf\]([A-Z0-9]+)\[cf\]#si";
                $replacements[2] = $bbcode_tpl['url2'];

i'm no good at php but it works a bit.
Logged
Pages: [1]   Go Up
 

Page created in 0.014 seconds with 20 queries.