I did something similar to this with an online magazine once.  I stored the
text for the article in the database, and then I stored the paths to the
images in the database as well.  I had something like:

Articles
---------
ArticleID
ArticleText

Images
--------
ImageID
ImageName
ImageFile

ArticlesImages
----------------
ArticleImageID
ImageID
ArticleID

This way I could easily associate any number of images with the article.

When the editor entered the article he would select from a list of the
images which ones are associated with the article.  Then he would select the
order he wanted the images to appear in.

The tricky part was how to determine where in the text the image should be
displayed.  To solve this problem I created a some "tags" that the editor
could add to the text of the article where he wanted the images to be
displayed, and whether he wanted it left justified, centered, or right
justified.  They looked something like |img-left|, or |img-right|.  When I
processed the page I would simply replace each of the image tags with an
<img> tag.  The first replace would use the first image, the second the
second image, etc...

This probably sounds more complex than it really is.  It really turned out
to be pretty simple, and it gave the editor the flexibility he was looking
for.  I hope that gives you a working idea.

Jared


----- Original Message -----
From: "James" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Monday, February 25, 2002 6:08 PM
Subject: Magazines, Article and Diagrams.


| Hi guys,
|
| I am setting up a site for a magazine.
|
| Each article needs to go on-line, most articles have
| got diagrams or images contained in them.
|
| I am a bit stuck on trying to figure out the best way to structure this.
|
| The 2 options I have come up with are:
|
| 1. Have a table called IMAGES which would store the reference to the
| diagram, image or table and relate that to the article number. From there
| I can loop through the query and output the related images at the bottom
| of the article.
|
| 2. Have a static page that I manually create for each article and then
using
| cfinclude pull the content into the page by way of a reference ID that I
store
| in the db.
|
| would like to hear any opinions if anyone has done anything like this
before.
|
| cheers
| James.
| 
______________________________________________________________________
Dedicated Windows 2000 Server
  PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
  Instant Activation � $99/Month � Free Setup
  http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to