...

View Full Version : Style sheet question



Kevin_M_Schafer
11-23-2011, 04:12 PM
Hello,

Does using a style sheet to control font style, size, and color, slow down the display of a webpage -- compared to having all the code in the same place?

I've used style sheets, and this is always something I wanted to ask someone.

Thanks for your time.

Frankie
11-23-2011, 05:43 PM
Yes, it does, but only slightly. So, if you would have only one page for whatever reason, you should keep the on-page style block. But if you have several pages that are identical apart from the contents, it would be foolish not to use an external style sheet, wouldn't it?

Kevin_M_Schafer
11-23-2011, 06:27 PM
Thank you, Frank. I agree, but I would never know unless I asked. I'm working on a project for myself that may have 80,000 pages when we're completed. A dictionary.

teedoff
11-23-2011, 06:30 PM
Thank you, Frank. I agree, but I would never know unless I asked. I'm working on a project for myself that may have 80,000 pages when we're completed. A dictionary.

80,000 pages? Wow! Why do you need that many pages?

Kevin_M_Schafer
11-23-2011, 11:16 PM
I'm trying to figure out the best way to produce results on a single word search, most likely using SSI -- a page for each word. The shtml content would show through a box in the master page, and a single style sheet would control the type style, size, and color of the shtml pages.

I'm trying to get this done by using patterns in a direct search rather than indexing 80,000 urls.

If there's a better way, I wouldn't mind an opinion.

teedoff
11-23-2011, 11:23 PM
I would think a database and a few pages would handle all this for you. The user searches a word using your form. The form user input is compared to the database using a sql query, then server side scripting language displays the results.

Kevin_M_Schafer
11-24-2011, 04:33 PM
Well, all the words of the English language still have to be available to a search engine, most likely by using each word as a title to a page, otherwise a search would find the word "computer," for example, in every other usage in the entire database.

I don't necessarily know how to keep a word search from finding more than one result unless I make one page for each word in the English language.

If you have perhaps a better way, I am open to all ideas.

tracknut
11-24-2011, 05:40 PM
The point though is that those 80,000 pages shouldn't be static pages that you somehow edit up and store as 80,000 separate html files. They should be dynamically generated at the time that someone looks up a word in the dictionary. If that's your plan all along, I think you're fine and this is just a semantic discussion about whether one typically calls those dynamically generated pages "pages of the web site", or "dynamic information presented to the user". I don't think they are normally called "pages of the web site" - that's probably what set off alarm bells :)

Dave

Kevin_M_Schafer
11-24-2011, 09:46 PM
tracknut or teed,

A question, though. Should my word pages -- numbering in the thousands -- have shtml suffixes -- such as "computer.shtml"? Do the pages need suffixes?

I want them to be called by a search and displayed inside an iframe or results box using SSI on the master page.

Thanks,

tracknut
11-24-2011, 09:57 PM
I guess we can't convince you not to make 80,000 files :)

Included files can have any name, so ".inc" or ".html" or anything else you like. Iframe'd files should be standard naming, .html, .php, .shtml - whatever the correct name would be (ie, if they're standard html, then I'd name them .html).

Dave

Kevin_M_Schafer
11-24-2011, 11:24 PM
But if I don't create the pages for my dictionary, where will I get my dictionary content? There are over 80,000 words in the English language, and I don't have a database containing them. I have to build it.

I don't quite understand how I will code a word and its definition, and not have it placed separately than all the other words so that it will appear all by itself in a search result.

If it's possible to have all the words with their definitions on a continuous listing, how does the search differentiate from where one word and its definition leaves off and the next word starts?

For example:

marigold
Pronunciation: mar-i-gohld. Three syllables: mar-i-gold
1. The asteraceous plant Calendula officinalis. Any asteraceous plant of the genus Tagetes, esp. T. erecta. Garden herb with strong-scented leaves and yellow, red, or variegated heads of flowers. See Pot Marigold.
2. A puff-paste cake with almonds arranged to look like petals.

Is there a symbol or something that can be placed between the individual words and their definitions, something that will tell the search query to "stop here" and show the result and not go any farther than this one block of content?

I would gladly take a different route than having to build 80,000 pages -- because that will literally take 5 years and we're already getting prepared.

Do you think a continuous listing could be built with all the words in it?

Thanks for your help.

tracknut
11-24-2011, 11:37 PM
Is there anyone on your team that knows databases? I'm not trying to insult, but this is extremely simple stuff and I'd think that with the prospect of 5 years of development coming up, you'd have someone on board to help design this thing.

A database has columns, and you might have a column for "word" and another column for "definition". When you do a search, you'd search within the "word" column for "marigold" without fear of finding another word who's definition happens to include the word "marigold".

Dave

teedoff
11-25-2011, 12:13 AM
How do you think a HUGE site like amazon.com, that I think it would be safe to say, sells 10's, maybe 100's of thousands of items, how do you think they do it? Do you think they build a page for every single item? Each of those items have descriptions, sizes, colors, prices, all generated from a database.

Kevin_M_Schafer
11-25-2011, 06:12 AM
tracknut,

Thanks. Okay, I'm just curious how, when a word is called from the "word" column, how does the correct definition get chosen? How does the page code know what definition to pull out of the database after it pulls the word?

Even with a database, it's still going to take years to enter all the data, but it would sure beat having to worry about code and individual pages.

This is really interesting.

Frankie
11-25-2011, 08:38 AM
when a word is called from the "word" column, how does the correct definition get chosen? How does the page code know what definition to pull out of the database after it pulls the word?

See here: http://www.w3schools.com/sql/default.asp.

Kevin_M_Schafer
11-25-2011, 02:32 PM
Thank you, Frank.

I'm going to be trying a SQL sofware program in the next couple of days. I appreciate your help.

teedoff
11-25-2011, 02:33 PM
tracknut,

Thanks. Okay, I'm just curious how, when a word is called from the "word" column, how does the correct definition get chosen? How does the page code know what definition to pull out of the database after it pulls the word?

Even with a database, it's still going to take years to enter all the data, but it would sure beat having to worry about code and individual pages.

This is really interesting.

You would do this using tables and table relationships you've established. Your user types in the word "Aardvark", which has an index of 1, since its the first word in your dictionary list, then taking that word, or more precisely the index on that word, the 1 would correspond to the definitions table and the definition of the index: 1

Honestly, if you are interested in this, as frankie said, w3schools has a good tutorial on sql. But that wont be enough. You'd need to know how to use php syntax, or the server side language of your choice, to "query" the database and pull the data. Each language is a little different, but the basic SQL syntax is the same:

SELECT word, definition
FROM tableWords, tableDefinitions
WHERE word = some user form ID



Even with a database, it's still going to take years to enter all the data

Yes, BUT the long term easy of maintainence will save you from pulling your hair out..lol

Kevin_M_Schafer
11-25-2011, 06:04 PM
Frank,

Check out what I found. This is what you and teed and tracknut mentioned:

http://www.odditysoftware.com/samples/Websters_1913_Dictionary_Sample.XLS

I can buy an entire database -- up to the year 1913 -- for $150 with full copyright release.

Thanks. Without you guys, I wouldn't have any direction on this.

Kevin_M_Schafer
11-25-2011, 06:12 PM
teed,

I need to purchase another SQL database capability from my site providder, because my first one is being used by my site search.

This is all right, though, because my dictionary is a completely different project, with a completely different domain name. I'll be purchasing an ftp account for it, and I'll do it all at the same time.

Please check out my previous post.

Without you guys, I would nevery have thought to go this way, and because of all your advice, I stumbled on a database that I can purchase. It's 97 years behind, but I'd rather spend 5 years upgrading -- or buying upgrades, than starting from scratch.

Thanks again.

