Get paid to search...we do!
Powered by MaxBlogPress Close 
A A
RSS

Getting Pligg to Auto-Fill

Social Web CMS
Advertise Here

Posted on Mon, May 12, 2008 by User ImageGeoserv

Modules

Late January of this year I attempted to get my Pligg install to auto populate the description of a story submitted on step 2 of the submission process.

This is the code I started with:

if ( preg_match ( ‘~~i’, $this->html, $matches ) ){
$description = preg_replace( ‘~^(.+?)content="([^"]+?)"(.+?)$~i’, ‘$2′, $matches[1].$matches[2] );
echo $description;
}

That obviously didn’t do the trick for me. It fetched the description of the story being submitted, but it would place it above my website, it was trying to make the description of my Pligg install.

I have been working on this off and on over the past couple of months to no avail. Thanks to a fellow Pligger, this mod is now a reality heres what you need to do:

  • Open libs/link.php, find:
                    if( preg_match( ‘~~is’, str_replace( ‘»’, ‘:’, $this->html ), $matches ) ){
                    $this->url_title = $matches[2];
                    }

    below, add:

    if(preg_match(’~<meta(.+?)name="description"(.+?)>~i’, $this->html,$matches)){
        $description = preg_replace(’~^(.+?)content="([^"]+?)"(.+?)$~i’, ‘$2′, $matches[1].$matches[2] );
        $description= str_replace("content=\"", " ", trim($description));
        $description= str_replace("\"", " ", trim($description));
        $this->content=$description;
    }

    Save and close.

  • Open submit.php, and find:
            $main_smarty->assign(’submit_url_title’, $linkres->url_title);

    below, add:

           $main_smarty->assign(’submit_content’, $linkres->content);

    Save and close.

  • Thats it.

    I have tested this on v9.8.2, and will later today test it on v9.9.0, it should work for any version though.

    Submit a story, if the story being submitted, has the meta tag “description” filled in, your Pligg install will automatically enter it in the Description box on step 2 of the 3 step submission process.

    Big thanks to Knight01 for his contribution to getting this to work. If anyone knows Knight01’s URL, post it below in a comment so a proper link to him can be posted.

    Next, I will show you how to auto populate the tag field.

    If you use this mod, or would like to show appreciation for it, please consider linking back to http://www.pliggs.com

    Remember to backup the above files before making code changes.

    UPDATE:

    Here is my lib/link.php file that auto-fills, libs/link.php.

    Need a host, midPhase has been tested to run Pligg.

Popularity: 32% [?]

Rate this:
2.5

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!


Add to BlogEngage

Tags: , , , ,

RSS feed for comments on this post. TrackBack URL

RELATED POSTS

Pligg Latest Submitted Story Module v0.1 Released

Pligg 9.9.5 released

Don’t Share This On Digg

FoxieWire? eBenta?

FREE Pligg Template - Pliggup v9.9.0

Related posts brought to you by Yet Another Related Posts Plugin.

RELATED ADS

