[SOLVED] Backlink checker won't work

Find all the help you need on the script Arfooo Directory.
Please refer any bugs found.

Moderator: effi

[SOLVED] Backlink checker won't work

Postby Evadido » Wed Mar 23, 2011 3:47 pm


I just installed tha last version of arfooo (2.02), and after setting it up, I started testing my site. I created three links on the directory, two of them with no reciprocal link. When I run the "check backlinks" options under "system", it shows a progress bar, and after completion, it shows the three links with no more information :roll:

If I go to "directory"->"search websites" and I search for "http", it shows a list with the three links with the "backlink" field greened and with a "yes" label.

Am I doing something wrong or the checker just don't work?

Is out there some external tool to check these backlinks?

Thank you very much! :)
Posts: 3
Joined: Wed Mar 23, 2011 3:06 pm

Re: [SOLVED] Backlink checker won't work

Postby Evadido » Thu Mar 24, 2011 3:20 pm

The Quick and drity solution I've found:

First, create a file with this content, and name it "linkchecker.php" or whatever you want:
Code: Select all
//open database connection
$username = "username";
$password = "pass"; //input your password here.
$database = "db";
//connect to database
@mysql_select_db($database) or die("<b>Unable to specified database</b>");
//retrieve reciprocal links
$query="select returnBond,siteid from Arfooo_sites";
$result=mysql_query($query) or die('Error, query failed');

//loop through reciprocal links


mysql_query("update Arfooo_sites set backlinkExists ='" .$check ."' where siteid=" .mysql_result($result,$row,"siteid") ) or die("fallo");

//check reciprocal link function
function linkcheck($mylink,$link)

$content = getPage($link);

return checkPage($content, $mylink);


function checkPage($content, $mylink){

   $check = "0";
   if (strlen($content) > 10){
      $startPos = 0;
      while (strpos($content,'<a ',$startPos) and $check=="0"){
         $spos  = strpos($content,'<a ',$startPos);
         $tmppos = strpos($content,'>',$spos);
         $spos  = strpos($content,'href',$spos);
         $spos1 = strpos($content,'"',$spos)+1;
         $spos2 = strpos($content,"'",$spos)+1;

   //echo "<br>" .$spos1 ."    sd         " .$spos2 ."<br>";

         if ($spos2 < $spos1 and $spos2>1) $spos = $spos2;
         else $spos = $spos1;

         $epos1 = strpos($content,'"',$spos);
         $epos2 = strpos($content,"'",$spos);
         if ($epos2 < $epos1 and $epos2>0) $epos = $epos2;
         else $epos = $epos1;

         $startPos = $epos;
         $link = substr($content,$spos,$epos-$spos);

         if (strpos($link,'http://') !== false){
      if (strcasecmp($link,$mylink)==0) {
         $check= "1";

   if ($check=="1")
      echo "->                              correcto<br>" ;
      echo "->                              <b>NO VALIDO</b><br>";
   return $check;

function getPage($link){
   echo "cargando: " .$link;
   if ($fp = fopen($link, 'r')) {
      $content = '';
      while ($line = fread($fp, 1024)) {
         $content .= $line;
      $content .= $line;

   return $content;


I have no idea of php, so I merged and tortured several pieces of code found across all the internet. It simply works. Just upload it to your server and execute it: http://myfabulousdomain.com/linkchecker.php

It tests if the backlinks are active, notifies you of the state of every backlink and saves it in the database.

But, ¿how to known from inside arfooo what backlinks are valid?... I hacked a little the file /admin/templates/arfooo/site/search.tpl

Code: Select all
<!-- Add this column to the table, call it "valid" in your language -->
<!-- end mod 1-->
{foreach from=$sites value=site}
<tr class="line{cycle values='1,2'}">
    <td><a href="{"/admin/site/edit/$site.siteId"|url}" title="{$site.siteTitle}">{$site.siteTitle}</a></td>
   <td><a href="{"/admin/site/edit/$site.siteId"|url}" title="{$site.siteTitle}">{$site.url}</a></td>
   <td>{if $site.status == 'banned'}<span class="text_red">{'Yes'|lang}</span>{else}<span class="text_green">{'No'|lang}</span>{/if}</td>
   <td>{if $site.returnBond == ''}<span class="text_red">{'No'|lang}</span>{else}<span class="text_green">{'Yes'|lang}</span>{/if}</td>

<!-- And now, add the corresponding data column -->
   <td>{if $site.backlinkExists == '0'}<span class="text_red">{'No'|lang}</span>{else}<span class="text_green">{'Yes'|lang}</span>{/if}</td>

<!-- End mod 2, and end of little hack -->
   <td><a href="{"/admin/site/edit/$site.siteId"|url}" class="link_green">{'link_edit'|lang}</a> |
      <a onclick="return $.confirmLinkClick('{'Do you really want to delete it?'|lang}', this.href)" href="{"/admin/site/delete/$site.siteId"|url}" class="link_red">{'link_delete'|lang}</a></td>

Now, you can go to directory->search websites, and the list will show you the valid and invalid backlinks.

Bye! 8-)
Posts: 3
Joined: Wed Mar 23, 2011 3:06 pm

Re: [SOLVED] Backlink checker won't work

Postby vlahul » Fri Mar 25, 2011 12:35 pm

It is give my this error when run the linkchecker.php:

Warning: fopen() [function.fopen]: Filename cannot be empty in /home/..../public_html/mysite.com/linkchecker.php on line 92

I set up the correct parameters (database, username, pass,. url) in linkchecker.php.
Any ideas?
Posts: 3
Joined: Sun Feb 20, 2011 5:50 pm

Re: [SOLVED] Backlink checker won't work

Postby Evadido » Mon Mar 28, 2011 5:13 am


It seems that you entered as backlink an absolute path relative to your own computer, or simply a path that does not exists. It is not serious, so the script tells you that the backlink is not valid ("no valido"). It will be marked as non existent backlink in your database. If you test it with more than one backlink, it should continue working well after this warning.

Have a good week ;)
Posts: 3
Joined: Wed Mar 23, 2011 3:06 pm

Re: [SOLVED] Backlink checker won't work

Postby jog2jog » Tue Aug 16, 2011 11:39 am

Thanks m8 worked perfectly
Posts: 2
Joined: Wed Aug 03, 2011 9:09 am

Return to Installation, support and bug reports


  • Related topics
    Last post

Who is online

Users browsing this forum: No registered users and 1 guest

Copyright © arfooo.net  2007 - 2010  -  All rights reserved.
Arfooo website group: petites annonces gratuites   voyance en direct - tirage tarot   Consultant en référencement
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group | phpBB SEO