User Tools

Site Tools


sitelist

NP_SiteList

This is the plugin that is used to manage the list of links to Nucleus sites on nucleuscms.org. Users can add new sites themselved, of which I'm notified through e-mail. When logged in as administrator, [delete] and [approve] links appear next to the list items. Management functions have been enhanced greatly in v. 1.0 and greater, including an Admin Area, and verification of sites against pregex or string conditions.

General Plugin info
Author: Wouter Demuynck,Frank Truscott
Current Version: 1.4.1
Download: NP_SiteList.zip, 76kb, 24 files
Code: Please download the Zip file
Demo: demo
Admin Screenshot: screenshot
Forum Thread: discuss

Upgrading to v. 1.0+

Follow this procedure if going from < 1.0 to >= 1.0. Going from 1.0 to 1.2+ requires an uninstall. Going from 1.2 to 1.3, just follow the Installation procedures. Going from any pre-1.4.x version to 1.4.x requires an uninstall of the old version. Updates from 1.4.x to 1.4.x, simply copy the new files over the existing files.

  1. Backup your database.
  2. Modify existing NP_SiteList.php file to disable the uninstall() function so you don't delete your data. see Help File.
  3. Uninstall the SiteList plugin.
  4. Install the new version as described below.

Installation

  1. Unzip the zipfile into your plugins directory
  2. Go to the 'manage plugins' section in Nucleus Admin, and install the plugin
  3. Click 'Update Subscriptions'
  4. Open up the 'plugin options' to modify the settings to your needs. Save the options.

Available SkinVars

  • <%SiteList%>: Same as <%SiteList(item)%> with all default values.
  • <%SiteList(form, $isize)%>: Displays the Submit Site form for users. Form is enclosed in by <div class=“sitelistform”>…</div>, each input field has a class of formfield and the Submit Sites button has a class of formbutton. $isize is an integer and will set the size of the input boxes, overriding css settings (NEW in v 1.2).
  • <%SiteList(count)%>: Displays the number of approved sites in the database.
  • <%SiteList(item, $nshow, $sort, $litag, $sman)%>: Displays a list of approved sites with the parameters given.

where:

  • $nshow : integer. Number of sites to show. If empty, will show the default as set in the Plugin Options. If 0, will show all approved sites. (set in Plugin Options)
  • $sort : string. Method of sorting the list of sites. Choices are asc, desc, random. (random)
  • $litag : string. Simple html tag to enclose sites between. Should not include the < or >. Possible choices are li, dd, br. (set in Plugin Options)
  • $sman : yes or no. Whether to show the site managements links along side the sites when the logged in user in the admin. (set in Plugin Options)

Options

There are a number of options that control the operation of the SiteList plugin. Most of these options are set from the ‘edit options’ link in the Plugin Admin area, but some advanced options are only available by editing variables in the plugin files. Both types of options are described below.

Plugin Options

  • Show Admin Area in quick menu : Whether the SiteList admin area should be shown in the Quick Menu area. yes or no. (yes)
  • Delete SiteList data table on uninstall? : Whether the database table should be deleted on an uninstall. This should be set to &lsquono;’ only when permanently removing NP_SiteList. yes or no. (no)
  • Default number of sites to show in skinvar : This is the default number of sites to show when the <%SiteList%> sitevar is called. This can be overridden by skinvar parameters as described in Available Skinvars section below. Positive Integer. 0 removes limit. (20)
  • Default html tag to enclose site links : This allows the user to set the list tag type enclosing each listed site. This should be a simple tag and not include the < and > special characters. This can be overridden by skinvar parameters as described in SkinVar section. Example values could be ‘li’, ‘dd’, ‘br’. (li)
  • Default setting for show management links in skinvar : Sets the default for whether management links should be shown next to the listed sites in skinvars. Can be overridden by sitevar parameters. (yes)
  • Notify on new additions : Sets whether admin wants to be notified when a user submits a url. yes or no. (no)
  • Send notifications to this address : Address to send notification. Email address. ()
  • Send notifications from this address : From address for notification. Email address. ()
  • Pregex condition (or simple string) to verify against (blank disables verification) : This is a string or pregex expression to use for verifying the submitted sites. If this option is blank, verification is disabled. It is a good idea to test this expression using the sltest.php application described below before using it on real data. ()
  • Pregex condition (or simple string) to verify against (blank is OK)–2nd instance : This is a string or pregex expression to use for verifying the submitted sites. If this option is blank, it becomes identical to the first condition, so be careful when using complex Logical Operators. It is a good idea to test this expression using the sltest.php application described below before using it on real data. ()
  • Logic Operator to apply on conditions : Sets the logical operator to use on the verification conditions. See table below for description of the 6 choices. OR, AND, AND!, !AND!, OR!, !OR!. (OR). see Help File for more detail.
  • Apply verification to submitted URLs? : If set to ‘yes’ verification will take place on the sites as they are submitted by users. Sites that fail the initial verification will remain as unchecked and require admin review. yes or no. (no)
  • Thank You Text (including any html tags) to display above add form when user submits a site. : This is the text (and html formating) that users will see when they submit a site. It will appear directly above the submission form.
  • Number of sites to show on single page in SiteList Admin Area. : Set the number of sites to show per page in the Admin Area. All, 10, 25, 50, 100, 500. (All).
  • Enable use of Spamcheck API? : Whether plugins subscribing to the Spamcheck API should check submitted sites for spam. yes or no. (no).
  • Enable use of NP_Captcha? : Whether the NP_Captcha plugin should be used to thwart spam submissions. Requires that NP_Captcha be installed. yes or no. (no).
  • Restrict site submission to only members? : Whether site submission should be restricted to only members. If yes, non-members will not see the submit form. yes or no. (no).

Advanced Options

These options are set by editing variables in the NP_SiteList.php and should only be done by those comfortable doing so. The default values for these options should suffice for most cases. All variables are found near the top of the file.

  • $maxsusp (5) : Sites that fail a verification are put into the suspended state. If a site fails $maxsusp consecutive verifications, it is deleted from the database.
  • $maxdesc (48) : This limits the length of the Site Description as entered by the user. Any Site Description longer than $maxdesc will be truncated at $maxdesc.
  • $sleepsec (0) : The verification process makes your web server act like a browser. For processing long lists of sites, this might cause troubles with your provider if too many requests are made per minute. This setting willcause the processing to pause for $sleepsec seconds between every 10 requests for the actions that require verification on large sets of sites.
  • $phost (null) : If your web server must use a proxy to access the internet, set this variable to the IP address or Fully-Qualified Domain Name of the proxy. You will probably want to set $sleepsec as well.
  • $pport (null) : Set to tcp port number of the proxy.
  • $tout (8) : Time in seconds to wait for connection during http request. If timeout is reached, the site fails verification.
  • $rtout (array(8,500)) : Time in seconds,milliseconds to wait to complete the reading of the site during the http request. If timeout is reached, the site fails verification.
  • $allowredir (true) : If set to true, the http request will follow up to * $maxredirs http redirects when fetching the site.
  • $maxredirs (3) : If $allowredir is true, limits the number of http redirects to allow.
  • $allowedProtocols (array(“http”,”https”)) : Only protocols listed here are permitted in sitelist urls.
  • $a_blockedExtensions (array(”.exe”,”.bat”,”.vbs”)) : Page or domain extensions listed here cannot be used in urls in sitelist.

Download

NP_SiteList.zip (February 26,2007)

History

  • Version 1.4.1: (2007-10-05)
    • better handle situation where duplicate url is submitted (was causing mysql error)
  • Version 1.4.0: (2007-02-26)
    • handle situation where no url is submitted (just http://, or even null)
  • fixes bug in Admin page where non-admin could see delete all link for suspended sites. Could not run action, so not major bug.
  • redo conditional in install() for restoring options. Some users had problems with it.
    • fix bug where submit form action was to web root, not nucleus root.
    • add use of spamcheck API to reduce spam
    • add ability to use NP_Captcha
    • add ability to restrict submission to members.
  • Version 1.3.3: (2006-10-21)
    • fixes bug in skinvar concerning sort order when not random
  • adds a stringStripTags() function if it doesn't exist (pre Nucleus 3.22)
  • Version 1.3.2: (2006-08-29)
    • fixes a bug where first checked site does not show up in admin interface
    • adds a ticket system to discourage direct submissions without loading the submission form (anti-spam). Just copy new files over existing 1.2 or 1.3 installs. See included help file for more info on upgrading from versions previous to 1.2
  • Version 1.3.1: (2006-08-17)
    • fixes minor bug in how Verify This Page action works when exempted sites are present. Just copy new files over existing 1.2 or 1.3 installs. See included help file for more info on upgrading from versions previous to 1.2
  • Version 1.3: (2006-06-03)
    • security improvements in how user input is handled and more careful about how includes are done.
    • Continued code cleanup.
    • Added execution timing function to time set processing functions.
    • used set_time_limit(0) to override max_execution_time setting in php.ini to allow verifying of large site sets. will only work when safe_mode is off.
    • Fixed bug that was verifying exempted sites when using verifychecked action.
    • Use of ob_flush() and flush() to update output to browser after each site in a set is verified.
    • Set mbstring.func_overload=“2” to disable gzip encoding in the HTTP_REQUEST objects (in pear library) Also disabled gzip encoding in Request.php (pear/HTTP). This seems to solve a problem for certain sites that hang during verification and cause process to fail.
    • Internationalized the plugin. Only english file available.
    • Made to work for all PHP versions >= 4.0.6
    • no uninstall/reinstall needed for upgrade from version 1.2
  • Version 1.2: (2006-05-17)
    • added code to save plugin options during uninstall if user sets option to not delete sitelist data on uninstall.
    • added parameter to form type of skinvar to allow overriding input box size.
    • Added page size option for handling large lists in the admin area.
    • Some other cleaning of admin area presentation
  • Version 1.1: (2006-05-05) No Public Release. Included in 1.2.
    • added support for sitelist browser.
    • now verification checks for existence of frame buster code and sets a table field that will exclude it from the SiteList Browser sets.
    • Requires uninstall and reinstall.
    • Also so minor bug fixes to the sleepsec function.
    • Requires uninstall and re-install.
  • Version 1.0.1: (2006-04-28) made so to use <?php instead of <? for better compatibility with all php installations.
  • Version 1.0: (2006-04-19) extensive modifications to add site verification by Frank Truscott. Among the new features added are the following:
    • added preg-based site verification
    • added admin area to manage links
    • added 'suspended' status and extended db table
    • added admin site edit feature
    • added option to save data table on uninstall
    • no longer require sites-thanks.php
    • sites added by admin can be auto-verified
    • added skinvar parameters to control how lists look
      • can now get # of approved sites, limit # shown, specify html tag to enclose elements, and turn off the management links for site admins from displayed SiteList
    • see the help.html file for more information on use of the plugin.
  • Version 0.1, release August 16,2002. Original release by Wouter Demuynck.

:: plugins ::

sitelist.txt · Last modified: 2008/09/26 21:48 (external edit)