Page 1 of 1

[MOD] NDEntries : Double entries check

Posted: Mon Feb 04, 2008 12:44 am
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!

Posted: Mon Feb 04, 2008 7:13 pm
by Klemen
Thanks for sharing, because it's just a simple modification to make no download or demo is necessary, I agree :wink:

Posted: Tue Feb 05, 2008 9:10 am
by frakosun
thanks for understanding klemen! :D

Posted: Fri Jan 30, 2009 8:50 am
by Steve.N
Hi all,

Cool, very cool 8)