|
|
Joined: Sep 2005
Posts: 44
Member
|
Member
Joined: Sep 2005
Posts: 44 |
Is there something that would modify my forum so whenever someone posts an url it would automatically get an http://safeurl.de/? url infront of it, and whenever someone posts an img, it would have a http://invis.free.anonymizer.com/ url as a prefix? I saw this done on another forum (phpbb) and was wondering if such mod existed for ubb 6.6 or if it could be done. Any response is appreciated. Thanks.
|
|
|
|
Joined: Mar 2000
Posts: 21,079 Likes: 3
I type Like navaho
|
I type Like navaho
Joined: Mar 2000
Posts: 21,079 Likes: 3 |
It could be done, would involve editing the posting routines in ubb_lib_posting.cgi
|
|
|
|
Joined: Mar 2001
Posts: 7,394
Admin / Code Breaker
|
Admin / Code Breaker
Joined: Mar 2001
Posts: 7,394 |
ubb_lib.cgi Find: $check =~ s/(^|s)(http://S+)(.|,|))?/$1<a href="$2" target="_blank">$2</a>$3/isg; $check =~ s/(^|s)(https://S+)(.|,|))?/$1<a href="$2" target="_blank">$2</a>$3/isg; $check =~ s/(^|s)(ftp://S+)(.|,|))?/$1<a href="$2" target="_blank">$2</a>$3/isg; $check =~ s/(^|s)(www.S+)(.|,|))?/$1<a href="http://$2" target="_blank">$2</a>$3/isg; Wherever you see: Add after that: Find: $returner = qq~<a href="$orig"$target>$wording</a>~; Replace with: $returner = qq~<a href="http://safeurl.de/?$orig"$target>$wording</a>~; Find: $returner = qq~ <img src="$orig" alt=" - " />~; Replace with: $returner = qq~ <img src="http://invis.free.anonymizer.com/$orig" alt=" - " />~; ubb_lib_posting.cgi Find: # auto-URLs $match++ if $message =~ s/(<a href=")(http|https|ftp)(://)(S+)(" target="_blank">)234(</a>)/ $2$3$4 /isg; # new URL $match++ if $message =~ s/(<a href=")(http|https|ftp)(://)(S+)(" target="_blank">)(.+?)(</a>)/$2://$4/isg; Add ABOVE: # auto-URLs $match++ if $message =~ s/(<a href="http://safeurl.de/?)(http|https|ftp)(://)(S+)(" target="_blank">)234(</a>)/ $2$3$4 /isg; # new URL $match++ if $message =~ s/(<a href="http://safeurl.de/?)(http|https|ftp)(://)(S+)(" target="_blank">)(.+?)(</a>)/$2://$4/isg; Find: $match++ if $message =~ s/(<img src=")(S+)(" alt=" - " />)/[img]$2[/img]/isg; Add ABOVE: $match++ if $message =~ s/(<img src="http://invis.free.anonymizer.com/)(S+)(" alt=" - " />)/[img]$2[/img]/isg; It's untested but should work.
|
|
|
|
Joined: Sep 2005
Posts: 44
Member
|
Member
Joined: Sep 2005
Posts: 44 |
Thank you. The help is much appreciated. It looks like everything is working according to plan. Although there isn't really a way to see if the image hack is really working... not one that I can see.
|
|
|
|
Joined: Jan 2000
Posts: 5,833 Likes: 20
UBBDev / UBBWiki Owner Time Lord
|
UBBDev / UBBWiki Owner Time Lord
Joined: Jan 2000
Posts: 5,833 Likes: 20 |
View the page (or image) source and see ...
|
|
|
|
Joined: Sep 2005
Posts: 44
Member
|
Member
Joined: Sep 2005
Posts: 44 |
It's working perfectly for the posting. Only thing is that it needs to also have the prefixes in the profile, the sig, and the avator. Could someone tell me how this can be done?
I'm guessing it's pretty much the same thing as LK posted except to some other files.
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
Posts: 417
Joined: November 2001
|
|
Forums63
Topics37,573
Posts293,925
Members13,849
|
Most Online5,166 Sep 15th, 2019
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|
|