<?php
If (!defined("in_astat")) {
    die("Dieses Script kann nicht ausserhalb des Frameworks laufen!");
} 
$addnav["right"]=FALSE;
$session->page_begin("Text Module", FALSE);

$topnav_home="<li><a href=\"/index.php\">Home</a></li>";

class text extends ajax_module{

	function ajax(){
		global $module,$config,$db,$tpl,$log,$error;
		if($_POST['call']=="url"){
			if(isset($_POST['url'])&& $_POST['url']!=""){
				$url=$db->escape($_POST['url']);
				$result = $db->query("SELECT count(`id`) as `count` FROM `" . $config["prefix"] . "article` WHERE `url`='".$url."'");
				$row = $db->fetch_array($result, MYSQL_ASSOC);
				if($row["count"]==0){
					echo 0;
				}else{
					 echo 1;
				}
			}
		}
	}
	
}
?>
