View Full Version : Links added by admin with Reciprocal enabled
softstor
12-19-2005, 03:34 AM
I have the Reciprocal Links option enabled. But when the admin user attempts to add a link, the script requires a reciprocal link. Is it possible for the admin user to add a link with the reciprocal link field blank?
echopulse
12-19-2005, 03:54 AM
Yes it is. You can do it in the admin panel.
softstor
12-19-2005, 04:18 AM
When I try this in the admin I receive the following error message in a big red box:
No reciprocal Link
The link is never added. The only way I am able to add the link is to turn off the reciprocal option.
Simon Gooffin
12-19-2005, 07:37 AM
Well, you can disable your reciprocal checking directly in file then :)
*** open admin/suggest-link.php in any plain text editor ***
*** find there the following code ***
if ((!isset($link['recip_valid']) || ($link['recip_valid'] == 1)) && (
($link['link_header'] == 200) ||
($link['link_header'] == 301) ||
($link['link_header'] == 302)))
*** change it to the following ***
if (($link['link_header'] == 200) ||
($link['link_header'] == 301) ||
($link['link_header'] == 302))
*** save changes ***
let me know if there are any problems
softstor
12-19-2005, 03:29 PM
Thanks, it works perfectly.
Simon Gooffin
12-20-2005, 04:48 AM
Thanks, it works perfectly.
glad to help you :)
May you please include this change into the next update?
Simon Gooffin
01-05-2006, 03:06 AM
np, already done ;) I completely remade our checking section and gave you (eSyndiCat users) more flexibility in checking configuration
uscasinos
10-14-2006, 01:44 PM
Well, you can disable your reciprocal checking directly in file then :)
*** open admin/suggest-link.php in any plain text editor ***
*** find there the following code ***
if ((!isset($link['recip_valid']) || ($link['recip_valid'] == 1)) && (
($link['link_header'] == 200) ||
($link['link_header'] == 301) ||
($link['link_header'] == 302)))
*** change it to the following ***
let me know if there are any problems
HI:
Simon
Please help me.
I can not find the codes that you said.
The suggest-link script that I used is like this.
How to edit it to make reciprocal link checking disable?
<?php
require_once('../classes/DirAdmin.php');
require_once('util.php');
require_once('../includes/pagerank.inc.php');
require_once("../language/{$gDirConfig['lang']}.php");
/** get information about parent category **/
$category =& $gAdminDb->getCategoryById($_GET['id']);
/** get extra fields **/
$fields =& $gAdminDb->getLinkFields();
if ($_POST['add_link'])
{
$link['id_editor'] = 0;
$link['status'] = $_POST['status'];
$link['rank'] = $_POST['rank'];
$link['owner'] = '0';
/** get category id **/
$cat_id = ($gDirConfig['categories_list'] && !$_GET['id']) ? $_POST['id_category'] : $_GET['id'];
$comment = (get_magic_quotes_gpc()) ? stripslashes($_POST['comment']) : $_POST['comment'];
$link['comment'] = addslashes($comment);
if ($fields)
{
foreach($fields as $key=>$value)
{
$field_name = $value['name'];
if (is_array($_POST[$field_name]))
{
$field_value = implode(",", $_POST[$field_name]);
$field_value = trim($field_value, ',');
}
else
{
$field_value = $_POST[$field_name];
}
/** magic quotes stripping for text and textarea fields **/
if (($value['type'] == 'text') || ($value['type'] == 'textarea'))
{
$field_value = (get_magic_quotes_gpc()) ? stripslashes($field_value) : $field_value;
$link[$field_name] = addslashes($field_value);
}
elseif ('storage' == $value['type'])
{
if ($_FILES)
{
$ext = substr($_FILES[$field_name]['name'], -3);
$token = get_new_token();
$file_name = "uploads/{$cat_id}-{$token}.{$ext}";
if (upload($field_name, '../'.$file_name))
{
$link[$field_name] = $file_name;
}
else
{
$error = true;
$msg = 'Unknown error during file upload.';
}
}
}
else
{
$link[$field_name] = $field_value;
}
}
}
if (!$link['description'])
{
$error = true;
$msg = 'Link description field is empty.';
}
if (!$link['title'])
{
$error = true;
$msg = 'Link title field is empty.';
}
if (!$_POST['url'] || ($_POST['url'] == 'http://'))
{
$error = true;
$msg = 'Please input correct URL.';
}
else
{
/** get pagerank **/
if ($gDirConfig['pagerank'])
{
$link['pagerank'] = getPageRank($_POST['url']);
}
/** get domain name **/
$link['domain'] = get_domain($_POST['url']);
/** check broken url **/
$link['link_header'] = 200;
if ($gDirConfig['link_check'] && !$gDirConfig['broken_visitors'])
{
$link['link_header'] = get_link_header($_POST['url']);
$correct_headers = explode(',', $gDirConfig['http_headers']);
if (!in_array($link['link_header'], $correct_headers))
{
$error = true;
$msg = $gDirLang['error_broken_link'];
}
}
}
/** check reciprocal link **/
if ($gDirConfig['reciprocal_check'] && !$gDirConfig['reciprocal_visitors'])
{
if ($gDirConfig['reciprocal_domain'])
{
if (get_domain($_POST['reciprocal']) != get_domain($_POST['url']))
{
$error = true;
$msg = 'Reciprocal link seems to be placed on different domain.';
}
}
$link['recip_valid'] = check_reciprocal($_POST['reciprocal']);
if (!$link['recip_valid'])
{
$error = true;
$msg = $gDirLang['no_backlink'];
}
}
/** check duplicate link **/
if ($gDirConfig['duplicate_checking'] && !$gDirConfig['duplicate_visitors'])
{
$forcheck = ($gDirConfig['duplicate_domain']) ? $link['domain'] : $_POST['url'];
if ($gAdminDb->checkDuplicateLinks($forcheck, $gDirConfig['duplicate_domain']))
{
$error = true;
$msg = $gDirLang['error_link_present'];
}
}
if (!$error)
{
/** get next id **/
$link['id'] = $gAdminDb->getNextId('links');
$gAdminDb->addLink($link, $cat_id, $_POST['send_email']);
$msg = "Link added.";
}
}
$gTitle = 'Suggest Link';
$gCaption = 'SUGGEST LINK';
require_once('header.php');
print_breadcrumb($category['id'], TRUE);
$type = $error ? 'error' : 'notif';
echo $msg ? box($type, '', $msg) : '';
ob_start();
$cause = ($gDirConfig['categories_list'] && !$_GET['id']) ? "" : "?id={$_GET['id']}";
echo "<form action=\"suggest-link.php{$cause}\" method=\"post\" enctype=\"multipart/form-data\">";
echo '<table cellspacing="0" cellpadding="0" width="100%">';
echo '<tr>';
echo '<td><strong>Link category:</strong></td>';
if ($gDirConfig['categories_list'])
{
$categories_list = $gAdminDb->getCategoriesByParent();
echo '<td>';
echo '<select name="id_category">';
print_categories_combo(-1, $tree, $iter, $top);
echo $tree;
echo '</select>';
echo '</td>';
}
else
{
echo "<td><strong><a href=\"browse.php?id={$category['id']}\">{$category['title']}</a></strong></td>";
}
echo '</tr>';
/** extra fields display **/
if ($fields)
{
$cnt = 1;
foreach($fields as $key=>$value)
{
$class = ($cnt%2) ? ' class="tr"' : '';
echo "<tr{$class}>";
echo "<td><strong>{$gDirLang[$value['name']]}:</strong></td>";
echo '<td>';
switch ($value['type'])
{
case 'text':
/** define default value **/
$temp = ($link[$value['name']]) ? stripslashes($link[$value['name']]) : $value['default'];
echo "<input type=\"text\" name=\"{$value['name']}\" value=\"{$temp}\" size=\"45\"/>";
break;
case 'textarea':
/** define default value **/
$temp = ($link[$value['name']]) ? stripslashes($link[$value['name']]) : $value['default'];
echo "<textarea name=\"{$value['name']}\" cols=\"53\" rows=\"8\">{$temp}</textarea>";
break;
case 'combo':
/** define default value **/
$temp = ($_POST[$value['name']]) ? $_POST[$value['name']] : $value['default'];
$values = explode(',',$value['values']);
if ($values)
{
echo "<select name=\"{$value['name']}\">";
foreach($values as $item)
{
$selected = ($item == $temp) ? ' selected="selected"' : '';
echo "<option value=\"{$item}\"{$selected}>{$gDirLang[$item]}</option>";
}
echo '</select>';
}
break;
case 'radio':
/** define default value **/
$temp = ($_POST[$value['name']]) ? $_POST[$value['name']] : $value['default'];
$values = explode(',',$value['values']);
if ($values)
{
$cnt = count($values);
foreach($values as $item)
{
$i++;
$checked = ($item == $temp) ? ' checked="checked"' : '';
echo "<input type=\"radio\" name=\"{$value['name']}\" id=\"{$value['name']}_{$item}\" value=\"{$item}\" {$checked} />";
echo "<label for=\"{$value['name']}_{$item}\">{$gDirLang[$item]}</label>";
echo ($i != $cnt) ? ' | ' : '';
}
}
break;
case 'checkbox':
/** define default value **/
if ($_POST[$value['name']])
{
$default = $_POST[$value['name']];
}
else
{
$default = explode(',', $value['default']);
}
$checkboxes = explode(',',$value['values']);
if ($checkboxes)
{
$cnt = count($checkboxes);
$i = 0;
foreach($checkboxes as $item)
{
$i++;
$checked = (in_array($item, $default)) ? ' checked="checked"' : '';
echo "<input type=\"checkbox\" name=\"{$value['name']}[]\" id=\"{$value['name']}_{$item}\" value=\"{$item}\" {$checked} />";
echo "<label for=\"{$value['name']}_{$item}\">{$gDirLang[$item]}</label>";
echo ($i != $cnt) ? ' | ' : '';
}
}
break;
case 'storage':
echo "<input type=\"file\" name=\"{$value['name']}\" id=\"{$value['name']}\" size=\"30\" />";
break;
}
echo '</td>';
echo '</tr>';
$cnt++;
}
}
?>
<tr>
<td class="caption" colspan="2"><strong>ADDITIONAL FIELDS</strong>
</td>
<tr>
<td><strong>Link status:</strong></td>
<td>
<select name="status">
<option value="approval"<?php echo ($_POST['status'] == 'approval') ? ' selected="selected"' : '';?>>Approval</option>
<option value="banned"<?php echo ($_POST['status'] == 'banned') ? ' selected="selected"' : '';?>>Banned</option>
<option value="active"<?php echo (($_POST['status'] == 'active') || !$_POST) ? ' selected="selected"' : '';?>>Active</option>
</select>
</td>
</tr>
<tr class="tr">
<td><strong>Link rank:</strong></td>
<td>
<select name="rank">
<option value="0">Not Ranked</option>
<?php
for($i = 1; $i <= 10; $i++)
{
$selected = ($_POST['rank'] == $i) ? ' selected="selected"' : '';
echo "<option value=\"{$i}\"{$selected}>Rank {$i}</option>";
}
?>
</select>
</td>
</tr>
<tr>
<td><strong>Admin comment:</strong></td>
<td><textarea name="comment" cols="53" rows="8"><?php echo $comment; ?></textarea></td>
</tr>
<tr class="all">
<td colspan="2">
<input type="checkbox" name="send_email" id="send_email"<?php echo $gDirConfig['link_admin_add'] ? ' checked="checked"' : ''; ?> /><label for="send_email">Send email notification</label> | <input type="submit" name="add_link" value="Add link" /></td>
</tr>
</table>
</form>
<?php
$s = ob_get_clean();
box('box', 'SUGGEST LINK', $s);
require_once('footer.php');
?>
John Turner
10-19-2006, 05:42 AM
Hi uscasinos,
You may also disable reciprocal links in AdminPanel - > Link Checking
in field Reciprocal Links Checking
check it all to disable.
On should be worked
vBulletin® v3.7.0, Copyright ©2000-2008, Jelsoft Enterprises Ltd.