ok ein beispiel bildlich in code für smilies:
[code]
$linkdevil = "http://www.baseportal.de/files/MyPortal/devil.gif";
$linksmile = "http://www.baseportal.de/files/MyPortal/smile.gif";
$linkfrown = "http://www.baseportal.de/files/MyPortal/frown.gif";
$linkfrusty = "http://www.baseportal.de/files/MyPortal/frusty.gif";
$linkpuh2 = "http://www.baseportal.de/files/MyPortal/puh2.gif";
$linkpukey = "http://www.baseportal.de/files/MyPortal/pukey.gif";
$linkkwijl = "http://www.baseportal.de/files/MyPortal/kwijl.gif";
$linkyummie = "http://www.baseportal.de/files/MyPortal/yummie.gif";
$linkwink = "http://www.baseportal.de/files/MyPortal/wink.gif";
$linkloveit = "http://www.baseportal.de/files/MyPortal/loveit.gif";
$linkclown = "http://www.baseportal.de/files/MyPortal/clown.gif";
$linkpuh = "http://www.baseportal.de/files/MyPortal/puh.gif";
$linkrc5 = "http://www.baseportal.de/files/MyPortal/rc5.gif";
$linkcool = "http://www.baseportal.de/files/MyPortal/cool.gif";
$linkconfused = "http://www.baseportal.de/files/MyPortal/confused.gif";
$linksleepey = "http://www.baseportal.de/files/MyPortal/sleepey.gif";
$linksadley = "http://www.baseportal.de/files/MyPortal/sadley.gif";
$linkshiny = "http://www.baseportal.de/files/MyPortal/shiny.gif";
$linksleephappy = "http://www.baseportal.de/files/MyPortal/sleephappy.gif";
$Text=~ s/<br>/\n/gi;
###### die if anfrage dient nur um die smilies ausgabe für nur gewisse foren zu erlauben######
if ($Forum_nr eq "0" or $Forum_nr eq "1" or $Forum_nr eq "5" or $Forum_nr eq "6")
{
### Umwandlung der Smilies in gifs ###
$Text =~ s/\:F/\<img src=$linkfrusty\>/g;
$Text =~ s/\>\:\)/\<img src=$linkdevil\>/g;
$Text =~ s/\:\)/\<img src=$linksmile\>/g;
$Text =~ s/\:\(/\<img src=$linkfrown\>/g;
$Text =~ s/\:P/\<img src=$linkpuh2\>/g;
$Text =~ s/\:r/\<img src=$linkpukey>/g;
$Text =~ s/\:9\~/\<img src=$linkkwijl\>/g;
$Text =~ s/\:9/\<img src=$linkyummie\>/g;
$Text =~ s/\;\)/\<img src=$linkwink\>/g;
$Text =~ s/\:7/\<img src=$linkloveit\>/g;
### Umwandlung der Smilies in gifs ende ###
out convert_br($Text)." ";
}
else
{
out convert_br(convert_links($Text))." ";
}
[/code]
was das tut ist jetzt verstanden oder?
so und jetzt stell dir einfach mal vor ich möchte eine youtube URL
automatisch in ein embed umwandeln aber auch nur wenn jemand innhalb des textes im meinem fall $URL (wird geändert) auch einen direkt View ULR zu youtube posted.
die url zu wandeln damit es im embed auch funktioniert habe ich ja schonmal raus, nur das embed generieren aufgrund der geposteten URL das innerhalb des textes steht macht mir schwierigkeiten.
$URL_2=$URL;
$URL_2=substr($URL_2, 0, 31);
$URL_3=$URL;
$URL_3=substr($URL_3, 31, 15);
$findURL="http\:\/\/www.youtube.com\/watch\?v\=";
$replaceURL="http://www.youtube.com/v/";
$URL_4=$URL;
#$URL_4 =~ s/$findURL/\<embed src\='http\:\/\/www.youtube.com\/v\/$URL_3' type\='application\/x\-shockwave\-flash' wmode\='transparent' width\='425' height\='350'\>\<\/embed\>/g;
#$URL_2 =~ s/http\:\/\/www.youtube.com\/watch?v\=/\<embed src\='http\:\/\/www.youtube.com\/v\/$URL_3' type\='application\/x\-shockwave\-flash' wmode\='transparent' width\='425' height\='350'\>\<\/embed\>/g;