Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Joined: Jan 2003
Posts: 3,456
Likes: 2
Master Hacker
Master Hacker
Offline
Joined: Jan 2003
Posts: 3,456
Likes: 2
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.

Sponsored Links
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
My users think these are fun, thanks Al laugh


- Allen wavey
- What Drives You?
Joined: May 2001
Posts: 684
Code Monkey
Code Monkey
Offline
Joined: May 2001
Posts: 684
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


Webmaster of d-talk & Kabel-Forum.com
Joined: Oct 2000
Posts: 2,667
Veteran
Veteran
Offline
Joined: Oct 2000
Posts: 2,667
this is because 6.7 uses strict thus the mod will need to be adapted for it smile


Do you believe in love at first sight,
or should I walk by again?
Joined: May 2001
Posts: 684
Code Monkey
Code Monkey
Offline
Joined: May 2001
Posts: 684
Al can you rewrite your mod? :rolleyes:


Webmaster of d-talk & Kabel-Forum.com
Sponsored Links
Joined: May 2001
Posts: 684
Code Monkey
Code Monkey
Offline
Joined: May 2001
Posts: 684
Hi Al,

does flare upload not work, you said you have fixed the problem...


Webmaster of d-talk & Kabel-Forum.com
Joined: Jan 2003
Posts: 3,456
Likes: 2
Master Hacker
Master Hacker
Offline
Joined: Jan 2003
Posts: 3,456
Likes: 2
there, it's up now

Joined: Nov 2003
Posts: 13
Junior Member
Junior Member
Offline
Joined: Nov 2003
Posts: 13
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.

Joined: Jan 2003
Posts: 3,456
Likes: 2
Master Hacker
Master Hacker
Offline
Joined: Jan 2003
Posts: 3,456
Likes: 2
link to the test forums and an account that I can use please.

I currectly have this running on 6.7 no problem

Joined: Nov 2003
Posts: 13
Junior Member
Junior Member
Offline
Joined: Nov 2003
Posts: 13
I've sent you a PM with a login that has Admin rights.

Sponsored Links
Joined: Jan 2003
Posts: 3,456
Likes: 2
Master Hacker
Master Hacker
Offline
Joined: Jan 2003
Posts: 3,456
Likes: 2
I posted the fix at your test board, you had changed the number in ubb_lib without also changing it in ubb_lib_posting

Joined: Nov 2003
Posts: 13
Junior Member
Junior Member
Offline
Joined: Nov 2003
Posts: 13
Insert smillie of palm slapping forehead here.

Thanks Al. Sorry for the trouble.

Joined: May 2001
Posts: 794
Content Queen
Content Queen
Offline
Joined: May 2001
Posts: 794
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.


Sue
adwoff.com
Joined: Jan 2003
Posts: 3,456
Likes: 2
Master Hacker
Master Hacker
Offline
Joined: Jan 2003
Posts: 3,456
Likes: 2
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

Joined: May 2001
Posts: 794
Content Queen
Content Queen
Offline
Joined: May 2001
Posts: 794
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.


Sue
adwoff.com
Joined: Jan 2003
Posts: 3,456
Likes: 2
Master Hacker
Master Hacker
Offline
Joined: Jan 2003
Posts: 3,456
Likes: 2
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)

Joined: May 2001
Posts: 794
Content Queen
Content Queen
Offline
Joined: May 2001
Posts: 794
Yeah, they are smile ... I just was giving you the ones that I definitely would like to have if possible. smile


Sue
adwoff.com
Joined: Jan 2003
Posts: 3,456
Likes: 2
Master Hacker
Master Hacker
Offline
Joined: Jan 2003
Posts: 3,456
Likes: 2
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.

Joined: May 2001
Posts: 794
Content Queen
Content Queen
Offline
Joined: May 2001
Posts: 794
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


Sue
adwoff.com
Joined: Jan 2003
Posts: 3,456
Likes: 2
Master Hacker
Master Hacker
Offline
Joined: Jan 2003
Posts: 3,456
Likes: 2
Quote
Originally posted by Ian Spence:
Codes are now:
Code
RED
RED
14px size font
[font:Trebuchet Ms]Best. Font. Ever.[/font]
*cough*