11 Comments For This Post

  1. no imageLincoln (Check me out!) (3 comments.) Says:

    Absolutely awesome m8 this is something i was looking for for a while :)
    Lincolns last blog post..RSS Importer Extended v0.6 Module For Pligg Released

    Rate this:
    2.5
  2. no imageLincoln (Check me out!) (3 comments.) Says:

    For some reason the code characters are messed up that you posted above m8 just to let you know ;)
    Lincolns last blog post..RSS Importer Extended v0.6 Module For Pligg Released

    Rate this:
    2.5
  3. no imageadmin (Check me out!) (34 comments.) Says:

    Lincoln,

    I think I got it sorted out, thanks for pointing it out.

    Rate this:
    2.5
  4. no imageLincoln (Check me out!) Says:

    Still broken m8 :(

    if(preg_match(‘~~i’, $this->html,$matches)){
    $description = preg_replace(‘~^(.+?)content=”([^"]+?)”(.+?)$~i’, ‘$2′, $matches[1].$matches[2] );
    $description= str_replace(”content=\”", ” “, trim($description));
    $description= str_replace(”\”", ” “, trim($description));
    $this->content=$description;
    }

    Rate this:
    2.5
  5. no imagemisterhappy (Check me out!) (1 comments.) Says:

    Hi,

    Tried this on pligg 9.9. but not working getting error unexpected ~

    anny solution?

    misterhappys last blog post..Lowlands in rap tempo uitverkocht

    Rate this:
    2.5
  6. no imageadmin (Check me out!) (34 comments.) Says:

    Send me libs/link.php, and submit.php and I will fix it.

    admins last blog post..Profile nominations

    Rate this:
    2.5
  7. no imagePliggaz (Check me out!) Says:

    Sounds nice.
    I tried this but get the same parse error than Misterhappy above. I think it has something to do with the code in your post. It looks bit messy to me, maybe you should put it to txt-file and give us a link to download it. The problem is in the libs/link.php part.

    Rate this:
    2.5
  8. no imageadmin (Check me out!) (34 comments.) Says:

    Pliggaz,

    Good suggestion, I have updated the post to include a download of my own libs/link.php

    admins last blog post..Profile nominations

    Rate this:
    2.5
  9. no imagePliggaz (Check me out!) Says:

    Thanks for the download.
    Have you tried this with version 9? It seems that it doesn’t work. The libs/link.php-file is quite different between older and latest version. I tried this with version 9 and the description field stays blank like nothing happened. Your file cannot be used because of the version differencies so I copied that description part from your file and included it to my libs/link.php. No errors but also no results.

    It’s also possible that I’m doing something wrong but I think that the problemis the difference between version 8 and 9.

    Rate this:
    2.5
  10. no imageadmin (Check me out!) (34 comments.) Says:

    I have only been able to get this to work on version 9.8.2, I’m working on v9.9.0 now.

    I will hopefully have a newer version soon.

    admins last blog post..Profile nominations

    Rate this:
    2.5
  11. no imagePliggaz (Check me out!) Says:

    Great, thanks.
    I’ll also try to make it work and let you know if I find a solution.

    Rate this:
    2.5

3 Trackbacks For This Post

  1. Top Stumbles - Best of StumbleUpon Says:

    Getting Pligg to Auto-Fill | Pliggs…

    Get your Pligg install to auto fill the description box on step 2….

  2. bloggingzoom.com Says:

    Getting Pligg to Auto-Fill on Step 2…

    Get your Pligg install to auto fill the description box on step 2 just like Digg.

    Submit a story, if the story being submitted, has the meta tag “description” filled in, your Pligg install will automatically enter it in the Description box on step…

  3. pligg.com Says:

    Getting Pligg to Auto-Fill…

    Get your Pligg install to auto fill the description box on step 2….

Leave a Reply

SimplyWP   My Blogging Experience



  RevResponse

Advertise Here

Recent Droppers

  • First Door on the Left

    Democrat surviving in Texas. Barely.

  • Technically Easy

    Provides useful and helpful advice to understanding various technologies in use today. Topics discussed include computers, networking (wired and wireless), security, Web sites, and digital cameras. Free reviews of personal blogs and Web sites are offered.

  • Nazham.com

    A blog about computing, programming (Microsoft related products and open source), technologies, Linux, latest internet trends and other general topic outside Information Technology scope.

  • What A Load Of Bullshit

    Exposing scams, lies and BS around the globe

  • ebcak.com| Fun| Technology | Computer | Tutorials

    Providing great tips and tutorials to make your computer experience simple. Awesome and funny pictures and videos to keep you laughing all day!

  • Powered by EntreDroppers

Publicity

Get in on the buzz

My site was nominated for Best Blog About Stuff! 

Advertise Here

fly.co.uk cheap flights from the uk to the whole world
Visit Now Find Deals
Qatar Flights Cheap Flight

Popularity: 100% [?]

Rate this:
2.5

Popularity: unranked [?]

Rate this:
2.5

Popularity: unranked [?]

Rate this:
2.5

Popularity: unranked [?]

Rate this:
2.5

Popularity: unranked [?]

Rate this:
2.4 (1 person)

Categories

Archives