FeedFlare

Register an Account
Pligg Chat Room
Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-19-2007, 01:04 PM
New Pligger
 
Join Date: Feb 2007
Posts: 10
Hello,

I created a feedflare for Feedburner to allow blogers and new site submit to my Pligg site.
The flare look like this:
PHP Code:
<FeedFlareUnit>

    <
Catalog>
<
Title>Pligg</Title>

    <
Description>
FeedFlare to submit stories to Pligg</Description>
</
Catalog>

    <
FeedFlare>
<
Text>Submit Story</Text>
<
Link href="http://myPliggSiteSample.com/submit.php?url=${link}"/>
</
FeedFlare>
</
FeedFlareUnit

The link http://myPliggSiteSample.com/submit.php?url=${link} seem to only work when the article is new. But if it was already entered into my Pligg users get this message:
Duplicate article URL:

Please double check the URL and make sure that the article has not been already published
You can vote and comment on the existing article:
[/QUOTE]

When I click on "You can vote and comment on the existing article: " I get an invalid page.

How do I make it so if the article exist then they are redirected to the article page instead of getting this message? Can some one help me with this?

Thanks
Reply With Quote
  #2 (permalink)  
Old 05-19-2007, 03:18 PM
Constant Pligger
 
Join Date: Mar 2006
Posts: 537
Ok, my thoughts would be that you need to create a page that will first look at the url attached, see if it is already posted, and if not, 301 to the story url. This may as well be done in submit.php.

Let me think....

Code:
//if url already exists, go to story page
$check_url = mysql_real_escape_string(strip_tags($_GET['url']));
$link_query = mysql_query("SELECT link_id FROM " . table_links . " WHERE link_url='$check_url' AND link_status!='discard'");
$link_rows = mysql_num_rows($link_query);
if($link_rows > 0) {
    $link = mysql_fetch_array($link_query);
    $id = $link['link_id'];
    header('Location: story.php?id='.$id);
}
Add that to your submit.php file, just below the force_authentication(); line. I just tried it out and it seems to work (I'll probably keep it in place too, as it will help users of my FireFox extension). See how that works for you.

Last edited by Simon; 05-19-2007 at 03:26 PM.
Reply With Quote
  #3 (permalink)  
Old 05-19-2007, 04:52 PM
New Pligger
 
Join Date: Feb 2007
Posts: 10
That did it

Thank you for the help!
Reply With Quote
  #4 (permalink)  
Old 04-12-2008, 11:38 AM
Casual Pligger
Pligg Version: 9.9.0
Pligg Template: YGet
 
Join Date: Oct 2007
Location: Minnesota
Posts: 34
Thanks for this code and the solution! Works perfectly.
Reply With Quote
Reply

Thread Tools
Display Modes




Pligg Modules and Pligg Templates from Pligg Pro Find support on the Pligg CMS Forum - 24 hours a day! Make a donation to support Pligg CMS development