sNews Step By Step Installation Guide
1381 days agoThis is yet another one of the guides I have been doing these few days. This time it is for sNews blog/CMS script. Well, actually it is more for news and...
This is yet another one of the guides I have been doing these few days. This time it is for sNews blog/CMS script. Well, actually it is more for news and stuff but you can definitely use it for blogs and others. sNews is a very lightweight script and it contains only a few files, making it extremely flexible and easy to configure. There is only one file for you to configure your settings and another template file (with it’s CSS files for styling). Yup, it’s that lightweight.
All sNew script requires is PHP and MySQL which most webhost support. If you are using all of the modern webhost, you should be able to run sNews without any problems.In fact, for all the webhost I have tried, sNews works without any problems. The version I am using is v1.6 and it is the latest stable version at the time of writing. I would encourage any user to always use the latest version of their script to prevent bugs or holes from affecting your site. I would also recommend users to use only the stable version for their production site.

Your first step is to go to the new sNews website and download the latest version. You just need to click on the file under the Stable Versions and save the file somewhere you can remember as you will need to extract the files out. The file you download will be in the zip format which should be no problem for anyone using Windows to extract.

I am using IZArc to extract the files. You can use any unzipping software to do that.

You will need to remember where you extract the files to as you will have to upload the files to your webserver. The file named “snews.php” is extremely important as it contains all the settings and configurations you need to setup your CMS.
The next few steps will require you to setup your MySQL database. If you do not know how to setup a blank MySQL database, you can refer to the two guides I have done for the Cpanel control panel (for MySQL Databases) and for the DirectAdmin control panel(for MySQL Databases). So, you need the password and username to access your control panel. Please get the information from your webhost. You will also need to access PhpMyAdmin from your control panel to add in content into your newly created database. So, the first thing you need to do is to create a MySQL Database, a user and a password for that user. After you have done that (refer to the links above), you have to populate your database with some information. I shall begin by accessing PhpMyAdmin. PhpMyAdmin is a user interface for accessing and manipulating MySQL Database.

Under Database option, choose your newly created database.

You will see that the database is empty with no tables. What you need to do is to populate the database with some information in order for the sNews script to work properly. Don’t worry, it is not difficult. Just a few clicks here and there and some copying.

The next step is for you to click on the SQL tab. You will be redirected to another page with allows you to run MySQL commands.
You will need to copy the following information:
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, 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 ); 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' ); 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(60) NOT NULL ); INSERT INTO settings VALUES (1, 'website_title', 'sNews 1.6'); 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, 'approve_comments', ''); INSERT INTO settings VALUES (17, 'comments_order', 'ASC'); INSERT INTO settings VALUES (18, 'comment_limit', '30'); INSERT INTO settings VALUES (19, 'word_filter_enable', ''); INSERT INTO settings VALUES (20, 'word_filter_file', ''); INSERT INTO settings VALUES (21, 'word_filter_change', ''); INSERT INTO settings VALUES (22, 'username', '098f6bcd4621d373cade4e832627b4f6'); INSERT INTO settings VALUES (23, 'password', '098f6bcd4621d373cade4e832627b4f6'); INSERT INTO settings VALUES (24, 'system_email', 'admin@mydomain.com'); INSERT INTO settings VALUES (25, 'system_name', 'Site Admin');
Aand then paste it on the Run SQL query/queries textbox provided as shown below. Please ensure that you have copied all the necessary information. Double check. You will need to get this right for your database to work properly.The information above can be found from the sNews website itself. In fact, it would be much better and safer to copy directly from their site. Please click here to access their official installing guide. I have added the information above for convenience sake.

Paste on the Run SQL query/queries textbox.

There, all copied. Click on Go to execute the commands.

Yes, your query has been executed successfully and we can all sleep peacefully tonight.
Do note thatthe tables created have no prefix. If you would like to have prefixes, then you will need to add the prefix to the commands. For example, if you would like a prefix called “happy_”, then under the “CREATE TABLE” command, you should add the prefix in. So, it will read “CREATE TABLE happy_articles”. You will need to do it for all four tables that are created.
Now that your database has been created and all populated with the necessary information to setup your script, you will need to edit some settings on your script. The most important thing to change is the database settings. You will need to tell sNews where your database is located, what’s the name and the user plus the password. So now you should fire up your text editor software.

I am using PSPad editor. Well, the main reason why I use PSPad Editor is because it just works so very well. If you are doing HTML or CSS coding, they make it all much easier with formatting. Furthermore, it’s free. If you are using some other text editor, the steps should be approximately the same. Fire up your text editor and open the”snews.php” file located inside your snews folder. You remember where you extracted the files don’t you?

Once you have opened the “snews.php” file, scroll down slightly till you see the “DATABASE VARIABLES”. You need to do the changes there. Change the website to your website’s URL. In my example, it is called “http://www.autho-rity.info/”. Then you will need to change the database name, database user and the password. If you have added prefixes to your database tables, then you will need to edit the information in the prefix row as well.

Save the file. If you don’t save it, then it is useless. The next step is to upload all the files to your web server. For this, you will need the FTP username and password as well as the URL for your FTP Server. Get those information from your webhost.

I am using Filezilla as my FTP Client. If you are using another FTP Client, the steps should be around the same. Most FTP software works about the same, as the concept is basically uploading or downloading (transfering of files). Don’t worry, it’s really not that difficult to do. If you are using Filezilla, choose the files you want to upload, right click and choose Upload and you are on your way. Please note that you should upload the files inside the sNews folder (extracted) and not the folder itself. If you do that, you are basically creating a subdirectory and your URL will change. The files you will need to upload to your webserver is “.htaccess”, “index.php”, “snews.php” and “style.css”. The rest you can ignore. *Thanks to Keyrocks*

There, all the needed files have been uploaded. Basically it is just 4 files. Which script can do that with just 4 files? And yes, we are almost done!

Your next step would be to browse to your website. If your domain name is “www.happy.com” and your files are located at root (not in any subdirectory) then you should browse to “http://www.happy.com” . You will be greeted by the big words “sNews 1.6″. This means that everything is setup properly and you can start reaching for that can of cheap beer. But before you do that, you should change your username and password as the default password and username is rather well-known. So click on “Login”.

Login with the default username and password which is “test” and “test” respectively. Of course, you will need to do that anti-spam thingy. Basically it is just maths like “1+1=2″. Do you see why I am telling you to change the username and password? If you don’t change your username and password, you will bound to get into trouble soon enough.

Under Site, choose Settings.

You will be able to see the “Change Username and Password” submenu, click on the submenu to expand it.

Yes, change your username and password to something difficult so that your site will not be easily hacked. Not sure why sNews limits the password to a maximum of 8 characters only. Kind of ridiculous if you ask me. I think passwords should be long, as long as 16 characters. But who am I to question coders with years and years of experience. Click on Save after you are done.

There, operation completed successfully!
So there you have it, your first brand new sNews blog/news and whatever site. Cool isn’t it? If this tutorial has been helpful to you, please leave some comments and let me know. I would really like to hear from you.












