<?php
/*
* buzzword
* Copyright (c) 2003 Brad Taylor, Jon Tai
*
* $Id: preferences.php,v 1.1 2003/12/08 09:38:01 jon Exp $
* Flush and re-populate the keywords cache for the relevance engine
*
* This file is part of buzzword.
*
* buzzword is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* buzzword is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with buzzword; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
// comment out this line to run the rest of this script
// (prevents malacious users from resetting all preferences)
die('permission denied');
$progress_dot = ".\n";
$progress_dot .= "<!--\n";
$progress_dot .= str_repeat(str_repeat('x', 70)."\n", 32);
$progress_dot .= "-->\n";
function print_progress_dot() {
global $progress_dot;
echo $progress_dot;
flush();
set_time_limit(30);
}
require_once '../includes/config.inc';
include_once '../includes/header.inc';
?>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td id="content">
<?php
// reset all preferences
echo 'flushing preferences: ';
for ($i = 0; $i < 100; $i++)
print_progress_dot();
$sql = 'TRUNCATE TABLE '.DB_PREFIX.'preferences';
$result = mysql_query($sql);
echo mysql_error();
echo "done<br>\n";
echo "<table><tr><td></td></tr></table>\n";
flush();
?>
</td>
</tr>
</table>
<?php
include_once '../includes/footer.inc';
?>