Apolyton Archive  |  Preserved copy of the Apolyton Civilization Site and its forums as they stood in September 2005. Read-only; nothing here can be posted to or replied to.  |  Forum index |  About this archive |  The 1998–2001 UBB forums
Today on Apolyton WARDELL INTERVIEW PROMO A.C.S. HISTORY CHAPTER 4 GET CIV4 /w FREE PLUS! A.C.S. PHOTO GALLERY GET A.O.M. V1.1
Apolyton Civilization Forums
main| civ2| civ3| civ4| smac| ctp2| ron| moo3| galciv| galciv2| alt| about|
ApolytonPLUS | register | search | faq | new posts | pm (-/-) | upload | members
hall of fame new! | civgroups | civgroups news | interviews | the column | radio | chat | directory | news | store | PLUS
Apolyton Civilization Forums : Powered by vBulletin version 2.0.3 Apolyton Civilization Forums > Miscellaneous > Archive > Off-Topic-Archive > HTML: global variables
Show a Printable Version | Email This Page to Someone! | Receive updates to this thread | Report this to Apolyton news!

bottom of page
  
Author
Thread    < Last Thread     Next Thread > Post New Thread     Post A Reply
MattH is offline MattH
King
Go sneer at that cow creamer!
Jul 2002
time: 05:30
  Old Post 13-08-2003 23:18
Edit/Delete Message Reply w/Quote
#1 Report this post to a moderator
HTML: global variables Support Apolyton, buy Civilization 2

Is there a way to store color info (like rgb and hex) as global variables in html? I'm working on this website, and it's got maybe 10 or 20 thousand tables, most with the same bg color. The last thing I want to do is go through all of them and change the colors cause of one stupid mistake (and it's more convenient than global find/replace).

Asher is offline Asher
King
Calgary, Alberta
Nov 1999
time: 22:30
  Old Post 13-08-2003 23:20 Visit Asher's homepage!
Edit/Delete Message Reply w/Quote
#2 Report this post to a moderator
Support Apolyton, buy Galactic Civilizations: Deluxe Edition

HTML doesn't have variables. Period.

It's a markup language, not a programming language.

What you probably want is a scripting environment of some kind (PHP could do that no problem), or CSS somehow.

MattH is offline MattH
King
Go sneer at that cow creamer!
Jul 2002
time: 05:30
  Old Post 13-08-2003 23:28
Edit/Delete Message Reply w/Quote
#3 Report this post to a moderator
Support Apolyton buy from Amazon

For large sections, such as navbar and some text, I'm using php includes, but I was hoping there was an easier way to do it with something like css. (really wasn't clear above)

Asher is offline Asher
King
Calgary, Alberta
Nov 1999
time: 22:30
  Old Post 13-08-2003 23:31 Visit Asher's homepage!
Edit/Delete Message Reply w/Quote
#4 Report this post to a moderator
Get a bigger avatar today!

If you're already using PHP, just use a PHP variable.

Then use "$color" everywhere and define it once at the top.

chegitz guevara is offline chegitz guevara
King
Ft. Lauderdale, FL Communist Party of Apolyton
Jun 2000
time: 00:30
  Old Post 13-08-2003 23:37 Visit chegitz guevara's homepage!
Edit/Delete Message Reply w/Quote
#5 Report this post to a moderator
Inflate your Upload Space

You can do it with CSS. Suppose (for some reason) you want all cells in bright red. Either in the head of your document, or better, in a external css file, write:

