News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Celebrity Quotes

Started by Mexican_Pirate, May 27, 2005, 01:43:27 PM

Previous topic - Next topic

Mexican_Pirate

This mod will add a dropdown box for instant celebrity quotes to your forum. However, the way I have done it requires the Custom BBCode mod to be installed. First, go to your Custom BBCode box and copy/paste this into it:
cableguy <B>Larry the Cable Guy says:</B><BR><TABLE BORDER=2 WIDTH=75%><TR><TD WIDTH=100><IMG SRC="http://www.opticalnightmare.wm-talk.com/images/icons/larrythecableguy.jpg" align=left BORDER=1></TD><TD>$1</TD></TR></TABLE>
conan <B>Conan O'Brien says:</B><BR><TABLE BORDER=2 WIDTH=75%><TR><TD WIDTH=110><IMG SRC="http://www.opticalnightmare.wm-talk.com/images/icons/conan.jpg" align=left BORDER=1></TD><TD>$1</TD></TR></TABLE>
johncleese <B>John Cleese says:</B><BR><TABLE BORDER=2 WIDTH=75%><TR><TD WIDTH=76><IMG SRC="http://www.opticalnightmare.wm-talk.com/images/icons/johncleese.jpg" align=left BORDER=1></TD><TD>$1</TD></TR></TABLE>
arnold <B>Arnold Schwarzenegger says:</B><BR><TABLE BORDER=2 WIDTH=75%><TR><TD WIDTH=78><IMG SRC="http://www.opticalnightmare.wm-talk.com/images/icons/arnold.jpg" align=left BORDER=1></TD><TD>$1</TD></TR></TABLE>


It would be appreciated if you got your own hosting for the images. Then, open your Themes > Default > Post.template.php, and look for this:
// Print a drop down list for all the colors we allow!
if (!isset($context['disabled_tags']['color']))
echo ' <select onchange="surroundText(\'[color=\'+this.options[this.selectedIndex].value+\']\', \'[/color]\', document.', $context['post_form'], '.', $context['post_box_name'], '); this.selectedIndex = 0;" style="margin-bottom: 1ex;">
<option value="" selected="selected">', $txt['change_color'], '</option>
<option value="Black">', $txt[262], '</option>
(The other colors that go in between)
<option value="LimeGreen">', $txt[275], '</option>
</select>';


After, press ENTER and add this:
// Print a drop down list for miscellaneous code!
if (!isset($context['disabled_tags']['misc.']))
echo ' <select onchange="surroundText(\'[\'+this.options[this.selectedIndex].value+\']\', \'[/\'+this.options[this.selectedIndex].value+\']\', document.', $context['post_form'], '.', $context['post_box_name'], '); this.selectedIndex = 0;" style="margin-bottom: 1ex;">
<option value="" selected="selected">', $txt, '</option>
<option value="cableguy">', cableguy, '</option>
<option value="conan">', conan, '</option>
<option value="johncleese">', johncleese, '</option>
<option value="arnold">', arnold, '</option>
</select>';


And there you have it. Instant quotes from John Cleese, Arnold Schwarzenegger, Larry the Cable Guy, and Conan O'Brien. Presented by Mexican_Pirate. Revolutionizing the way you waste your time.

z3rb

nice, i like how it is on your forum.

Thantos

You realize that the HTML you posted in that first block is not valid for XHTML which is the default for this board.

z3rb


Mexican_Pirate

Quote from: MikeMill on May 28, 2005, 10:16:01 AM
You realize that the HTML you posted in that first block is not valid for XHTML which is the default for this board.
But it is valid if you Copy/Paste it into the box that is given by the "Custom BBCode" mod. Like z3rb said, even go to my web site to see it in action.

Thantos


Mexican_Pirate

Oh my... That's... that's not good... So how do I fix it?

Thantos

probably by using standard compliant markup

Mexican_Pirate

I don't know XHTML, though.

And does that thing see all plain HTML as an error? Because I've had no problems with this code, no matter what browser I try it in.

Thantos

