Simpnews [News Publishing]

Questions? Need Help? Want to share? » PHP Forum
Script Name:
Simpnews

Download:
simpnews.zip

Category:
News Publishing

Archive Content:

Content:

Admin

Admin > Css

Admin

Admin > Gfx

Admin

Admin > Help > De

Admin > Help > En

Admin

Admin > Includes

Admin > Includes > Js

Admin > Includes

Admin > Includes > Layoutpages

Admin > Includes

Admin

Admin > Js

Admin > Js > Tabbed

Admin > Language

Admin

Applet

Doc > De

Doc > En

Doc

Gfx

Gfx > Bbcodes > Highlight

Gfx > Bbcodes > Normal

Gfx

Gfx > Emoticons

Gfx

Gfx > Icons

Gfx

Help > De

Help > En

Includes

Includes > Js

Includes

Js

Language

Sfx

Content:

Readme.html:





        body{
                font-size : 10pt;
                font-family : Verdana,  Geneva,  Arial,  Helvetica,  sans-serif;
                font-weight : normal;
                background-color : #FFFFF0;
                border : thin solid Black;
        }
        .remark{
                font-size : 8pt;
        }
        .footnote{
                font-size : 8pt;
        }
        a.footnote{
                text-decoration : none;
                color : #191970;
        }
        a.footnote:hover{
                background-color : Yellow;
        }
        PRE {
                font-family : "Courier New",  Courier,  monospace;
                font-size : 10pt;
                color : Black;
        }
        tr.params{
                background-color : #DCDCDC;
                font-family : Verdana,  Geneva,  Arial,  Helvetica,  sans-serif;
                font-size: 10pt;
        }
        tr.params_heading{
                background-color : #A9A9A9;
        }
        td.paramname{
                font-style : italic;
                text-align : center;
                width : 20%;
                vertical-align : top;
        }
        td.paramscripts{
                font-family : "Courier New",  Courier,  monospace;
                font-size : 9pt;
                text-align : left;
                padding-left : 2pt;
                width : 30%;
                vertical-align : top;
        }
        td.paramdesc{
                text-align : left;
                padding-left : 2pt;
                vertical-align : top;
                width : 25%
        }
        td.paramdefval{
                text-align : left;
                padding-left : 2pt;
                vertical-align : top;
                font-family : "Courier New",  Courier,  monospace;
                font-size : 9pt;
        }
        table.code{
                background-color : #F0F8FF;
                border : 1 solid Black;
                color : #444444;
                font-family : "Courier New",  Courier,  monospace;
                font-size : 9pt;
                padding-left : 2px;
                padding-right : 2px;
        }
        th{
                font-family : Verdana,  Geneva,  Arial,  Helvetica,  sans-serif;
                font-size: 10pt;
        }

SimpNews - ReadMe


Note for users of versions <2.20:
Starting with 2.20 a new userlevel for admins (superadmin) is available. Critical actions (e.g. shutdown of SimpNews)
only can be performed by admins with this level. If admin interface or whole script is being shutdown,  admins with this level
still will be able to login. They also will be able to login,  even if max. number of allowed admin logins has been reached.
'Cause of this,  you should assign this level to at least one admin after upgrading.
We recommend only to have one admin with this level,  so performing critical actions will not result in a "collision".
Installation
Important installation note: the database you define in config.php must still exist. The
install script does not create the database for security reasons.
Note for users of PHP4 <= 4.0.4:
Please uncomment function is_null at end of functions.php.

Copy config.dist.php to config.php and edit it to fit your needs (only recommended for people with PHP knowledge) or call admin/mkconfig.php to generate a config.php
(if you're using PHP version >= 4.2.0,  you have to set $new_global_handling=true;
in mkconfig.php).
Note: You can have multiple instances of SimpNews in the same database.
Just set tableprefix in config.php to different values for each installation.
Do this before calling admin/install.php.
To switch default language to English set the approriate values in config.php:
$default_lang = "en"; for user view
$admin_lang = "en"; for admin interface
On upgrading an existing installation,  ensure you put all new vars of the new version in your existing config.php !!

