PDA

View Full Version : (Useless) Acronym vBcode


Velocd
05-24-2003, 10:00 PM
While browsing the web I came across a website that used <acronym> HTML4 tag, and finding the concept interesting, I decided to try out a vBcode tag for it.

I soon ran into an error with the <acronym> tag that was buggin' the hell out of me, so I switched over to the <span> tag.

Anyway, 98% of the people here might find this utterly useless, but what this does is allows somebody to type:


United States of America
PHP Hypertext Preprocessor


And outputted will be:


USA
PHP


This is different from the HTML acronym tag for it automatically does the ?acronymization? of the compounded term for you. ;)

Upon hovering the word with your mouse, which will not be solid underlined but "dotted" underlined, the acronym full term will show up in one of those "alt" boxes.

The main convenience of the HTML and this acronym tag is that sometimes not everyone knows what an acronym means, if the acronym isn't well-known, so this will aid in clarifying things.

----------------

If you feel inspired by this hack, feel free to click the install-button (inspired meaning, even if you didn't install it on your forum :rolleyes: j/k)

Velocd
05-25-2003, 03:33 AM
Here is an example, just for those deprived of imagination. :p

Austin Dea
05-25-2003, 04:55 AM
I saw this at vBT but with no hacking.. o_O

Austin Dea
05-25-2003, 04:56 AM
Originally posted at vBTemplates
vB Code tag: Acronym
vB Code replacement: <span style="border-bottom: 1px dashed {option}; cursor: help;">{param}</span>
vB Code example: This BB code changes the cursor and title.
vB Code explanation: Acronym - descibibing with question cursor help. Developded by Marco from WebMaxtor.com
Use {option}: Yes

=P

Velocd
05-25-2003, 05:02 AM
If you took a second to look inside the magical file titled "install_acronym.txt" you would find out how this differs from the general <acronym> tag, as I stated in the first post. =P *infinite +1

You can't do this style of hack with no php coding.

Robink
05-25-2003, 05:03 AM
Cool, but useless...

Velocd
05-25-2003, 05:05 AM
Hence the title. ;)

Boofo
05-25-2003, 05:11 AM
Found a problem with it. If you use the word OFF in an acronym, it picks up the last F because one of the omitted words is OF. Try doing:

Laughing My Ass Off

with your code and you will see what I mean.

Velocd
05-25-2003, 05:30 AM
Ah... looks like I underestimated the functionality of that darn str_replace().

I'm a bit tired as of now though, and about to doze off, but if anyone would care to find out how to make it so str_replace() matches "whole words" only, that would be cool. ;)

Boofo
05-25-2003, 05:34 AM
Do a preg_replace instead.

gmarik
05-25-2003, 07:47 AM
Austin Dea - nice to see my code spreading around.
Velocd - have you updated install_acronym.txt? Is it ok now with the "f" letter?

Boofo
05-25-2003, 08:13 PM
Velocd, did you find a fix for this yet?

Velocd
05-25-2003, 10:00 PM
I've been gone all day, sorry about the wait. I found the preg_replace() expression to do the job, and have updated the text file. Clear your cache if you are re-downloading. ;)

Erwin
05-26-2003, 12:05 AM
Interesting hack. :)