Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    eon
    eon is offline
    Casual Pligger eon's Avatar
    Joined
    May 2007
    Posts
    38
    Thanks
    Received:0
    Given: 0

    Can A Story Be Submitted By URL???

    Is it possible to submit a new story like this?

    <a href="http://pliggsite.com/submit.php?url=http://thisstoryurl">Pligg this page</a>

    Just like we digg stuff.

  2. #2
    Constant Pligger Simon's Avatar
    Joined
    Mar 2006
    Posts
    537
    Thanks
    Received:0
    Given: 0
    Yep, that's just how it works. The EVB uses the same method to let people submit webpages to pligg sites, as does the basic version of the FireFox extension I posted.

    If you're not logged in, it will re-direct you to the login page, and when logged in it will return you to the submit page again (with url still in tact).

  3. #3
    eon
    eon is offline
    Casual Pligger eon's Avatar
    Joined
    May 2007
    Posts
    38
    Thanks
    Received:0
    Given: 0
    Good to hear. Thanks for the reply.

    Could you give me links to those?

    I've looke into the EVB mod but looked like its for voting not submitting, and lots of people having trouble with it. Am I wrong?

    Thanks

  4. #4
    Constant Pligger Simon's Avatar
    Joined
    Mar 2006
    Posts
    537
    Thanks
    Received:0
    Given: 0
    The EVB does both - if a page hasn't been submitted already, it will take you to the submit page. I have no trouble with the EVB in its current form. The FF extension can be found here.

  5. #5
    eon
    eon is offline
    Casual Pligger eon's Avatar
    Joined
    May 2007
    Posts
    38
    Thanks
    Received:0
    Given: 0
    Well it seems that the evb uses javascript, and I'd like to avoid that.

    I want to just straight url with an html image. I tried just sending a url to submit.php but if it exists, it just gives an error saying it already exists. I would like for it to forward the user to login or register and once in to be directed to the story.

    How do I do that?

  6. #6
    Constant Pligger Simon's Avatar
    Joined
    Mar 2006
    Posts
    537
    Thanks
    Received:0
    Given: 0
    You can use an iframe instead of javascript (look in button.php to see the iframe that is written).

    As for the submit.php process, if you aren't logged in and you go to submit.php?url=http://site.com then it will take you to the login page before you can submit a url. If a url already exists, you may want to add in a check at the start of submit.php for it. I use one that re-directs to the story page instead of submit, if the url is already in the database:

    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!='discarded'");
    $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);
    }

  7. #7
    eon
    eon is offline
    Casual Pligger eon's Avatar
    Joined
    May 2007
    Posts
    38
    Thanks
    Received:0
    Given: 0
    Super! About what line did you add that code to?

    Edit:

    Right under the includes? Like line 18?

  8. #8
    Constant Pligger Simon's Avatar
    Joined
    Mar 2006
    Posts
    537
    Thanks
    Received:0
    Given: 0
    I added it just below the includes, yeh.

  9. #9
    eon
    eon is offline
    Casual Pligger eon's Avatar
    Joined
    May 2007
    Posts
    38
    Thanks
    Received:0
    Given: 0
    Did that... thanks.

    The only thing that sucks is that if the user has not registered before, this doesn't work. It's lost during registration. Is that fixable?

  10. #10
    Constant Pligger Simon's Avatar
    Joined
    Mar 2006
    Posts
    537
    Thanks
    Received:0
    Given: 0
    Not sure about registration - maybe save it as a session variable?

Page 1 of 2 12 LastLast

Similar Threads

  1. Redirecting to the submitted story after step 3
    By hamidhamid1985 in forum Questions & Comments
    Replies: 3
    Last Post: 11-04-2010, 03:41 PM
  2. Email notification when a story is submitted
    By federrer in forum Questions & Comments
    Replies: 0
    Last Post: 05-02-2008, 04:31 AM
  3. Email notification when a story is submitted
    By federrer in forum Questions & Comments
    Replies: 1
    Last Post: 04-23-2008, 10:48 PM
  4. Once a Story is Submitted does it ever get deleted?
    By Naomi in forum Questions & Comments
    Replies: 15
    Last Post: 08-10-2007, 03:08 AM
  5. Why mt submitted story still in Unpublished
    By keem1201 in forum Questions & Comments
    Replies: 2
    Last Post: 03-06-2007, 06:16 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Pligg Modules and Pligg Templates from Pligg Pro Web Hosting Services by Midphase Dreamhost Web Hosting Donate to Pligg