Upload all files (.php,  inc. ...) to your webhoster. Please maintain subdirectory structure.
Important:
Use binary mode in ftp to transfer files in /applet,  /gfx /admin/gfx and /sfx !!!!



1st time installation:
Now you can call http://your.host.com/installdir/admin/install.php to create the tables and the 1st admin user

Upgrade:
THIS ARCHIVE ONLY CONTAINS DB UPDATE SCRIPTS FOR V2.25+. TO UPDATE OLDER VERSION PLEASE
DONWLOAD UPDATE PACKAGE TO 2.25 FROM WEBSITE !!!
Please replace all files (.php,  .inc ...) on your server !!
This way you determine which script you need:
Take the actually installed versionnumber (e.g. 1.10).
Remove the point in the versionnumber (in our example this results in 110).
Now you have the upgrade version.
After this you need to sequentially use all upgrade scripts from this version to the actual version.
For our example the actual version should be 1.22 (short 122). Use upgrade_110_to_111.php
than upgrade_111_to_112.php and so on until you reach upgrade_121_to_122.php
If one script in the sequence does not exists,  for this upgrade step
no database changes were necessary. In this case just continue with the next one in the sequence.
Upgrade scripts reside in subdir admin


After installation remove admin/mkconfig.php,  admin/install.php,  admin/upgrade_* and admin/fill_* and set filemode for config.php to disable
PHP from writing to this file (on most server configurations this will be chmod 644).
Now you can enter the admininterface by calling http://your.host.com/installdir/admin/index.php
and login using the adminuser created during the installprogress.


Calling different user views

Newslist:
Type 1:

http://your.host.com/installdir/news.php?params


Type 2:

http://your.host.com/installdir/news4.php?params


Type 3:

http://your.host.com/installdir/news5.php?params


Newslist for archiv categories:
Type 1:

http://your.host.com/installdir/news_arc.php?params


Type 2:

http://your.host.com/installdir/news4_arc.php?params



Newslist separated by categories:
Type 1:

http://your.host.com/installdir/news2.php?params


Type 2:

http://your.host.com/installdir/news3.php?params




Subscription form:

http://your.host.com/installdir/subscription.php?params


Event calender:

http://your.host.com/installdir/eventcal.php?params


List of all events defined:
Type 1:

http://your.host.com/installdir/events.php?params


Type 2:

http://your.host.com/installdir/evlist2.php?params

Type 3:

http://your.host.com/installdir/evlist3.php?params


News and categorylist as frameset:

http://your.host.com/installdir/newsframe.php?params


RSS newsfeed:

http://your.host.com/installdir/rss_news.php?params


WAP Pages:
WAP categorylist:

http://your.host.com/installdir/wap_catlist.php?params


WAP categorylist type 2:

http://your.host.com/installdir/wap_catlist2.php?params


WAP search events:

http://your.host.com/installdir/wap_ev_search.php?params


WAP list of events type 1:

http://your.host.com/installdir/wap_short_events.php?params


WAP list of events type 2:

http://your.host.com/installdir/wap_short_events2.php?params


WAP list of announcements:

http://your.host.com/installdir/wap_short_announce.php?params


WAP list of news:

http://your.host.com/installdir/wap_short_news.php?params



