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: Supporting non http:// links such as magnet, edonkey, ..  (Read 3021 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.017 seconds with 20 queries.