sNews 1.7 logo

sNews 1.7 Readme

(1.7 Release Candidate 2)

Welcome to sNews 1.7 a single file, template independant, PHP and MySQL powered, standards compliant Content Management System (CMS). sNews consists of one engine file (snews.php), one language file (snews_EN.php), one XHTML file (index.php) for content presentation, one stylesheet (style.css) for content styling and one javascript file for functionality. This makes sNews the lightest and one of the most user-friendly CMSs available today.

Before installing, please check that your server meets the minimum system requirements:

Fits any OS (Linux, Mac, Windows)

Apache, MySQL and PHP are all Open Source applications and freely available. They come preinstalled on Mac OS X 10.2.8 and later; they can be installed both on Windows and Linux OS (detailed info can be found on their respective websites) and they form the most widely used database server setup on the Internet today. For best result in a local server environment though, we suggest that you use a dedicated server stack (applications bundle): LAMP (Linux), MAMP (Mac) and XAMPP (Windows) are the recommended stacks at this time.

Note that sNews 1.7 in its default configuration will not work on a Windows IIS server because it uses different methods of URL rewriting.

Install sNews by following these simple steps:

1. Setup the Database

1.a. Start by creating a database and user/password (if required by the server), using the database administration tool available on your server (phpMyAdmin for example). If you already have a database set up, skip this step.

1.b. Next, use the code below to populate the database. Copy all of the code and paste it into the textarea in your database admin tools SQL panel, alternatively paste it into a text document using your text editor and save it as a .sql file (e.g. snews17.sql) and use the Import panel in the servers database admin tool to locate and import that file.

1.c. Important! If you need to use a prefix, for example if your domain host only allows you to use one database, you should add that prefix to each table e.g. prefix_articles, prefix_extras, prefix_categories etc, including all instances of settings before running the code. You must also add that prefix into snews.php in step 2. Be aware that this prefix is something that you choose: it is entirely separate from any prefix that your host may add.

SQL Data

CREATE TABLE articles (
	id int(11) primary key auto_increment,
	title varchar(100) default NULL,
	seftitle varchar(100) default NULL,
  	`text` longtext,
  	`date` datetime default NULL,
  	category int(8) NOT NULL default '0',
  	position int(6) default NULL,
  	extraid varchar(8) default NULL,
  	page_extra varchar(8) default NULL,
  	displaytitle char(3) NOT NULL default 'YES',
  	displayinfo char(3) NOT NULL default 'YES',
  	commentable varchar(5) NOT NULL default '',
  	published int(3) NOT NULL default '1',
  	description_meta varchar(255) default NULL,
  	keywords_meta varchar(255) default NULL,
  	show_on_home enum('YES','NO') default 'YES',
  	show_in_subcats enum('YES','NO') default 'NO',
	artorder smallint(6) NOT NULL default '0',
	visible varchar(6) default 'YES',
	default_page varchar(6) default 'NO'
);
INSERT INTO articles VALUES
(1, 'Welcome to sNews 1.7', 'welcome-to-snews-17', '<p>If you\'re seeing this article, you have installed <strong>sNews 1.7</strong> and are connected to the database.</p>\r\n\r\n<p>It is <strong>strongly </strong>suggested that you <a href=\"login/\" title=\"Login\">login </a>right away, the default username and password is \"<strong>test</strong>\" and \"<strong>test</strong>\", then go to the page \"<a href=\"snews_settings/\" title=\"Settings\">settings</a>\". At the bottom of that page you\'ll find <em>\"Change Username and Password\"</em>. <strong>Do it</strong> and make the password hard to guess.</p>\r\n\r\n<p>After doing that, feel free to delete this article & <a href=\"administration/\" title=\"Admin sNews\">start building your site</a>.</p>\r\n\r\n<p>If you stumble along the way, check the <a href=\"http://snewscms.com/faq/faq/\" title=\"Troubleshooting and FAQ\">Troubleshooting and FAQ</a> page.  If you\'re still having trouble search the <a href=\"http://snewscms.com/forum/\" title=\"sNews CMS Forum\">sNews CMS Forum</a> before posting your question, it may already be answered.  Still lost? We\'ll be there to assist you in any way we can.</p>\r\n\r\n<p>Thank you for choosing sNews.  We hope you enjoy it as much as we do.</p>', NOW(), 1, 1, '', '', 'YES', 'YES', 'NO', 1, '', '', 'YES', 'NO', '1', 'YES', 'NO');
CREATE TABLE extras (
  	id int(8) primary key auto_increment,
 	name varchar(40) NOT NULL,
  	seftitle varchar(100) default NULL,
  	description varchar(100) NOT NULL
);
	INSERT INTO extras VALUES (1, 'Extra', 'extra', 'The default extra');
CREATE TABLE categories (
  	id int(8) primary key auto_increment,
 	name varchar(100) NOT NULL,
 	seftitle varchar(100) NOT NULL,
 	description varchar(255) NOT NULL,
 	published varchar(4) NOT NULL default 'YES',
 	catorder smallint(6) NOT NULL default '0',
 	subcat int(8) NOT NULL default '0'
);
	INSERT INTO categories VALUES ('1', 'Uncategorized', 'uncategorized', '', 'YES', '1', '0');
