Go Back   Pligg CMS Forum > Pligg Development > Modification Tutorials

Reply
 
LinkBack Thread Tools Display Modes
  #21 (permalink)  
Old 01-28-2008, 11:54 AM
Banned
Pligg Version: 9.9.5
 
Join Date: Oct 2007
Location: Canada
Posts: 914
Thanks: 169
Thanked 17 Times in 17 Posts
I get all this

Quote:
Blog Engage Blog » Blog Archive » New Blog Engage Directory! Inside Forums!
I only want this,

Quote:
New Blog Engage Directory! Inside Forums!
Reply With Quote
  #22 (permalink)  
Old 01-29-2008, 10:59 AM
Banned
Pligg Version: 9.8.
Pligg Template: Custom
 
Join Date: Feb 2007
Location: Canada
Posts: 849
Thanks: 74
Thanked 49 Times in 45 Posts
Change:

Code:
if(preg_match("'<title>([^<]*?)</title>'", $this->html, $matches)) {
            $url_title=trim($matches[1]);
            $url_title = preg_split("/:|&raquo;\-/", $url_title);
            $url_title = array_slice($url_title, -1);
            $this->url_title = $url_title[0];  

}
to:

Code:
if( preg_match( '~<title>(.*?)([^:\-]*?)</title>~is', str_replace( '&raquo;', ':', $this->html ), $matches ) )
{
  $this->url_title = $matches[2];
}
and that will fix them all.

Geoserv.
Reply With Quote
The Following User Says Thank You to Geoserv For This Useful Post:
  #23 (permalink)  
Old 01-29-2008, 12:45 PM
Banned
Pligg Version: 9.9.5
 
Join Date: Oct 2007
Location: Canada
Posts: 914
Thanks: 169
Thanked 17 Times in 17 Posts
Quote:
Originally Posted by Geoserv View Post
Change:

Code:
if(preg_match("'<title>([^<]*?)</title>'", $this->html, $matches)) {
            $url_title=trim($matches[1]);
            $url_title = preg_split("/:|&raquo;\-/", $url_title);
            $url_title = array_slice($url_title, -1);
            $this->url_title = $url_title[0];  

}
to:

Code:
if( preg_match( '~<title>(.*?)([^:\-]*?)</title>~is', str_replace( '&raquo;', ':', $this->html ), $matches ) )
{
  $this->url_title = $matches[2];
}
and that will fix them all.

Geoserv.
Seems to be working Geoserv thanks a lot
Reply With Quote
  #24 (permalink)  
Old 02-13-2008, 04:09 AM
nzbullet's Avatar
Coder
 
Join Date: Jun 2007
Location: New Zealand
Posts: 133
Thanks: 17
Thanked 19 Times in 14 Posts
Hi there, Can anyone code the below with an 'if' statement so that if the url contains 'somesite.com' it does:

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];
else it does this:

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

Dan
Reply With Quote
  #25 (permalink)  
Old 02-21-2008, 06:26 PM
nzbullet's Avatar
Coder
 
Join Date: Jun 2007
Location: New Zealand
Posts: 133
Thanks: 17
Thanked 19 Times in 14 Posts
*****BUMP*****

Anyone??
__________________
Cheers

Dan
Reply With Quote
Reply

Thread Tools
Display Modes
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Similar Threads
Thread Thread Starter Forum Replies Last Post
Change page title only for story page - Google hadock General Help 12 11-23-2008 07:29 AM
How to change title in browser BillyC "yget" 1 06-21-2008 03:52 PM
Title Issue with Editorials and SEO not2serious General Help 0 12-26-2007 10:25 AM
HELP - Title Tags For Category Pages blaze General Help 2 12-24-2007 08:22 AM
Page Title - Instant Need plum Suggestions 5 10-17-2007 01:57 PM


Search Engine Friendly URLs by vBSEO 3.2.0