Location: PHPKode > projects > Modular Site Manager > htdocs/inc/ajaxfunc.inc.php
<?php
	/* AJAX Functions */
	function forumsedit($postid)
	{
		global $xajax, $mysql;
		$resp = new xajaxResponse();
		$sel = $mysql->select(PRE.'forums_posts', "id='".$postid."'", "id");
		$a = mysql_fetch_assoc($sel);
		$post = $a['message'];
		$resp->addAssign('post-'.$postid, "innerHTML", '<form action="misc/forums.quickedit.php" method="post">
		<div class="buttondiv"><textarea rows="20" cols="60" name="message">'.htmlspecialchars($post).'</textarea>
		<br /><input type="hidden" name="postid" value="'.$postid.'" /> <input type="submit" name="submit" value="Edit" />
		<input type="button" name="cancel" value="Cancel" onclick="xajax_canceledit(\''.$postid.'\')" /></div></form><br />');
		return $resp->getXML();
	}
	function canceledit($postid)
	{
		global $xajax, $mysql;
		$resp = new xajaxResponse();
		$sel = $mysql->select(PRE.'forums_posts', "id='".$postid."'", "id");
		$a = mysql_fetch_assoc($sel);
		$post = $a['message'];
		$resp->addAssign('post-'.$postid, 'innerHTML', parse($a['message']));
		return $resp->getXML();
	}
	function deletepost($postid)
	{
		global $xajax, $mysql;
		$resp = new xajaxResponse();
		$mysql->delete(PRE.'forums_posts', "id='".$postid."'");
		$resp->addAssign('post-tr-'.$postid, "innerHTML", '');
		$resp->addAssign('post-tr2-'.$postid, "innerHTML", '');
		$resp->addAlert('Post id '.$postid.' deleted.');
		return $resp->getXML();
	}
	function quotepost($postid, $user)
	{
		global $xajax, $mysql;
		$resp = new xajaxResponse();
		$sel = $mysql->select(PRE.'forums_posts', "id='".$postid."'", "id");
		$a = mysql_fetch_assoc($sel);
		$resp->addPrepend('qp', 'value', "[quote=".$user."]".$a['message']."[/quote]");
		return $resp->getXML();
	}
	function queryupdate($qnum)
	{
		global $mysql;
		$resp->addAssign('querynum', 'innerHTML', $qnum);
	}
?>
Return current item: Modular Site Manager