tracknut
11-25-2011, 06:17 PM
Sounds like good forward progress, Kevin. I'm curious about the "year 1913" issue though. Is this just an "old dictionary", which of course gets updated with new words every year and hence you need those updates? Or is it something more specific to an area of research? It seems a bid odd that you can find online, ie typed into a computer in the post-1960 timeframe, a 1913 dictionary, but none newer :)

Dave

teedoff
11-25-2011, 06:18 PM
teed,

I need to purchase another SQL database capability from my site providder, because my first one is being used by my site search.

This is all right, though, because my dictionary is a completely different project, with a completely different domain name. I'll be purchasing an ftp account for it, and I'll do it all at the same time.

Please check out my previous post.

Without you guys, I would nevery have thought to go this way, and because of all your advice, I stumbled on a database that I can purchase. It's 97 years behind, but I'd rather spend 5 years upgrading -- or buying upgrades, than starting from scratch.

Thanks again.


Purchase another database? not sure what you mean. You can have other tables in the same database to handle data for multiple applications.


And usually whoever you host your site with has more than one MySQL database, some even have unlimited.

Before you "purchase" anything, really do some research and reading. MySQL databases are FREE.

Kevin_M_Schafer
11-26-2011, 02:50 AM
hi teed,

I downloaded dbForge Studio for MySQL and was successful in uploading the sample table of the dictionary to my existing database. That worked pretty slick -- I think. When I go to my cpanel, the table is there and shows about 6 kb.

Strange thing, my hosting package allows only one database, and I'm using it for my member login for a protected page (e-edition of my weekly newspaper). My host said I can upload tables all day long to my existing database, as long as I stay under 5gb. If I go over I have to purchase more storage, and if I want a whole separate database, I have to pay for it.

I was able to upload the test table of five fields and 30+ lines. A question I have now, what type of search box code do I need to search this one particular table? Also, I would like to be able to just search the "Word" field of the dictionary.

I Googled the heck out of php search code, but so many sites want to give the task to Google and it's hard to figure out which piece of code would work best for me.

Once I get the table to produce a result, I'll be getting into style sheet and iframe coding to produce the results just the way I would like them.

I'm really enjoying figuring this out, and I'm learning a lot.

Kevin_M_Schafer
11-26-2011, 02:58 AM
Dave,

I was surprised that the database is called 1913 -- and I think they mean it. It's a whole software package, and it's a starting point, at least.

This database idea of yours and teed's is really amazing. I just posted an earlier post to teed telling you all that I was able to upload the sample table to my host server.

I just need to work on getting the search action and style the results into a box on the master page or into an iframe.

It's a good thing you guys are just down the street from me. You wouldn't get anything done for all my questions.

Thanks. :)

Kevin_M_Schafer
11-26-2011, 03:02 AM
Correction: It's a good thing you guys aren't just down the street from me. lol

If you ever need to know anything about running a piece of printing equipment, don't be afraid to ask. Next year, 2012, my Linotype will be 100 years old. I bought it for $100 that my Dad borrowed to me in 1984 when I was just 16. I've completely rebuilt it, and it works like new. My oldest printing press is circa 1890.

Kevin_M_Schafer
11-26-2011, 03:12 AM
Here's a link to my website for my newspaper in case you'd like to see it:

http://www.theeagleextra.com

I created it by myself (Kemisurf -- that's me), and all the tough questions were asked right here on CodingForums. I never once had to go somewhere else. I remember teed helping a lot.

The home page is the only one I really worked hard on. The other pages are pretty much thrown together and terrible as far as coding goes.

Eventually, newspapers will be gone, and news will be delivered all hours of the day -- much like big newspapers are now. At least I have the site built.

tracknut
11-26-2011, 03:28 AM
Interesting stuff Kevin. When I was in 7-8th grade, our teacher had us setting type by hand and printing on a platen press (I think that's what it's called). A seriously dangerous machine, but back in those olde-tymes, nobody worried about the liability, they just wanted to teach us.

Good memories, but realistically I haven't done any of it since. Now I get proportional spacing just by using the right font.

Dave



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum