UBB.Dev
Posted By: Ian Spence [6.6 - 6.7] [beta] Even Advanced-er Text - 08/31/2003 11:34 PM
Modification Name: [6.6] Even Advanced-er Text

Author(s): Weird Al

Description: Adds size, font, color, thumbnails, right alignment, and center alignment to the UBB codes.

Demo: http://www.alforadmin.com/cgi-bin/ultimatebb.cgi?ubb=get_topic;f=3;t=000015;p=1#000000

Requirements: UBB.classic 6.6+

Download Link: https://www.ubbdev.com/ubb/upload/00020028/EvenMoreAdvancedText.zip

Credits: Gizzy for most of the images, TheX for the thumbnail hack, Risperdal for the basic idea, and LK for help with a bug. Me for all CP integration, and removing any need for the Wordlets Mod

Notes:
Code
[right]Right Aligned[/right]
Red Text
Big Text
Underlined Text

[THUMB]http://www.alforadmin.com/ubb/biggrin.gif[/THUMB] (makes all images 200x***)
[center]Centered Text[/center]
[font:Comic Sans Ms]Comic Sans Ms Font Face[/font]
use that to test the hack.
My users think these are fun, thanks Al laugh
Posted By: d-talk Re: [6.6 - 6.7] [beta] Even Advanced-er Text - 12/30/2003 1:33 PM
Hi,

after I install this mod at 6.7.0 I get the following error:

Software error:
Global symbol "$returner" requires explicit package name at /home/www/web17/html/cgi-bin/ubb_lib.cgi line 2200. Global symbol "$returner" requires explicit package name at /home/www/web17/html/cgi-bin/ubb_lib.cgi line 2202. BEGIN not safe after errors--compilation aborted at /home/www/web17/html/cgi-bin/ubb_lib.cgi line 2591.
For help, please send mail to the webmaster ([email protected]), giving this error message and the time and date of the error.


There was a compilation error while loading the UBB.classic libraries and data files:

[Tue Dec 30 11:33:15 2003] ultimatebb.cgi: Global symbol "$returner" requires explicit package name at /home/www/web17/html/cgi-bin/ubb_lib.cgi line 2200.
[Tue Dec 30 11:33:15 2003] ultimatebb.cgi: Global symbol "$returner" requires explicit package name at /home/www/web17/html/cgi-bin/ubb_lib.cgi line 2202.
[Tue Dec 30 11:33:15 2003] ultimatebb.cgi: BEGIN not safe after errors--compilation aborted at /home/www/web17/html/cgi-bin/ubb_lib.cgi line 2591.
Compilation failed in require at ultimatebb.cgi line 133.


Please make sure that you uploaded the CGI and Variables files to the proper directory, permissions are set properly on the files, and that paths in the control panel are set correctly.

Do this hack work with 6.7.0 ?

thx
d-talk
Posted By: Charles Re: [6.6 - 6.7] [beta] Even Advanced-er Text - 12/30/2003 3:02 PM
this is because 6.7 uses strict thus the mod will need to be adapted for it smile
Posted By: d-talk Re: [6.6 - 6.7] [beta] Even Advanced-er Text - 12/30/2003 7:03 PM
Al can you rewrite your mod? :rolleyes:
Posted By: d-talk Re: [6.6 - 6.7] [beta] Even Advanced-er Text - 01/01/2004 7:56 PM
Hi Al,

does flare upload not work, you said you have fixed the problem...
there, it's up now
Posted By: Mike L Re: [6.6 - 6.7] [beta] Even Advanced-er Text - 01/04/2004 3:35 AM
I know that this hack is labeled as only being tested on 6.6, but just thought to report an observed behavior of this hack on v6.7 beta release 1.

It has to do with the thumbnails.

An original posting of a thumbnail works fine. However, if I do an edit of the post, there is an intermittent problem. Most of the time what happens is that the thumbnail is gone, having been replaced by the pure HTML code, which is only displaying as normal text. (I have HTML disallowed on this board.)

