News:

Want to get involved in developing SMF, then why not lend a hand on our github!

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]

Tristan Perry

Quote from: [Unknown] on May 31, 2005, 09:16:30 PM
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]
You're right about the examples you given I guess.. Although I can actually view my website fine with all the PDAs I've tried. I can see what you're saying, although in some ways it still proves my point. People who are web designers, or simply people who are good with coding, care about the HTML coding behind a website, but many others don't.

I've never said that because I don't use valid XHTML strict 1.1 I hate all blind people, I have just simply said that in my experiences I haven't found the effort to pay off. I'm re-designing my website in about a month, I'll look into user disabilites to see whether the effort would be worth it... Saying that though, how do I go about making my website usable for WAP/PDA/Blind users?

Mexican_Pirate

Quote from: [Unknown] on May 31, 2005, 09:16:30 PM
I'm glad to hear you don't care about:
  - my other friend who is blind.

-[Unknown]
Pardon my asking, but how would a blind person be able to use a forum web site?

Ben_S

Via a programme that reads the source and turns it into audio.

If the html isn't valid, the reader will struggle to work out what's what.
Liverpool FC Forum with 14 million+ posts.

Mexican_Pirate

Ah, I see. Well, not a lot of people want to go to my web site anyways, so I guess it's fine for now.

[Unknown]

In her case, while she is blind she can see a little bit with a very strong magnifying glass (the sort you have to purchase from disability places.)  Color is out for her completely, but she can read if she goes in close.  You'd be surprised how often she uses the internet, because she doesn't want to hate her life.

-[Unknown]

Mexican_Pirate

Great, now I feel like a horrible person...

rudoka

Here is my opinion on standards.
They are surely made as a guide lines. And usually the purpose of the standards was/is to make a webpage look the same in EVERY browser. At least one of the purposes.

Now, since some time I use one browser and I end up to sites that are usually broken, looking like hell. I turn over to IE and find it that it looks just fine.

I looked at the html and css and whatever, did some research (I ain't an expert) and found out that those pages are broken in Firefox only because they are NOT standard compliant. Because Firefox didn't "understood" them. Which I found perfectly correct and acceptable.
  Some "standards" are also made for security issues, I suppose. Therefore I wouldn't want my browser interpretating something that is written bad (accidentally or planned) => therefore doing something that is not supposed to do.

   And yes. If I find a site that doesn't opens correct in the browser that I trust (talking generally here) then I don't open it. I won't turn to another browser that proved a failure (to me).
   People forget this., I hear saying: Oh but the majority of folks are using IE so we should write the pages for IE. Well, that's quite a bad attitude.
   We should write the pages for the PEOPLE, considering what is good and correct. For example, IE is NOT "good and correct" and I had the chance to prove this to myself over and over again. Other browsers I don't know, but the standard issue applies to them too.

So let's just follow the standards. Rules and laws are made to be broken, but not this time.  ;)

Rudolf

Mexican_Pirate

Yeah... but it works cross-browser...

Tristan Perry

#28
Quote from: rudoka on June 01, 2005, 01:51:56 PM
Here is my opinion on standards.
They are surely made as a guide lines. And usually the purpose of the standards was/is to make a webpage look the same in EVERY browser. At least one of the purposes.

Now, since some time I use one browser and I end up to sites that are usually broken, looking like hell. I turn over to IE and find it that it looks just fine.

I looked at the html and css and whatever, did some research (I ain't an expert) and found out that those pages are broken in Firefox only because they are NOT standard compliant. Because Firefox didn't "understood" them. Which I found perfectly correct and acceptable.
  Some "standards" are also made for security issues, I suppose. Therefore I wouldn't want my browser interpretating something that is written bad (accidentally or planned) => therefore doing something that is not supposed to do.

   And yes. If I find a site that doesn't opens correct in the browser that I trust (talking generally here) then I don't open it. I won't turn to another browser that proved a failure (to me).
   People forget this., I hear saying: Oh but the majority of folks are using IE so we should write the pages for IE. Well, that's quite a bad attitude.
   We should write the pages for the PEOPLE, considering what is good and correct. For example, IE is NOT "good and correct" and I had the chance to prove this to myself over and over again. Other browsers I don't know, but the standard issue applies to them too.

So let's just follow the standards. Rules and laws are made to be broken, but not this time.  ;)

Rudolf
In some ways I agree. Although take my website as an example. It's not XHTML, nor HTML valid. However, I look at it using the different browsers/machines I have:

Internet Explorer: Fine
Firefox: Fine
Netscape: Fine
Opera: Fine
My PDA: Fine

My website looks fine in most browsers I have tested and it's not even.. XHTML valid. :o Now I know that my website doesn't work for blind people, although I haven't the time at the moment to convert my website to XHTML valid for less than .5% of my audience. However, if someone shows me how blind people would use my website, and the answer being they can't, I will change my site over to valid XHTML 1.1 when I have the time.

rudoka

Hi Tau.

I congratulate you.
Your site looks good (in Firefox), and I like the look too.  ;)
What I said wasn't that EVERYTHING that is not conforming the standards is broken.
   As a quick glimpse at your html it seems that it's quite clear and beautifully arranged. I can't verify it's validity, however a clean and well-thought job will end up in a good work. Now, of course, nothing is 100% standard compliant. Specially if it's acomplex website.
Yet, everyone creating/designing websites should try to make them so. Xhtml or html doesn't matter. I don't know much the difference anyway. But the goal should be to write pages viewable by everyone.
  And the browser developers should work in that direction too. Not to create their own "standards".  Obviously there are some who do not care about the "industry" standards (W3C). They include new "features" to lure people to their side. It's abattle for the market and for MONEY!!!
Ack!! And what about us??


    It seems that it is not your case. As I said, it seems that you are not one of those freaks, who include every stupid extra "feature"  IE and other browser has to offer to them.

Rudolf

Tristan Perry

Quote from: rudoka on June 01, 2005, 02:17:38 PM
Hi Tau.

I congratulate you.
Your site looks good (in Firefox), and I like the look too.  ;)
What I said wasn't that EVERYTHING that is not conforming the standards is broken.
   As a quick glimpse at your html it seems that it's quite clear and beautifully arranged. I can't verify it's validity, however a clean and well-thought job will end up in a good work. Now, of course, nothing is 100% standard compliant. Specially if it's acomplex website.
