Location: PHPKode > projects > Article System > include/modules/admin/include/idx_one.php
<?php

/*
 *	Article System
 *	Online journal management tool written in PHP/MySQL/PostgreSQL.
 *	This code is available at http://sourceforge.net/projects/artsys
 *
 *	Copyright (C) 2001-2005 Jan Hnatek
 *	Distributed under the terms of the GNU General Public License
 *
 *	Date:	  05/08/2005
 *	Version:  0.6   	
 */

###############################################################################
# ADMIN PART
# admin index build
#

	// TODO: style fixes
	function adm_info ($text) {	echo "<p class=\"head2\">$text: </p>\n";	}
	function ainfo ($text) {	echo $text.'<br>';	}
	function aalert ($text) {	echo '<span style="color: red">'.$text.'</span><br>'; 	}

###############################################################################

	// TODO: (
	$id = $_GET["id"];

	if ($id)
		$ids = array ($id);
	else
		$ids = get_array_from ($list);
	debug ("id: $id/".$ids[0]);
	debug ("total: ".count ($ids));
	$OK = test (count ($ids), alert_run (msg ("no item selected")));
	
	if ($OK) {
		adm_info ("building fulltext index for $id");
		// ******************************************
		$index_present = $db->exec ("SELECT * FROM object_word_link LIMIT 1");
		if (!$index_present) {
			aalert ("index: tables not found, cannot build index <br>\n");
		} else {
			ainfo ("index: tables present\n");
		
			require_once (INCLUDE_DIR ."/classes/class.fulltext_index.php");
			// TODO: indexed columns list as global setting ? 
			$s =& new fulltext_index ("Articles", array ("content", "title", "subtitle", "preview"));
			// disable time limit for this page
			ini_set ("max_execution_time", 0);
			
			$s->remove_item_index ($id);
			echo "<p class=txt>";
			$s->create_item_index ($id);
			echo "</p>";
			ainfo ("done");
		}
		echo "<br>";
	}
?>
Return current item: Article System