Location: PHPKode > projects > PHPFreeNews > phpfn/Doc/index.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
		<title>Untitled Document</title>
		<link rel="stylesheet" type="text/css" href="../Inc/Styles.css">
	</head>
	<body>
		<table width="700">
			<tr>
				<td><a href="#Introduction">Introduction</a></td>
			</tr>
			<tr>
				<td><a href="#Requirements">Requirements</a></td>
			</tr>
			<tr>
				<td><a href="#Installation">Installation</a></td>
			</tr>
			<tr>
				<td><a href="#IncludingOnSite">Including News On Your Site</a></td>
			</tr>
			<tr>
				<td><a href="#Examples">Examples</a></td>
			</tr>
			<tr>
				<td><a href="#Templates">Templates</a></td>
			</tr>
			<tr>
				<td><a href="#UserDef">User-Defined Codes</a></td>
			</tr>
			<tr>
				<td><a href="#Terminology">Terminology</a></td>
			</tr>
			<tr>
				<td><a href="#Help">Help and Support</a></td>
			</tr>
			<tr>
				<td><a href="#Donations">Donations</a></td>
			</tr>
			<tr>
				<td><a href="#Credits">Credits</a></td>
			</tr>
			<tr>
				<td><a href="#License">License</a></td>
			</tr>
		</table>
		<table width="700">
			<tr>
				<td><p class="ErrorText">
						<a name="Introduction"></a><strong>Introduction</strong>
					</p>
					<p>
						PHPFreeNews is a free PHP script which allows you to display "news" articles on your own website. This allows you (or your friends or colleagues) to easily update new articles without having to naually edit the web page HTML. The script allows you to control the content and layout of the news articles, and allows full maintenance and audit of the news items. Features include:
					</p>
					<ul>
						<li>Creation, Editing and Posting of news articles</li>
						<li>Associate an image with each article</li>
						<li>Allow users to provide comments on articles</li>
						<li>Allows user to rate articles</li>
						<li>Full back-office maintenance and control facilities.</li>
						<li>Highly configurable</li>
						<li>Frequent upgrades and new features</li>
						<li>Free!</li>
					</ul>
					<p>
						The latest version of the script can be downloaded from the <a href="http://www.phpfreenews.co.uk" target="_blank">PHPFreeNews website</a>, and you should ensure that you are using the latest version before you install this script.
					</p>
					<p class="ErrorText">
						<a name="Requirements"></a><strong>Requirements</strong>
					</p>
					<p>
						PHPFreeNews has very few system requirements:
					</p>
					<ul>
						<li>A webserver. The script has been developed on Apache 2.x running on Linux, but it should work with any PHP/MySql compatible server</li>
						<li>PHP support. The script has been developed on PHP4 but it should work happily with other versions</li>
						<li>MySql. The script has been developed on MySql 4 and requires MySql 4 or later to function.</li>
					</ul>
					<p class="ErrorText">
						<a name="Installation"></a><strong>Installation</strong>
					</p>
					<p>
						1. Get hold of the script from the Downloads page at <a href="http://www.phpfreenews.co.uk" target="_blank">www.phpfreenews.co.uk</a>. This is a ZIP archive with pathnames.
					</p>
					<p>
						2. Extract the zip file contents (retaining the folder structure), and upload this to your website. The suggested location is www.yourservername.com/phpfn (or www.yourservername.com/News), and the rest of this page assumes that is where you have placed the script.
					</p>
					<p>
						3. Edit the configuration file Config.php in the /phpfn/Config folder. In here you should specify your MySql details and also the name of your news database (which you must create yourself). The first section in the configuration file is mandatory; the remainder can be changed if you wish to alter the default behaviour.
					</p>
					<p>
						4. Point your browser at www.yourservername.com/phpfn/Install.php (e.g. www.yourservername.com/phpfn/Install.php) and follow the prompts. This will now set up your database structure and will populate the tables with some very basic sample data. If you see any errors then you must correct these and then try again.
					</p>
					<p>
						5. Edit the Config.php file again (the copy on the webserver) and set the &quot;AllowInstall&quot; value to false - this will prevent anybody else from re-running your installation script!!!
					</p>
					<p>
						6. Err....there's no step 6, you've finished! Point your browser at www.yourservername.com/phpfn/Admin.php and login with user=<i>Admin</i>, password=<i>Admin</i>.<br />
					</p>
					<p>
						If you are <strong>upgrading</strong> an existing installation then please point your browser at the appropriate 
 file	within	the	Upgrade	subfolder. This will upgrade your database structure, so be sure to take a backup of your data first! You must upgrade
					from the previously released database structure, e.g. work your way through the Upgrade scripts. However, it's much better to keep &quot;on top&quot; of upgrades, so that you only need to apply a single upgrade.
					</p>
					<p>
					Once you have installed the software, either as a clean install or as an upgrade, then please 
					delete the entire <em>Upgrade</em> subfolder.
					</p>
					<p class="ErrorText">
						<a name="IncludingOnSite"></a><strong>Including News On Your Site</strong>
					</p>
					<p>
						Once you've configured your script and setup your templates etc, you'll probably want to display the news on your site! This is actually very easy to do - though there's lots of ways to do it. The simplest option is to add the following line to your existing PHP page:
					</p>
					<blockquote>
						<p>
							<strong>&lt;?php include &quot;phpfn/News.php&quot; ?&gt;</strong>
						</p>
					</blockquote>
					<p>
						This will display the news on your site. If nothing shows, or if you see an error, then now would be a good time to resolve it. But everything should run smoothly.
					</p>
					<p>
						HOWEVER...the chances are
 that	you	saw	nothing	on your site. Why? Well, because articles have to	
					be assigned to categories, and you need to say which news-category you want to show. Therefore 
					the following examples are better:
					</p>
					<blockquote>
						<p>
							<strong>&lt;?php $CatID='1'; include 'phpfn/News.php' ?&gt;</strong>
						</p>
					</blockquote>
					<blockquote>
						<p>
							<strong>&lt;?php $CatID='1,2,3'; include 'phpfn/News.php' ?&gt;</strong>
						</p>
					</blockquote>
					<p>
						The exception to this is if you change the $ShowIfNoCat value in the Config file, as this will display articles even if they have been assigned no categories.
					</p>
					<p>
						Note that the values set up in the Configuration file will take effect each time you display the news. If you want to override these on a per-page basis (e.g. display the news twice on one page, with each listing showing different news items) then you <strong>MUST</strong> include the file <strong>Override.php</strong>. So for example, let's say your default &quot;news mode&quot; in the config file says &quot;<strong>$NewsMode = 2</strong>&quot;, but you want to change this to &quot;<strong>$NewsMode = 1</strong>&quot; for one page, then you would do this:
					</p>
					<blockquote>
						<p>
							<strong>&lt;?php include &quot;phpfn/Override.php&quot;; $NewsMode=1; include &quot;phpfn/News.php&quot; ?&gt; </strong>
						</p>
					</blockquote>
					<p>
						The same logic can be applied to override <em>any</em> of the config-file values, on an ad-hoc basis. Note that any values you override will remain overridden for all calls to News.php on that page. Therefore if you override a value for a one-off instance you might then have to override it back again, depending upon your requirements.
						<em>If you don't include Override.php then your &quot;extra values&quot; 
					will be ignored.</em> 
					</p>
					<p>
						If you want to just display news headlines instead of news then you should use &quot;<strong>phpfn/NewsHeadlines.php</strong>&quot;instead of &quot;<strong>phpfn/News.php</strong>&quot;
					</p>
					<p class="ErrorText">
						<a name="Examples"></a><strong>Examples</strong>
					</p>
					<p>
						Display simple news:<br />
						<strong>&lt;?php include &quot;phpfn/News.php&quot; ?&gt;</strong>
					</p>
					<p>
						Display news, overriding the display-mode<br />
						<strong>&lt;?php include &quot;phpfn/Override.php&quot;; $NewsMode=1; include &quot;phpfn/News.php&quot; ?&gt;</strong>
					</p>
					<p>
						Display news, displaying one specific article (Article IDs 17, 23 and 46)<br />
						<strong>&lt;?php include &quot;phpfn/Override.php&quot;; $ArticleList='17, 23, 46'; include &quot;phpfn/News.php&quot; ?&gt;</strong>
					</p>
					<p>
						Display news, displaying archived-items as well as normal items: <br />
						<strong>&lt;?php include &quot;phpfn/Override.php&quot;; include &quot;phpfn/News.php&quot; ?&gt;</strong>
					</p>
					<p>
						Display news, displaying only live posts, and only displaying one category:<br />
						<strong>&lt;?php include &quot;phpfn/Override.php&quot;; $ExcludeArchivedPosts=1; $CatID='1'; include &quot;phpfn/News.php&quot; ?&gt;</strong>
					</p>
					<p>
						Display news, displaying only live posts, but also displaying Archived posts if a search is underway:<br />
						<strong>&lt;?php include &quot;phpfn/Override.php&quot;; $ExcludeArchivedPosts=(isset($_POST['Match']) ? 0 : 1); include &quot;phpfn/News.php&quot; ?&gt;</strong>
					</p>
					<p>
						Display the search form above the news:<br />
						<strong>&lt;?php include &quot;phpfn/NewsSearchForm.php&quot;; include &quot;phpfn/NewsHeadlines.php&quot; ?&gt;</strong>
					</p>
					<p>
						Display news, but allow the user to filter the category themselves:<br />
						<strong>&lt;?php include &quot;phpfn/NewsCategoryForm.php&quot;; include &quot;phpfn/News.php&quot; ?&gt;</strong>
					</p>
					<p>
						Display news, forcing all articles to use a fixed template (Template ID 5):<br />
						<strong>&lt;?php $TemplateOverride=5; include &quot;phpfn/News.php&quot; ?&gt;</strong>
					</p>
					<p>
						Display news twice on the page, once witha fixed category and then once with all categories:<br />
						<strong>&lt;?php include &quot;phpfn/Override.php&quot;; $CatID='1; include &quot;phpfn/News.php&quot; ?&gt;</strong><br>
						<strong>&lt;?php unset($CatID); include &quot;phpfn/News.php&quot; ?&gt;</strong>
					</p>
					<p class="ErrorText">
						<a name="Templates"></a><strong>Templates</strong>
					</p>
					<p>
						Templates
					allow you to apply a fixed but flexibly design to your news article. You can set up as many templates as you like, and then associate a single template with each article.
					</p>
					<p>
						Templates are designed using standard HTML tags, such as &lt;TABLE&gt;, &lt;TR&gt; etc. But in addition, there are certain &quot;special words&quot; you can use in these templates to show your news. For example, if your template 
					consists of the following:
					</p>
					<p>
						&lt;TABLE&gt;&lt;TR&gt;&lt;TD&gt;Posted on {newsdate} at {newstime}
					&lt;/TD&gt;&lt;/TR&gt;&lt;/TABLE&gt;
					</p>
					<p>
						Then your news will show the date and time the article was published.
					</p>
					<p>
						Several tags are available, and they are shown within the Template Maintenance page.
					</p>
					<p>
						Note that Templates are made up from three parts, each one controlling the display of Headlines, Short Posts and Long Posts. You can customise them all however you wish, and PHPFreeNews will apply the appropriate formatting according to the type of listing being displayed. For
					example, if you are displaying only news headlines then only the &quot;Headline&quot; element of the Template will be applied.
					</p>
					<p>
						The exact template codes are as follows:
					</p>
					<ul>
						<li>							{headline} - the news headline;						</li>
						<li> {author} - the name of the person writing the news;						</li>
						<li> {newsdate} - the datestamp on the news article; </li>
						<li> {newstime} - the timestamp on the news article; </li>
						<li> {timesread} - the number of times the article has been read; </li>
						<li> {image} - the image associated with the article, if any;
						There are three variants on this - {imagel}, {imagec} and (imager} and these will give your image Left, Centre or Right alignment respectively. </li>
						<li> {id} - the internal ID of the article - useful for creating your own links;						</li>
						<li> {news} - the actual news (short or long); </li>
						<li> {rating} - the number of votes, if you have enabled the voting system; </li>
						<li> {comments} - a link to Comments functionality, if you have enabled it; </li>
						<li> {readmore} - a link to the long-post, if there is one . </li>
					</ul>
					<p>
						Most of these are optional, and will be replaced with blanks if applicable (e.g. the {image} tag will be replaced with blanks if an article has no associated image)
					</p>
					<p class="ErrorText">&nbsp;
						<a name="UserDef"></a><strong>User-Defined Codes</strong>
					</p>
					<p>
						User-Defined Codes allow you to create your own &quot;meta-tags&quot; which will be used 
						when news is displayed.
					</p>
					<p>
						So for example, if you always write the words &quot;Smith and Sons - Your Online Partner&quot; in your articles you could setup a user-defined code called &quot;{tagline}&quot; and just use &quot;{tagline} in your articles. When the article is published it will show your actual tagline instead.
					</p>
					<p>
						This is a great way of maintaining 
					consistency across your articles. Change the user-defined code, and all your articles are immediately updated!					
					</p>
					<p class="ErrorText">
						<a name="Terminology"></a><strong>Terminology</strong>
					</p>
					<p>
						PHPFreeNews uses a few terms which you may or may not be familiar with. Here's brief explanation of them:
					<p>
						<strong>Archive</strong>: Push articles into the Archives so that they are removed from display. This can be done on a per-article basis or by the age of the article. Useful if you want to remove articles from display but still retain them for reference.
					<p>
					<strong>News Feed</strong>: An RSS feed, similar to the feeds appearing on lots of websites. This allows users to &quot;subscribe&quot; to your news articles.					
					<p>
						<strong>Locked</strong>: A Locked article is one which cannot be changed. It cannot be edited, made Sticky, etc. Locked articles are also explicity excluded from the Archive and Purge routines.	Only	users	with	the	correct privileges 
					can lock and unlock 
					articles.
					<p>
						<strong>Purge</strong>: Allow you to permanently delete articles from your database. This is a simply feature, useful only for having a spring-clean.
					<p>
						<strong>Sticky</strong>: An article which is to appear as though it is &quot;stuck&quot; at the top of the list. Useful for displaying long-running news articles which you don't want to get &quot;bumped&quot; down the list by more recent articles.
					<p>
						<strong>Template</strong>: A default layout for your new articles. 
					<p>
						<strong>Visible</strong>: 
						Only Visible articles will be displayed. This cannot be overridden.
					<p class="ErrorText">
						<strong><a name="Help" id="Help"></a>Help and Support</strong>
					</p>
					<p>
						PHPFreeNews is well-supported, both by the author and by a growing community of supporters. If you experience a problem or you need some assistance, your first port of call should be the <a href="http://www.phpfreenews.co.uk/forums/" target="_blank">Forums</a>. Here you will find answers to many questions, or you can raise a new question. Please search for answers before posting a new question!
					</p>
					<p>
						If you find that you are unable to login to the site, i.e. you forget the Admin password, then there's a Rewrite Password facility. Point your browser at http://website/InstallDir/RewritePassword.php. You will be prompted to enter a username - this is the MySql Username which you have in your Config file. If you supply the correct credentials then the master administrator (User ID 1) will have its password reset to the same as your Config-file password. 
					</p>
					<p>
						If you can't get a satisfactory solution from the forum (which is highly unlikely) then please get in touch with me via the <a href="http://www.phpfreenews.co.uk/Contact.php" target="_blank">website</a>.
					</p>
					<p class="ErrorText">
						<a name="Donations"></a><strong>Donations</strong>
					</p>
					<p>
						Okay, begging-bowl time! Software development, hosting and distribution costs money. If you like this software and you use it on a website, then please consider making a donation. It doesn't have to be much, but everything helps! You can donate via PayPal on the PHPFreeNews website.
					</p>
					<p class="ErrorText">
						<a name="Credits" id="Credits"></a>Credits
					</p>
					<p>
						The original concept for this site was taken from <a href="http://www.atomicpenguin.com" target="_blank">Atomic Penguin</a> news. This news script fell into disrepair many months ago (even the website has been hacked and left unfixed for months!) and the script has clearly died. I liked the concepts behind Atomic Penguin so I decided to write my own script.
					</p>
					<p>
						All the coding is my own, but much of the testing and ideas have come form the user community. Two people in particular have been instrumental to the current functionality, and they are Daf and Duvien. The script wouldn't be nearly as good if it wasn't for their ideas and support!
					</p>
					<p class="ErrorText">
						<a name="License" id="License"></a>License
					</p>
					<p>
						This software 
					is released into the public domain and has no licensing requirements. All I ask is that you don't tweak it
					and then pass it off as your own work! You are free to modify it as you wish, but please leave the original copyright notices (in each PHP file) intact. 
					</p>
					<p>&nbsp;
					</p>
					<p>
						<strong>Copyright Jim Willsher 2005						</strong>
					</p>				</td>
			</tr>
			<tr>
				<td>&nbsp;</td>
			</tr>
		</table>
	</body>
</html>
Return current item: PHPFreeNews