Seite 4 von 4

Verfasst: 25.06.2005 17:51
von Max
hmmmm.


hier mal einige neue Ideen, natürlich auch wieder ohne Garantie auf Funktion ;)

1.)

Code: Alles auswählen

öffne includes/bbcode.php 

suche: 

// [img]image_url_here[/img] code.. 
      $text = preg_replace("#\[img\]((http|ftp|https|ftps)://)([^ \?&=\#\"\n\r\t<]*?)\[/img\]#sie", "'[img:$uid]\\1' . str_replace(' ', '%20', '\\3') . '[/img:$uid]'", $text); 


ersetze es durch: 

  // [img]image_url_here[/img] code.. 
  if (substr_count( $text, $_SERVER["SERVER_NAME"]) && substr_count( $text, "modules/mx_smartor/album.php")) 
  { 
    $text = preg_replace("#\[img\]((ht|f)tp://)([^\r\n\t<\"]*?)\[/img\]#sie", "'[img:$uid]\\1' . str_replace(' ', '%20', '\\3') . '[/img:$uid]'", $text); 
  } 
  else 
  { 
    $text = preg_replace("#\[img\]((ht|f)tp://)([^ \?&=\"\n\r\t<]*?(\.(jpg|jpeg|gif|png)))\[/img\]#sie", "'[img:$uid]\\1' . str_replace(' ', '%20', '\\3') . '[/img:$uid]'", $text); 
  } 
wenn das nicht klappt, dann das:

2.)

Code: Alles auswählen

öffne includes/bbcode.php 

suche: 

// [img]image_url_here[/img] code.. 
      $text = preg_replace("#\[img\]((http|ftp|https|ftps)://)([^ \?&=\#\"\n\r\t<]*?)\[/img\]#sie", "'[img:$uid]\\1' . str_replace(' ', '%20', '\\3') . '[/img:$uid]'", $text); 


ersetze es durch: 

  // [img]image_url_here[/img] code.. 
  if (substr_count( $text, $_SERVER["SERVER_NAME"]) && substr_count( $text, "modules/mx_smartor/album.php?smartor_mode=album_pic)) 
  { 
    $text = preg_replace("#\[img\]((ht|f)tp://)([^\r\n\t<\"]*?)\[/img\]#sie", "'[img:$uid]\\1' . str_replace(' ', '%20', '\\3') . '[/img:$uid]'", $text); 
  } 
  else 
  { 
    $text = preg_replace("#\[img\]((ht|f)tp://)([^ \?&=\"\n\r\t<]*?(\.(jpg|jpeg|gif|png)))\[/img\]#sie", "'[img:$uid]\\1' . str_replace(' ', '%20', '\\3') . '[/img:$uid]'", $text); 
  } 

nun wieder einen generellen Machartwechsel:

3.)

Code: Alles auswählen

BEGINNING OF HACK ----------------------------------------------------- 

HACK NAME: BJB1 
HACK VERSION: 1.0 
PHPBB2 VERSION: 2.0.11 
PHOTO ALBUM VERSION: 2.0.53 

OPEN 

includes/bbcode.php 

FIND 

   // [img]image_url_here[/img] code.. 
   $text = preg_replace("#\[img\]((http|ftp|https|ftps)://)([^ \?&=\#\"\n\r\t<]*?(\.(jpg|jpeg|gif|png)))\[/img\]#sie", "'[img:$uid]\\1' . str_replace(' ', '%20', '\\3') . '[/img:$uid]'", $text); 

AFTER, ADD 

   //***************************************************** 
   // HACK: Allow embedded images from this server's photo album 
   // [img]http://www.example.com/forum_image_url[/img] code. 

   // Option 1: 
   $text = preg_replace("#\[img\](http://www\.sttweb\.de/mx/modules/mx_smartor/[^?[\]]*album\.php\?smartor_mode=album_pic&pic_id=\d+)\[\/img\]#sie", "'[img:$uid]' . str_replace(' ', '%20', '\\1') . '[/img:$uid]'", $text); 

   //*****************************************************

und wenn das nicht klappt, dann das:
4.)

Code: Alles auswählen

BEGINNING OF HACK ----------------------------------------------------- 

HACK NAME: BJB1 
HACK VERSION: 1.0 
PHPBB2 VERSION: 2.0.11 
PHOTO ALBUM VERSION: 2.0.53 

OPEN 

includes/bbcode.php 

FIND 

   // [img]image_url_here[/img] code.. 
   $text = preg_replace("#\[img\]((http|ftp|https|ftps)://)([^ \?&=\#\"\n\r\t<]*?(\.(jpg|jpeg|gif|png)))\[/img\]#sie", "'[img:$uid]\\1' . str_replace(' ', '%20', '\\3') . '[/img:$uid]'", $text); 

AFTER, ADD 

   //***************************************************** 
   // HACK: Allow embedded images from this server's photo album 
   // [img]http://www.example.com/forum_image_url[/img] code. 

   // Option 1: 
   $text = preg_replace("#\[img\](http://www\.sttweb\.de/mx/modules/mx_smartor/[^?[\]]*album_(pic|thumbnail)\.php\?pic_id=\d+)\[\/img\]#sie", "'[img:$uid]' . str_replace(' ', '%20', '\\1') . '[/img:$uid]'", $text); 

   //***************************************************** 

Wobei ich hier meine, dass 4.) sehr sicher nix bringen wird, 1.) wahrscheinlich auch ein Reinfall ist und 2.) und 3.) die Favoriten sein könnten.