Yet, everyone creating/designing websites should try to make them so. Xhtml or html doesn't matter. I don't know much the difference anyway. But the goal should be to write pages viewable by everyone.
  And the browser developers should work in that direction too. Not to create their own "standards".  Obviously there are some who do not care about the "industry" standards (W3C). They include new "features" to lure people to their side. It's abattle for the market and for MONEY!!!
Ack!! And what about us??


    It seems that it is not your case. As I said, it seems that you are not one of those freaks, who include every stupid extra "feature"  IE and other browser has to offer to them.

Rudolf
I see what you're saying and it makes sense. Also thanks for the compliments  :)  So well formed HTML pages can be as cross-browser/compliant as XHTML pages?

rudoka

#31
Quote from: Tau Online on June 01, 2005, 03:05:34 PM
I see what you're saying and it makes sense. Also thanks for the compliments  :)  So well formed HTML pages can be as cross-browser/compliant as XHTML pages?

A well baked cookie can be liked by everyone even if you don't put the exact miligramms of flour, sugar, the exact number of eggs, and whatnot. It takes only a little "common sense".
You know what I mean? ;)

   And then XHTML and HTML are the same, or not? Well, the X is for eXtra or eXtended. So, I think the HTML was before. ;) Why shouldn't the browsers understand it?
When I say standard compliant I don't mean it to be XHTML. Only that if you state that your code is XHMTL then it should be.
   Instead if you instruct the browsers that your script is (just) HTML and should be interpreted that way, then obviously you should stick with what's correct in HTML and don't use new features from XHTML.  The same with Javascript 1.1/1.2/1.3 and everything else in general.
    A script written as Javascript 1.1 will be parsed correctly by every (good) browser until it IS based on the Javascript 1.1 "standard" (and not 1.2+).
    This is my logic on the subject.

So the question is. Do you want XHTML or HTML? Do you need something you can do only using XHTML? Then you should try to make the whole page so, and not only the part you want, keeping in mind the rules.
By the way. I think i saw in your page some XHTML style scripting. But that's just a wild guess.

Rudolf

Tristan Perry

Quote from: rudoka on June 01, 2005, 11:58:44 PM
Quote from: Tau Online on June 01, 2005, 03:05:34 PM
I see what you're saying and it makes sense. Also thanks for the compliments  :)  So well formed HTML pages can be as cross-browser/compliant as XHTML pages?

A well baked cookie can be liked by everyone even if you don't put the exact miligramms of flour, sugar, the exact number of eggs, and whatnot. It takes only a little "common sense".
You know what I mean? ;)

   And then XHTML and HTML are the same, or not? Well, the X is for eXtra or eXtended. So, I think the HTML was before. ;) Why shouldn't the browsers understand it?
When I say standard compliant I don't mean it to be XHTML. Only that if you state that your code is XHMTL then it should be.
   Instead if you instruct the browsers that your script is (just) HTML and should be interpreted that way, then obviously you should stick with what's correct in HTML and don't use new features from XHTML.  The same with Javascript 1.1/1.2/1.3 and everything else in general.
    A script written as Javascript 1.1 will be parsed correctly by every (good) browser until it IS based on the Javascript 1.1 "standard" (and not 1.2+).
    This is my logic on the subject.

So the question is. Do you want XHTML or HTML? Do you need something you can do only using XHTML? Then you should try to make the whole page so, and not only the part you want, keeping in mind the rules.
By the way. I think i saw in your page some XHTML style scripting. But that's just a wild guess.

Rudolf
Good points, thanks  :) Also I have put XHTML in the page, although only instead of <br> and <hr> I'm using <br /> and <hr /> respectively. I'm not really sticking to XHTML much on my website at the moment.

Mexican_Pirate

Me neither, I only learned basic HTML a few months ago.

rudoka

Good. Now, what was the topic of this discussion? ;)

Rudolf

Tristan Perry

Quote from: rudoka on June 02, 2005, 02:26:59 PM
Good. Now, what was the topic of this discussion? ;)

Rudolf
Erm.. good point  :P This topic has gone slightly off-topic!  ;)

Mexican_Pirate

Oh yeah, it was about the Celebrity Quotes drop-down box that I made. Any comments on what it does rather than its HTML structure?

Advertisement: