PDA

View Full Version : WEB DESIGN HEP


Chojin
Dec 18th, 2006, 09:07 PM
Hey, y'alls. I'm using a server that supports php.

I figured out how to do PHP includes so that I can type out game reviews in .txt and then have the tables on the page load them up. Now that that's done, I'm wondering if there's a way to make text leap from one table to the next automagically instead of being all in one table and stretching the shit out of it.

A lot of news and review sites do something like this:

[text] [pict]
[text] [text]
[pict] [text]
[text] [text]
[text] [pict]

and the text flows from one box to the next with pictures interspersed, and i'm sure someone doesn't go into each article to split up the text into DESIGNATED BOXES.

So like, there a way to say WHEN TEXT FULL HERE, CONTINUE ON NEXT TABLE?

Prz hep

MetalMilitia
Dec 18th, 2006, 11:20 PM
You'd probably be better off positioning all your elements with CSS and storing all the data in a mySQL database. It's much eaiser than it sounds and it allows you to create pages far more efficently.

With that in mind but still using a HTML table in the way you described you could just grab the review from the database a bit at a time inserting it into the relevant boxes.

I've only ever done a small amount of PHP so you may need to wait for someone like Chimp to give a better example but you could have a table which looks like this:

[include GetArticlePart1.php;] [include getImage1.php;]
[include GetArticlePart2.php;] [include GetArticlePart3.php;]
etc...

When each of these .php files are called they will perform a database query and echo the results (with formatting tags).

Even better than that you could just statically position the pictures with CSS and use a single content box for all the text. The text should automotically wrap around the pictures.

I'm sure there IS a way of doing it with standard .txt includes but it'll make much more work for you in the long run.

Chojin
Dec 18th, 2006, 11:25 PM
how do i use css to position the pictures, then?

MetalMilitia
Dec 18th, 2006, 11:31 PM
Well first learn how to use CSS to position things.

Here is an example of a nested element within a body of text; http://www.glish.com/css/1.asp

Chojin
Dec 18th, 2006, 11:37 PM
oh learn css why didn't i think of that before >:

MetalMilitia
Dec 18th, 2006, 11:39 PM
Well it seems pointless to write exactly how to position an image when there are a ton of tutorials online already. :/

Chojin
Dec 18th, 2006, 11:43 PM
you'd think so, but what the fuck do you search for to find that? 'image'? 'css'? it all leads back to kim possible porn.

MetalMilitia
Dec 18th, 2006, 11:47 PM
Try this:

http://www.brainjar.com/css/positioning/default.asp

(bottom of page 2 has a section on floating images in text)

liquidstatik
Dec 18th, 2006, 11:58 PM
hey chojin ;o

this should work :x im not sure about in tables, since i never do that, but here it is ;o

img.floatLeft {
float: left;
margin: 5px;
}
img.floatRight {
float: right; ;
margin: 5px;
}

and then if you want the picture on the left of the text, its blablhfdsaklfh.blah

hope it helps ;o

liquidstatik
Dec 19th, 2006, 12:05 AM
http://dannytatom.com/chojin.htm

if you mean like that :x