New Zenner
- Join Date:
- Nov 2008
- Posts:
- 6
- Plugin Contributions:
- 0
Simple SEO URL (OLD version) [support thread]
Yes. Here's the entire file:
<?php // note: we can later move part of this function into sub-functions, which we can store in the base class. require('language.php'); class SSULanguage extends SSULanguageBase{ var $registry; function parse_name($name, $params){ $this->registerArray($params); // Remove short words first if(($word_length = $this->registry('minimum_word_length')) > 0){ $name_parts = explode(' ', $name); foreach($name_parts as $key => $value) if(strlen($value) < $word_length) unset($name_parts[$key]); $name = implode($this->registry('name_delimiter'), $name_parts); } // trim the sentence if ($this->registry('max_name_length') > 0 && (strlen($name) > $this->registry('max_name_length'))){ preg_match('/(.{' . $this->registry('max_name_length') . '}.*?)\b/', $name, $matches); $name = rtrim($matches[1]); } // we replace any non alpha numeric characters by the name delimiter $name = str_replace(array(' ', '\'', '/', '\\', '"', '.', ':', '@', '_', '-', '?', '&', '='), $this->registry('name_delimiter'), $name); // remove excess $this->registry('name_delimiter') $name = $this->removeDelimiter($name); // remove trailing _ $name = strtolower(trim($name, $this->registry('name_delimiter'))); return urlencode($name); } }