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 on Postnuke 714 - 726. Requires Static Docs module for Postnuke by Simon Wunderlin available at http://noc.postnuke.com/project/showfiles.php?group_id=9 . There is also a download link for Static Docs at http://cyberlaw.info .|
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 only! If no search term is entered, all documents are listed.');Place this file (text.php) in your postnuke includes/search directory after making the following changes.
define('_SEARCH_TEXTFILES_RESULTS','Static Docs: The following documents matched your search.');
define('_SEARCH_NO_TEXTFILES', 'Static Docs: No documents matched your search.');
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).That's it!
Change line (around 106) of this file (text.php) to replace only the fictitious "yoursite.com" URL with your own (leave the rest of the tag alone).
1) The search is case sensitive.
2) The search does not handle multiple search criteria.
The file is available at http://cyberlaw.info  under Postnuke Downloads. It is called pnSimpleSearchSD.zip. You can try it by selecting "Search" at http://cyberlaw.info . 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