PDA

View Full Version : how do I block from submitting links on my directroy


tadisaus2
09-04-2006, 04:57 PM
Hello,

How do I block from submitting links on my directory? right now too many spammers attach my directory and they even make changes on my directory which can't submit on both admin and my directory.

Please help me to block any users from submitting. But I need to submit links on admin panel. That's all I need.

Here is my suggest-links.php file

<?php

/************************************************** *************************

*

* IMPORTANT: This program is a commercial software and any kind of using

* it must agree to eSyndiCat license agreement. It can be found here:

* http://www.esyndicat.com/license.html

*

* This notice may not be removed from the source code.

*

* Copyright 2005 eSyndiCat Software Development Ltd.

* http://www.esyndicat.com/

*

************************************************** *************************/

require_once('../classes/DirAdmin.php');

require_once('util.php');

require_once('../includes/pagerank.inc.php');

require_once("../language/{$gDirConfig['lang']}.php");



/** gets category where link is added **/

$category =& $gAdminDb->getCategoryById($_GET['id']);



if ($_POST['add_link'])

{

$link['id_editor'] = $gDirEditor ? $gDirEditor['id'] : 0;

$link['id_category'] = $_GET['id'];

$link['url'] = $_POST['url'];

$link['title'] = $_POST['title'];

$link['description'] = $_POST['description'];

$link['email'] = $_POST['email'];

$link['reciprocal'] = $_POST['reciprocal'];

$link['status'] = $_POST['status'];

$link['rank'] = $_POST['rank'];

$link['owner'] = '0';



/** gets pagerank **/

if ($gDirConfig['pagerank'])

{

$link['pagerank'] = getPageRank($_POST['url']);

}



/** reciprocal link checking **/

if ($gDirConfig['reciprocal_check'])

{

$link['recip_valid'] = check_reciprocal($_POST['reciprocal']);

}



/** checking for correct url **/

$link['link_header'] = 200;

if ($gDirConfig['link_check'])

{

$link['link_header'] = get_link_header($_POST['url']);

}



if ((!isset($link['recip_valid']) || ($link['recip_valid'] == 1)) && (

($link['link_header'] == 200) ||

($link['link_header'] == 301) ||

($link['link_header'] == 302)))

{

if (!$gAdminDb->checkDuplicateLinks($_POST['url']))

{

$gAdminDb->addLink($link, $_POST['send_email']);

$msg = "Link added";

$type = 'notif';

}

else

{

$msg = $gDirLang['link_present'];

$type = 'error';

}

}

elseif ($link['link_header'] != 200)

{

$msg = $gDirLang['broken_link'];

$type = 'error';

}

elseif ($link['recip_valid'] != 1)

{

$msg = $gDirLang['no_backlink'];

$type = 'error';

}

}



$gTitle = "Suggest Link{$gDirConfig['suffix']}";

$gCaption = 'SUGGEST LINK';

require_once('header.php');



print_breadcrumb($category['id'], TRUE);



echo $msg ? box($type, '', $msg) : '';



ob_start();

?>

<form action="<?php echo "suggest-link.php?id={$_GET['id']}"; ?>" method="post">

<table cellspacing="0" width="100%">

<tr>

<td><strong>Link category:</strong></td>

<td><strong><?php echo "<a href=\"browse.php?id={$category['id']}\">{$category['title']}</a>"; ?></strong></td>

</tr>

<tr class="tr">

<td><strong>Link URL:</strong></td>

<td><input type="text" name="url" value="http://" size="30" maxlength="150" /></td>

</tr>

<tr>

<td><strong>Link title:</strong></td>

<td><input type="text" name="title" size="30" maxlength="150" /></td>

</tr>

<tr class="tr">

<td><strong>Link description:</strong></td>

<td><textarea name="description" cols="53" rows="8"></textarea></td>

</tr>

<tr>

<td><strong>Link email:</strong></td>

<td><input type="text" name="email" size="30" maxlength="100" /></td>

</tr>

<tr class="tr">

<td><strong>Reciprocal URL:</strong></td>

<td><input type="text" name="reciprocal" value="http://" size="30" maxlength="150" /></td>

</tr>

<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">Approval</option>

<option value="banned">Banned</option>

<option value="active" 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++)

{

echo "<option value=\"{$i}\">Rank {$i}</option>";

}

?>

</select>

</td>

</tr>



<tr>

<td><strong>Admin comment:</strong></td>

<td><textarea name="comment" cols="53" rows="8"><?php echo $link['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');

?>

Greg
09-04-2006, 05:03 PM
The easiest way would be to remove this from the layout.php
$menu['suggest-link']['caption'] = $gDirLang['suggest_link'];
$menu['suggest-link']['url'] = "{$url}suggest-link.php?id={$aCategory}";

Nows there no link for anyone to click on.

Dave Baker
09-04-2006, 06:08 PM
Perhaps this information will be useful to you too:
http://www.esyndicat.com/forum/showthread.php?t=6456&highlight=remove+suggest

tadisaus2
09-05-2006, 09:09 PM
when I remove this suggest-link and category, do you think spammers be able to access to my directory?

Thanks.

Sai_dallas
09-05-2006, 10:04 PM
Hope not


.

Dave Baker
09-06-2006, 04:50 PM
If you remove suggest-link and category, spammers not be able get access to your directory through suggest-link and category.

tadisaus2
09-07-2006, 05:22 PM
thanks.
I modified the suggest link page by removing the code and tell link exchanger to send an email if they want to exchange links.
I hope spammer can't find a way to go to the admin panel, if they can, then, I have to use the text links instead....

Thanks.