td {background-color: #ff0000}

All table cells in linked documents wil then be red. You can override indivudual cells with by using the CLASS attribute to link another style or using an inline style:

<td align="center" width="45" style="background-color: #ffff00">

MattH is offline MattH
King
Go sneer at that cow creamer!
Jul 2002
time: 05:30
  Old Post 13-08-2003 23:38
Edit/Delete Message Reply w/Quote
#6 Report this post to a moderator
Lose 30 kilos (of popups)

MattH is offline MattH
King
Go sneer at that cow creamer!
Jul 2002
time: 05:30
  Old Post 13-08-2003 23:42
Edit/Delete Message Reply w/Quote
#7 Report this post to a moderator
Support Apolyton buy from Amazon

I think I'll go with the php approach
I allready have a mile long css file, an all the tables are slightly different- don't want to go around with

code:
td {blah: "" etc} .{} .{} .{} .{}

and then have to redefine class for each table.

Lets see how this works.

chegitz guevara is offline chegitz guevara
King
Ft. Lauderdale, FL Communist Party of Apolyton
Jun 2000
time: 00:30
  Old Post 13-08-2003 23:43 Visit chegitz guevara's homepage!
Edit/Delete Message Reply w/Quote
#8 Report this post to a moderator
Full PM-box? Change here!

You can do the same thing for any element, it doesn't have to just be TD.

Ten to twenty thousand tables. Man, and I thought my work was hard.

MattH is offline MattH
King
Go sneer at that cow creamer!
Jul 2002
time: 05:30
  Old Post 13-08-2003 23:47
Edit/Delete Message Reply w/Quote
#9 Report this post to a moderator
Support Apolyton, buy Civilization 2

I know some css... enough to define styles

Well, maybe it's not exactly 20,000, but who's counting?

chegitz guevara is offline chegitz guevara
King
Ft. Lauderdale, FL Communist Party of Apolyton
Jun 2000
time: 00:30
  Old Post 13-08-2003 23:52 Visit chegitz guevara's homepage!
Edit/Delete Message Reply w/Quote
#10 Report this post to a moderator
Support Apolyton, buy GURPS/ Alpha Centauri

CSS is bloody simple.
http://archive.devx.com/projectcool...amic/index.html

On the one hand, if you're more comfortable with PHP, go with it. On the other hand, you do need to keep in mind future developers. My current task is ripping out a bunch of brilliant JavaScript that no one here at the company can understand. It functions very well, but since we can't understand it (it's extremly complex and well over 1200 lines), we can't modify it. It's been around for three years, and none of the developers here was here when it was written.

MattH is offline MattH
King
Go sneer at that cow creamer!
Jul 2002
time: 05:30
  Old Post 13-08-2003 23:55
Edit/Delete Message Reply w/Quote
#11 Report this post to a moderator
Support Apolyton, buy Civilization: The Boardgame

No, no... I do know CSS... And I don't know how I've lived without it. The o'reilley book is right behind me.

chegitz guevara is offline chegitz guevara
King
Ft. Lauderdale, FL Communist Party of Apolyton
Jun 2000
time: 00:30
  Old Post 13-08-2003 23:56 Visit chegitz guevara's homepage!
Edit/Delete Message Reply w/Quote
#12 Report this post to a moderator
Support Apolyton, buy Alpha Centauri

Mea culpa, read too quickly.

chegitz guevara is offline chegitz guevara
King
Ft. Lauderdale, FL Communist Party of Apolyton
Jun 2000
time: 00:30
  Old Post 13-08-2003 23:58 Visit chegitz guevara's homepage!
Edit/Delete Message Reply w/Quote
#13 Report this post to a moderator
Support Apolyton, buy Civilization 2

Alternatively, you could create variables using JavaScript.

Just giving you options.

Asher is offline Asher
King
Calgary, Alberta
Nov 1999
time: 22:30
  Old Post 14-08-2003 00:07 Visit Asher's homepage!
Edit/Delete Message Reply w/Quote
#14 Report this post to a moderator
Increase Your PM Length

1,200 lines of JavaScript is a challenge?

chegitz guevara is offline chegitz guevara
King
Ft. Lauderdale, FL Communist Party of Apolyton
Jun 2000
time: 00:30
  Old Post 14-08-2003 00:21 Visit chegitz guevara's homepage!
Edit/Delete Message Reply w/Quote
#15 Report this post to a moderator
Support Apolyton, buy Galactic Civilizations

quote:
Originally posted by Asher
1,200 lines of JavaScript is a challenge?


I said at least. We really don't know how long it was, because it was all wrapped up into one long line. 1200 was where I got to before I was told to drop it.

Go here: http://www.acuvue.com/

Those twelve hundred+ lines of code control the buttons in the left side navbar. A couple rollovers, and a flyout menu? I could (and will) do the same with about 50 lines of code.

dejon is offline dejon
King

Sep 2002
time: 00:30
  Old Post 14-08-2003 02:42
Edit/Delete Message Reply w/Quote
#16 Report this post to a moderator
Suffering from ads?

Did you even do a web search on that old menu system? I just found where it came from in a few seconds.

AllWebMenus

MattH is offline MattH
King
Go sneer at that cow creamer!
Jul 2002
time: 05:30
  Old Post 14-08-2003 02:51
Edit/Delete Message Reply w/Quote
#17 Report this post to a moderator
Support Apolyton, buy GURPS/ Alpha Centauri

WTF????? Crazy menu! Run!
I'm using the menu system from milonic.com/menu... super easy.
Free, or $40 for a corporation.

Urban Ranger is offline Urban Ranger
Apolyton Duke of Off-Topic

Donate to the Red Cross
The City State of Noosphere, CPA special envoy
May 1999
time: 13:30
  Old Post 14-08-2003 12:45
Edit/Delete Message Reply w/Quote
#18 Report this post to a moderator
Re: HTML: global variables Help yourself to an AD-FREE life

quote:
Originally posted by MattH
Is there a way to store color info (like rgb and hex) as global variables in html? I'm working on this website, and it's got maybe 10 or 20 thousand tables, most with the same bg color.


Isn't doing website layout with tables a bit behind the times?

MattH is offline MattH
King
Go sneer at that cow creamer!
Jul 2002
time: 05:30
  Old Post 14-08-2003 18:28
Edit/Delete Message Reply w/Quote
#19 Report this post to a moderator
Re: Re: HTML: global variables Increase the size of your Attachments

quote:
Originally posted by Urban Ranger


Isn't doing website layout with tables a bit behind the times?


I'll forgive you

Don't see what's wrong with them, they don't look as dorky as most.

chegitz guevara is offline chegitz guevara
King
Ft. Lauderdale, FL Communist Party of Apolyton
Jun 2000
time: 00:30
  Old Post 14-08-2003 19:19 Visit chegitz guevara's homepage!
Edit/Delete Message Reply w/Quote
#20 Report this post to a moderator
Re: Re: HTML: global variables Got spare money?

quote:
Originally posted by Urban Ranger
Isn't doing website layout with tables a bit behind the times?


That's what I tell them every week. I've even given my boss the interview from DevNet with the PL from ESPN on why they went to an all CSS design. I've got their attention.

Here's the problem, our buyers (eye doctors) buy many thousands of dollars worth of product at a time. Regular folks have to buy them from eye doctors, so our technical requirements mean we need to support even the 2% of 1% (.0002) of users who still access our site with Netscape Nav 4 for Mac (which doesn't support layers or CSS). If those 5,000 people buy $1,000 worth of product, well, that's a half million dollars.

Of course, we need to break the numbers down further, and find out how many of those people are access the professional side of the site.

But whereas they would reject my arguments quickly before, they are now listening, especially after I showed them the ESPN site and how they were handling old users. Plus I mentioned we can migrate slowly and prepare people for the change ahead of time.

chegitz guevara is offline chegitz guevara
King
Ft. Lauderdale, FL Communist Party of Apolyton
Jun 2000
time: 00:30
  Old Post 14-08-2003 19:25 Visit chegitz guevara's homepage!
Edit/Delete Message Reply w/Quote
#21 Report this post to a moderator
Tired of ads?

quote:
Originally posted by dejon
Did you even do a web search on that old menu system? I just found where it came from in a few seconds.

AllWebMenus


And what, I'm just supposed to convince my bosses to purchase this program because the design firm that created this site two+ years ago had a copy? It swats flies with a sledgehammer and we've been looking for a reason to get rid of it. I can replicate the same functionality with much less effort.

And yes, I googled the name of the product. I've been writing mouseOvers for seven years, and this is the most useless product I've ever seen.

Urban Ranger is offline Urban Ranger
Apolyton Duke of Off-Topic

Donate to the Red Cross
The City State of Noosphere, CPA special envoy
May 1999
time: 13:30
  Old Post 14-08-2003 19:36
Edit/Delete Message Reply w/Quote
#22 Report this post to a moderator
Re: Re: Re: HTML: global variables Lose 30 kilos (of popups)

quote:
Originally posted by MattH

I'll forgive you

Don't see what's wrong with them, they don't look as dorky as most.


I have been doing websites since 1996, when there weren't any WYSIWYG editors, CSS wasn't conceived, and HTML 3.2 was the best thing there was. So I think I know a few things about websites here and there

There are a few problems with tables.

1. Browsers don't render them the same way, particularly nested tables, which is something you will have to use if you do layouts with tables.

2. Complicated tables are rendered slowly.

3. They are hell to edit.

In the bad old days when there was nothing else, one gotta do what one gotta do. But why use them for layout now?

Urban Ranger is offline Urban Ranger
Apolyton Duke of Off-Topic

Donate to the Red Cross
The City State of Noosphere, CPA special envoy
May 1999
time: 13:30
  Old Post 14-08-2003 19:39
Edit/Delete Message Reply w/Quote
#23 Report this post to a moderator
Re: Re: Re: HTML: global variables Inflate your Upload Space

quote:
Originally posted by chegitz guevara
Here's the problem, our buyers (eye doctors) buy many thousands of dollars worth of product at a time. Regular folks have to buy them from eye doctors, so our technical requirements mean we need to support even the 2% of 1% (.0002) of users who still access our site with Netscape Nav 4 for Mac (which doesn't support layers or CSS). If those 5,000 people buy $1,000 worth of product, well, that's a half million dollars.


