CyberLaw.Info™ :: Intellectual Property Law, CyberLaw, Entertainment Law and Litigation

PnSimpleSearchSD Released

Articles / Computer Programs and Scripts
Posted by elliot on Nov 08, 2003 - 11:27 AM

PnSimpleSearch for Static Docs! Version 1.  Written by Craig R. Saunders and Elliot Zimmerman, 11.5.3.  POSTNUKE TEXT SEARCH MODULE FOR STATIC DOCS.  Tested o­n Postnuke 714 - 726.  Requires Static Docs module for Postnuke by Simon Wunderlin available at [1].  There is also a download link for Static Docs at [2].

This module will display all Static Docs files that contain your single search term as a list of hyperlinks at the end of the usual Postnuke search under the heading "PnSimpleSearch Documents."  When a hyperlink is selected, the file is displayed in Postnuke.  If the search box is left empty, a list of hyperlinks to all files in the directory is displayed.  In effect, PnSimpleSearch and PnSimpleSearchSD are a dynamic content management system for information that is not entered directly into Postnuke.  This is a great way to add html or other pages to your site with the ability to dynamically display all (if the search box is empty), or just those that contain the search criteria, in a list of hyperlinks.

To install, add the following to your /language/eng/global.php file at the very end:
define('_SEARCH_TEXTFILES','Search Static Docs: Search is case sensitive & for a single term o­nly! If no search term is entered, all documents are listed.');

define('_SEARCH_TEXTFILES_RESULTS','Static Docs: The following documents matched your search.');

define('_SEARCH_NO_TEXTFILES', 'Static Docs: No documents matched your search.');
Place this file (text.php) in your postnuke includes/search directory after making the following changes.
Change line (around 92) of this fille (text.php) to reflect the server path to your modules/Static_Docs/data/ directory and which files to search (i.e. *.htm).

Change line (around 106) of this file (text.php) to replace o­nly the fictitious "" URL with your own (leave the rest of the tag alone).
That's it!

Known shortcomings:
1) The search is case sensitive.
2) The search does not handle multiple search criteria.

The file is available at [3] under Postnuke Downloads.  It is called  You can try it by selecting "Search" at [4].  Leave the textbox for the search empty and the results will include all documents.  This version's search results, when selected, are displayed within the Postnuke interface with all code intact.

This article is from CyberLaw.Info™ :: Intellectual Property Law, CyberLaw, Entertainment Law and Litigation

The URL for this story is:

Links in this article