Go Back   Pligg Forum > Pligg Development > Pligg Mods
Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-19-2007, 12:04 PM
tariqali tariqali is offline
New Pligger
 
Join Date: Feb 2007
Posts: 8
Downloads: 2
Uploads: 0
Thanks: 0
Thanked 0 Times in 0 Posts
FeedFlare

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
Sponsored Links
Check out the New Templates at the Pligg Pro Shop.
  #2 (permalink)  
Old 05-19-2007, 02:18 PM
Simon Simon is offline
Innovator
 
Join Date: Mar 2006
Posts: 581
Downloads: 22
Uploads: 1
Thanks: 14
Thanked 126 Times in 61 Posts
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 02:26 PM.
Reply With Quote
  #3 (permalink)  
Old 05-19-2007, 03:52 PM
tariqali tariqali is offline
New Pligger
 
Join Date: Feb 2007
Posts: 8
Downloads: 2
Uploads: 0
Thanks: 0
Thanked 0 Times in 0 Posts
That did it

Thank you for the help!
Reply With Quote
  #4 (permalink)  
Old 04-12-2008, 10:38 AM
godrox godrox is offline
Casual Pligger
Pligg Version: 9.9.0
Pligg Template: YGet
 
Join Date: Oct 2007
Location: Minnesota
Posts: 35
Downloads: 11
Uploads: 0
Thanks: 1
Thanked 0 Times in 0 Posts
Thanks for this code and the solution! Works perfectly.
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

LinkBacks Enabled by vBSEO 3.0.0