2009-09-07, 12:48 AM
2009-09-07, 01:01 AM
No, it would confuse the system. Only show 1 variable.
2009-09-07, 01:14 AM
An array...? I believe.
2009-09-07, 01:40 AM
Well, here's what I want:
I have a directory. The backlink checker currently checks for a backlink under a certain URL. In this case, it is defined by:
$cfg['scan_needle'] = 'mydomain.com';
I want to set it so that I could put two domains there, so people can choose which domain they want to link back to. Something like:
$cfg['scan_needle'] = 'mydomain.com' || 'myotherdomain.com';
Although I'm pretty sure the above doesn't work...
I have a directory. The backlink checker currently checks for a backlink under a certain URL. In this case, it is defined by:
$cfg['scan_needle'] = 'mydomain.com';
I want to set it so that I could put two domains there, so people can choose which domain they want to link back to. Something like:
$cfg['scan_needle'] = 'mydomain.com' || 'myotherdomain.com';
Although I'm pretty sure the above doesn't work...
2009-09-07, 02:07 AM
Ah its on the tip of my tongue...there might be a way to do this but I dont know...Can't remember.
2009-09-07, 02:27 AM
I'm sure this is important to. This is a script inside of the submission processor:
$scanner->init($proxy, $cfg['scan_needle']);
$cfg['scan_needle'] is the URL that I declared earlier in config.php. Can I replace this so that it scans two URLs? Would this simply work?
$scanner->init($proxy, $cfg['scan_needle']);
$scanner->init($proxy, $cfg['scan_needle2']);
if (!$errors && $cfg['scan'])
{
$found_needle = false;
$url_2 = @parse_url($hint);
if (isset($url_2['host']) && $url_2['host'] == $url['host'])
{
$tmp = "http://".$url['host'];
if (isset($url_2['path']))
$tmp .= $url_2['path'];
if (isset($url_2['query']))
$tmp .= '?'.$url_2['query'];
$data = file_get_contents($tmp);
if (stristr($data, $cfg['scan_needle']) !== false)
$found_needle = true;
}
if (!$found_needle)
{
$scanner = new Scanner();
$scanner->init($proxy, $cfg['scan_needle']);
$found_needle = $scanner->scan($cfg['scan_timeout']);
}
if (!$found_needle)
$errors[] = 'We can\'t find a link back to us on your website.';
I think the line is:$scanner->init($proxy, $cfg['scan_needle']);
$cfg['scan_needle'] is the URL that I declared earlier in config.php. Can I replace this so that it scans two URLs? Would this simply work?
$scanner->init($proxy, $cfg['scan_needle']);
$scanner->init($proxy, $cfg['scan_needle2']);
2009-09-07, 02:56 AM
Maybe $var = "this|that";
then $var = explode("|", $var);
then $var = explode("|", $var);
2009-09-07, 03:09 AM
(2009-09-07, 02:56 AM)xiofire Wrote: [ -> ]Maybe $var = "this|that";
then $var = explode("|", $var);
Where would I put that? Would this work?
$cfg['scan_needle'] = 'domain1.com';
$cfg['scan_needle_2'] = 'domain2.com';
$var = "$cfg['scan_needle']|$cfg['scan_needle_2']";
$var = explode("|", $var);
And then I would replace all instances of $cfg['scan_needle'] in that PHP file with $var?
2009-09-07, 03:11 AM
Yes, but here is a cleaner version:
<?php
$cfg['scan_needle'] = 'domain1.com';
$cfg['scan_needle_2'] = 'domain2.com';
$var = $cfg['scan_needle']."|".$cfg['scan_needle_2'];
$var = explode("|", $var);
?>
2009-09-07, 03:15 AM
Here's what I did:
$linkback = $cfg['scan_needle']."|".$cfg['scan_needle_2'];
$linkback = explode("|", $linkback);
if (isset($url_2['host']) && $url_2['host'] == $url['host'])
{
$tmp = "http://".$url['host'];
if (isset($url_2['path']))
$tmp .= $url_2['path'];
if (isset($url_2['query']))
$tmp .= '?'.$url_2['query'];
$data = file_get_contents($tmp);
if (stristr($data, $linkback) !== false)
$found_needle = true;
}
if (!$found_needle)
{
$scanner = new Scanner();
$scanner->init($proxy, $linkback);
$found_needle = $scanner->scan($cfg['scan_timeout']);
}
But now it doesn't work at all.