first all tags are suppose to be lowercase
<B> = invalid
<b> = valid

Second every tag must be closed
<br> = invalid
<br/> = valid

Third all attribute values must be enclosed in quotes
<table border=2> = invalid
<table border="2"> = valid

Forth all images must have an alt specified
<img src="blah.jpg" /> = invalid
<img src="blah.jpg" alt="" /> = valid

There might be more things also.  Just look at the validation errors.  For the most part they are fairly easy to understand

Mexican_Pirate

That's it? That's all XHTML is? That's easy, I'll go fix it.

Thantos

No thats not "all" XHTML is, but thats the majority points I saw in your example code

Tristan Perry

I wouldn't worry too much about being XHTML compliant. I don't stick to it at the moment and my website displays fine in Internet Explorer, Opera and Firefox. Although it has some advantages, being XHTML compliant is more for added peace of mind and makes your website look good to web designs and the like.

*Waits to be flamed*  :P What I have said above it true, for me. In my experiences complying to XHTML has been a waste of time.

Mexican_Pirate

Okay, I got it done the *right* way, just for all of you who need it to be correct.
cableguy <b>Larry the Cable Guy says:</b><br/><table border=2 width="75%"><tr><td width="100"><img src="http://www.opticalnightmare.wm-talk.com/images/icons/larrythecableguy.jpg" align="left" border="1" alt="Photo of Larry the Cable Guy" /></td><td>$1</td></tr></table>
conan <b>Conan O'Brien says:</b><br/><table border="2" width="75%"><tr><td width="110"><img src="http://www.opticalnightmare.wm-talk.com/images/icons/conan.jpg" align="left" border="1" alt="Photo of Conan O'Brien" /></td><td>$1</td></tr></table>
johncleese <b>John Cleese says:</b><br/><table border="2" width="75%"><tr><td width="76"><img src="http://www.opticalnightmare.wm-talk.com/images/icons/johncleese.jpg" align="left" border="1" alt="Photo of John Cleese" /></td><td>$1</td></tr></table>
arnold <b>Arnold Schwarzenegger says:</b><br/><table border="2" width="75%"><tr><td width="78"><img src="http://www.opticalnightmare.wm-talk.com/images/icons/arnold.jpg" align="left" border="1" alt="Photo of Arnold Schwarzenegger" /></td><td>$1</td></tr></table>

And you know what? It doesn't even look different, all that did was make it more confusing.

Tristan Perry

Quote from: Mexican_Pirate on May 31, 2005, 02:03:34 PM
Okay, I got it done the *right* way, just for all of you who need it to be correct.
cableguy <b>Larry the Cable Guy says:</b><br/><table border=2 width="75%"><tr><td width="100"><img src="http://www.opticalnightmare.wm-talk.com/images/icons/larrythecableguy.jpg" align="left" border="1" alt="Photo of Larry the Cable Guy" /></td><td>$1</td></tr></table>
conan <b>Conan O'Brien says:</b><br/><table border="2" width="75%"><tr><td width="110"><img src="http://www.opticalnightmare.wm-talk.com/images/icons/conan.jpg" align="left" border="1" alt="Photo of Conan O'Brien" /></td><td>$1</td></tr></table>
johncleese <b>John Cleese says:</b><br/><table border="2" width="75%"><tr><td width="76"><img src="http://www.opticalnightmare.wm-talk.com/images/icons/johncleese.jpg" align="left" border="1" alt="Photo of John Cleese" /></td><td>$1</td></tr></table>
arnold <b>Arnold Schwarzenegger says:</b><br/><table border="2" width="75%"><tr><td width="78"><img src="http://www.opticalnightmare.wm-talk.com/images/icons/arnold.jpg" align="left" border="1" alt="Photo of Arnold Schwarzenegger" /></td><td>$1</td></tr></table>

There's still a few mistakes, e.g. "border=2"

Quote from: Mexican_Pirate on May 31, 2005, 02:03:34 PM
And you know what? It doesn't even look different, all that did was make it more confusing.
Yep. It takes time and effort for.. hardly any gain. Fairly pointless if you ask me.