Joined: May 2001
Posts: 794
Content Queen
Content Queen
Offline
Joined: May 2001
Posts: 794
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 ...


Sue
adwoff.com
Joined: Jan 2003
Posts: 3,456
Likes: 2
Master Hacker
Master Hacker
Offline
Joined: Jan 2003
Posts: 3,456
Likes: 2
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

Joined: May 2001
Posts: 794
Content Queen
Content Queen
Offline
Joined: May 2001
Posts: 794
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


Sue
adwoff.com
Joined: May 2001
Posts: 794
Content Queen
Content Queen
Offline
Joined: May 2001
Posts: 794
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


Sue
adwoff.com
Joined: Jan 2003
Posts: 3,456
Likes: 2
Master Hacker
Master Hacker
Offline
Joined: Jan 2003
Posts: 3,456
Likes: 2
that will all be updated as soon as you don't break it

Joined: Jan 2003
Posts: 3,456
Likes: 2
Master Hacker
Master Hacker
Offline
Joined: Jan 2003
Posts: 3,456
Likes: 2
smile I assume the lack of whining means that you couldn't break it?

Joined: May 2001
Posts: 794
Content Queen
Content Queen
Offline
Joined: May 2001
Posts: 794
Whining! HEY! tipsy

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

So far, so good, Ian. smile


Sue
adwoff.com
Joined: Jan 2003
Posts: 3,456
Likes: 2
Master Hacker
Master Hacker
Offline
Joined: Jan 2003
Posts: 3,456
Likes: 2
*does the "Haha, You can't break it" dance*

laugh

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
Hey Ian, that's mean; Sue is the best whiner...


UBB.Dev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.Threads: My UBB Themes, My UBB Scripts
Joined: Nov 2003
Posts: 11
Junior Member
Junior Member
Offline
Joined: Nov 2003
Posts: 11
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...


Clay Autery
"More, Better, Faster..."
Joined: Jan 2003
Posts: 3,456
Likes: 2
Master Hacker
Master Hacker
Offline
Joined: Jan 2003
Posts: 3,456
Likes: 2
Sorry for the lack of updates, finals are coming up and the teachers want to fit in as many tests as possible before them

Joined: Nov 2003
Posts: 11
Junior Member
Junior Member
Offline
Joined: Nov 2003
Posts: 11
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


Clay Autery
"More, Better, Faster..."
Joined: Nov 2001
Posts: 1,080
Member
Member
Offline
Joined: Nov 2001
Posts: 1,080
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

Joined: Jan 2003
Posts: 118
Member
Member
Offline
Joined: Jan 2003
Posts: 118
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...


-GATOR

"Pain is temporary, Pride is forever"
Joined: Jan 2003
Posts: 3,456
Likes: 2
Master Hacker
Master Hacker
Offline
Joined: Jan 2003
Posts: 3,456
Likes: 2
no, that would not work, that would remove all the buttons. You can find the code for the image image in public_common.pl

Joined: Jan 2003
Posts: 118
Member
Member
Offline
Joined: Jan 2003
Posts: 118
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.


-GATOR

"Pain is temporary, Pride is forever"
Joined: Jan 2003
Posts: 3,456
Likes: 2
Master Hacker
Master Hacker
Offline
Joined: Jan 2003
Posts: 3,456
Likes: 2
yes, remove both pieces of code.

It would not realign the buttons, but you can edit the html accordingly

Joined: Nov 2002
Posts: 188
Member
Member
Offline
Joined: Nov 2002
Posts: 188
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.

Joined: Oct 2001
Posts: 15
Junior Member
Junior Member
Offline
Joined: Oct 2001
Posts: 15
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.

Joined: Jan 2003
Posts: 3,456
Likes: 2
Master Hacker
Master Hacker
Offline
Joined: Jan 2003
Posts: 3,456
Likes: 2
allowing flash files to be embedded is a security risk.

Real player is just a bad program tipsy

Page 1 of 2 1 2

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
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)