Is there any way to duplicate the [URL] code in the forum.pl file to replace ":)" with "smile.gif"?
I get some hideous errors when I tried to code that in, as I can't put a ")".
Thanks
2) Angus TurnbullGroup: Guests IP: 210.54.--.--
Posted:
You're on the right track -- just make sure you escape any special characters, so match and replace :\( as the backslash means "treat the next character as a literal character rather than a special meaning".
If you replace them with the appropriate <img src> tag smiley support should be easy.
Good luck - Angus.
3) JoaoGroup: Guests IP: 213.13.--.--
Posted:
Yes, it would be a great feature. Does any one knows how to do it? making this ":P" be replace by "/images/smile2.gif" ? please insert here the code if possible, and where it should be insert in the script. I have made some changes in forum (translating it from English to Portuguese) but I don't see how to do this.
4) Angus TurnbullGroup: Moderators Posts: 4042Joined: 7 Dec 2003Location: New ZealandIP: 210.54.--.--
Posted:
Well, look in the post formatting function in forum.pl.
Put in a substitution regular expression there that matches :P and replaces with <img>. That should do it.
- Angus.
5) JoaoGroup: Guests IP: 81.193.--.--
Posted:
I've found: # Match and write IMG tag. $tmp =~ s/\[img\]([^"\s<>\]\[]+[^"\s<>\]\[\.\,\(\)])(\[\/img\])?/<img src ="$1" \/>/ig;
but I don't understand here to insert image link (ie.: http://myserver.tld/images/piture.jpg) and the shourt cut... (ie.: :P or :D)
If some one could give me help I would apreciate :P
6) Angus TurnbullGroup: Moderators Posts: 4042Joined: 7 Dec 2003Location: New ZealandIP: 203.96.--.--
Posted:
Find a Perl tutorial ;). Something like this should do:
$tmp =~ s/\:P/<img src ="smiley.gif" \/>/ig;
The forward slashes separate the match and replace halves of the regex, and any special characters are escaped with backslashes. "ig" on the end means case-insensitive global match.
- Angus.
7) JoaoGroup: Guests IP: 81.193.--.--
Posted:
Thanks Angus for your help :D
8) RyanGroup: Guests IP: 62.53.--.--
Posted:
I tried putting the smilies in but I just cant seem to get them to work. I did exactly as above.
9) JoaoGroup: Guests IP: 81.193.--.--
Posted:
Dear Ryan, find in forum.pl: " # Match [ img ]picture.gif and write IMG tag. " the "[" "]" between "picture.gif" is more near... but would appear in this message as an not existing image.. in forum they are more near!... then put in this way: $tmp =~ s/\:\)/<img src ="http\:\/\/www\.yourdomain\.com\/images\/smile1.jpg" \/>/ig;
making this :) will appear the image at your server with the name: smile1.jpg . As you are seeing after "$tmp =~ s/\" its ":\)" an not ":)" ... be sure to put an "\" before ")", "(", "$" ... our you will get an error and the script will not work. If you have problems you my have insert something like this: "|", ")", "(", "$", "%" or someting like this... try putting an "\" before this special characters.. if it does not solved the problem simply remove the special character and try another short cut.