<?php
// $Id: deletePost.php,v 1.1 2004/07/11 10:28:46 Farsus Exp $
// -------------------------------------------------------------------------//
//			                 RUNCMS                                         //
//                                                                          //
//	 reliable - Unique - Nocost &  Simplicity & ease off use                //
//                       < http://www.runcms.org >                          //
// -------------------------------------------------------------------------//
// Original Author: i-Tech (Half-Dead)
// Author Website : http://www.i-Technology.NET
// License Type   : LGPL: See /manual/LICENSES/LGPL.txt
// ------------------------------------------------------------------------- //

// Function: blogger.deletePost

load_function("isAdmin");
$user = (string)$params[2];
$pass = (string)$params[3];
$uid  = login($user, $pass);

$storyid = (int)$params[1];

if ( !defined("isAdmin") ) {
	trigger_error(_phpRPC_AdminOnly, E_USER_ERROR);
}

$sql   = "DELETE FROM " .$db->prefix("stories"). " WHERE storyid='$storyid'";
$query = $db->query($sql);

$sql1   = "DELETE FROM " .$db->prefix("comments"). " WHERE item_id='$storyid'";
$query1 = $db->query($sql);

// Return a result
if (!$query) {
	trigger_error(_phpRPC_DBerreur, E_USER_ERROR);
	} elseif (isAdmin == 1) {
		load_function("newsRSS");
		build_rss();
	}

$rpc_encoder->add_value("boolean", 1);
$rpc_encoder->return_call();
?>
