Applying a Mod to sNews
Mods available on this site should be reasonably clear in the application description, however, if a mistake is made, you may have to start over.
To prevent either an incorrectly applied mod, or one that doesn’t fit your needs as expected from causing you recovery grief, here are a few tips to make it easier to back-track.
- 1) Do not work on your live site sNews file. Set up an off-line site on your computer, and only upload the modified snews.php when you have tested the modification.
- 2) Before starting, create a backup copy of snews.php, and put it in a safe place in the event that a complete restoration is required.
- 3) Use comments to label the location of a change, and what the change is for.
- a) use /* and */ to surround the label, and place the label on the same line as the modified code where it can quickly be seen in your editor. e.g. /*Captcha mod – adding words*/
- b) use the same label for every line being modified for that particular mod. This separates out different mods you have applied.
- c) use the same tags ( /* and */ ) to surround a complete block of code being replaced, and insert the replacement directly after.
- 4) In the same manner, place the above comment tags around a complete function being modified or replaced, then make a copy of the function (minus these tags) and paste it below/above the original.
- 5) To comment out a single line of code only, use // .
For more information and description of php comments, see the manual on php.net
- 6) Once you have thoroughly tested the code alterations and replacements, if you choose, you can easily locate and remove the old code from snews.php.
Following these steps or variations of them, if the mod doesn’t work out, you can delete the new, restore the old and return to an operating snews file.
sNews requires PHP, MySQL and mod rewrite. If your server meets those requirements, get started and learn how to install sNews on your website in 3 easy steps.
Browse through our help center and learn about template tags and how to simply create your own theme. Dig into sNews and customize it to behave the way you want.
sNews can be a simple blog tool and a full blown CMS. Customize it with addons, mods or play with different themes.
Talk about sNews on our Forum and share your expirience.