Recipical url not being detected if www left off

Problems installing LinkMan?
Post Reply
802284585
Posts: 4
Joined: Mon Jun 14, 2010 2:43 pm

Recipical url not being detected if www left off

Post by 802284585 »

I am getting error messages in the check links saying link not found on recipical site. I can see the link on the site and noticed it is not added fully.
The site has added the url without the 'www' or without the 'www' and a '/' at the end.

I have added a short site name variable and extended line 771 (admin.php) to include this but it still fails. Short site name is defined as http://name.com

My knowledge of scripting is low so this may not be the way to go.

{
if ($match[2] == $settings['site_url'] || $match[2] == $settings['site_url'].'/' || $match[2] == $settings['short_site_url'] || $match[2] == $settings['short_site_url'].'/')
{
$found = 1;
break;
}
802284585
Posts: 4
Joined: Mon Jun 14, 2010 2:43 pm

Update

Post by 802284585 »

Been looking at this closer and it seems the program can't find the url due to the layout of the page. The stripped $html text only finds mandinka-lodges.com it does not find the http://mandinka-lodges.com hence it fails.


Page source:

<a href ="http://gambiatourguides.com" target =_blank"><b>Gambiatourguides.com</b></a><br />
<span class="dots">.............................................................</span><br />
<a href ="http://mandinka-lodges.com" target =_blank"><b>Mandinka-lodges.com</b></a><br />
<span class="dots">.............................................................</span><br />
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

Just BELOW the code you posted try adding this for the second (non-www) check:

Code: Select all

$settings['site_url']=str_replace('www.','',$settings['site_url']);
if ($match[2] == $settings['site_url'] || $match[2] == $settings['site_url'].'/' || $match[2] == $settings['short_site_url'] || $match[2] == $settings['short_site_url'].'/') 
{ 
$found = 1; 
break; 
}
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
802284585
Posts: 4
Joined: Mon Jun 14, 2010 2:43 pm

No Joy

Post by 802284585 »

I tried that and it made no difference.

The reciprocal site is http://www.cheaptravel1.com/resources.html

Looking for http://www.mandinka-lodges.com

It also has the same problem with other URLs added to this site. They are legacy links added via the admin panel.

If you can't add these to your own version of Linkman I am happy to give you access to the admin page, I have added code to echo $html to screen if the link is not found and echo all urls found, it is something strange with the page layout and search strings I think.

Thanks
Kevin
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

How about if you add the same code as before, but also just below

Code: Select all

$html=strtolower($html);
paste this

Code: Select all

$html=str_replace('href =','href=',$html);
Any luck?
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
802284585
Posts: 4
Joined: Mon Jun 14, 2010 2:43 pm

yeahhhhh

Post by 802284585 »

Thanks, thats cracked the problem. A beer on the way

Kevin
Post Reply