z3rb

yeah, whats the point in it being XHTML compliant?

Thantos

QuoteYep. It takes time and effort for.. hardly any gain. Fairly pointless if you ask me.
Standards exist for a reason.  They are not pointless.  If you don't want to follow the standard thats fine, at least remove that image at the bottom of the forum that says you do.

QuoteI wouldn't worry too much about being XHTML compliant. I don't stick to it at the moment and my website displays fine in Internet Explorer, Opera and Firefox. Although it has some advantages, being XHTML compliant is more for added peace of mind and makes your website look good to web designs and the like.
What about the host of other browsers out there?  By following the standard you can ensure that it will displaying correctly and if you didn't make any assumptions it should look the same.

A lot of these can be fixed with a simple text editor and using find and replace

As I said if you don't want to follow the standard fine, but I will point it out since its a goal we should strive for.

Ben_S

Quote from: Tau Online on May 31, 2005, 03:10:06 PM
Quote from: Mexican_Pirate on May 31, 2005, 02:03:34 PM
And you know what? It doesn't even look different, all that did was make it more confusing.
Yep. It takes time and effort for.. hardly any gain. Fairly pointless if you ask me.

No problem if it's for you own board only, if it's in tips and tricks though, it needs to be valid for the reasons mike said.
Liverpool FC Forum with 14 million+ posts.

Tristan Perry

#18
Disclaimer: Firstly I don't mean to sound argumentative, I'm mearly saying what I know/have learnt from my past experiences.

Quote from: MikeMill on May 31, 2005, 03:32:50 PM
Standards exist for a reason.  They are not pointless.  If you don't want to follow the standard thats fine, at least remove that image at the bottom of the forum that says you do.
Not meaning to sound dense or anything, although what is the reason? Also I have removed the XHTML compliant image from the bottom of my forum..?

Quote from: MikeMill on May 31, 2005, 03:32:50 PM
What about the host of other browsers out there?  By following the standard you can ensure that it will displaying correctly and if you didn't make any assumptions it should look the same.

A lot of these can be fixed with a simple text editor and using find and replace

As I said if you don't want to follow the standard fine, but I will point it out since its a goal we should strive for.
The host of other browsers? The one's I reffered to (Firefox reffering to Mozilla and Netscape BTW) account for about 0.1% of the browser usage on the internet, if that. There are other browsers out there, although they aren't used much.

Also I have heard (Before now) that following the standards supposedly makes sure that you're website displays correctly in all browsers, although that's not true. Web standards are nowadays generally using XHTML and CSS: CSS for style and general layout, XHTML for content. CSS2 intergration for the most used browsers is very poor. If I make a website following the strictest web standards it will look terrible in different browsers and making it cross-browser is a nightmare. Using HTML for layout and content and CSS for a bit of styles has worked much better for me: Fast enough loading pages and works well in 99.9% of internet user's browsers.

Quote from: Ben_S on May 31, 2005, 03:44:18 PM
No problem if it's for you own board only, if it's in tips and tricks though, it needs to be valid for the reasons mike said.
Sure, I hadn't realized that.

[Unknown]

#19
I'm glad to hear you don't care about:
  - my friend who largely uses a PDA.
  - my other friend who is blind.
  - my brother who often uses Links while recompiling his kernel to a new burning-edge version.

Web standards are also about just plum being correct.  If I see a website which isn't correct, it leads me to believe the person maintaining it isn't trustworthy; if they don't care to be correct with HTML, who knows what else they just "do what works" for?

For example, I'd never hire a lawyer with bad HTML in his or her website.  This means he or she either doesn't care enough to hire knowledgable people to get the job done RIGHT, doesn't do it right HIMSELF (or herself), or doesn't even KNOW there's a problem.  Any of those three are sure to reflect on his or her legal practices.

I see you don't talk lik u dnt now how 2 spel
y do u typ rite xcpt wit htm? I can stil red it! every1 can

-[Unknown]

Advertisement: