Go Back   Pligg CMS Forum > Pligg Help > Customization Assistance

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-30-2008, 09:39 PM
Banned
Pligg Version: 9.8.
Pligg Template: Custom
 
Join Date: Feb 2007
Location: Canada
Posts: 849
Thanks: 74
Thanked 49 Times in 45 Posts
Auto-Fill

I am trying to get the script to GET the metas for description and auto fill the description box on submit.

Much like it auto fills the title field.

Anyone have this working or have a starting point?

Geoserv.
Reply With Quote
  #2 (permalink)  
Old 01-31-2008, 12:19 PM
Constant Pligger
Pligg Version: 9.9.0
Pligg Template: yget
 
Join Date: Jan 2008
Posts: 164
Thanks: 8
Thanked 24 Times in 16 Posts
did u get anywhere with this?
__________________
iGameit

helpthewriters.com
Reply With Quote
  #3 (permalink)  
Old 01-31-2008, 12:27 PM
Banned
Pligg Version: 9.8.
Pligg Template: Custom
 
Join Date: Feb 2007
Location: Canada
Posts: 849
Thanks: 74
Thanked 49 Times in 45 Posts
Not yet, I was thinking something like this would have done it:

Code:
preg_match("|<meta[^>]*description[^>]*content=\"([^>]+)\"[^>]*>|Ui",$headers[1], $matches);
but not sure yet how to implement it. I added in libs/link.php, but thats as far as I got.

Geoserv.
Reply With Quote
  #4 (permalink)  
Old 02-04-2008, 09:24 PM
Banned
Pligg Version: 9.8.
Pligg Template: Custom
 
Join Date: Feb 2007
Location: Canada
Posts: 849
Thanks: 74
Thanked 49 Times in 45 Posts
Ok, I am making progress with this, but need a little help.

In libs/link.php:

Code:
if ( preg_match ( '~<meta(.+?)name="description"(.+?)>~i',  $this->html, $matches ) )
{
  $description = preg_replace( '~^(.+?)content="([^"]+?)"(.+?)$~i', '$2', $matches[1].$matches[2] );
  echo $description;
}
in submit_step_2.tpl:

[cod]<textarea name="bodytext" rows="10" cols="55" id="bodytext" WRAP=SOFT onkeyup="if(this.form.summarycheckbox.checked == false) {ldelim}this.form.summarytext.value = this.form.bodytext.value.substring(0, {$StorySummary_ContentTruncate});{rdelim}textCount er(this.form.summarytext,this.form.remLen, {$StorySummary_ContentTruncate});">{$description}</textarea>[/code]

It is fetching the meta description of the URL submitted, but it is placing it above my content.



Try it out at News Dots / Login

Any ideas?

Geoserv.
Reply With Quote
  #5 (permalink)  
Old 02-04-2008, 09:46 PM
nzbullet's Avatar
Coder
 
Join Date: Jun 2007
Location: New Zealand
Posts: 133
Thanks: 17
Thanked 19 Times in 14 Posts
I have just tried this on my site and it doesn't show anything at all??
__________________
Cheers

Dan
Reply With Quote
  #6 (permalink)  
Old 02-05-2008, 07:22 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
Heres my libs/link.php file so you can see where I have mine placed.

Its starts on line 99:

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

if ( 
preg_match '~<meta(.+?)name="description"(.+?)>~i'$this->html$matches ) ){
$description preg_replace'~^(.+?)content="([^"]+?)"(.+?)$~i''$2'$matches[1].$matches[2] );
echo 
$description;
}



// Detect trackbacks
if (!empty($_POST['trackback'])) {
$this->trackback=trim($_POST['trackback']);
} elseif (
preg_match('/trackback:ping="([^"]+)"/i'$this->html$matches) ||
preg_match('/trackback:ping +rdf:resource="([^>]+)"/i'$this->html$matches) ||
preg_match('/<trackback:ping>([^<>]+)/i'$this->html$matches)) {
$this->trackback=trim($matches[1]);
} elseif (
preg_match('/<a[^>]+rel="trackback"[^>]*>/i'$this->html$matches)) {
if (
preg_match('/href="([^"]+)"/i'$matches[0], $matches2)) {
$this->trackback=trim($matches2[1]);
}
} elseif (
preg_match('/<a[^>]+href=[^>]+>trackback<\/a>/i'$this->html$matches)) {
if (
preg_match('/href="([^"]+)"/i'$matches[0], $matches2)) {
$this->trackback=trim($matches2[1]);
}
}


Geoserv
Attached Files
File Type: txt link.php.txt (34.0 KB, 28 views)
Reply With Quote
The Following User Says Thank You to Geoserv For This Useful Post:
  #7 (permalink)  
Old 02-05-2008, 07:47 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
When I try to add
Quote:
pligg.com
it shows this:

Quote:
content="Pligg Content Management System"
above all of my content.

When I do a page source, this is what it looks like:

Quote:
content="Pligg Content Management System"
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
Geoserv
Reply With Quote
  #8 (permalink)  
Old 02-06-2008, 06:56 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
I think this is going to be a smarty issue.

Any smarty pros available to take a peak?

Geoserv
Reply With Quote
  #9 (permalink)  
Old 02-09-2008, 10:30 PM
Banned
Pligg Version: 9.8.
Pligg Template: Custom
 
Join Date: Feb 2007
Location: Canada
Posts: 849
Thanks: 74
Thanked 49 Times in 45 Posts
No one has any ideas on this?

Geoserv.
Reply With Quote
  #10 (permalink)  
Old 04-13-2008, 04:12 PM
New Pligger
 
Join Date: Jul 2007
Posts: 6
Thanks: 1
Thanked 1 Time in 1 Post
Has there been any success with getting this done?
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 Off
[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
New story gets auto discarded with zero votes envieme General Help 4 11-19-2008 08:14 PM
Pligg auto tagging script. kazey Modification Tutorials 30 05-09-2008 02:37 PM
RSS Auto Import? KState General Help 6 02-21-2008 05:54 AM
I'm looking for : Auto Sitemaps for pligg l2aelba Modification Tutorials 4 12-05-2007 01:48 AM
auto fill tags and description from source URL chad90382 Modification Tutorials 1 11-06-2006 09:04 AM


Search Engine Friendly URLs by vBSEO 3.2.0