Page 1 of 2 12 LastLast
Results 1 to 15 of 19

Thread: Checking for duplicate URL in add form

  1. #1
    linksor.com is offline Active Member
    Join Date
    Sep 2005
    Location
    Poland - Warsaw
    Posts
    341

    Default Checking for duplicate URL in add form

    Hi,

    My directories are going to be a huge ones and I need a modification which checks during submitting a page if the URL exists in database 9or after pressing SUBMIT button).

    Is there any ideas howto ?

    Checking for dupliacte content via ACP is going to be difficult because I must check by ID which URL must be deleted. I prefer to make it automated.

  2. #2
    FSGDAG's Avatar
    FSGDAG is offline Moderator
    Join Date
    May 2007
    Location
    NJ, United States
    Posts
    1,651

    Default

    I've also wanted this... I get a TON of duplicate submissions all the time and have to remember to constantly use the "Find Duplicate Link". If it could be done at the time that the user was adding the URL, it would be much better and efficent
    FSGDAG | IndexU Hosting | Owner
    Website | NiceCoder Script Hosting and More! | Web4URL is For Sale!
    Follow Us On Twitter | FaceBook Profile | YouTube Videos

  3. #3
    inspireme is offline Active Member
    Join Date
    Nov 2004
    Posts
    1,822

    Default

    didnt test this. Load up add.php, around line 230ish

    Code:
     // check to see if already exists 
     strtolower ($url);
     $query    = "select * from idx_link where url LIKE %$url%";
        $result   = $dbConn->Execute($query);
        $duplicated = $result->Fields("url");
    
    if ($duplicated){
     $error_msg = ("Im sorry we already have your URL listed.");
     }
     
        elseif (empty($title))
          $error_msg = $msg["10101"];

    notice the if for checking to see if title is empty needs to be altered to "elseif"

    NOT TESTED, just to get you started...
    Main IndexU sites : | Campsite Directory | Tourist Guide | Places2B | AfterDirectory <-- Half price submission using coupon DP50 (from just $11 premium, and $10 basic permanent )

  4. #4
    dody is offline Administrator
    Join Date
    Aug 2001
    Location
    Indonesia
    Posts
    3,731

    Default

    I've updated indexu svn.
    http://nicecoder.com/svn/index.php?act=changeset&id=559

    In simple way, use this code
    Code:
        elseif ($dbConn->Lookup("link_id", "idx_link", "url = '$url'"))
          $error_msg = 'Im sorry we already have your URL listed.';

  5. #5
    linksor.com is offline Active Member
    Join Date
    Sep 2005
    Location
    Poland - Warsaw
    Posts
    341

    Default

    Doesnt work on IU 5.3.0
    Last edited by linksor.com; 01-18-2008 at 02:25 AM.

  6. #6
    dody is offline Administrator
    Join Date
    Aug 2001
    Location
    Indonesia
    Posts
    3,731

    Default

    it should work.
    i just checked that 5.3 can understand $dbConn->Lookup

    any error msg do you get?
    and where do you put the codes? Try below these lines:

    elseif (empty($url) || $url == 'http://')
    $error_msg = $msg["10102"];

  7. #7
    Bruceper is offline Active Member
    Join Date
    Jun 2002
    Location
    Winnipeg Canada
    Posts
    4,913

    Default

    IndexU should really reject submissions at the time of submission if it's a duplicate. Users should be sent off to the modify page if it already exists.

  8. #8
    esm's Avatar
    esm
    esm is offline Active Member
    Join Date
    Apr 2003
    Location
    Atlanta GA
    Posts
    3,395

    Default

    Quote Originally Posted by dody View Post
    I've updated indexu svn.
    http://nicecoder.com/svn/index.php?act=changeset&id=559

    In simple way, use this code
    Code:
        elseif ($dbConn->Lookup("link_id", "idx_link", "url = '$url'"))
          $error_msg = 'Im sorry we already have your URL listed.';
    hmmmmm....I don't think the following would be considered duplicates but all point to the exact same page.

    Code:
    http://cnn.com
    http://cnn.com/
    http://www.cnn.com
    http://www.cnn.com/
    http://cnn.com/index.html
    http://www.cnn.com/index.html


    .
    esm
    "The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

    .

  9. #9
    linksor.com is offline Active Member
    Join Date
    Sep 2005
    Location
    Poland - Warsaw
    Posts
    341

    Default

    I have added many times one site on Linksor.com and it always's been accepted

    I have placed all necessary codes as dody described.

    I dont get any error - just a page about successful submitting

    edit: I will test it on another my dir.
    Last edited by linksor.com; 01-18-2008 at 05:46 AM.

  10. #10
    dody is offline Administrator
    Join Date
    Aug 2001
    Location
    Indonesia
    Posts
    3,731

    Default

    Thanks esm, it mean that only top level domains are accepted?

  11. #11
    esm's Avatar
    esm
    esm is offline Active Member
    Join Date
    Apr 2003
    Location
    Atlanta GA
    Posts
    3,395

    Default

    Quote Originally Posted by dody View Post
    Thanks esm, it mean that only top level domains are accepted?
    aren't they all top-level domain urls...???



    .
    Last edited by esm; 01-18-2008 at 04:24 PM.
    esm
    "The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

    .

  12. #12
    dody is offline Administrator
    Join Date
    Aug 2001
    Location
    Indonesia
    Posts
    3,731

    Default

    i mean no deep link url?

  13. #13
    Antony is offline Active Member
    Join Date
    Sep 2006
    Posts
    167

    Default

    The duplicate are working without problem...
    But have a problem with the ajax cat.... uNDER IE ONLY FIREFOX WORK WELL
    I made svn updated site...

    http://www.toutou-chien.com

    Antony
    Last edited by Antony; 01-19-2008 at 06:55 PM.
    Hotel Discount Web Search
    www.hotel-discount.com

  14. #14
    linksor.com is offline Active Member
    Join Date
    Sep 2005
    Location
    Poland - Warsaw
    Posts
    341

    Default

    I have tested this on my all directories with no luck. Seems that th eproblem is somewhere else not in PHP code. May be in collation of database ?

    BTW found another issue: when I want to check duplicate links via ACP it doesn;t show me all duplicated links: the URL with the ending SLASH "/" is not the same as the link withoud slahs.

    http://www.domain.com is not the same as http://www.domain.com/

  15. #15
    CEC
    CEC is offline Active Member
    Join Date
    Apr 2006
    Posts
    446

    Default

    I know this is an old thread ... but does any of this duplicate link check at the point of adding work in version 1.21?

Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 9
    Last Post: 01-12-2008, 08:59 AM
  2. Checking reciprocal link
    By enrico in forum v5.x
    Replies: 1
    Last Post: 09-21-2006, 07:02 AM
  3. Checking linkbacks Mod
    By esm in forum v3.2
    Replies: 26
    Last Post: 09-21-2004, 09:18 PM
  4. Mod for Checking ALL linkbacks
    By esm in forum v3.2
    Replies: 5
    Last Post: 12-21-2003, 01:16 PM
  5. weblogs.com and blo.gs ping checking
    By rbl in forum Pre-Sales Questions
    Replies: 10
    Last Post: 07-17-2003, 09:25 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
  •