<?PHP
/* ====================
Seditio - Website engine
Copyright Neocrome
http://www.neocrome.net
[BEGIN_SED]
File=plugins/xsearch/xsearch.page.add.php
Version=1.0
Updated=2009-jan-13
Type=Plugin
Author=Dmitry Lapin
Description=
[END_SED]
[BEGIN_SED_EXTPLUGIN]
Code=xsearch
Part=pageadd
File=xsearch.page.add
Hooks=page.add.add.done
Tags=
Order=98
[END_SED_EXTPLUGIN]
==================== */

if (!defined('SED_CODE')) { die('Wrong URL.'); }

$id = sed_sql_result(sed_sql_query("SELECT LAST_INSERT_ID()"), 0, 0);

require_once("plugins/xsearch/inc/xsearch.common.php");

$words1 = textToBaseFormWords($newpagetext);
$words1 = implode(" ", $words1);

$words2 = textToBaseFormWords($newpagetitle);
$words2 = implode(" ", $words2);

$sql = sed_sql_query("UPDATE $db_pages SET
		page_index = '".sed_sql_prep($words1)."',
		title_index = '".sed_sql_prep($words2)."'
		WHERE page_id='".$id."'");

?>