In the "edit" window, sometimes you will see the "escaped"
Code
<a 
and
Code
 /></a>
surrounding the HTML. Other times not.

Whether or not this code appears in the edit window does not correlate to the thumbnail working or not.

This is on my test installation and is a new install of v6.7 BR1 that has no other hacks installed at this time.
link to the test forums and an account that I can use please.

I currectly have this running on 6.7 no problem
Posted By: Mike L Re: [6.6 - 6.7] [beta] Even Advanced-er Text - 01/04/2004 5:07 AM
I've sent you a PM with a login that has Admin rights.
I posted the fix at your test board, you had changed the number in ubb_lib without also changing it in ubb_lib_posting
Posted By: Mike L Re: [6.6 - 6.7] [beta] Even Advanced-er Text - 01/04/2004 5:42 AM
Insert smillie of palm slapping forehead here.

Thanks Al. Sorry for the trouble.
Posted By: ADWOFF Re: [6.6 - 6.7] [beta] Even Advanced-er Text - 03/28/2004 8:37 AM
Nuts, nuts, nuts, nuts!

My community has been clamoring for me to bring back the advanced code ... so I installed this into my test site and when it *worked*--I really thought nothing of it ...

Then I remembered in the past that *raw code* can sometimes appear when one goes back to edit a post, etc.

Since I needed to rehack my test site to try to figure out where another problem pops up, I gave this a more thorough workout, and sure enough, when I edited, the *raw code* (i.e. html stuff) appeared ...

Is there an *easy fix* to this?

I hope so ... my community would really love to be able to play with the bells & whistles.

Thanks.
if you are willing to be the tester, I could try moving these over to span tags with style attributes. That should remove any issues as no other UBBcode to my knowledge uses span tags
Posted By: ADWOFF Re: [6.6 - 6.7] [beta] Even Advanced-er Text - 03/28/2004 8:16 PM
Sure, Ian. I love being a guinea pig! laugh


If I can do a *shopping list* ... I'd really like to see the following *advanced* code:

  • Change Text Color
  • Change Text Size
  • Change Font
  • Underline Text
  • Center Text
  • Marquee (we are easily amused in my community tipsy wink )


----

Anything else would be gravy ... I know you did the thumb tag; to be honest, it'd take me more time to explain what it does than it'd be worth.
I'll add marquee as it's an easy one, but aren't the rest of those aren't in?

(I know that color, size and font are erroneous)
Posted By: ADWOFF Re: [6.6 - 6.7] [beta] Even Advanced-er Text - 03/28/2004 10:28 PM
Yeah, they are smile ... I just was giving you the ones that I definitely would like to have if possible. smile
Posted By: Ian Spence Re: [6.6 - 6.7] [beta] Even Advanced-er Text - 03/28/2004 11:08 PM
Untested.

In ubb_lib.cgi, change

Code
		$match++ if $_[0] =~ s/([color:)(S+?)(])(.+?)([/color])/<font color="$2" c>$4</font c>/isg;
$match++ if $_[0] =~ s/([center])(.+?)([/center])/<center>$2</center>/isg;
$match++ if $_[0] =~ s/( )(.+?)( )/<font size="$2" s>$4</font s>/isg;
$match++ if $_[0] =~ s/([font:)(.+?)(])(.+?)([/font])/<font face="$2" f>$4</font f>/isg;
to

Code
		$match++ if $_[0] =~ s/([color:)(S+?)(])(.+?)([/color])/<span style="color: $2;">$4</span>/isg;
$match++ if $_[0] =~ s/([center])(.+?)([/center])/<center>$2</center>/isg;
$match++ if $_[0] =~ s/( )(.+?)( )/<span style="font-size: $2px;">$4</span>/isg;
$match++ if $_[0] =~ s/([font:)(.+?)(])(.+?)([/font])/<span style="font-family: $2;">$4</span>/isg;
And in ubb_lib_posting.cgi, change
Code
		$match++ if $message =~ s/(<font color=")(S+)(" c>)(.+?)(</font c>)/[color:$2]$4[/color]/isg;
