Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > BOOK: PHP and MySQL: Create-Modify-Reuse ISBN: 978-0-470-19242-9
|
BOOK: PHP and MySQL: Create-Modify-Reuse ISBN: 978-0-470-19242-9
This is the forum to discuss the Wrox book PHP and MySQL: Create-Modify-Reuse by Timothy Boronczyk, Martin E. Psinas; ISBN: 9780470192429
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: PHP and MySQL: Create-Modify-Reuse ISBN: 978-0-470-19242-9 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 13th, 2010, 01:05 AM
Authorized User
 
Join Date: Jul 2009
Posts: 77
Thanks: 4
Thanked 6 Times in 6 Posts
Default Chap 10 - issues in rss.php, view.php, and comments on rss

ISSUE # 1 - missing rss.php file

There is no rss.php file in the downloads. The only way
to get it is to type it in from the book. It is on page
278.


ISSUE #2 - in rss.php file, did not include database code

The database code was not included.
You need to add it. I added it right after <?php
PHP Code:
   <?php
   
include '../lib/db.php';
ISSUE #3 - in rss.php, printf contains &, should be &amp;

The printf statement on about line 29, uses an ampersand on the
query string.
PHP Code:
    printf('<link>http://www.example.com/myBlog/view.php?m=%d&y=%d</link>'
    
date('n'$row['POST_DATE'] ), date('Y'$row['POST_DATE']) ); 
This results in xml that is not
well formed. It needs to be changed to &amp;
It should look like this.

PHP Code:
   printf('<link>http://www.example.com/myBlog/view.php?m=%d&amp;y=%d</link>'
    
date('n'$row['POST_DATE'] ), date('Y'$row['POST_DATE']) ); 
ISSUE #4 - in view.php , ob_get_clean


About 6 lines up from the bottom is the line.
PHP Code:
   $GLOBALS['TEMPLATE']['content'] = ob_get_clean(); 
When you go to view.php in the browser there is no
output, the screen is blank. When you change it
to ob_get_contents, the output appears as it should.
PHP Code:
   $GLOBALS['TEMPLATE']['content'] = ob_get_contents(); 
ISSUE #5 view.php

There is a mistake in the book, page 293, in the gray
box showing the view code, line 8, it says $day and
it should be $month.
PHP Code:
   list($day$year) = explode('/'date('m/Y'$timestamp)); 
It is correct in the download code. Here is how it should
look.
PHP Code:
   list($month$year) = explode('/'date('m/Y'$timestamp)); 
COMMENTS ABOUT RSS

I think the best approach is to go to one of the aggregators like
Google Reader and set that up. Subscribe to a couple of the
big rss feeds like CNN or The Official Google Blog. This
way you can get a feel for it.

Here are a couple links on RSS that may be helpful.

http://www.commoncraft.com/rss_plain_english

http://searchenginewatch.com/2175271

When you go to add your own site on Google Reader,
go to "Add a subscription" and type in the path
to your rss.php, http://yourdomain/yoursite/public_files/rss.php





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chap 10 - issues with admin.php file kenj BOOK: PHP and MySQL: Create-Modify-Reuse ISBN: 978-0-470-19242-9 0 October 12th, 2010 09:08 PM
Chap 2, Some small errors in add_post.php and view.php kenj BOOK: PHP and MySQL: Create-Modify-Reuse ISBN: 978-0-470-19242-9 0 October 22nd, 2009 07:48 PM
RSS View/Service Pack Michelle Watts SharePoint Admin 0 January 8th, 2008 07:34 PM
Rss Feed in php surendran RSS and Atom 2 October 22nd, 2005 12:59 AM
RSS Feed to PHP in Array? sami PHP How-To 1 April 17th, 2005 04:53 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.