<?php
$myts = icms_core_Textsanitizer::getInstance();

$url = empty($_POST['url']) ? '' : $myts->stripSlashesGPC($_POST['url']) ;
if (empty($url) || strlen($url)<=10) {
	return;
}

$table  = $xoopsDB->prefix($mydirname . '_links');
$where  = $_POST['status'] == 1 ? "`url`=": "`murl`=";
$where .= "'". mysql_real_escape_string($url) ."'";

$sql = "SELECT count(*) FROM `{$table}` WHERE {$where}" ;
$num = $xoopsDB->fetchRow($xoopsDB->query($sql));

print intval($num[0]);