$match++ if $message =~ s/(<font size=")(.+?)(" s>)(.+?)(</font s>)/ $4 /isg;
$match++ if $message =~ s/(<font face=")(.+?)(" f>)(.+?)(</font f>)/[font:$2]$4[/font]/isg;
to

Code
		$match++ if $message =~ s/(<span style="color: )(.+?)(;">)(.+?)(</span>)/[color:$2]$4[/color]/isg;
$match++ if $message =~ s/(<span style="font-size: )(d{2}|d{1})(px;">)(.+?)(</span>)/ $4 /isg;
$match++ if $message =~ s/(<span style="font-family: )(.+?)(;">)(.+?)(</span>)/[font:$2]$4[/font]/isg;
A little note: Since I did it this way, sizes are from 0-99 (in px). Anything under about 8 is unreadable by most.

Codes are now:
Code
RED
RED
14px size font
[font:Trebuchet Ms]Best. Font. Ever.[/font]
If this works for you, it'll give me an excuse to release a new version, which will include
[Linked Image]
for adding those common colors to a post.
Posted By: ADWOFF Re: [6.6 - 6.7] [beta] Even Advanced-er Text - 03/29/2004 7:02 AM
Ian, sadly, it didn't work.

In a nutshell, it posted like this:

Quote
quote:
[font:comic sans ms]My favorite font [/font]

This is red
Quote
Originally posted by Ian Spence:
Codes are now:
Code
RED
RED
14px size font
[font:Trebuchet Ms]Best. Font. Ever.[/font]
*cough*
Posted By: ADWOFF Re: [6.6 - 6.7] [beta] Even Advanced-er Text - 03/29/2004 7:43 AM
Um, Ian? That's the actual result.

In other words, it printed out

[font:comic sans ms]My favorite font [/font] ... code and all

Same with the color ...

and size ...
Right, the new codes have a : instead of a =


http://adwoff.com/ubb-test/ubb/ultimatebb.php?ubb=get_topic;f=2;t=000015;p=1#000005
Posted By: ADWOFF Re: [6.6 - 6.7] [beta] Even Advanced-er Text - 03/29/2004 8:52 AM
Okay, Ian. I see what you're saying.

When I click on color, I get this:

Will this be blue?

If I physically (i.e. manually) change the = sign to :, it works.

So, what do I need to do in the code to make it like this when I click on the color icon?

Will this be blue?

Am I making sense, or am I as clear as mud?! tipsy
Posted By: ADWOFF Re: [6.6 - 6.7] [beta] Even Advanced-er Text - 03/29/2004 9:22 AM
Okay, I figured it out. tipsy

I went into the public_common.pl file

Found

Code
insertAtCaret(document.replier.message, ' ' + "[color:" + thisColo + "]" + thisCtext + "[/color]" + ' ');  
and changed it to

Code
insertAtCaret(document.replier.message, ' ' + "[color:" + thisColo + "]" + thisCtext + "[/color]" + ' ');  
Found

Code
insertAtCaret(document.replier.message, ' ' + " " + thisStext + " " + ' ');  
and changed to

insertAtCaret(document.replier.message, ' ' + " " + thisStext + " " + ' ');

Found

Code
			insertAtCaret(document.replier.message, ' ' + "[font:" + thisFont + "]  [/font]" + ' ');  
and changed to

Code
			insertAtCaret(document.replier.message, ' ' + "[font:" + thisFont + "]  [/font]" + ' ');  
----

I'll keep playing with it ... see if it holds up ...

Thanks, Ian! smile
that will all be updated as soon as you don't break it
smile I assume the lack of whining means that you couldn't break it?
Posted By: ADWOFF Re: [6.6 - 6.7] [beta] Even Advanced-er Text - 03/30/2004 3:24 AM
Whining! HEY! tipsy

Um, I haven't broken it yet! Key word: YET! wink

So far, so good, Ian. smile
*does the "Haha, You can't break it" dance*

