<?php
	$topdir = '..';
	require $topdir."/dacode.php3";

	$cache = LoadClass('Cache');
	$user = LoadClass('User');
	$comments = LoadClass('Comments');
	$html = LoadClass('Html');

	if (!($user->checked && ($user->level&pow(2,23)))) {
		echo lecho("you bad boy...");
		exit;
	}
	if (isset($table['action']) && $table['action'] == "mod") {
		$cache->delete_obsolete_news($news_id);
		$comments->mod_score($table);
		$text = lecho("Scored !\n");
		$text .= "<script language=\"javascript\">self.close()</script>\n";
	} else {
		$text = '<form action="score.'.$config->php.'" type="post">'.
			'<input type="hidden" name="table[comments_id]" value="'.$id.'">'.
			'<input type="hidden" name="table[score]" value="'.$score.'">'.
			'<input type="hidden" name="table[action]" value="mod">'.
			'<input type="hidden" name="news_id" value="'.$news_id.'">'.
			'<input type="text" name="table[info]" value="" size="20"><br>'.
			'<input type="submit" name="table[submit]" VALUE="Submit!">'.
			'</form>';
	}
	$text = '<div class="sboxtext">'.$text.'</div>';
	$nobanner = 1;
	$html->parsetemplate('basic.tmpl');
?>
