Results 1 to 10 of 10

Thread: What counts as a duplicate link?

  1. #1

    Default What counts as a duplicate link?

    I currently have Allow Duplicate Links set to No. However, it won't allow completely different links from the same site to be added. Will it only allow one link per domain?

  2. #2
    Join Date
    Jan 2004
    Location
    Georgia, USA
    Posts
    34,466

    Default Re: What counts as a duplicate link?

    Yes, it checks the links by domain. Otherwise people could easily get around that by adding links like this:

    http://www.vbadvanced.com
    http://www.vbadvanced.com/index.php

  3. #3

    Default Re: What counts as a duplicate link?

    We need to get around this issue. What about the Geocities or Yahoo Groups situation? If the above is true, the member's links would be considered duplicates. We also have a domain name that issues out space for users as subdirectories and these users would like to be linked to.

    Better to make the option for EXACT duplicates.

    Please help.
    Last edited by oldengine; 08-18-2007 at 02:27 PM.

  4. #4

    Default Re: What counts as a duplicate link?

    So, for example, if we wanted to have links to the vbadvanced page and the vblinks page and the vbdynamics page, we couldn't do it? At least not with Allow Duplicate Links set to No?

  5. #5
    Join Date
    Jan 2004
    Location
    Miami
    Posts
    1,040

    Default Re: What counts as a duplicate link?

    Quote Originally Posted by oldengine View Post
    We need to get around this issue. What about the Geocities or Yahoo Groups situation? If the above is true, the member's links would be considered duplicates. We also have a domain name that issues out space for users as subdirectories and these users would like to be linked to.

    Better to make the option for EXACT duplicates.

    Please help.
    My way around it is to set a category where I allow for duplicates with all subcategories too. Then in includes/functions_vba_links_savelinks.php I put

    // Missing default fields
    $lcatid=$link['catid'];
    $getparent= $db->query_read("SELECT parentlist from new_adv_links_categories where catid='$lcatid'");
    while ($theparent=$db->fetch_array($getparent))
    {
    $parentlist=explode(',',$theparent['parentlist']);

    }


    if ($_POST['do'] != 'addlink' AND !$link['name'])

    {
    eval('$errors[] = "' . fetch_error('adv_links_missingfiled') . '";');
    }

    else if (in_array("2",$parentlist))
    {

    if ($link['linkurl'] == 'http://' OR !$link['linkurl'] OR ($_POST['do'] != 'addlink' AND (!$link['name'] OR !$link['description'])))



    {
    eval('$errors[] = "' . fetch_error('adv_links_missingfiled') . '";');
    }
    }
    so for that specific parent catego (2 in my case), you can put as many dupes as you want. Since I am doing this for a yellow pages to allow entry with no links, i just don't check for dupes. And that goes for 600 subcategos under parent number 2
    Last edited by Lionel; 08-18-2007 at 07:05 PM.

  6. #6

    Default Re: What counts as a duplicate link?

    Lionel,

    Thank you for responding. I'm going to have to figure this out so that all of the categories on my links board can deal with this situation.

    With places like myspace.com and youtube.com surely someone else needs to provide multiple links at the sub-folder level in a domain, yet keep duplicates at that level under control.

  7. #7

    Default Re: What counts as a duplicate link?

    Quote Originally Posted by Doug Nelson View Post
    I currently have Allow Duplicate Links set to No. However, it won't allow completely different links from the same site to be added. Will it only allow one link per domain?
    Can we please take this thread back to the original question?

    I have done a search on this board for "duplicate links" and it appears that there are a lot of users with this issue. However, dealing with it in only ONE category isn't an answer.

    The only solution at this time is to simply ALLOW duplicate links. Hopefully, someone will come up with a method to check the entire link rather than just the domain name for duplicates. So what if someone puts their index.htm or index.html in a couple of times. That's better than having the same page in a dozen times. IT's the DIFFERENT PAGES that we want to allow.

    Can this code be made a bit less aggressive when checking for duplicates so that http://namedomainname.com/myfolder/ and http://namedomainname.com/hisfolder/ are OK, but if either one of them is entered twice, they are rejected?

    http://www.vbadvanced.com/forum/showthread.php?t=23879
    Last edited by oldengine; 08-21-2007 at 05:55 PM.

  8. #8
    Join Date
    Jan 2004
    Location
    Georgia, USA
    Posts
    34,466

    Default Re: What counts as a duplicate link?

    Look in your forum/includes/functions_vba_links_savelink.php file for this code:
    PHP Code:
            $finddomain strip_url($urlparsed['host']);

            
    $checkdupe $db->query_read("SELECT linkid, linkurl, valid FROM " TABLE_PREFIX "adv_links WHERE linkurl LIKE '%$finddomain%' " iif(!$dupe"AND linkid != '$link[linkid]'") . " LIMIT 1");
            while (
    $dupe $db->fetch_array($checkdupe))
            {
                
    $dupe['urlparsed'] = @parse_url($dupe['linkurl']);
                
    $dupe['linkurl'] = strip_url($dupe['urlparsed']['host']);

                if (
    $dupe['linkurl'] == $finddomain)
                {
                    
    $errors[] = fetch_error('adv_links_duplicate'htmlspecialchars($link['linkurl']), iif($dupe['valid'], fetch_error('adv_links_duplicate_viewlink'$dupe['linkid']), ''));
                }
            } 
    Replace with this:
    PHP Code:
            $dupe $db->query_first("SELECT linkid, linkurl, valid FROM " TABLE_PREFIX "adv_links WHERE linkurl = '" $db->escape_string($link['linkurl']) . "' " iif(!$dupe"AND linkid != '$link[linkid]'"));

            if (
    $dupe['linkid'])
            {
                
    $errors[] = fetch_error('adv_links_duplicate'htmlspecialchars($link['linkurl']), iif($dupe['valid'], fetch_error('adv_links_duplicate_viewlink'$dupe['linkid']), ''));
            } 
    And that will only return an error if the exact link is found.

  9. #9

    Default Re: What counts as a duplicate link?

    Thank you Brian, I'll get to work on it.

    This is truly appreciated and it's icing on the cake of an EXCELLENT program!

    Please pardon my mess of having asked about this on other categories.

    EDIT: And it WORKS excellently!
    Last edited by oldengine; 08-22-2007 at 01:20 AM.

  10. #10

    Default Re: What counts as a duplicate link?

    I found my way back here after upgrading to vB 3.7 and putting in the new Links upgrade.

    This mod is definitely an asset!

    Thanks.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Guest book counts
    By attroll in forum Feedback & Suggestions
    Replies: 0
    Last Post: 07-24-2007, 02:26 PM
  2. duplicate vBA link in adminCP
    By vbusers11 in forum Troubleshooting / "How do I..." Questions
    Replies: 3
    Last Post: 01-30-2005, 11:49 PM
  3. [MOD] A slightly more helpful duplicate link message
    By StewardManscat in forum Modifications
    Replies: 2
    Last Post: 01-27-2005, 11:15 AM
  4. View counts not updating
    By Merjawy in forum Site Feedback & Updates
    Replies: 3
    Last Post: 07-07-2004, 04:53 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
  •