eDNews is a PHP module to display news or quotes on your website or within your web application. Its main characteristic is the news display algorithm which use random only at the last moment and guarantees that each news is displayed and read equitably. Screenshots and a live demo are available on the eDreamers website.
The following components are required (between brackets the one used during the eDNews developments):
On Windows, PHP and the Apache web server can be installed in a few mouse clicks thanks to EasyPHP. Simply download and install this free tool (10 Mo) if you don't have yet such an environment on your machine. We also recommend the use of phpMyAdmin for the management of your MySQL database.
If it's the FIRST TIME you're installing eDNews you just have to extract the archive under any path at the root of your webserver.
C:/Program Files/EasyPHP/WWW/
apache/conf/httpd.conf
file and search for the 'DocumentRoot' parameter to find out what is the root of your webserverIf you already have a previous version of eDNews installed, we advice you put the new version in another folder so that you can keep the both configuration file and update the new one based on your previous parameters.
Once successfully extracted, the following should be available in the target folder:
readme.html
- this file, providing all the information needed to install, configure and use eDNews
install.sql
- this file contains the SQL code to create the news table. Run it against your MySQL database
myConfig.php
- this is the main and only configuration file of eDNews. You have to set some of the parameters of this file in order to get eDNews running properly in your environment. More explanations are provided below and in the file itself
index.php
- the sample file, including eDNews for you to use. This is showing an example of how to include eDNews in your web pages but is not the only way to do it
eDNews.php
- the core source file, containing the algorithm controlling the selection and expiration of news. As a user you don't have to worry about it
eDNews_view.php
- the viewer component responsible for the display of news
eDNews_add.php
- the add component allowing the online creation of news
eDNews_archive.php
- the archive component offering access to the expired news
languages/
- the folder storing the language files. The ones provided with eDNews are english (en) and french (fr).
skins/
- the folder containing some sample stylesheets that you can use to influence the visual rendering of the eDNews components.
templates/
- the folder storing the templates driving the display of the various eDNews components. They define the HTML code used to display the viewer, add and archive components and can be modified to adapt the visual rendering to your needs.
eDToolbox
- the eDreamers default toolbox module providing database, debugging and templates scripts used by most other eDreamers modules and applications.
It has its own development path and new versions may be released and you might or might not decide to upgrade (backward compatibility is usually ensured unless the contrary is stated).
All the configuration parameters can be found and modified in the myConfig.php
file and explanations are provided in english in the file itself before each configuration parameters.
$CONFIG['root'] = 'http://pathto/eDNews/';Assuming you created a sub-folder under the root of your local webserver, for example C:/Program Files/EasyPHP/www/eDNews/ (using EasyPHP on Windows) then the value should be:
$CONFIG['root'] = 'http://localhost/eDNews/';
$CONFIG['language'] = 'en'; // 'fr' | 'en'
myConfig.php
, you will specify the connection parameters to the news MySQL database from the hostname to the database name.
$CONFIG['host'] = 'hostname'; // host of the MySQL db $CONFIG['user'] = 'username'; // user to access the news db $CONFIG['password'] = 'changeme'; // password to access the news db $CONFIG['db'] = 'dbname'; // database nameYou have to do the same in the eDToolbox configuration file
eDToolbox/config.php
with the same values.
The parameters name are different from the eDNews because the needs of eDToolbox are different as well but you should not worry about it.
$CONFIG[++$i]['host'] = 'hostname'; $CONFIG[$i]['user'] = 'username'; $CONFIG[$i]['password'] = 'changeme';We recommend that you create a specific user to access the news database with limited privileges (SELECT, INSERT and UPDATE are the only ones required).
$CONFIG['display_add']
and $CONFIG['expirationDelay']
parameters.
Read more in the configuration file itself.
As said earlier, eDNews is meant to be integrated seamlessly (or not) in your website or web applications. This is usually causing 2 problems:
All the links (well 4 links) used by eDNews are not hardcoded but controlled via the following configuration parameters:
$CONFIG['addURL'] = $CONFIG['root'].'?action=add'; $CONFIG['startURL'] = $CONFIG['root'].'?action=null'; $CONFIG['viewURL'] = $CONFIG['root'].'?action=view'; $CONFIG['archiveURL'] = $CONFIG['root'].'?action=archive';
The current values are set in order to work with the sample index.php
which is showing one way to integrate eDNews: calling all components from one page using an action
variable to switch between the components (add, start, view or archive) using a switch() {}
statement.
<?php if ( isset( $_REQUEST['action'] ) ) { $action = $_REQUEST['action']; } else { $action = null; } require dirname(__FILE__).'/myConfig.php'; switch( $action ) { case 'view': if ( isset( $_REQUEST['newsid'] ) ) { ${$CONFIG['fld_id']} = $_REQUEST['newsid']; } else if ( !isset( ${$CONFIG['fld_id']} ) ) { ${$CONFIG['fld_id']} = null; } require dirname( __FILE__ ).'/eDNews_view.php'; break; case 'add': require dirname( __FILE__ ).'/eDNews_add.php'; break; case 'archive': require dirname( __FILE__ ).'/eDNews_archive.php'; break; default: require dirname( __FILE__ ).'/eDNews.php'; break; } ?>
You can decide to do the same thing and just need to copy and paste the PHP code you'll find in the index.php
file.
Another typical configuration is to have one component per page or the viewer used in multiple pages and the rest of the components to add and view the archives in one single but different page.
If you need some assistance, contact us anytime at support@edreamers.org or by posting a message to the Forums
to be documented
to be documented
to be documented
_If you need support during the installation of this patch, please contact us at support@edreamers.org.