Und wenn das nix bringt, liegt das an dem Modulegedönse, dann habe ich erstmal keine Idee mehr.



Gruß Max

Verfasst: 09.08.2005 22:31
von Knaubi
Hi!
Habe es mit folgendem Code jetzt auch hinbekommen:

Code: Alles auswählen

öffne includes/bbcode.php 

suche: 

// [img]image_url_here[/img] code.. 
      $text = preg_replace("#\[img\]((http|ftp|https|ftps)://)([^ \?&=\#\"\n\r\t<]*?)\[/img\]#sie", "'[img:$uid]\\1' . str_replace(' ', '%20', '\\3') . '[/img:$uid]'", $text); 


ersetze es durch: 

  // [img]image_url_here[/img] code.. 
  if (substr_count( $text, $_SERVER["SERVER_NAME"]) && substr_count( $text, "album_pic.php")) 
  { 
    $text = preg_replace("#\[img\]((ht|f)tp://)([^\r\n\t<\"]*?)\[/img\]#sie", "'[img:$uid]\\1' . str_replace(' ', '%20', '\\3') . '[/img:$uid]'", $text); 
  } 
  else 
  { 
    $text = preg_replace("#\[img\]((ht|f)tp://)([^ \?&=\"\n\r\t<]*?(\.(jpg|jpeg|gif|png)))\[/img\]#sie", "'[img:$uid]\\1' . str_replace(' ', '%20', '\\3') . '[/img:$uid]'", $text); 
  } 
Jetzt würde ich das gerne so machen dass gepostete Album-Bilder generell als Thumbnail angezeigt werden und gleichzeitig ein Link sind, über den man zur Albumseite mit der Großansicht kommt. Lässt sich dieser Code dazu anpassen oder ist das ne größere Sache?

Verfasst: 05.04.2006 21:41
von enymisc
Also ich hab das Problem auch, dass die [img] Tags bei den Bildern aus dem Album nicht funktionieren und ich hab jetzt jede einzelne Lösung aus diesem Thread probiert und es funktioniert keine :(

Meine URL's sehen auch normal aus, siehe hier:

Code: Alles auswählen

http://tucki.tu.funpic.de/phpBB2/album_pic.php?pic_id=39
Jetzt wollte ich die Variante nehmen, die habe ich bei meinem anderen Forum und dort funktioniert sie komischerweise, siehe hier:

Code: Alles auswählen

// [img]image_url_here[/img] code..
	$text = preg_replace("#\[img\]((http|ftp|https|ftps)://)([^ \?&=\#\"\n\r\t<]*?(\.(jpg|jpeg|gif|png)))\[/img\]#sie", "'[img:$uid]\\1' . str_replace(' ', '%20', '\\3') . '[/img:$uid]'", $text);$text = preg_replace("#\[img\](http://www\.placeboworld-online\.de/[^?[\]]*album_(pic|thumbnail)\.php\?pic_id=\d+)\[\/img\]#sie", "'[img:$uid]' . str_replace(' ', '%20', '\\1') . '[/img:$uid]'", $text);
Dann hab ich versucht die Adresse logischerweise in den Pfad von dem "Problem-Forum" umzuschreiben, aber wie gesagt, es funktioniert nicht. :(
Hier nochmal der Code aus dem "Problem-Forum":

Code: Alles auswählen

// [img]image_url_here[/img] code..
	$text = preg_replace("#\[img\]((http|ftp|https|ftps)://)([^ \?&=\#\"\n\r\t<]*?(\.(jpg|jpeg|gif|png)))\[/img\]#sie", "'[img:$uid]\\1' . str_replace(' ', '%20', '\\3') . '[/img:$uid]'", $text);$text = preg_replace("#\[img\](http://tucki\.funpic\.de/[^?[\]]*album_(pic|thumbnail)\.php\?pic_id=\d+)\[\/img\]#sie", "'[img:$uid]' . str_replace(' ', '%20', '\\1') . '[/img:$uid]'", $text);
Die URL vom Forum ist http://tucki.funpic.de/phpBB2. Kann natürlich sein, dass in der Adresse-Änderung im Code der Fehler liegt... kann sich das mal jmd anschauen bitte? :oops:

Verfasst: 09.04.2006 18:51
von enymisc
*push* :oops:

Verfasst: 07.09.2006 12:17
von lostvoices
hallöchen

ich hab mir jetzt auch mal diesen code eingebaut:

Code: Alles auswählen

  // [img]image_url_here[/img] code..
  if (substr_count( $text, $_SERVER["SERVER_NAME"]) && substr_count( $text, "album_pic.php"))
  {
    $text = preg_replace("#\[img\]((ht|f)tp://)([^\r\n\t<\"]*?)\[/img\]#sie", "'[img:$uid]\\1' . str_replace(' ', '%20', '\\3') . '[/img:$uid]'", $text);
  }
  else
  {
    $text = preg_replace("#\[img\]((ht|f)tp://)([^ \?&=\"\n\r\t<]*?(\.(jpg|jpeg|gif|png)))\[/img\]#sie", "'[img:$uid]\\1' . str_replace(' ', '%20', '\\3') . '[/img:$uid]'", $text);
  }
doch wenn ich jetzt die url des bildes eingeben will, das mir als thumb angezeigt werden soll, bekomme ich nur ne codezeile die in etwa so aussieht:

Code: Alles auswählen

[img:2c1d88662a]http://www.ntht.hp4me.de/board/album_pic.php?pic_id=2%20%20[/img:2c1d88662a]
muß ich die url anders eingeben, oder ist was mit dem code nicht in ordnung?

grüße losti