/////////////////////////////////////////////////////////////////////////////////// // // // phpBoard -- Copyright (c) 2000 by Nathan Clemons // // nathan@thelinuxcommunity.org // // // // This program 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. // // // // This program 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 this program; if not, write to the Free Software // // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // // /////////////////////////////////////////////////////////////////////////////////// require "config_inc.php3"; require $inc_dir . "sql_inc.php3"; require $inc_dir . "lib_inc.php3"; require $inc_dir . $user_lib; if (!$timestamp) { $timestamp = time(); } if ($mark_all_new) { $db_link = SQL_connect(); $statement = "SELECT * FROM categories"; $db_result = SQL_query($statement, $db_link); $aff_rows = SQL_get_aff_rows($db_link, $db_result); for ($db_rows = 0; $db_rows < $aff_rows; $db_rows++) { $row = SQL_fetch_array($db_result, $db_rows); $category = $row["name"]; //$st2 = "SELECT touched FROM articles WHERE category='" . $row["name"] . "' AND approved=" . $row["moderated"] . " ORDER BY touched DESC" . SQL_limit(0,1); //print("
SQL: $st2");
//$res2 = SQL_query($st2, $db_link);
//$rows = SQL_get_aff_rows($db_link, $res2);
//$row2 = SQL_fetch_array($res2, 0);
//$mydatetime = $row2["touched"];
//print(" ($mydatetime)");
//print("Setting $cookie_name-$category-last to $mydatetime...SQL: $st2");
//$res2 = SQL_query($st2, $db_link);
//$rows = SQL_get_aff_rows($db_link, $res2);
//$row2 = SQL_fetch_array($res2, 0);
//$mydatetime = $row2["touched"];
$thiscookie = "$site_name-$mark_cat_new-last";
$thiscookie = eregi_replace(" ", "_", $thiscookie);
if (ereg("^4", phpversion())) {
setcookie("$thiscookie", "", time() - 31536000, "", "$site_domain");
setcookie("$thiscookie", "$timestamp", time() + 31536000, "", "$site_domain");
} else {
setcookie("$thiscookie", "$timestamp", time() + 31536000, "", "$site_domain");
setcookie("$thiscookie", "", time() - 31536000, "", "$site_domain");
}
Header("Location: $site_url");
exit;
}
if ($kill_last) {
for (reset($HTTP_COOKIE_VARS); $key = key($HTTP_COOKIE_VARS); next($HTTP_COOKIE_VARS)) {
$value = $HTTP_COOKIE_VARS[$key];
if (eregi("-last$", $key)) {
setcookie("$key", "", time() - 31536000, "", "$site_domain");
//print("Removing cookie '$key'
");
}
}
Header("Location: $site_url");
exit;
}
$thiscookie = "$site_name-$category-password";
$thiscookie = eregi_replace(" ", "_", $thiscookie);
if (ereg("^4", phpversion())) {
setcookie("$thiscookie", "", time() - 31536000, "", "$site_domain");
setcookie("$thiscookie", "$cat_pass", time() + 31536000, "", "$site_domain");
} else {
setcookie("$thiscookie", "$cat_pass", time() + 31536000, "", "$site_domain");
setcookie("$thiscookie", "", time() - 31536000, "", "$site_domain");
}
Header("Location: $redir_page");
?>