Hi Court, thanks a lot for your advice.

I am fairly new to PHP, so, I'm a little slow in understanding some of the
suggestions in your detailed post. From what I gather, you suggested that an
Admin script be created to basically build each portion of an article piece
by piece, which would then be combined and stored in a single field in the
Articles data table. Is that right?

The only thing I can see being a problem with this method is if the writer
needs to go back and edit the article. Unless I strip out all HTML and parse
the sections out into individual fields, they would have to contend with all
the HTML code written into the article content field. I'd like to reduce the
amount of HTML stored with the article content in the database as much as
possible so that writers don't have to worry about anything but the most
basic codes.

Here's one idea I have. In the database field, the article content may look
something like this:

[START-BLOCK]
[IMG="photos/image1.jpg"]
This product will make your skin feel silky smooth.
[END-BLOCK]

[START-BLOCK]
[IMG="photos/image2.jpg"]
New from Nivea, a lotion that moisturizes and protects from the sun.
[END-BLOCK]


...which I can then parse to lay the article out like this...


+-----------+      +-----------+      +-----------+
|  image 1  |      |  image 2  |      |  image 3  |
+-----------+      +-----------+      +-----------+

Short paragraph    Short paragraph    Short paragraph
of text under      of text under      of text under
the image.         the image.         the image.

+-----------+      +-----------+      +-----------+
|  image 4  |      |  image 5  |      |  image 6  |
+-----------+      +-----------+      +-----------+

Short paragraph    Short paragraph    Short paragraph
of text under      of text under      of text under
the image.         the image.         the image.


If this is a doable and good way to go, then my next question is, which PHP
string function would be the best to use for parsing custom codes (like
[IMG=) into actual HTML codes?

Thanks!

Monty


> From: [EMAIL PROTECTED] (Court Shrock)
> Newsgroups: php.db
> Date: Thu, 7 Mar 2002 12:16:07 -0800
> To: 'Monty' <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
> Subject: RE: [PHP-DB] Best way to store/retrieve content??
> 
> Actually, CSS is very powerful--way more than simple html.  One drawback is
> that CSS1 did not include any support for tables directly, but the generic
> controls work nicely, there just is no way to say "<table align=center>" in
> CSS1.  A great book that taught me a lot about CSS is
> http://www.oreilly.com/catalog/css/ --I'd lone it to you if you were local.
> 
> I think it would be feasible to store all content in one db: just use your
> templates to convert the articles to appropriate markup and then store the
> results.
> 
> (I am departing from html)
> The interview:
> [input_form]
> Template: <select>"Interview"</select>
> Question: <input value="How are you doing?">
> Answer: <input value="Fine, thanks for asking">
> 
> [form_submittal]
> $content = _header($template);
> foreach (question) {
> $content .= "<p class='question'><span class='us'>Us:</span>$question</p>"
> "<p class='answer'><span
> class='them'>Them:</span>$answer</p>";
> }
> insertArticle($content);
> 
> The beauty product:
> [input_form]
> Template: <select>"picture"</select>
> Picture: <input file="pic1.jpg">
> Description: <textarea>"Just imagine yourself all prettied up like this
> glorious person"</textarea>
> 
> Transition: <textarea>"And now that brings us to some really cool
> whale-inard products"</textarea>
> 
> Picture: <input file="pic2.jpg">
> Description: <textarea>"We promise that no animals were harmed during the
> making....."</textarea>
> 
> [form_submittal]
> $content = _header($template);
> foreach(picture) {
> $content .= "<p class='picture'><img class='pic$count'
> src='$file'>$description</p>";
> if ($transition != '')
> $content .= "<p class='$transition_count'>$transition</p>";
> }
> 
> 
> ...anyway, you get the idea.....this is a rather simple approach--but, you
> could combine something like this with an output template to get really good
> results.
> 


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to