URL parameters for scripts



    Parametername
    Valid for
    Description
        default Value1


    language
    news.php news2.php news3.php news4.php news5.php eventcal.php events.php evlist2.php newsframe.php subscription.phpnews_arc.phpnews4_arc.phpevlist3.phpmasssub.phpnlmaint.phprss_news.phpwap_catlist.phpwap_ev_search.phpwap_short_events.phpwap_short_events2.phpwap_short_announce.phpwap_short_news.phpwap_catlist2.php
    Language to use for interface(Valid language settings are those,  for which a language file is available in language subdir.
        The value to be used is the part of the filename between '_' and '.' -> for lang_en.php the value is "en")
        $default_lang from config.php


    layout
    news.php news2.php news3.php news4.php news5.php eventcal.php events.php evlist2.php newsframe.php subscription.phpnews_arc.phpnews4_arc.phpevlist3.phpmasssub.phpnlmaint.phprss_news.phpwap_catlist.phpwap_ev_search.phpwap_short_events.phpwap_short_events2.phpwap_short_announce.phpwap_short_news.phpwap_catlist2.php
    Layout to use for interface
        Layout for the provided language marked as default in admin interface


    category
    news.php news4.php news5.php eventcal.php events.php subscription.phpnews_arc.phpnews4_arc.phpevlist3.phprss_news.phpwap_short_events.phpwap_short_events2.phpwap_short_announce.phpwap_short_news.php
    Category to display in list(-1=display all categories)For news_arc.php and news4_arc.php selected category has to be marked as archiv in admin interface.
        Category 0 (general)


    sortorder
    news.php news2.php news3.php news4.php news5.php events.php evlist2.php newsframe.phpevlist3.phprss_news.phpwap_short_events.phpwap_short_events2.phpwap_short_announce.phpwap_short_news.php
    Sorting order for entries(0=order by date descending,  1=order by date ascending,  2=order by heading ascending,  3=order by heading descending)
        Order by date descendingnews5.php/evlist2.php: order by date ascending


    limitdays
    news.php news2.php news3.php news4.phpevlist3.phprss_news.phpwap_short_events.phpwap_short_events2.phpwap_short_announce.phpwap_short_news.php
    Limits list to display only provided number of days.(Overrides setting in database)
         


    startdateFormat: YYYY-MM-DD
    news.php news2.php news3.php news4.php news5.php events.php evlist2.phpevlist3.phprss_news.php
    Start listing at given date
         


    enddateFormat: YYYY-MM-DD
    news.php news2.php news3.php news4.php news5.php events.php evlist2.phpevlist3.phprss_news.php
    Stop listing at given date(overrides any limiting by days
         


    maxannounce
    news.php news2.php news3.php news4.php news5.php events.php evlist2.phpevlist3.php
    Only display given number of announcements.(for scripts separating by category: limit number of announcements per category)
         


    maxentries
    news.phpnews3.phpnews4.phprss_news.phpwap_short_announce.phpwap_short_events.phpwap_short_events2.phpwap_short_news.php
    Only display given number of entries.
         


        cats
        masssub.php
        Liste of categories to be included in form(separated by colon,  e.g. cats=1, 2, 3)
         


        mode
        wap_catlist.php
        Define to which script category entries should link.
        possible values:
        news = wap_short_news.php
        events = wap_short_events.php
        events2 = wap_short_events2.php
        announce = wap_short_announce.php
        evsearch = wap_ev_search.php
        
        
        news


        searchtype
        wap_ev_search.php
        Define which searching mode to use.
        possible values:
        text = search by text
        normal = search by category and date
        
        
        mode defined within admin interface


        sortorder
        news_arc.phpnews4_arc.php
        Define which sortorder to use.
        possible values:
        0 = defined display position
        10 = heading ascending
        11 = heading descending
        20 = date ascending
        21 = date descending
        
        
        0




1 default Value used if parameter is not supplied

URL-Parameters have to be provided as follows:
 First parameter after URL has to be preceeded by ? (e.g. news.php?language=en)
 All succeeding parameters have to be preceeded by & (e.g. news.php?language=en&layout=1)

Including lists in your own pages
Please note,  you only can include the lists mentioned in this section in your own pages. The other lists are designed to be
called directly and can't be included in you own pages.
Best way to get the code to include the appropriate list in your page is to use the generator for the code snippet provided
in admin interface.
Note: The code snippets provided in this documentation are PHP code
Hotnews list

Use include('<pathtosimpnews>/hotnews.php'); or include('<pathtosimpnews>/hotnews2.php');
or include('<pathtosimpnews>/hotnews4.php'); or include('<pathtosimpnews>/hotnews5.php');
or include('<pathtosimpnews>/hotnews6.php'); or include('<pathtosimpnews>/hotnews7.php');
or include('<pathtosimpnews>/hotnews8.php'); or include('<pathtosimpnews>/hotnews9.php');
to include the table in your page.
If you want to enable last visit tracking by cookie (and marking new news since last visit),
use include('<pathtosimpnews>/newscookie.php'); to include cookiehandling in your existing
page.This file has to be included before any HTTP body content is sent by PHP.

These versions do not use the header and footer data defined in the admin interface,  nor
the stylesheet,  nor metadata.php,  nor link colors. These scripts are designed to be
included in an existing page (e.g. if you want to have the latest 3 entries on your main page).
hotnews.php works like news.php,  hotnews2.php like news2.php,  hotnews4.php like news4.php and hotnews5.php like news5.php.
hotnews6/7/8/9 display the amount of entries (per category) defined in admin interface for the
categories selected in admin interface.
List of current events

Use include('<pathtosimpnews>/currentevents.php');
to include the table in your page.
If you want to enable last visit tracking by cookie (and marking new news since last visit),
use include('<pathtosimpnews>/newscookie.php'); to include cookiehandling in your existing
page.This file has to be included before any HTTP body content is sent by PHP.

This version does not use the header and footer data defined in the admin interface,  nor
the stylesheet,  nor metadata.php,  nor link colors. This script is designed to be
included in an existing page.
News notification icon
without lastvisit cookie

Use include('<pathtosimpnews>/newsnotify.php');
to include the table in your page.

with last visit cookie

Use include('<pathtosimpnews>/newsnotify2.php');
to include the table in your page.
If you want to enable last visit tracking by cookie (and marking new news since last visit),
use include('<pathtosimpnews>/newscookie.php'); to include cookiehandling in your existing
page.This file has to be included before any HTTP body content is sent by PHP.

Event calendar

Use include('<pathtosimpnews>/eventcal2.php');
to include the table in your page.
If you want to enable last visit tracking by cookie (and marking new news since last visit),
use include('<pathtosimpnews>/newscookie.php'); to include cookiehandling in your existing
page.This file has to be included before any HTTP body content is sent by PHP.

Ticker Java Applets
There are 6 different kinds of ticker avail:
newsticker.php
newsscroller.php
newstyper.php
newsmsgtyper.php
starscroller.php
eventscroller.php

Method for inclusion is the same for all 6. In the following instruction just replace <script> with the
name of the script you want to include.

Use include('<pathtosimpnews>/<script>');
to include the applet in your page.
If you want to enable last visit tracking by cookie (and marking new news since last visit),
use include('<pathtosimpnews>/newscookie.php'); to include cookiehandling in your existing
page.This file has to be included before any HTTP body content is sent by PHP.

JavaScript newsfader/newsscroller

Use include('<pathtosimpnews>/js_newsfader.php'); or include('<pathtosimpnews>/js_newsscroller.php');
to include the fader/scroller in your page.
If you want to enable last visit tracking by cookie (and marking new news since last visit),
use include('<pathtosimpnews>/newscookie.php'); to include cookiehandling in your existing
page.This file has to be included before any HTTP body content is sent by PHP.

catlist_inc.php

Use include('<pathtosimpnews>/catlist_inc.php');
to include the fader/scroller in your page.

Note: Name of frame,  news will occur in,  is defined by $linktarget at top of script.
subscribe/unsubscribe newsletter
using forms generated by scripts
subscribe/unsubscribe single newsletter

http://your.host.com/installdir/subscription.php?params

If param category is provided,  form only provides subscription/unsubscription for defined category.
If param is not provided,  user can selected category to subscribe/unsubscribe from a dropdown list.
subscribe multiple newsletter with 1 click

http://your.host.com/installdir/masssub.php?params

User gets a list of all categories available for newsletter. He/she can check the desired cats and
subscribe them with submitting just 1 form.
maintain subscribed newsletter

http://your.host.com/installdir/nlmaint.php?params

User has to enter his email. After this he will see a list of all subscribed (and confirmed)
newsletter. From this list he/she can select the newsletter(s) to unsubscribe.
Include subscription form for newsletter in own pages
form to subscribe/unsubscribe single newsletter
Example code for using external form to subscribe to news:
Please replace {desired category} with the news category to use for this newsletter (0=subscribe for all available categories).


<!-- --------- Start of subscription code --------- -->
<table width="80%" align="center">
<form method="post" action="/simpnews/subscription.php">
<input type="hidden" name="lang" value="en">
<input type="hidden" name="layout" value="1">
<input type="hidden" name="mode" value="subscribe">
<tr><td align="right" width="30%">Email:</td>
<td><input type="text" name="email" size="40" maxlength="240"></td></tr>
<tr><td align="right" valign="top">Email type:</td><td>
<input type="radio" name="emailtype" value="0" checked> HTML<br>
<input type="radio" name="emailtype" value="1"> plain text</td></tr>
<input type="hidden" name="newscat" value="{desired category}">
<td align="center" colspan="2"><input type="submit" value="subscribe">
</td></tr></form></table>
<!-- --------- End of subscription code --------- -->

Example code for using external form to unsubscribe:


<!-- --------- Start of unsubscription code --------- -->
<table width="80%" align="center">
<form method="post" action="/simpnews/subscription.php">
<input type="hidden" name="lang" value="en">
<input type="hidden" name="layout" value="1">
<input type="hidden" name="mode" value="unsubscribe">
<tr><td align="right" width="30%">Email:</td>
<td><input type="text" name="email" size="40" maxlength="240"></td></tr>
<input type="hidden" name="newscat" value="{desired category}">
<td align="center" colspan="2"><input type="submit" value="unsubscribe">
</td></tr></form></table>
<!-- --------- End of unsubscription code --------- -->

form to subscribe multiple newsletter with 1 click
Please generate the HMTL code for this form using the function in admin interface.
Admin interface
Note concerning attachements
If you switch $attach_in_fs from true to false or vice versa and there are existing attachements,
this will result in database inconsitency. Please first delete all attachements in the admin
interface,  than switch and upload the attachements again.
Note on field "remark put in emails" in layout:
Please include "{unsubscribeurl}" somewhere in your text (without the quotes). This will
be replaced by the appropriate URL to unsubscribe for the recipient on sending mails.
Texts
You can use different placeholders for the different texts. These placeholders on runtime will be
replaced by the actual,  asociated values.
The following list shows the placeholders available for the various texts and what values will be used
to replace.

Remark on transferred proposal
{postername} --> Name of person,  who has proposed this entry.
{postermail} --> Email of person,  who has proposed this entry.

Notification on new proposal (subject)
{sitename} --> Name of website.
{ptype} --> Type of proposal (News/Events)

Notification on new proposal (mailbody)
{sitename} --> Name of website.
{ptype} --> Type of proposal (News/Events)
{category} --> Category,  in which proposal has been posted
{postername} --> Name of person,  who has proposed this entry.
{postermail} --> Email of person,  who has proposed this entry.
{linkurl} --> URL,  which direct links to displaymod of the associated proposal in admin interface

Notification on new subscription (subject)
{sitename} --> Name of website.

Notification on new subscription (mailbody)
{sitename} --> Name of website.
{email} --> Email of subscriber
{category} --> Category,  which has been subscribed
{linkurl} --> URL,  which direct links to displaymode of the subscription in admin interface

Notification on removed subscription (subject)
{sitename} --> Name of website.

Notification on removed subscription (mailbody)
{sitename} --> Name of website.
{email} --> Email of subscriber
{category} --> Category,  which subscription has been removed from

Confirmationmail on removing subscription
{sitename} --> Name of website.
{confirmurl} --> URL user has to visit to confirm unsubscription


Confirmationmail on subscribing
{sitename} --> Name of website.
{confirmurl} --> URL user has to visit to confirm subscription
{confirtime} --> Time within the user has to do the confirmation


Confirmationmail on removing subscription (nlmaint.php)
{sitename} --> Name of website.
{confirmurl} --> URL user has to visit to confirm unsubscription
{catname} --> Name of category to unsubscribe


Confirmationmail on subscribing (masssub.php)
{sitename} --> Name of website.
{confirmurl} --> URL user has to visit to confirm subscription
{confirtime} --> Time within the user has to do the confirmation
{catname} --> Name of category to subscribe


Notification on new comment (subject)
{sitename} --> Name of website.


Notification on new comment (mailbody)
{sitename} --> Name of website as defined in config.php.
{email} --> Email of poster
{poster} --> Name of poster
{entry} --> # of entry this comment is on
{linkurl} --> link to directly call viewing comments for the referenced entry in admin interface


Authentitication of admin users
There are 3 ways to get authentication for admin users.

Using the internal authentication method. This is based on the data in the admin table and uses
cookies for session handling.
Using the internal authentication method. Sessionid sent by get and post requests.
Using authentication by webserver via .htaccess

Method #1
You have to set $enable_htaccess and $sessid_url in config.php to false.
In this case please ensure the following settings in config.php are correct:
$url_simpnews
$cookiename
$cookiepath
$cookiesecure
$sesscookiename
$sesscookietime

This method uses username and password stored in the database and because of this you can
change the password within the admin interface.
Method #2
You have to set $enable_htaccess to false and $sessid_url to true in config.php.
This method uses no cookie for storing the sessionid,  but instead sends the sessionid in every
get and post request.
Because of this,  everybody who can look on your screen also can see your sessionid.
We think
this is not really secure and recommend to use method 1 or 3. But you decide yourself.
Please ensure $sesscookiename is set to an value not used in an other way by SimpNews (best
would be to let the default name,  because this ensures avoiding conflicts with other
HTTP-variables SimpNews uses).
This method uses username and password stored in the database and because of this you can
change the password within the admin interface.
Method #3
You have to set $enable_htaccess to true in config.php.
For every user set up in the admin interface,  you also have to set up an user in .htpasswd.
Username in database and .htpasswd must be the same,  so the program can do assignment of
external and internal userdefinition (Note: usernames are not case sensitiv
in SimpNews,  but may be in .htaccess).
Because of security reasons the admin interface does not update .htpasswd. So if you use
this kind of authentication changes of the password in the admin interface will not have
any effects. Also if you generate a new user in the admin interface be sure to also add
this user to .htpasswd. You still have to provide a password while creating a new user,
so no security whole appears if you change from Method 3 to Method 1 or 2.
Remark: Using this method the internal login and failed login tracking is not available.
Also the logout function does not work.
Changing storing mode for attachements
Important: Don't just change storing mode for attachements in config.php ($attach_in_fs),  if you allready have
used attachements in SimpNews. Before you change storing type from database to filesystem (and vice versa),
use the function transfer files to database or transfer files to filesystem in manage files
in admin interface. This will transfer binary data of attachements from database to filesystem (or vice versa) and
update database entries. After this and before uploading new files,  you can switch the storing mode
in config.php
Tested browsers and systems
For actual list see our website
Licence
This program is Freeware. You are allowed to use this for free in non commercial
and commercial environments. You are not allowed to do any changes to the scripts,
except of the following files:
language/*
admin/language/*
stylesheets (*.css)
index.html
metadata.php
the marked parts in the files in the main directory. Changes only allowed between // begin user editable part
and // end user editable part

If you are using this program on your website,  please enter your site as a
reference on our homepage.

If you are using this program in a commercial environment,  it would be very kind to
provide our work with a little donation.

Newest version can be found at
http://www.boesch-it.de

Uses:

HTML Mime Mail class by Richard Heyes <richard  phpguru  org>
Coolmenus 4 by Thomas Brattli - www.dhtmlcentral.com
Tabs by Garrett Smith - dhtmlkitchen.com



© 2002-2005 Bösch IT-Consulting
Last updated: 03/02/2005




Other News Publishing Scripts:

WebMaster Resources Home

©RingsWorld.com