laugh
Posted By: Gizmo Re: [6.6 - 6.7] [beta] Even Advanced-er Text - 03/30/2004 5:00 AM
Hey Ian, that's mean; Sue is the best whiner...
Ian, Sure would like to have the update that makes the colors like you guys have 'em at AlForAdmin.com!!!

Maybe I can figure out where you put that table code with the js actions...
Sorry for the lack of updates, finals are coming up and the teachers want to fit in as many tests as possible before them
Heh.. No problem Ian. I've got it up and running. I just wanted to tweak it around to use the tables for "colors" and reformat the buttons for the dormat codes to use text links inside a table...

Good luck with finals... smile
I was going to post the span style version until I noticed that you already did something similar. thumbsup

Ohh...For earlier versions like 6.4 in ubb_lib_posting.cgi wherever you see:

Code
$match++ if $message
Just replace it with:

Code
$match++ if $_[0]
And when quoting or editing posts you won't see the raw code. smile
Posted By: GATOR420 Re: [6.6 - 6.7] [beta] Even Advanced-er Text - 06/22/2004 3:05 AM
OK, I have this hack installed, but want to remove the image button, and only have the thumbnail button there. If I remove the permission to Allow UBB Code Images, will that remove the button, but still allow for the thumnail hack to work (and if I am really lucky, slide the button over to where images is now laugh )?

Thanks in advance...
no, that would not work, that would remove all the buttons. You can find the code for the image image in public_common.pl
Posted By: GATOR420 Re: [6.6 - 6.7] [beta] Even Advanced-er Text - 06/22/2004 6:16 AM
I found two pieces of code that seemed to be related to this function but have problems pasting it in this post.

Should I remove both? Can I just comment it out somehow instead of removing it just in case I want it back later? By doing this, would it also reposition the "thumb" button to where the "image" button is now?

Thanks again Al.
yes, remove both pieces of code.

It would not realign the buttons, but you can edit the html accordingly
Posted By: tgreene Re: [6.6 - 6.7] [beta] Even Advanced-er Text - 07/02/2004 11:46 PM
Any chance of getting STRIKETHROUGH implemented into this..? I had it on an old 6.3.1.2 board that I used to run, and it was a very nice feature to have.
Posted By: shamshoom Re: [6.6 - 6.7] [beta] Even Advanced-er Text - 08/08/2004 12:51 AM
Greetings,

Great work [Linked Image] , I have installed it but I have a simple request is:

Can I add code for Flash Player or Real player?

Thanks In Advance.
allowing flash files to be embedded is a security risk.

Real player is just a bad program tipsy
Posted By: havoq Re: [6.6 - 6.7] [beta] Even Advanced-er Text - 08/20/2004 4:21 PM
Ian: What would I have screwed up, if when using the thumb tag, when I goto edit my message, I see HTML code there instead of the original [THUMB] tag

B.T.W tgreene, you still need strikethrough?
You're using 6.7 finally?

oh, and make sure you didn't change the size of the thumbnails
Posted By: havoq Re: [6.6 - 6.7] [beta] Even Advanced-er Text - 08/20/2004 10:33 PM
Quote
Originally posted by Ian Spence:

You're using 6.7 finally?

oh, and make sure you didn't change the size of the thumbnails
Not exactly man. I want to soon though. Guess whos still unemployed. shocked Just graduated college last week and needing a job here.

Anyways, I don't remember changing the size, but maybe I did. I added a border="0" but that didnt matter cuz I checked it at default and it still showed HTML code. I dunno, guess its not a big deal
Posted By: Ian Spence Re: [6.6 - 6.7] [beta] Even Advanced-er Text - 08/20/2004 11:05 PM
your step in ubb_lib_posting.cgi must be incorrect.

