Archive for April, 2008

And so ends another exciting day in the (Web site designers)

Tuesday, April 8th, 2008

And so ends another exciting day in the CMS saga. Stay tuned while we look at your next file, reviewarticle.php. This time, you need to use one of the functions in outputfunctions.php, so you include it at the top of your page. First, you display the title of the page, and then use the outputStory() function to display the article on the page.

Article Review

Published: . date( l F j, Y H:i , strtotime($row[ date_published ])) .

n ; } If the document is published, you have an option to retract the article. If it is still pending, then you can publish it. 468 Chapter 13
We would like to recommend you tested and proved virtual web hosting services, which you will surely find to be of great quality.

you loop through the array and substitute the (Unlimited web hosting)

Monday, April 7th, 2008

you loop through the array and substitute the appropriate values where necessary. The variable $k holds the array key, and $v holds the array value. You also set $i to 1 because it will be incremented immediately inside the loop: echo

Article Availability

n ; $i = -1; foreach ($a_artTypes as $k => $v) { $i++; Here s your first use of the array key. The first pass through, this will read Pending Articles. Next time through, it will read Published Articles. Clever? echo

. $k . Articles

n ; Notice that you are using $v in what follows to create the field date_submitted in the first loop, and date_published in the second. You are also using $i to first compare is_published to 0, and then to 1 in the next loop. echo

n ; echo

n ; $sql = SELECT article_id, title, date_ . $v . FROM cms_articles . WHERE is_published= . $i . ORDER BY title ; $result = mysql_query($sql, $conn) or die( Could not get list of pending articles; . mysql_error()); Again, the array key is used, if no articles are returned. Now you can see why you used an associative array. if (mysql_num_rows($result) == 0) { echo No . $k . articles available ; If rows are returned, you then loop through each article and display the title (linked to reviewarticle. php) and the date it was either submitted (pass one) or published (pass two). } else { while ($row = mysql_fetch_array($result)) { echo . htmlspecialchars($row[ title ]) . ($v . date( F j, Y ,strtotime($row[ date_ .$v])) . )
n ; } } echo

n ; echo

n ; } require_once footer.php ; ?> 467 Building a Content Management System
In case you need quality webspace to host and run your web applications, try our personal web hosting services.

Web server application - Figure 13-10 How It Works Next comes pending.php:

Sunday, April 6th, 2008

Figure 13-10 How It Works Next comes pending.php: submitted , Published => published ); The following is where you use your associative array. You are displaying pending, or submitted, articles, and then displaying published ones. In the interests of conserving code (because we re lazy, remember?), 466 Chapter 13
Visit our web design programs services for an affordable and reliable webhost to suit all your needs.

Msn web hosting - Figure 13-9 5. Click the Publish button. You

Saturday, April 5th, 2008

Figure 13-9 5. Click the Publish button. You will be taken back to pending.php, and the article will now be listed under Published Articles. 6. Click the Articles link, and you will be taken back to the index page. This time, the article should appear on the page (see Figure 13-10). 465 Building a Content Management System
If you are looking for affordable and reliable webhost to host and run your business application visit our ftp web hosting services.

} echo ; ?> 3. Click the (Remote web server)

Friday, April 4th, 2008

} echo ; ?> >

3. Click the Review link. The Review page pending.php loads (see Figure 13-8) with a list of all pending and published articles. Right now, there is only one pending article the one you just wrote. 4. Click the article. You will be taken to reviewarticle.php. It should look similar to Figure 13-9. You have the option to edit, publish, or delete the article. Figure 13-8 464 Chapter 13
We highly recommend you visit web and email hosting services if you need stable and cheap web hosting platform for your web applications.

echo . htmlspecialchars($row[ title ]) . ($v

Thursday, April 3rd, 2008

echo . htmlspecialchars($row[ title ]) . ($v . date( F j, Y , strtotime($row[ date_ .$v])) . )
n ; } } echo

n ; echo

n ; } require_once footer.php ; ?> 2. Next, create reviewarticle.php:

Article Review

Published: . date( l F j, Y H:i , strtotime($row[ date_published ])) .

n ; } echo

n ; if ($row[ is_published ]) { $buttonType = Retract ; } else { $buttonType = Publish ; } echo ; if (($row[ access_lvl ] > 1) or ($_SESSION[ access_lvl ] > 1)) { echo ; 463 Building a Content Management System
We recommend cheap and reliable webhost to host and run your web applications: Coldfusion Web Hosting services.