View Single Post
  #1 (permalink)  
Old 01-25-2008, 10:05 PM
Geoserv Geoserv is offline
Banned
 
Join Date: Feb 2007
Location: Canada
Posts: 849
Thanks: 74
Thanked 49 Times in 45 Posts
Trimming the title

A lot of submissions, especially blogs, when submitted show a title similar to:

Quote:
Website name : page title
The only pertinent information there is the page title, so to clean this up do the following:

open libs/link.php and find:

Code:
if(preg_match("'<title>([^<]*?)</title>'", $this->html, $matches)) {
			$this->url_title=trim($matches[1]);
		}
change to:

Code:
if(preg_match("'<title>([^<]*?)</title>'", $this->html, $matches)) {
            $url_title=trim($matches[1]);
            $url_title = explode(":",$url_title);
            $this->url_title = $url_title[1]; 

}
Thats it.

This only works for new submissions and not current ones, and only submission in the format of Website name : Page title

Tested only in 9.8.2, but the code 9.9.0 looks the same. Backup the above file before applying mod.

Geoserv

Last edited by Geoserv; 01-25-2008 at 10:45 PM..
Reply With Quote
The Following 2 Users Say Thank You to Geoserv For This Useful Post: