###############################################################################
# 452 Productions Internet Group (http://www.452productions.com)
# MyPHP-XML News v1.0
#    This script is freeware and is released under the GPL
#    Copyright (C) 2000  452 Productions
#
#    This program is free software; you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation; either version 2 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program; if not, write to the Free Software
#    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#    Or just download it http://www.fsf.org/
###############################################################################
 
Welcome to the readme for the 452 Productions Internet Group MyPHP-XML News!
This document will walk you through the set up and use of this program.
1. Files you need
2. Install procedure
3. Use
4. FAQ
Section 1: Files
The 452 MyPHP-XML News program allows for the easy creation and maintenance of 
news posting. As the name implies this program uses MySQL and PHP, and has the ability
to create an XML backend to allow you to syndicate your headlines. Naturally you need:

MySQL (version really not important; make sure it has no dust on it or anything)
PHP 3.0+
Apache/*nix webserver
A web browser

You laugh but some people ask if those are needed.

Of course you also need the right files. You should have the following files:
README:   	  	   				  		 This file
news_admin.php: 				   The news admin script
pull.php: 							 		   The news puller file for your news page
install.php: 						  		  The install program
archive.php: 							   The archive browsing program
myphp-xmlnews.dtd                 XML Doc type dec
config.inc.php: 	    	               A blank file
backend.xml:				  	  		 A blank file
f_tables.sql: 					     	     SQL tables in case install program fails for you
f_config.inc.php:           A default config file in case install program fails for you

Section 2: Install

Upload the files to your server. There is no need to edit any of the files by hand. You do not need 
to upload the f_x.php files. chmod all files to 666, (This is only for install) except install.php which
should be chmod 755. All of these files MUST be in the same directory.

Now open your web browser and go to http://www.yoursite.com/news/install.php
Here you will see the install program. It will ask you to tell you the name of the 
database you wish to use. If you already have a database created for us to use
put the name in. If you do not, put in the name you would like to use, and the program
will attempt to create it for you.

Next is your database password. The default is YES. Very, very, very rarely is this 
the correct password. If you don't know your database pass contact your sysadmin.

Next is your database username. The default of root may work, but if you do not know
your username contact your sysadmin.

Next is your database host. The default of localhost should work on most systems. If you get an error
contact your sysadmin.

Next is the base url. This is your actual domain name, for example: 452productions.com
works. http://www.452productions.com and http://www.452productions.com do not work.
This is a securtiy feature. The script will check to make sure that this appears in the name of the
referer. If you do not have a domain, it needs somthing that will always be in the URL
your username if your url is in the form of http://somehost.com/username is fine.

Next is the absloute unix path to your config file. This is NOT http://anything. This should
be in the form of /www/news/config.php or /home/www/news/config.php or whatever your
case may be.

Press go.

If everything went fine the script will say either that the data base existed and the tables were added
or that the data base was created and the tables added.

The most common error at this point is:
 Error creating database: Access denied for user: 'username@localhost' to database 'news' 

This means that the database did not exist, but that you do not have permission to create
databases. You will need to ask your sysadmin to create the database, then run the install.

If you get an error about tables already existing you already have a table named news.
You need to drop it.

If you get an error about file identifiers and permissions, make sure that
all files except install.php are chmod 666, install.php should be 755.

Important: If during the install you get an error, make sure you drop the table news and nuser
from your database.

The next screen will allow you to set the text color and size. If you don't feel like playing with them
you can go back later and hand edit the config file. Scroll down until you see the field 
'Path to dtd'. This is the location (http://www.etc.com) of the dtd for the XML backend. If you
don't plan to use the backend or if you don't feel like changing the address you can leave it.
The XML document will then attempt to pull the dtd off the 452 server. This is fine, but, keep in mind
that we move things around a lot. If you plan to use the XML back end you are STRONGLY urged 
to enter the path to your dtd. No gaurenteee that ours will be there.

The field below is the path to your backend.xml file. This is the absolute unix path, NOT http://anything

The next fields are the news admin and password. The default password is PaSsW0rD.
Change it. The username can be whatever you want.

Press go.

If no errors pop up then you are done. You have installed this script and everything is ready to go.

Go back to ftp. chmod all files to 755, except for login_failure.php and backend.xml
those two fiels should stay 666.

GO AND DELETE install.php NOW! THIS INSTANT. DO NOT LEAVE IT ON YOUR SITE.
We also recommend deleting the f_x.php docs, if you uploaded them.

---------------------If everything worked skip this part go on to use---------------------
Lets say you have a paranoid sysadmin and the install script choked all over. For some odd reason
install.php gave you errors up to high heaven. This is where the f documents come in.

Open f_tables.sql and send that to MySQL. If you have MyPHPAdmin installed (Not in any
way related to us or this script) just copy and paste it into the SQL query field.

If you don't have MyPHPAdmin or some other web based database admin you need telnet.
Log in and at the prompt type 

	   mysql -h host -u user -p

Replacing host and user with localhost and your username. Press enter. It should ask for your pass.
Enter it.

	 Enter password: ********

You are now connected. You should see something like:
 
 	Welcome to the MySQL monitor.  Commands end with ; or \g.
	Your MySQL connection id is 1 to server version: 3.22.20a-log

	Type 'help' for help.

	mysql>

Now copy the text from f_tables.sql into your prompt. Cut and paste.

	mysql>CREATE TABLE news (
   		 				id tinyint(4) DEFAULT '0' NOT NULL auto_increment,
  						title varchar(255) NOT NULL,
   						date varchar(255) NOT NULL,
   						item text NOT NULL,
   						PRIMARY KEY (id),
  						UNIQUE id (id)
			 			);
						etc
						
						OR
						
	mysql> database_name < f_tables.sql
	
And press enter. It should give you some sort of success message. You're done.

		 mysql> QUIT
		 Bye
		 shell>exit
		 log off

Now go back to FTP and change f_config.inc.php to config.inc.php and hand edit the values.
Delete install.php off your server. We also recommend deleting the f_x.php docs.

If you ran into a problem along there ask your sys admin how to create tables and databases.

Now you're done, and ready to go.

Section 3: Use

Now for the fun stuff. Take your web browser to http://www.yoursite.com/news/news_admin.php
At the pop up prompt enter your username and pass, click the save password box. click ok.
You'll see the admin page come up. Of course you have no news items. Click add news to add one.
Once you have news, if you made a mistake you can click on that news item and edit it.

You can delete items. We don't recommend this. If you start deleting all the old news your archive is
worthless.

Once you have at least one news item you can go to pull.php and see it displayed.

Now if you wish to include news on your main page all you need to do is insert
<?php include("/path/to/pull.php"); ?>
where you want the news table to appear. Then move archive.php into the same dir.

You can also take a look at backend.xml . This is your XML backend. Other people can
easily pull headlines from it to display on their site.

You want to allow other people to post news and such? Click on Add/edit user. Here you
can specify the username and password. These people will be allowed to post whatever
they want. NO content filters are in the script. (HTML tags other than <b> <i> <a> and <br>
are dropped from the main news items, all tags except <i> and <b> are dropped
from the other fields) That said, users other than yourself can only
edit and delete items that they contributed. Only you as admin can delete/edit other people's
news items.

If you add users you might want to let people see who posted what. In this case open
pull.php and follow the instructions for printing the posters name. Replace the 
printf() function in the script with the commented out one. If someone logs in incorrectly
their information is logged to login_failure.txt, if you have many failed attempts from the same
IP you might want to investigate it.

Now send an e-mail to services@452productions.com and tell us where you are
using this script. If it looks good we'll link to ya!

Section 4: FAQ

1. Why is the admin console so bland and why are none of the files full html docs?
   	   These files are ment to be pulled as includes. So you have one admin console
	   with all your admin functions or something.  If we added in pretty colored tables
	   then it would create problems when you include them. This script was created for
	   use with the Page Engine v1.1  and so these are include files.
	   
2. Any problems/limitations?
   We fix all problems/know issues as soon as they become know to us. If you encounter a
   problem services@452productions.com would like to know. The script has almost 
   no limitations but we touch on that subject in the source of install.php
   
3.  Whats with your spelling? Haven't you ever heard of a spell check?
	It is a poor mind that can only imagine one way to spell a word.
	
4. What can I do with the source?
    Read the GPL. Basically anything except try and make money or redistribute it.

	
We hope you enjoy using this as much as we enjoyed creating it. The staff of 452 Productions
creates these scripts as learning experiences, as a result, we really like creating them.
If you have any further questions/comments/accolades/flames/offers of cool stuff, feel free
to contact us.

Good luck and enjoy!

Services Dept
services@452productions.com
http://www.452productions.com