Previous Thread
Next Thread
Print Thread
Rate Thread
#54553 09/03/2002 2:14 PM
Joined: Jul 2002
Posts: 45
Member
Member
Offline
Joined: Jul 2002
Posts: 45
hi. i am using mrstormynight's advanced ubbcodebutton hack on 6.3 (the one meant for 6.2). it works fine except when i go to edit a post the ubbcodes turn into html.

how would i go about fixing this?

thanks!

Sponsored Links
Joined: Nov 2001
Posts: 1,704
CTM Offline
Moderator / Da Masta
Moderator / Da Masta
Offline
Joined: Nov 2001
Posts: 1,704
Rehack ubb_lib_posting.cgi, sub reverse_ubb_code. smile

Joined: Jul 2002
Posts: 45
Member
Member
Offline
Joined: Jul 2002
Posts: 45
Quote
quote:
Originally posted by CTM:
Rehack ubb_lib_posting.cgi, sub reverse_ubb_code. smile
I'm sorry can you elaborate a tad? I am quite stupid. Do you think I put in the sub_reverse_ubb_code part incorrectly?

Joined: Nov 2001
Posts: 1,704
CTM Offline
Moderator / Da Masta
Moderator / Da Masta
Offline
Joined: Nov 2001
Posts: 1,704
Maybe. wink Search for "reverse_ubb_code" in ubb_lib_posting.cgi, and retry the instructions it gave you in the install text file for that file. In other words, redo this step:

Quote
quote:

##############################
## in ubb_lib_posting.cgi ##
##############################

##################
## find ##
##################

