Welcome, Guest. Please Login or Register.
April 27, 2025, 05:43:43 PM
Home Help Search Log in Register
News: SMF is the next generation in forum software, almost completely re-written from the ground up, make sure you don't fall for cheap imitations that suffer from feature bloat!

YaBB SE Community  |  German User Help  |  Hilfe zu YaBB SE  |  "http://" nicht vor jeden link hinzufügen ? « previous next »
Pages: [1] Reply Ignore Print
Author Topic: "http://" nicht vor jeden link hinzufügen ?  (Read 413 times)
VB
Noobie
*
Posts: 3


I'm a llama!

"http://" nicht vor jeden link hinzufügen ?
« on: September 08, 2002, 09:50:36 AM »
Reply with quote

hi

ich habe zZ ein Problem, und zwar fügt das Boardsystem ja vor jeden link http:// hinzu. Aber eben auch bei anderen links, die gar keine www Addresse sind. zB ed2k:// oder irc:// etc.

Das schaut dann nachher so aus http://irc:// ...

Das funktioniert natürlich nicht so ganz ;)

Wie kann ich das umgehen ?

Danke

bye
Logged
Horseman
YaBB God
*****
Posts: 784


'MAS VALE CABALLO QUE CAUDAL!'

ICQ - 44729151 WWW
Re:"http://" nicht vor jeden link hinzufügen ?
« Reply #1 on: September 08, 2002, 10:13:53 AM »
Reply with quote

die umwandlungen des bbcode werden in der datei:

ssources/subs.php

vorgenommen.

wenn du also die wandlung von http:// und/oder  ftp:// nicht haben möchstest, müssen diese routinen entfernt (ausdokumentiert) werden.

Logged
VB
Noobie
*
Posts: 3


I'm a llama!

Re:"http://" nicht vor jeden link hinzufügen ?
« Reply #2 on: September 11, 2002, 12:51:50 PM »
Reply with quote

hi

ich denke mal der teil hier ist gemeint:

   // Now the [url]'s

   while (preg_match("/\[url\](.+?)\[\/url\]/si", $message, $matches)) {

      $searchfor = $matches[1];
      $replace = $searchfor;
      $replace = trim($replace);   // remove all leading and trailing whitespaces
      if (!stristr($replace,"http://")) {
         if (!stristr($replace,"https://")) {
            $replace = "http://".$replace;
         } else {
            $replace = stristr($replace,"https://");
         }
      } else {
         $replace = stristr($replace,"http://");
      }
      $message = str_replace("[url]".$searchfor."[/url]","{url=".$replace."]".$matches[1]."{/url}",$message);
        $message = str_replace("[URL]".$searchfor."[/URL]","{URL=".$replace."]".$matches[1]."{/URL}",$message);

 }

   $message = str_replace("{url=","[url=",$message);
   $message = str_replace("{/url}","[/url]",$message);
    $message = str_replace("{URL=","[URL=",$message);
   $message = str_replace("{/URL}","[/URL]",$message);

   while (preg_match("/\[url=(.+?)\](.+?)\[\/url\]/si", $message, $matches)) {

      $searchfor = $matches[1];
      $replace = $searchfor;
      $replace = trim($replace);   // remove all leading and trailing whitespaces
      if (!stristr($replace,"http://")) {
         if (!stristr($replace,"https://")) {
            $replace = "http://".$replace;
         } else {
            $replace = stristr($replace,"https://");
         }
      } else {
         $replace = stristr($replace,"http://");
      }
      $message = str_replace("[url=".$searchfor."]".$matches[2]."[/url]","{url=".$replace."]".$matches[2]."{/url}",$message);
        $message = str_replace("[URL=".$searchfor."]".$matches[2]."[/URL]","{URL=".$replace."]".$matches[2]."{/URL}",$message);

   }

   $message = str_replace("{url=","[url=",$message);
   $message = str_replace("{/url}","[/url]",$message);
    $message = str_replace("{URL=","[URL=",$message);
   $message = str_replace("{/URL}","[/URL]",$message);

richtig ?

Was genau muss ich da jetzt ausdokumentieren ? Alles ?

Danke :)

bye
Logged
Horseman
YaBB God
*****
Posts: 784


'MAS VALE CABALLO QUE CAUDAL!'

ICQ - 44729151 WWW
Re:"http://" nicht vor jeden link hinzufügen ?
« Reply #3 on: September 17, 2002, 10:18:01 AM »
Reply with quote

in der original subs.php beginnt der code bei der zeile 475 - 483 und noch einmal bei 499 - 507

diese solltest du mit /* (beginn) und */ (ende) ausdokumentieren
suche also diese codeabschnitte und dokumentiere sie aus, wie unten gemacht:

      /*if (!stristr($replace,"http://")) {
         if (!stristr($replace,"https://")) {
            $replace = "http://".$replace;
         } else {
            $replace = stristr($replace,"https://");
         }
      } else {
         $replace = stristr($replace,"http://");
      } */
[
« Last Edit: September 17, 2002, 10:19:45 AM by Horseman » Logged
Pages: [1] Reply Ignore Print 
YaBB SE Community  |  German User Help  |  Hilfe zu YaBB SE  |  "http://" nicht vor jeden link hinzufügen ? « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.028 seconds with 16 queries.