Location: PHPKode > projects > Article System > include/modules/admin/include/idx_build.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>'; 	}

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

	adm_info ("building fulltext index");
	// **********************************
	$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");
		$s =& new fulltext_index ("Articles", "content");
		// disable time limit for this page
		ini_set ("max_execution_time", 0);
		
		$s->remove_all_indexes ();
		echo "<p class=txt>";
		$s->rebuild_all_indexes ();
		echo "</p>";
		ainfo ("done");
	}
	echo "<br>";

?>
Return current item: Article System