CREATE TABLE comments (
 	id int(11) primary key auto_increment,
 	articleid int(11) default '0',
 	name varchar(50),
 	url varchar(100) NOT NULL,
 	comment text,
 	time datetime NOT NULL default '0000-00-00 00:00:00',
 	approved varchar(5) NOT NULL default 'True'
);
CREATE TABLE settings (
 	id int(8) primary key auto_increment,
 	name varchar(20) NOT NULL,
 	`value` varchar(255) NOT NULL
);
	INSERT INTO settings VALUES (1, 'website_title', 'sNews 1.7RC2');
	INSERT INTO settings VALUES (2, 'home_sef', 'home');
	INSERT INTO settings VALUES (3, 'website_description', 'sNews CMS');
	INSERT INTO settings VALUES (4, 'website_keywords', 'new, site, snews');
	INSERT INTO settings VALUES (5, 'website_email', 'info@mydomain.com');
	INSERT INTO settings VALUES (6, 'contact_subject', 'Contact Form');
	INSERT INTO settings VALUES (7, 'language', 'EN');
	INSERT INTO settings VALUES (8, 'charset', 'UTF-8');
	INSERT INTO settings VALUES (9, 'date_format', 'd.m.Y. H:i');
	INSERT INTO settings VALUES (10, 'article_limit', '3');
	INSERT INTO settings VALUES (11, 'rss_limit', '5');
	INSERT INTO settings VALUES (12, 'display_page', '');
	INSERT INTO settings VALUES (13, 'display_new_on_home', '');
	INSERT INTO settings VALUES (14, 'display_pagination', '');
	INSERT INTO settings VALUES (15, 'num_categories', 'on');
	INSERT INTO settings VALUES (16, 'show_cat_names', '');
	INSERT INTO settings VALUES (17, 'approve_comments', '');
	INSERT INTO settings VALUES (18, 'mail_on_comments', '');
	INSERT INTO settings VALUES (19, 'comment_repost_timer', '20');
	INSERT INTO settings VALUES (20, 'comments_order', 'ASC');
	INSERT INTO settings VALUES (21, 'comment_limit', '30');
	INSERT INTO settings VALUES (22, 'enable_comments', 'NO');
	INSERT INTO settings VALUES (23, 'freeze_comments', 'NO');
	INSERT INTO settings VALUES (24, 'word_filter_enable', '');
	INSERT INTO settings VALUES (25, 'word_filter_file', '');
	INSERT INTO settings VALUES (26, 'word_filter_change', '');
	INSERT INTO settings VALUES (27, 'username', '098f6bcd4621d373cade4e832627b4f6');
	INSERT INTO settings VALUES (28, 'password', '098f6bcd4621d373cade4e832627b4f6');
	INSERT INTO settings VALUES (29, 'enable_extras', 'NO');
	INSERT INTO settings VALUES (30, 'last_date', NOW());
	INSERT INTO settings VALUES (31, 'file_extensions', 'phps,php,txt,inc,htm,html');
	INSERT INTO settings VALUES (32, 'allowed_files', 'php,htm,html,txt,inc,css,js,swf');
	INSERT INTO settings VALUES (33, 'allowed_images', 'gif,jpg,jpeg,png');
	
	-- SPECIAL KEYS

	ALTER TABLE articles ADD INDEX ( `show_on_home` );
	ALTER TABLE comments ADD INDEX ( `articleid` );
	

2. Edit Settings

Edit "snews.php" and enter your settings at the top of the file:

Please note that the $db['website'] variable that was needed in previous versions has been replaced & no longer needs to be manually entered, as the path is automatially detected.

MySQL Host provided by hosting company, this is usually "localhost":
$db['dbhost'] = 'localhost';

Database Name created in phpMyAdmin or similar database editor:
$db['dbname'] = 'snews';

Database Username created in phpMyAdmin or similar database editor:
$db['dbuname'] = 'username';

Database password created in phpMyAdmin or similar database editor:
$db['dbpass'] = 'password';

Database prefix, which should end with an underscore (ex: 'snews_') created in phpMyAdmin or similar database editor, usually used when a hosting company provides only one database:
$db['prefix'] = '';

3. Upload files

Copy all the files from the sNews 1.7 package to your server and CHMOD 777 (= rwx-rwx-rwx) your folder where you'll upload your images (e.g. img). If you don't know how to change permissions, contact your server administrator.

Done!

You are ready to go! Login to start adding content and managing your site default username is test and password is test.
Bug reports, suggestions, comments, questions: sNews Forum

Additional info

Important! sNews makes use of the Apache module mod_rewrite and the system file .htaccess to create the Search Engine Friendly (SEF) links that are essential to the CMS. Using SEF or pretty links makes your site much more search engine friendly and gives it better rankings on Google and other popular search engines. If you install the sNews files in a subfolder on your domain root (i.e. http://mydomain.com/subfolder/), you must edit the included .htaccess file to match the path to your installation. On a web server, use your FTP client to locate the .htaccess file in your sNews installation folder (you will need to enable "show hidden files" or similar feature in the client);

Open the .htaccess file in the FTP client or your text editor of choice and find the line: #RewriteBase /sNews17.
Change this line to look like the following, with the second part matching the path to your sNews installation:
RewriteBase /name-of-sNews-folder

If you need to do the same operation locally on a Mac using Mac OS X or a PC using Windows Vista and can't find the .htaccess file, use the included "htaccess.txt" file to make your changes, then save it as .htaccess in your sNews installation folder. Mac OS X and Windows Vista (some editions) hide files that start with a period (.) from plain view.

More information about using sNews on your local computer can be found in the Help section at snewscms.com.

Enjoy!
The sNews Team


© Copyright Solucija, 2008. sNews is licensed under a Creative Commons Attribution 2.5 License.