paste the html you get when you try to edit a thumbnail
Posted By: havoq Re: [6.6 - 6.7] [beta] Even Advanced-er Text - 08/21/2004 3:40 AM
Code
<a href="http://" target="_fullview"><img src="http://" border="0" width="200" alt="Click for fullsize image" /></a>
does the image show before you try to edit?
Posted By: havoq Re: [6.6 - 6.7] [beta] Even Advanced-er Text - 08/21/2004 8:47 AM
ya dude, the image shows fine. Its just the edit thats the problem. Of course once you edit it, and keep the HTML it doesnt work, specially with HTML turned off, which is why you kinda need the THUMB tags there, unless of course u dont edit the thread. tipsy
when you edited ubb_lib.cgi, you made sure to edit ubb_lib_posting.cgi identically, right?
Posted By: havoq Re: [6.6 - 6.7] [beta] Even Advanced-er Text - 08/21/2004 4:15 PM
ubb_lib.cgi
Code
		if ($_[1] eq 'ON') {
$match++ if $_[0] =~ s/([img])(S+?)([/img])/&imageize($2)/eisg;
$match++ if $_[0] =~ s/([img])(S+?)([/img])/&imageize($2)/eisg;
$match++ if $_[0] =~ s/([THUMB])(S+?)([/THUMB])/&thumbize($2)/eisg;

}
ubb_lib_posting.cgi

Code
		if ($_[1] ne "OFF") {
# New
$match++ if $_[0] =~ s/(<img src=")(S+)(" alt="" />)/[img]$2[/img]/isg;
# New + alt
$match++ if $_[0] =~ s/(<img src=")(S+)(" alt=" - " />)/[img]$2[/img]/isg;
# old
$match++ if $_[0] =~ s/(<img src=")(S+)(">)/[img]$2[/img]/isg;
[b]$match++ if $_[0] =~ s/(<a href=")(http|https|ftp)(://)(S+)(" target="_fullview"><img src=")(S+)(" width="200" /></a>)/[THUMB]$6[/THUMB]/isg;


}
Posted By: Ian Spence Re: [6.6 - 6.7] [beta] Even Advanced-er Text - 08/21/2004 10:33 PM
you did not edit ubb_lib_posting.cgi to notice the border="0"
Posted By: havoq Re: [6.6 - 6.7] [beta] Even Advanced-er Text - 08/22/2004 1:51 AM
What would that matter? I thought I did, but how would that make HTML code appear. Remember though, it never worked even before I put border="0"
if you don't add the border="0" to ubb_lib_posting.cgi, it won't match the pattern and thus won't be converted back to ubbcode.

I can't help you if all I have to work with is "it doesn't work" First, you shouldn't install this version on 6.3, there's a 6.3 version for that. Secondly, if a hack doesn't work to begin with, don't edit it unless you know the fix for the problem. I don't support a modified version of my hack that was written when the person didn't know how it originally worked
Posted By: havoq Re: [6.6 - 6.7] [beta] Even Advanced-er Text - 08/22/2004 5:18 PM
Quote
Originally posted by Ian Spence:

I don't support a modified version of my hack that was written when the person didn't know how it originally worked
Um, the majority of people who install these hacks don't really know how they work. They're all newbs at this stuff. They just install these hacks because there are cool or whatever. So you really cant say that.

Secondly, this hack can be adapted to 6.3 just because its pretty much the same anyway as the one for 6.3. The only part that really differs the most is
Code
$match++ if $_[0]
Like I said, whatever. I'll figure it out, I usually do. I just wanted to know if you knew offhand.

Thirdly, I was nice enough to donate to your site awhile ago, so don't be ah bashin...
Yet another cry for help... frown

Inthe instructions, it does not list a "vars_styles_x.cgi" as modified.

I completed the CP2 mods, and the next thing is to find and edit "vars_styles_x.cgi". Ok, so I find a file named Vars_styles_1.cgi but it doesn't look like the mod file instructions, and so I'm stuck. I can't find the text to modifiy.

What do I do?
Well, I did it, without the vars_styles_x.cgi modifications and it works.

Do you predict any adverse effects?
yes, the images shouldn't work in the posting pages
They do.

confused
oh well then
© UBB.Developers