[MOD] NDEntries : Double entries check

Everything related to LinkMan - reciprocal links manager
Post Reply
frakosun
Posts: 2
Joined: Sun Feb 03, 2008 11:19 pm

[MOD] NDEntries : Double entries check

Post by frakosun »

/*************************************
Title: NDEntries
Version: 0.1
Author: frakosun (frakosun [--at--] gmail.com)
Demo: -
Download: -
Website: -

Short description: This mod checks if a link has already been submitted. It blocks double entries.
*************************************/


Hi everybody,

We all agree to say that LinkMan it a great link exchange php script, but one important thing is missing : the double entries check.
By default it's possible to add unlimited links to the same website with the same backlink, that's why i made this small MOD. ;)

I know that i should provide a demo + a download link, but i don't have the time to do this (and there is no reason for such a small improvement i think) so i just share it with you. I hope that klemen understands and won't remove it...

So here it is: in the addlink.php file, search for:

Code: Select all

/* Compare URL and Reciprocal page URL */
$parsed_url=parse_url($url);
$parsed_rec=parse_url($recurl);
just add the following code after (line 53)

Code: Select all

//NDEntries MOD [start]
$fichier = $settings['linkfile'];
$NDE = $parsed_url['host'];

$motif = "/".$NDE."/";

$pointeur = fopen($fichier, "r");
$i = 0;
if ($pointeur) {
  while (!feof($pointeur)) {
    $ligne = fgets($pointeur);
    if (preg_match($motif, $ligne, $r)) {
      $i++;
      }
    }
  fclose($pointeur);
  }
if ($i > 0) {
	problem('Link already submitted!');
}

//NDentries MOD [End]
Some explanations: the MOD will browse the .txt file where all the link exchanges are stored. If it detects that someone is trying to add a link already submited, an error message is shown.
This script focus on the 'host' to make this check, so it doesn't matter if the link stored is 'domain.com' or 'domain.com/folder/folder2/' , it will block the submission in both cases.


That's all folks, enjoy!
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

Thanks for sharing, because it's just a simple modification to make no download or demo is necessary, I agree :wink:
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
frakosun
Posts: 2
Joined: Sun Feb 03, 2008 11:19 pm

Post by frakosun »

thanks for understanding klemen! :D
Steve.N
Posts: 4
Joined: Fri Jan 30, 2009 8:24 am

Post by Steve.N »

Hi all,

Cool, very cool 8)
Post Reply