That would be a problem.

quote:
Originally posted by chegitz guevara
But whereas they would reject my arguments quickly before, they are now listening, especially after I showed them the ESPN site and how they were handling old users. Plus I mentioned we can migrate slowly and prepare people for the change ahead of time.


Excellent, at least you are getting somewhere.

chegitz guevara is offline chegitz guevara
King
Ft. Lauderdale, FL Communist Party of Apolyton
Jun 2000
time: 00:30
  Old Post 14-08-2003 19:48 Visit chegitz guevara's homepage!
Edit/Delete Message Reply w/Quote
#24 Report this post to a moderator
Re: Re: Re: Re: HTML: global variables Browse Apolyton AD-FREE

quote:
Originally posted by Urban Ranger
That would be a problem.


If it were a small number of users, I was prepared to go out to their places and upgrade the browser for them for free, just so I could get rid of this issue.

One thing at a time. First I'm getting all our sites WCAG Priority 1 compliant. I'm working on Taiwan right now and will be moving on to Hong Kong soon. Working in a language you don't know is hard. Working in another alphabet is damn near impossible. And then the Taiwanese have to go and use tradiational Chinese while Hong Kong uses simplified (so I can't just copy the modifications to one country to another). You'd think being a former Brit colony English would be more prevalent there. Ah well, right now it's the East Asians keeping me employed so I won't complain too loudly.

