[geeklog-devel] Spelling interface ready for testing...

Blaine Lang geeklog at langfamily.ca
Wed Dec 3 20:08:07 EST 2003


This is great Tony .. I tried it out.
Windows XP

I was not sure if I would see it when in story editor creating a story. I saw it highlight my test bad words after I posted it and tried to edit it.
No indication before that.

Now this was just a quick initial test. I entered this for my test:
thi is a tst
helo dos this worke

It highligted the "is" on the first line and the "is in "this" on the second line. These are the only correct words ;)

I took the same test and dropped it into the ispell executable and it caught all the miss-spelled words.


I installed the English dictionary as well.

Blaine

----- Original Message ----- 

  From: Tony Bibbs 
  To: Geeklog 
  Sent: Tuesday, December 02, 2003 12:01 AM
  Subject: [geeklog-devel] Spelling interface ready for testing...


  I have finally completed the spellchecker code I am planning to use in 
  Geeklog 2.  As you might guess, there is nothing precluding it from 
  being used in 1.3.x so I am attaching the file along with the modified 
  CVS files needed to get this working on admin/story.php.

  Dirk, if you could test it's use on another language that would be 
  great.  I have already tested this on windows.  If you tested an alpha 
  of what I had a few months ago, this is *much* easier to use.  My prior 
  version used the native PHP functions (pspell) which is a PITA to get 
  working both on *nix and windows.  This version simply needs a working 
  aspel binary which is called using shell_exec().

  For those needing more info here is what we have:

  1) Uses only the Aspell binary (http://aspell.net)
  2) Capable of supporting multiple languages
  3) Able to highlight misspelled words.  By default it uses a set of span 
  tags and the title attribute gets the suggested spellings put into it. 
  This allows you to see the suggestions by hovering over it with your mouse
  4) I modified the config file to have a new set of entries for spell 
  checking.  By default I think we'd turn this feature off, no?
  5) Works regardless of the postmode of the article
  6) I have implemented with little effort for admin/story.php, I would 
  think one could update all possible areas of use in just a few hours

  Oh, before I forget, to use the attached files, be sure to put 
  PHPSpellChecker.class.php into the /path/to/geeklog/system/classes/ 
  directory.

  Questions welcomed and, of course, more testers welcome.  PHPDoc file 
  forthcoming (I don't have PHPDoc installed here at home).

  --Tony

  +-------------------+--------------------------------------------------+
  |Tony Bibbs         |[R]egardless of what you may think of our penal   |
  |tony at tonybibbs.com |system, the fact is that every man in jail is one |
  |                   |less potential fisherman to clutter up your       |
  |                   |favorite pool or pond. --Ed Zern                  | 

  +-------------------+--------------------------------------------------+



------------------------------------------------------------------------------


  * @copyright Tony Bibbs 2003 * @package net.geeklog.utilities * @version $Id:$ * @todo Need to test the personal dictionary stuff. Haven't even tried to yet. * */ /** * Used to indicate the server is a posix-compliant one (e.g. linux/unix) * @const SPELL_OS_POSIX */ define('SPELL_OS_POSIX',1); /** * Used to indicate the server uses a version of windows (e.g. 98/XP) * @const SPELL_OS_POSIX */ define('SPELL_OS_WINDOWS',2); /** * PHPSpellCheck, a simple spellchecking class * * This class makes it easy to implement spellchecking into your PHP applications * with minimal effort. Requirements for this class for Posix hosts (Unix/Linux) is * an installed aspell system. On my RedHat 9 system aspell was installed by default * which should be the case for most of you. For Windows users, you should obtain the * Aspell setup program and the corresponding dictionary file as none is installed by * default. Aspell for Posix and Windows can be downloaded from @link http://aspell.net * * Here is a most basic example of how to use this class: * * setPathToAspellBinary('/usr/bin/aspell'); * $spellChecker->setTempDir('C:/Windows/Temp'); * echo $spellChecker->checkWords('This is a test, I srue hope therre are no mispelings'); * ?> * * * @author Tony Bibbs * */ class PHPSpellChecker { /** * Holds OS type that Aspell is installed on. * * When calling the Aspell binary we will need to know what OS is being * used. This could be potentially used for future enhancements as well. * * @see PHPSpellChecker() * @see checkWords() * @var int * @access private * */ var $_operatingSystem = null; /** * Holds path to Aspell binary * * This holds the fully qualified path to the actual Aspell binary. Please * specifiy the path to the executable file, not to a directory. NOTE: windows * users may find that aspell is picky about the format of the path. For example, * if you have aspell located at C:|Program Files\Aspell\bin\aspell then this value * will need to be C:\progra~1\Aspell\bin\aspell * * @see checkWords() * @var string * @access private * */ var $_pathToAspellBinary = null; /** * Code for language to spellcheck against * * As expected, this class can spellcheck against a variety of supported languages. NOTE: * you will need to ensure that your respective language dictionaries have been installed * otherwise this won't work * * @see setLanguage() * @var string * @access private * */ var $_languageCode = null; /** * Holds any additional Aspell options that aren't supported by this * class with a setter and/or getter method. * * Aspell has a number of options available. To support those yet keep this * class relatively simple, we implement ways to set the most common attributes * and allow you to specify additional options that we can include for you when * the call to the Aspell binary is made. Please read the documentation for the * constructor as it will explain this better * * @see PHPSpellChecker() * @var array * @access private * */ var $_aspellOptions = null; /** * This holds the path to the dictionary file we should use * * Please specify the absolute path to the dictionary file * * @see setPersonalDictionary() * @see checkwords() * @var string * @access private * */ var $_pathToPersonalDictionary = null; /** * This holds the path to teh personal wordlist file we should use * * Please specify the absolute path to the word list file * * @see setPersonalWordList() * @var string * @access private * */ var $_pathToPersonalWordList = false; /** * Sets the minimum size of a legitimate word * * Setting this allows applications to specify how big a word has * to be before it is really considered a real word. By default we set this * to 3, but you can override this * * @see checkwords * @var int * @access private * */ var $_skipLength = null; /** * Name of temp dir * * This class puts the text to spell into a temporary file before checking the spelling. This * attribute simply gives us a directory where we can create these temporary files (e.g. * /tmp) * * @see _createTempFile() * @var string * @access private * */ var $_tempDir = null; /** * Array of the works that were misspelled * * During the spellchecking process we keep track of all mispelled words in this * array. This values in this array are used to index into the $_suggestions variable * below. Array format is $myArray[] = '' * * @see checkWords() * @var array * @access private * */ var $_misspellings = null; /** * Holds suggestions for misspelled words * * This array holds the suggested spellings for all misspelled words. The format of this * array is $myArray[] = ',' * * @see checkWords() * @var array * @access private * */ var $_suggestions = null; /** * Holds the original text we were to spellcheck against * * This simply holds the original text to spellcheck against. It * never gets modified * * @see checkWords() * @var string * @access private * */ var $_origText = null; /** * Formating to use to begin highlighting a misspelled word * * The format string is pretty basic, by default we use a div tag * that allows the mispellings to be show by using the title attribute. * Doing so will show suggestions by simply hovering over the mispelled words. * If you want to use a similar format, be sure to use the special tag {suggested} * which will get automatically parsed. * * @see PHPSpellChecker(); * @see checkWords(); * @see setHighlight(); * @var string * @access private * */ var $_beginHighlight = null; /** * Formatting to use to end highlighting a misspelled word * * This is similar to $_beginHighlight above. This simply ends the highlight * * @see PHPSpellChecker(); * @see checkWords(); * @see setHighlight(); * @var string * @access private * */ var $_endHighlight = null; /** * Constructor * * Constructor, does the necessary pspell initialization. When setting aspell options, be sure * to use the option names as shown by calling aspell with no options from your unix or dos shell. * note that some of the aspell options can be overridden by some of the methods in this class. Those * methods are: * - setMinimumWordList(), since this is explicitly called in the constructor it will effectively ignore * anything you put for aspell's -W or --ignore options * - setPersonalWordList(), this isn't called explicitly so you can use the -p,--personal options or call * that function instead. * - * * @author Tony Bibbs * @access public * @param array $aspellOptions Options for aspell in formate myArray['aspellOption'] => 'aspellValue' * */ function PHPSpellChecker($aspellOptions = '') { // Right now this is only used when determining how to call aspell but I'm // adding this in case there are other OS specific differences added in the // future. if (substr(PHP_OS, 0, 3) == 'WIN') { $this->_operatingSystem = SPELL_OS_WINDOWS; } else { $this->_operatingSystem = SPELL_OS_POSIX; } if (empty($aspellOptions)) { $this->_aspellOptions = array(); } else { $this->_aspellOptions = $aspellOptions; } $this->_misspellings = array(); $this->_suggestings = array(); $this->_positions = array(); $this->setLanguage(); $this->setMinimumWordLimit(); $this->setHighlight('',''); } /** * Sets the language that should be used. * * Allows applications to set the language to spellcheck against. We * assume US English by default * * @author Tony Bibbs * @access public * @param string $languageCode Code of language to use * */ function setLanguage($languageCode = 'en_US') { $this->_languageCode = $languageCode; } /** * Sets the temporary directory for Aspell to use * * This class pipes the text to check out of a temporary file. This * method will set the location where we put those temporary files. * * @author Tony Bibbs * @access public * @param string $absolutePath Path to the temporary directory * */ function setTempDir($absolutePath = '') { $this->_tempDir = $absolutePath; } /** * Sets the location to the Aspell binary * * This sets the path to the actual aspell binary. Note that * this must be an absolute path, don't depend on your * operating system's path variables. * * @author Tony Bibbs * @access public * @param string $absoluteFileName Location of aspell binary * */ function setPathToApsellBinary($absoluteFileName) { $this->_pathToAspellBinary = $absoluteFileName; } /** * Sets the minimum size of what a 'word' is defined as. * * Aspell can be configured to ignore words below a certain * length and this is facilitate in this class using this * method. For example if you set the minimum size to 3 * then any word less than 3 characters long. * * @author Tony Bibbs * @access public * @param int $minWordLength Minimum length of a word * */ function setMinimumWordlimit($minWordLength = 3) { $this->_skipLength = $minWordLength; } /** * Sets the location of the personal dictionary to use * * Aspell allows for any number of dictionary files. This can * be handy when an application might want each of it's users to * have their own dictionary * * @author Tony Bibbs * @access public * @param string $absoluteFileName Exact location of dictionary to use * */ function setPersonalDictionary($absoluteFileName) { $this->_pathToPersonalWordList($absoluteFileName); } /** * Sets the file where the current user's personal pspell dictionary can be found. Files * should be of the .pws extension and must be in a directory your webserver to write files * to. This feature is optional and disabled by default. If the given file doesn't exist, * this function will attempt to create it. * * @author Tony Bibbs * @access public * @param string $absoluteFileName The fully qualified location of the .pws file to use * */ function setPersonalWordList($absoluteFileName) { $this->_pathToPersonalWordList($absoluteFileName); } /** * Creates a temp file for use during the spellcheck process * * Text that is being spellchecked gets loaded into temporary file and * then it gets piped over to aspell for checking. This method creates that * temporary file * * @author Tony Bibbs * @access private * @return boolean True if successful otherwise false * */ function _createTempFile() { $this->_tempFile = tempnam($this->_tempDir, 'textToCheck'); if ($this->_tempFile == false) { trigger_error('Unable to write the temporary file.'); } else { if (!empty($this->_origText)) { if ($fd = fopen($this->_tempFile,'w')) { // Chop it up by line. $textarray = explode("\n",$this->_origText); fwrite($fd,"!\n"); foreach ($textarray as $key=>$value) { $value = ereg_replace('\\"','"',$value); fwrite($fd,"^$value\n"); } fclose($fd); return true; } else { trigger_error('Unable to open the temporary file.'); return false; } } else { trigger_error('No text has been set.'); return false; } } } /** * Adds a word to a user's personal dictionary. Requires you to call * setPersonalWordList() first * * @author Tony Bibbs * @access public * @param string $word Word to add to personal dictionary * */ function addWord($word) { /*if ($this->_usePersonalDicts) { return pspell_add_to_personal($this->_pspellCfgHandle, $word); }*/ } /** * Parse the return output from aspell * * Aspell's return values aren't the easiest to work with * so this method puts the data into easy to use structures * that can be used later by this class and, if needed, by * the calling application * * @author Tony Bibbs * @access private * @param string $aspellReturn Return output from aspell * */ function _parseReturn($aspellReturn) { //next parse $return and $text line by line, eh? $returnarray = explode("\n",$aspellReturn); $returnlines = count($returnarray); $textarray = explode("\n",$this->text); $lineindex = -1; $poscorrect = 0; $counter = 0; foreach($returnarray as $line) { $correction = explode(' ',$line); $word = $correction[1]; // If there is a correction here, processes it, else move the $textarray pointer to the next line if (substr($line,0,1) == '&') { // Build the position, comma separated. Line, character $absposition = substr($correction[3],0,-1)-1; $position = $absposition + $poscorrect; $niceposition = $lineindex . "," . $absposition; // Start building the suggestion list $suggstart = strpos($line,":")+2; $suggestions = substr($line,$suggstart); $suggestionarray = explode(', ',$suggestions); // Set an array for the suggestions. $suggestions = array(); foreach ($suggestionarray as $aSuggestion) { $suggestions[] = $aSuggestion; } } else { if (substr($line,0,1) == '#') { // Find the position. $absposition = $correction[2] - 1; $position = $absposition + $poscorrect; $niceposition = $lineindex .",". $absposition; // Add this word to the arrays. $thePositions[] = array($word => $niceposition); $theSuggestions[] = array($word => 'No Suggestions.'); } else { $poscorrect = 0; $lineindex = $lineindex + 1; } } $this->_misspellings[] = $word; if (count($suggestions) > 0) { $this->_suggestions[$word] = implode(',',$suggestions); } else { // Should not make this string english dependent. For future we should // make this string configurable so it can be overridden by calling // applications language preference. $this->_suggestions[$word] = 'No suggestions'; } } } /** * Spell checks a set of words by iterating through words and calling check(). * During the check, it collects the suggested spellings of misspelled words. If there * are mispelled words, _highlightedText is set to $textString and highlights all misspelled words * * @author Tony Bibbs * @access public * @param string $textString * @param boolean $isHTMLEmbedded Indicates if the text to check has HTML in it * @return string $textString with misspelled words highlighted, otherwise true * */ function checkWords($textString, $isHTMLEmbedded = false) { $this->_origText = $textString; if ($this->_createTempFile() != false) { if ($isHTMLEmbedded == true) { $addOptions .= ' -H'; } if (!empty($this->_dictionary)) { $addOptions .= ' -d ' . $this->dictionary; } if (!empty($this->wordList)) { $addOptions .= ' -p ' . $this->wordList; } // Grab any other aspell options for ($i = 1; $i <= count($this->_aspellOptions); $i++) { $addOptions .= sprintf(' %s %s', key($this->_aspellOptions), current($this->_aspellOptions)); next($this->_aspellOptions); } reset($this->_aspellOptions); // Calling aspell differs slightly by OS if ($this->_operatingSystem == SPELL_OS_WINDOWS) { $command = sprintf('%s -a --lang=%s %s < "%s" 2>&1',$this->_pathToAspellBinary, $this->_languageCode, $addOptions, $this->_tempFile); } else { $command = sprintf('%s -a --lang=%s %s < %s',$this->_pathToAspellBinary, $this->_languageCode, $addOptions, $this->_tempFile); } // Execute the command. $retValue = shell_exec($command); // Delete the temporary file created. if (unlink($this->_tempFile) == false) { trigger_error('Unable to delete temporary file.'); } // Check to see if the execute statement returned anything. if (empty($retValue)) { trigger_error('There was a problem in executing the command against the Aspell binary.'); } else { $this->_parseReturn($retValue); } } else { trigger_error('Unable to create the temporary file.'); } if (count($this->_misspellings) > 0) { return $this->highlightBadWords(); } } /** * Allows ability to set a custom method for highlight misspelled words * * @author Tony Bibbs * @access public * @param string $beginHighlight Opening format of a highlighted word * @param string $endHighlight Closing format of a highlighted word * */ function setHighlight($beginHighlight, $endHighlight) { $this->_beginHighlight = $beginHighlight; $this->_endHighlight = $endHighlight; } /** * Highlights misspelled words and returns the text * * @author Tony Bibbs * @access public * @return original search text with misspellings highlighted. * */ function highlightBadWords() { $tmpString = $this->_origText; foreach ($this->_misspellings AS $curWord) { $tmpBeginHighlight = str_replace('{suggested}', $this->_suggestions[$curWord], $this->_beginHighlight); // Be sure to operate on original text in case there was some HTML/XML in it $tmpString = str_replace($curWord, $tmpBeginHighlight . $curWord . $this->_endHighlight, $tmpString); } return $tmpString; } } ?>


------------------------------------------------------------------------------


  'mail', // can be one of 'mail', 'sendmail', 'smtp' // sendmail parameters (for 'backend' => 'sendmail') 'sendmail_path' => '/usr/bin/sendmail', 'sendmail_args' => '', // SMTP parameters (for 'backend' => 'smtp') 'host' => 'smtp.example.com', 'port' => '25', 'auth' => false, 'username' => 'smtp-username', 'password' => 'smtp-password' ); // +---------------------------------------------------------------------------+ // | Email Settings | // | | // | Configure how Geeklog sends email: Via PHP's mail() function, sendmail, | // | or via an SMTP server. | // +---------------------------------------------------------------------------+ $_CONF['spelling_enabled'] = true; $_CONF['spelling_language'] = 'en_US'; // Must be fully qualified location of the aspell binary $_CONF['path_aspell'] = 'c:\progra~1\Aspell\bin\aspell'; // This is just for now, we probably shouldn't encourage the use of the logs // dir since the call unlink() will happen there $_CONF['path_tempdir'] = $_CONF['path'] . 'logs'; // +---------------------------------------------------------------------------+ // | OTHER DATABASE SETTINGS | // | | // | Database type and database backup settings. | // +---------------------------------------------------------------------------+ $_DB_dbms = 'mysql'; // Do not change (currently, only MySQL is supported) // optional settings for making database backups from within Geeklog $_CONF['allow_mysqldump'] = 1; // 1 = on, 0 = off $_DB_mysqldump_path = '/usr/bin/mysqldump'; // path to mysqldump binary $_CONF['mysqldump_options'] = '-Q'; // additional options for mysqldump // +---------------------------------------------------------------------------+ // | SITE SETTINGS | // | | // | These settings help define your Geeklog site. | // +---------------------------------------------------------------------------+ $_CONF['theme'] = 'XSilver'; // default theme // you shouldn't need to edit the following $_CONF['layout_url'] = $_CONF['site_url'] . '/layout/' . $_CONF['theme']; $_CONF['path_themes'] = $_CONF['path_html'] . 'layout/'; $_CONF['path_layout'] = $_CONF['path_themes'] . $_CONF['theme'] .'/'; // optional settings (1 = on, 0 = off) $_CONF['allow_user_themes'] = 1; $_CONF['allow_user_language'] = 1; $_CONF['allow_user_photo'] = 1; // allow users to upload self-photo // hides the list of authors from the preferences $_CONF['hide_author_exclusion'] = 0; // +---------------------------------------------------------------------------+ // | Support for custom user registration form and account details | // | Requires custom functions to be written that can be placed in lib-custom | // | Function hooks are in users.php, usersettings.php and admin/user.php | // +---------------------------------------------------------------------------+ $_CONF['custom_registration'] = false; // Set to true if you have custom code // +---------------------------------------------------------------------------+ // | LOCALE SETTINGS | // +---------------------------------------------------------------------------+ $_CONF['language'] = 'english'; $_CONF['locale'] = 'en-gb'; $_CONF['date'] = '%A, %B %d %Y @ %I:%M %p %Z'; $_CONF['daytime'] = '%m/%d %I:%M%p'; $_CONF['shortdate'] = '%x'; $_CONF['dateonly'] = '%d-%b'; $_CONF['timeonly'] = '%I:%M %p %Z'; $_CONF['default_charset'] = 'iso-8859-1'; // +---------------------------------------------------------------------------+ // | SITE STATUS | // | | // | To disable your Geeklog site quickly, simply set this flag to false | // +---------------------------------------------------------------------------+ $_CONF['site_enabled'] = true; // true or false // Message shown when site is down // When this starts with 'http:' visitors are redirected to that URL $_CONF['site_disabled_msg'] = 'Geeklog Site is down. Please come back soon.'; // +---------------------------------------------------------------------------+ // | SESSION SETTINGS | // | | // | cookie_ip will store md5(remoteip + randomnum) as the session ID in the | // | cookie. This is more secure but will more than likely require dialed up | // | users to login each and every time. If ipbasedsessid is turned off | // | (which it is by default) it will just store a random number as the | // | session ID in the cookie. | // | | // | default_perm_cookie_timeout is how long you want the permanent cookie | // | to persist for. This can be overridden by the user in their user prefs | // | if they want. If you don't want to allow permanent cookies set the | // | value to an empty string ''. | // | | // | session_cookie_time is how long you want the session cookie to persist | // | for. Only really useful in scenarios where you don't want to allow | // | permanent cookies | // +---------------------------------------------------------------------------+ $_CONF['cookie_session'] = 'gl_session'; $_CONF['cookie_name'] = 'geeklog'; $_CONF['cookie_password'] = 'password'; $_CONF['cookie_theme'] = 'theme'; $_CONF['cookie_language'] = 'language'; $_CONF['cookie_lastvisit'] = 'LastVisit'; $_CONF['cookie_lastvisittemp'] = 'LastVisitTemp'; $_CONF['cookie_ip'] = 0; $_CONF['default_perm_cookie_timeout'] = 604800; $_CONF['session_cookie_timeout'] = 7200; $_CONF['cookie_path'] = '/'; $_CONF['cookiedomain'] = ''; // e.g. '.example.com' $_CONF['cookiesecure'] = 0; // Set to false if you don't want to store last login data and time in the userinfo table $_CONF['lastlogin'] = true; // +---------------------------------------------------------------------------+ // | This is really redundant but I am including this as a reminder that those | // | people writing Geeklog Plug-ins that are OS dependent should check either | // | the $_CONF variable below or PHP_OS directly. If you are writing an | // | addon that is OS specific your addon should check the system is using the | // | right OS. If not, be sure to show a friendly message that says their GL | // | distro isn't running the right OS. Do not modify this value | // +---------------------------------------------------------------------------+ $_CONF['ostype'] = PHP_OS; // +---------------------------------------------------------------------------+ // | SEARCH SETTINGS | // | | // | These aren't really used at the moment - leave as is ... | // +---------------------------------------------------------------------------+ // Indicates if we should expand search results or not. // true = show title with summary // false = title date author hits on one line $_CONF['expanded_search_results'] = true; // 0: use users max stories per page // 1: Show all // any other number is the # of results per page $_CONF['max_search_results'] = 1; // maximum length for the summary text for search results should be $_CONF['summary_length'] = 250; // +---------------------------------------------------------------------------+ // | MISCELLANEOUS SETTINGS | // | | // | These are other various Geeklog settings. The defaults should work OK | // | for most situations. | // +---------------------------------------------------------------------------+ // this lets you select which functions are available for registered users only $_CONF['loginrequired'] = 0; // all of them, if set to 1 will override all else $_CONF['submitloginrequired'] = 0; $_CONF['commentsloginrequired'] = 0; $_CONF['linksloginrequired'] = 0; $_CONF['pollsloginrequired'] = 0; $_CONF['calendarloginrequired'] = 0; $_CONF['statsloginrequired'] = 0; $_CONF['searchloginrequired'] = 0; $_CONF['profileloginrequired'] = 0; $_CONF['emailuserloginrequired'] = 0; $_CONF['emailstoryloginrequired'] = 0; // Submission Settings // enable (set to 1) or disable (set to 0) submission queues: $_CONF['storysubmission'] = 1; $_CONF['linksubmission'] = 1; $_CONF['eventsubmission'] = 1; $_CONF['usersubmission'] = 0; // When set to 1, this will display an additional block on the submissions page // that lists all stories that have the 'draft' flag set. $_CONF['listdraftstories'] = 0; // Send an email notification when a new submission has been made. The contents // of the array can be any combination of 'story', 'link', 'event', and 'user'. // Example: $_CONF['notification'] = array ('story', 'link', 'event'); // The email will be sent to $_CONF['site_mail'] (see above). $_CONF['notification'] = array (); $_CONF['postmode'] = 'plaintext'; // can be 'plaintext' or 'html' $_CONF['speedlimit'] = 45; // in seconds $_CONF['skip_preview'] = 0; // If = 1, allow user to submit comments and stories without previewing // Allow users to change their username (if set to 1). $_CONF['allow_username_change'] = 0; // Allow users to delete their account (if set to 1). $_CONF['allow_account_delete'] = 0; // Topic Settings // Topics can be assigned a sort number so that you can control what order they // appear in the 'Topics' block on the homepage. If you prefer you can also // have this sort alphabetically by changing the value to 'alpha' (default is // by 'sortnum' $_CONF['sortmethod'] = 'sortnum'; // or 'alpha' // Show the number of stories in a topic in Topics Block $_CONF['showstorycount'] = 1; // Show the number of story submissions for a topic in Topics Block $_CONF['showsubmissioncount'] = 1; // Hide 'Home' link from Topics block (if set to 1) $_CONF['hide_home_link'] = 0; // Show blocks for empty search results $_CONF['showemptysearchresults'] = 0; // How long an anonymous (guest) user session is good for $_CONF['whosonline_threshold'] = 300; // in seconds // "Daily Digest" settings // Let users get stories emailed to them // Requires cron and the use of php as a shell script $_CONF['emailstories'] = 0; // Specify length of stories in those emails: // 0 = send only title + link, 1 = send entire introtext, // any other number = max. number of characters per story $_CONF['emailstorieslength'] = 1; // New users get stories emailed to them per default (= 1) or not (= 0) $_CONF['emailstoriesperdefault'] = 0; // When user submission is activated, allow users from these domains to // register without having to go through the submission queue. $_CONF['allow_domains'] = ''; // e.g. 'mycompany.com,myothercompany.com' // Following times are in seconds $_CONF['newstoriesinterval'] = 86400; // = 24 hours $_CONF['newcommentsinterval'] = 172800; // = 48 hours $_CONF['newlinksinterval'] = 1209600; // = 14 days // Set to 1 to hide a section from the What's New block: $_CONF['hidenewstories'] = 0; $_CONF['hidenewcomments'] = 0; $_CONF['hidenewlinks'] = 0; // Calendar Settings $_CONF['personalcalendars'] = 1; $_CONF['showupcomingevents'] = 1; $_CONF['upcomingeventsrange'] = 14; // days $_CONF['event_types'] = 'Anniversary,Appointment,Birthday,Business,Education,Holiday,Meeting,Miscellaneous,Personal,Phone Call,Special Occasion,Travel,Vacation'; // Story Settings $_CONF['maximagesperarticle'] = 5; $_CONF['limitnews'] = 10; $_CONF['minnews'] = 1; // minimum number of stories per page $_CONF['contributedbyline'] = 1; // If 1, show contributed by line $_CONF['article_image_align'] = 'right'; // Topic icon on left or right. $_CONF['hideemailicon'] = 0; // If 1, hide "email story" option $_CONF['hideprintericon'] = 0; // If 1, hide "printer friendly" option // When set to 1, this will render the first story on any page using the // templates for featured stories - even if that story is not featured. $_CONF['showfirstasfeatured'] = 0; // +---------------------------------------------------------------------------+ // | RSS feed settings | // | | // | Settings for RSS feeds (aka RDF feeds). Please note that most of these | // | are merely default settings for the feeds created from the "Content | // | Syndication" entry in the Admin's menu. | // +---------------------------------------------------------------------------+ $_CONF['backend'] = 1; // 1 = activate feeds, 0 = off // path to your site's default RSS feed $_CONF['rdf_file'] = $_CONF['path_html'] . 'backend/geeklog.rdf'; // This allows a person to limit the rss feed to a certain number of stories // (e.g. 10 or 12) or else limit the rss feed to all stories within a certain // period of time in hours (e.g. 24h or 168h). $_CONF['rdf_limit'] = 10; // number of stories (10) or hours (24h) // Include the story's entire intro text in the feed (= 1) or limit the number // of characters from the intro text (any number > 1) or don't include the text // at all (= 0). $_CONF['rdf_storytext'] = 0; // Default language for the feed - may have to be different than the locale $_CONF['rdf_language'] = 'en-gb'; // Uncomment the following line to set the copyright year in the site's footer // to a specific year. Otherwise, the current year will be used. // $_CONF['copyrightyear'] = '2003'; // Optional Image Settings // If you set $_CONF['image_lib'] below, you must supply a path for the library // you will use. Setting this also assumes that if a photo is uploaded that is // too big either by the image sizes below or by overriding them using the // upload object then the library you choose will attempt to resize the image. // Leaving this value empty disables this feature $_CONF['image_lib'] = ''; // can be one of 'netpbm', 'imagemagick', 'gdlib' // If you set image_lib to imagemagick give this path otherwise comment it out // NOTE: you will need a fairly recent version of ImageMagick for this to work. // ImageMagick version 5.4.9 (or newer) is recommended. //$_CONF['path_to_mogrify'] = '/path/to/mogrify'; // If you set image_lib to netpbm give the path to the netpbm directory, you // need the trailing slash here. // NOTE: if you use NETPBM, use the latest package from the Gallery package for // your operating system found at http://sourceforge.net/projects/gallery in // the download section. You need to take the netpbm tarball from them and // uncompress the file which will create a netpbm directory. If you plan to // only use netpbm with Geeklog, put that entire folder in /path/to/geeklog and // adjust the path below. The only programs you need from netpbm are giftopnm, // jpegtopnm, pngtopnm, ppmtogif, ppmtojpeg, pnmtopng and pnmscale //$_CONF['path_to_netpbm'] = '/path/to/netpbm/'; // Uncomment the following line if you experience problems with the image // upload. Debug messages will be added to the error.log file. // $_CONF['debug_image_upload'] = true; // When set to 1, Geeklog will keep the original, unscaled images and make // the smaller image link to the unscaled image. $_CONF['keep_unscaled_image'] = 0; // 1 = keep original images // Story image settings $_CONF['max_image_width'] = 300; // In pixels $_CONF['max_image_height'] = 300; // In pixels $_CONF['max_image_size'] = 1048576; // 1048576 = 1MB // User photo settings $_CONF['max_photo_width'] = 96; // In pixels $_CONF['max_photo_height'] = 96; // In pixels $_CONF['max_photo_size'] = 65536; // 65536 = 64KB // Comment Settings $_CONF['commentspeedlimit'] = 45; $_CONF['comment_limit'] = 100; // Default Number of Comments under Story $_CONF['comment_mode'] = 'threaded'; // Default Comment Mode; from 'threaded','nested','nocomments',and 'flat' // Allow / disallow comments to stories by default (can be changed individually for every story) $_CONF['comment_code'] = 0; // 0 = comments enabled, -1 = disabled // Poll Settings $_CONF['maxanswers'] = 10; // 'submitorder' is order answers are saved in admin/poll.php // 'voteorder' will list answers in order of number of votes (highest->lowest); $_CONF['answerorder'] = 'submitorder'; $_CONF['pollcookietime'] = 86400; $_CONF['polladdresstime'] = 604800; // Password setting: minimum time between two requests for a new password $_CONF['passwordspeedlimit'] = 300; // seconds = 5 minutes // Links Settings // You can set both of the following to 0 to get back the old (pre-1.3.6) // style of the links section. Setting only linkcols to 0 will hide the // categories but keep the paging. Setting only linksperpage to 0 will list // all the links of the selected category on one page. $_CONF['linkcols'] = 3; // categories per column $_CONF['linksperpage'] = 10; // links per page // Parameters for checking HTML tags // *** Warning: Adding the following tags to the list of allowable HTML can // *** make your site vulnerable to scripting attacks! // *** Use with care:  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist8.pair.net/pipermail/geeklog-devel/attachments/20031203/41d2b462/attachment.html>


More information about the geeklog-devel mailing list