code:
[qb]
Code
sub reverse_ubb_code {

# two parameters:
# $_[0] : the text to convert
# $_[1] : ubbcode [IMG] enabled? (ON/OFF)

my $match = 1;

# Kludge the second
while($match != 0) {
$match = 0;

# new URL
$match++ if $_[0] =~ s/(<a href=")(http|https|ftp)(://)(S+)(" target="_blank">)(.+?)(</a>)/$2://$4/isg;
# old URL
$match++ if $_[0] =~ s/(<A HREF=")(http|https|ftp)(://)(S+)(" TARGET=_blank>)(.+?)(</A>)/$2://$4/isg;

$match++ if $_[0] =~ s/(<a href="mailto:)(S+)(">)(S+)(</a>)/[email]$2[/email]/isg;

$match++ if $_[0] =~ s/(<i>)(.+?)(</i>)/$2/isg;
$match++ if $_[0] =~ s/(<b>)(.+?)(</b>)/$2/isg;
$match++ if $_[0] =~ s/(<strong>)(.+?)(</strong>)/[qb]$2[/qb]/isg;

# new quote/code
$match++ if $_[0] =~ s/(</font><blockquote><font size="1" face="[^"]*?">$vars_wordlets{ubbcode_code}:</font><hr /><pre style="[^"]*?">)(.+?)(</pre><HR /></BLOCKQUOTE><font size="[^"]*?" face="[^"]*?">)/
Code
$2</pre></div></div>/isg;<br>		$match++ if $_[0] =~ s/(</font><blockquote><font size="1" face="[^"]*?">$vars_wordlets{ubbcode_quote}:</font><hr /><font size="[^"]*?" face="[^"]*?">)(.+?)(</font><hr /></blockquote><font size="[^"]*?" face="[^"]*?">)/<div class="ubbcode-block"><div class="ubbcode-header">Quote</div><div class="ubbcode-body">$2</div></div>/isg;<br>		# old quote/code<br>		$match++ if $_[0] =~ s/(<BLOCKQUOTE><font size="1" face="[^"]*?">$vars_wordlets{ubbcode_code}:</font><HR><pre>?)(.+?)(</pre><HR></BLOCKQUOTE>)/<div class="ubbcode-block"><div class="ubbcode-header">Code</div><div class="ubbcode-body ubbcode-pre" ><pre>$2</pre></div></div>/isg;<br>		$match++ if $_[0] =~ s/(<BLOCKQUOTE><font size="1" face="[^"]*?">$vars_wordlets{ubbcode_quote}:</font><HR>?)(.+?)(<HR></BLOCKQUOTE>)/<div class="ubbcode-block"><div class="ubbcode-header">Quote</div><div class="ubbcode-body">$2</div></div>/isg;<br><br>		if ($_[1] ne "OFF") {<br>			# New<br>			$match++ if $_[0] =~ s/(<img src=")(S+)(" alt="" />)/[img]$2[/img]/isg;<br>			# old<br>			$match++ if $_[0] =~ s/(<img src=")(S+)(">)/[img]$2[/img]/isg;<br>		}<br><br>		# new lists<br>		$match++ if $_[0] =~ s/(</font><ul type="square">)(.+?)(</ul><font size=".*?" face=".*?">)/<ul style="list-style-type:disc;"><li>$2</li></ul>/isg;<br>		$match++ if $_[0] =~ s/(</font><ol type=")(A|1)(">)(.+?)(</ol><font size=".*?" face=".*?">)/[list=$2]$4<li>/isg;<br>		# old lists<br>		$match++ if $_[0] =~ s/(<UL TYPE="SQUARE">)(.+?)(</UL>)/<ul style="list-style-type:disc;">$2</ul></li><li>/isg;<br>		$match++ if $_[0] =~ s/(<OL TYPE=")(A|1)(">)(.+?)(</OL>)/[list=$2]$4</li><li>/isg;<br>		$match++ if $_[0] =~ s/(<ul type=square>)(.+?)(</ul>)/<ul style="list-style-type:disc;"><li>$2</li></ul></li><li>/isg;<br><br>		# newer li<br>		$match++ if $_[0] =~ s/(<li><font size=".*?" face=".*?">)(.+?)(</font></li>)/</li><li>$2/isg;<br>		# new li<br>		$match++ if $_[0] =~ s/(<li>)(.+?)(</li>)/</li><li>$2/isg;<br>		# old li<br>		$match++ if $_[0] =~ s/<LI>/</li><li>/isg;<br>	} # end while<br><br>	return ($_[0]);<br>}    #end EditUBBConvert
[/qb]
########################
## and replace with ##
########################

Code
sub reverse_ubb_code {<br><br>	# two parameters:<br>	# $_[0] : the text to convert<br>	# $_[1] : ubbcode [IMG] enabled? (ON/OFF)<br><br>	my $match = 1;<br><br>	# Kludge the second<br>	while($match != 0) {<br>		$match = 0;<br><br>		# new URL<br>		$match++ if $_[0] =~ s/(<a href=")(http|https|ftp)(://)(S+)(" target="_blank">)(.+?)(</a>)/$2://$4/isg;<br>		# old URL<br>		$match++ if $_[0] =~ s/(<a href=")(http|https|ftp)(://)(S+)(" target=_blank>)(.+?)(</a>)/$2://$4/isg;<br><br>		$match++ if $_[0] =~ s/(<a href="mailto:)(S+)(">)(S+)(</a>)/[email]$2[/email]/isg;<br><br>		$match++ if $_[0] =~ s/(<i>)(.+?)(</i>)/<span style="font-style: italic">$2</span>/isg;<br>		$match++ if $_[0] =~ s/(<b>)(.+?)(</b>)/<span style="font-weight: bold">$2</span>/isg;<br>		$match++ if $_[0] =~ s/(<strong>)(.+?)(</strong>)/[qb]$2[/qb]/isg;<br><br>		# new quote/code<br>		$match++ if $_[0] =~ s/(</font><blockquote><font size="1" face="[^"]*?">$vars_wordlets{ubbcode_code}:</font><hr /><pre style="[^"]*?">)(.+?)(</pre><HR /></BLOCKQUOTE><font size="[^"]*?" face="[^"]*?">)/<div class="ubbcode-block"><div class="ubbcode-header">Code</div><div class="ubbcode-body ubbcode-pre" ><pre>$2</pre></div></div>/isg;<br>		$match++ if $_[0] =~ s/(</font><blockquote><font size="1" face="[^"]*?">$vars_wordlets{ubbcode_quote}:</font><hr /><font size="[^"]*?" face="[^"]*?">)(.+?)(</font><hr /></blockquote><font size="[^"]*?" face="[^"]*?">)/<div class="ubbcode-block"><div class="ubbcode-header">Quote</div><div class="ubbcode-body">$2</div></div>/isg;<br>		# old quote/code<br>		$match++ if $_[0] =~ s/(<BLOCKQUOTE><font size="1" face="[^"]*?">$vars_wordlets{ubbcode_code}:</font><HR><pre>?)(.+?)(</pre><HR></BLOCKQUOTE>)/<div class="ubbcode-block"><div class="ubbcode-header">Code</div><div class="ubbcode-body ubbcode-pre" ><pre>$2</pre></div></div>/isg;<br>		$match++ if $_[0] =~ s/(<BLOCKQUOTE><font size="1" face="[^"]*?">$vars_wordlets{ubbcode_quote}:</font><HR>?)(.+?)(<HR></BLOCKQUOTE>)/<div class="ubbcode-block"><div class="ubbcode-header">Quote</div><div class="ubbcode-body">$2</div></div>/isg;<br><br>		# new lists<br>		$match++ if $_[0] =~ s/(</font><ul type="square">)(.+?)(</ul><font size=".*?" face=".*?">)/<ul style="list-style-type:disc;"><li>$2</li></ul></li><li>/isg;<br>		$match++ if $_[0] =~ s/(</font><ol type=")(A|1)(">)(.+?)(</ol><font size=".*?" face=".*?">)/[list=$2]$4</li><li>/isg;<br>		# old lists<br>		$match++ if $_[0] =~ s/(<UL TYPE="SQUARE">)(.+?)(</UL>)/<ul style="list-style-type:disc;"><li>$2</li></ul></li><li>/isg;<br>		$match++ if $_[0] =~ s/(<OL TYPE=")(A|1)(">)(.+?)(</OL>)/[list=$2]$4</li><li>/isg;<br>		$match++ if $_[0] =~ s/(<ul type=square>)(.+?)(</ul>)/<ul style="list-style-type:disc;"><li>$2</li></ul></li><li>/isg;<br><br>		# newer li<br>		$match++ if $_[0] =~ s/(<li><font size=".*?" face=".*?">)(.+?)(</font></li>)/</li><li>$2/isg;<br>		# new li<br>		$match++ if $_[0] =~ s/(<li>)(.+?)(</li>)/</li><li>$2/isg;<br>		# old li<br>		$match++ if $_[0] =~ s/<LI>/</li><li>/isg;<br><br>		$match++ if $_[0] =~ s/(<embed src=")(.+?)(">)(</embed>)/[embed]$2[/embed]/isg;<br>		$match++ if $_[0] =~ s/(<font color=")(S+?)(">)(.+?)(</font c>)/[color:$2]$4[/color]/isg;<br>		$match++ if $_[0] =~ s/(<center>)(.+?)(</center>)/[center]$2[/center]/isg;<br>		$match++ if $_[0] =~ s/(<u>)(.+?)(</u>)/<span style="text-decoration: underline">$2</span>/isg;<br>		$match++ if $_[0] =~ s/(<font face=")(.+?)(">)(.+?)(</font f>)/[font:$2]$4[/font]/isg;<br>		$match++ if $_[0] =~ s/(<font size=")(S+?)(">)(.+?)(</font s>)/ $4 /isg;<br>		$match++ if $_[0] =~ s/(<h1>)(.+?)(</h1>)/[h1]$2[/h1]/isg;<br>		$match++ if $_[0] =~ s/(<h2>)(.+?)(</h2>)/[h2]$2[/h2]/isg;<br>		$match++ if $_[0] =~ s/(<h3>)(.+?)(</h3>)/[h3]$2[/h3]/isg;<br>		$match++ if $_[0] =~ s/(<table style="filter:fliph">)(.+?)(</table>)/[fliph]$2[/fliph]/isg;<br>		$match++ if $_[0] =~ s/(<table style="filter:flipv">)(.+?)(</table>)/[flipv]$2[/flipv]/isg;<br>		$match++ if $_[0] =~ s/(<table style="filter:invert">)(.+?)(</table>)/[invert]$2[/invert]/isg;<br>		$match++ if $_[0] =~ s/(<table style="filter:xray">)(.+?)(</table>)/[xray]$2[/xray]/isg;<br>		$match++ if $_[0] =~ s/(<table border="5" cellpadding="15" bordercolor=")(S+)("><tr><td>)(.+?)(</td></tr></table>)/[border=$2]$4[/border]/isg;<br>		$match++ if $_[0] =~ s/(<marquee behavior="alternate">)(.+?)(</marquee>)/[marquee]$2[/marquee]/isg;<br>		$match++ if $_[0] =~ s/(<hr color=")(S+?)(" />)/[hr=$2][/hr]/isg;<br>		$match++ if $_[0] =~ s/(<font size=")(S+?)(" color=")(S+?)(">)(.+?)(</font sc>)/[szcolor=$2,$4]$6[/szcolor]/isg;<br>		$match++ if $_[0] =~ s/(<font face=")(.+?)(" size=")(S+?)(" color=")(S+?)(">)(.+?)(</font fsc>)/[fsc=$2,$4,$6]$8[/fsc]/isg;<br><br>		if ($_[1] ne "OFF") {<br>			# New<br>			$match++ if $_[0] =~ s/(<img src=")(S+)(" alt="" />)/[img]$2[/img]/isg;<br>			# old<br>			$match++ if $_[0] =~ s/(<img src=")(S+)(">)/[img]$2[/img]/isg;<br>		}<br><br>	} # end while<br><br>	return ($_[0]);<br>}    #end EditUBBConvert

Hope that makes things clearer for you. smile

Joined: Jul 2002
Posts: 45
Member
Member
Offline
Joined: Jul 2002
Posts: 45
That didn't help. frown

And it also happens when I go to edit my signature in my profile.

Help frown

Sponsored Links

Link Copied to Clipboard
Donate Today!
Donate via PayPal

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.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
isaac
isaac
California
Posts: 1,157
Joined: July 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)