Urban Ranger is offline Urban Ranger
Apolyton Duke of Off-Topic

Donate to the Red Cross
The City State of Noosphere, CPA special envoy
May 1999
time: 13:30
  Old Post 14-08-2003 19:54
Edit/Delete Message Reply w/Quote
#25 Report this post to a moderator
Re: Re: Re: Re: Re: HTML: global variables Support Apolyton or Terrorists Win

quote:
Originally posted by chegitz guevara
And then the Taiwanese have to go and use tradiational Chinese while Hong Kong uses simplified (so I can't just copy the modifications to one country to another). You'd think being a former Brit colony English would be more prevalent there.


Hm, no. You could have asked me. Both Hong Kong and Taiwan use the traditional Chinese characters. In fact, most Hong Kong people cannot read simplified Chinese [yeah, yeah, I know]. We also use English, yes, but 95% (at least) of the population sucks in English. Even English teachers fail qualifying exams

What is "WCAG Priority 1 compliant?"

chegitz guevara is offline chegitz guevara
King
Ft. Lauderdale, FL Communist Party of Apolyton
Jun 2000
time: 00:30
  Old Post 14-08-2003 20:03 Visit chegitz guevara's homepage!
Edit/Delete Message Reply w/Quote
#26 Report this post to a moderator
Re: Re: Re: Re: Re: Re: HTML: global variables Support Apolyton or Terrorists Win

quote:
Originally posted by Urban Ranger
Hm, no. You could have asked me. Both Hong Kong and Taiwan use the traditional Chinese characters. In fact, most Hong Kong people cannot read simplified Chinese [yeah, yeah, I know]. We also use English, yes, but 95% (at least) of the population sucks in English. Even English teachers fail qualifying exams


Really? They want me to use simplified. I considered asking you, but I felt it was unprofessional to have you help when I couldn't bill for your time. Plus, it's up to the Hong Kong department to tell me what to use. I will, however, ask for clarification.

quote:
What is "WCAG Priority 1 compliant?"


Do you know what US 508 regulations are? Almost the same thing. Make sure all images have appropriate alt-text, that all information can be accessed by any users, by they blind, deaf, motor impared or even congnatively disabled (the last one is toughest cuz it means butting heads with marketting and trying to get them to use simpler language).

dejon is offline dejon
King

Sep 2002
time: 00:30
  Old Post 14-08-2003 20:23
Edit/Delete Message Reply w/Quote
#27 Report this post to a moderator
Suffering from ads?

quote:
Originally posted by chegitz guevara

And what, I'm just supposed to convince my bosses to purchase this program because the design firm that created this site two+ years ago had a copy? It swats flies with a sledgehammer and we've been looking for a reason to get rid of it. I can replicate the same functionality with much less effort.

And yes, I googled the name of the product. I've been writing mouseOvers for seven years, and this is the most useless product I've ever seen.


Indeed, for your needs it looks like quite a bit of excessive functionality and overhead. I would replace it too.

I only pointed it out because your prior posts seemed to indicate a lack of knowledge about the menu system or how it works - when the makers of it were easily discoverable, and should have documentation on it. (Maybe next time I won't try to help. )

Urban Ranger is offline Urban Ranger
Apolyton Duke of Off-Topic

Donate to the Red Cross
The City State of Noosphere, CPA special envoy
May 1999
time: 13:30
  Old Post 14-08-2003 20:41
Edit/Delete Message Reply w/Quote
#28 Report this post to a moderator
Re: Re: Re: Re: Re: Re: Re: HTML: global variables Support Apolyton, buy Civilization III: Complete

quote:
Originally posted by chegitz guevara
Really? They want me to use simplified.


What? What utter boobs! The only reason if they do that is they want to do the website for Mainland China.

quote:
Originally posted by chegitz guevara
I considered asking you, but I felt it was unprofessional to have you help when I couldn't bill for your time.


Pah. Lots of people asked tech questions and those who answered never got paid anyway.

quote:
Originally posted by chegitz guevara
Plus, it's up to the Hong Kong department to tell me what to use. I will, however, ask for clarification.


This is a Hong Kong government website. Press the "Chinese" button (red button with yellow characters, top left), and see for yourself whether that is traditional or simplified Chinese. I hope you can tell

quote:
Originally posted by chegitz guevara
Do you know what US 508 regulations are? Almost the same thing. Make sure all images have appropriate alt-text, that all information can be accessed by any users, by they blind, deaf, motor impared or even congnatively disabled (the last one is toughest cuz it means butting heads with marketting and trying to get them to use simpler language).


Oh that. Looks reasonable, though one wonders how many blind people (deaf people aren't really impaired here) surf websites. So far, I have seen only one, who happens to be the head of the local Oxfam.

chegitz guevara is offline chegitz guevara
King
Ft. Lauderdale, FL Communist Party of Apolyton
Jun 2000
time: 00:30
  Old Post 14-08-2003 23:33 Visit chegitz guevara's homepage!
Edit/Delete Message Reply w/Quote
#29 Report this post to a moderator
Re: Re: Re: Re: Re: Re: Re: Re: HTML: global variables Get a bigger avatar today!

quote:
Originally posted by Urban Ranger
Oh that. Looks reasonable, though one wonders how many blind people (deaf people aren't really impaired here) surf websites. So far, I have seen only one, who happens to be the head of the local Oxfam.


The real question you should be asking yourself is how many blind people need contact lenses?

Seriously, though, all of Johnson & Johnson's websites need to be accessible, so despite the fact that it doesn't seem to make sense at first glance . . . on top of that, most contact lens users do have some sort of vision problem. There are actually good reasons to do it, but it's time for me to leave.

Urban Ranger is offline Urban Ranger
Apolyton Duke of Off-Topic

Donate to the Red Cross
The City State of Noosphere, CPA special envoy
May 1999
time: 13:30
  Old Post 15-08-2003 09:47
Edit/Delete Message Reply w/Quote
#30 Report this post to a moderator
Browse Apolyton AD-FREE

Got a better offer already?

  < Last Thread     Next Thread > Post New Thread     Post A Reply
All times are GMT. The time now is 05:30.
Apolyton Time is 00:30.
    top of page
Rate This Thread:
archivepost
Forum Jump:
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is ON
vB code is ON
Smilies are ON
[IMG] code is ON
 




Contact Us - Apolyton Civilization Site - Support Us!

Building a better Apolyton through better information. Click here and take our poll!
Non-US visitors, click here!

Powered by: vBulletin Version 2.0.3
Copyright ©2000, 2001, Jelsoft Enterprises Limited.

Page generated in 0.0675 seconds (91.93% PHP - 8.07% MySQL) with 31 queries
Page Loading Time:

Support Apolyton: Amazon USA | Amazon UK | Amazon DE | Amazon FR |
Support Apolyton and get FREE PLUS, Buy from Chips&Bits: Galactic Civilizations | Galactic Civilizations: Deluxe Edition | Call to Power 2 | Civilization: The Boardgame | GURPS/ Alpha Centauri | Alpha Centauri | Civilization IV | Civilization III: Complete |


Front Page | Civilization IV | Civilization III | Civilization II | Call to Power II | Alpha Centauri | Master of Orion III
Rise of Nations | Galactic Civilizations | Galactic Civilizations II | Misc
Alt.Civs | Civ I | C:CtP I | About | News | Directory | Apolyton Store | Forums | Chat | Columns | Interviews | Newsletter
Scenario League | CSC | Clash of Civs | Spanish Site | CtP Maps | Cradle of Civ | WesW's Ctp1/2 Site | Civ3 Haven

apolyton.net | apolyton.com | civilization2.net | civilization3.net | civilization4.net | civilizationiv.info | calltopower.net | galciv.net | galciv2.net | moo3.net