[Toxicengine-cvs] website/include utils.inc.php,1.1,1.2
Status: Alpha
Brought to you by:
jperret
From: Jonathan P. <jp...@us...> - 2004-10-30 19:16:36
|
Update of /cvsroot/toxicengine/website/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8330/include Modified Files: utils.inc.php Log Message: - use of CVS keywords - replaced useragent logging with referrer and IP logging Index: utils.inc.php =================================================================== RCS file: /cvsroot/toxicengine/website/include/utils.inc.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** utils.inc.php 2 Oct 2004 01:44:46 -0000 1.1 --- utils.inc.php 30 Oct 2004 19:16:21 -0000 1.2 *************** *** 2,20 **** /* toxic - A Global Illumination Renderer ! Copyright (C) 2003-2004 Francois Beaune ! Contact: be...@ai... ! This file is part of toxic. ! toxic 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. ! toxic 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 toxic; if not, write to the Free Software --- 2,20 ---- /* toxic - A Global Illumination Renderer ! Copyright (C) 2004 The toxic Project ! http://toxicengine.sourceforge.net ! This file is part of toxic. ! toxic 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. ! toxic 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 toxic; if not, write to the Free Software *************** *** 23,28 **** function current_file() { ! $script_name = $_SERVER["SCRIPT_NAME"]; ! $parts = Explode('/', $script_name); return $parts[count($parts) - 1]; } --- 23,28 ---- function current_file() { ! $script_name = $_SERVER["SCRIPT_NAME"]; ! $parts = Explode('/', $script_name); return $parts[count($parts) - 1]; } *************** *** 61,64 **** --- 61,68 ---- } + function extract_rcs_header($header) { + return preg_replace('/^[^:]+:\s*(.*)\s*\$$/','$1',$header); + } + function output_document_info($author, $revision, $update_timestamp) { ?> *************** *** 66,70 **** <tr> <td class="postheader"> ! Author: <?php echo $author; ?><br> Revision: <?php echo $revision; ?><br> Last Update: <?php echo date('r', $update_timestamp); ?><br> --- 70,74 ---- <tr> <td class="postheader"> ! Latest author: <?php echo $author; ?><br> Revision: <?php echo $revision; ?><br> Last Update: <?php echo date('r', $update_timestamp); ?><br> *************** *** 85,122 **** function record_hit($admin, $page_id) { ! $identstring = addslashes($_SERVER['HTTP_USER_AGENT']); ! ! // Look for the browser's identification string into the 'useragents' database. ! $entry_vector = mysql_query( ! 'SELECT DISTINCT id ' . ! ' FROM useragents ' . ! ' WHERE identstring=\'' . $identstring . '\''); ! ! // Add a new entry to the 'useragents' database if the identification string of ! // this browser is unknown. ! if(mysql_num_rows($entry_vector) == 0) { ! mysql_query( ! 'INSERT INTO useragents VALUES (' . ! ' \'NULL\', ' . ! ' \'' . $identstring . '\')'); ! ! // Look (again) for the browser's identification string. ! $entry_vector = mysql_query( ! 'SELECT DISTINCT id ' . ! ' FROM useragents ' . ! ' WHERE identstring=\'' . $identstring . '\''); ! } ! ! assert(mysql_num_rows($entry_vector) == 1); ! $row = mysql_fetch_array($entry_vector); // Insert new hit record. mysql_query( ! 'INSERT INTO pagehits VALUES (' . ! ' \'NULL\', ' . ' \'' . mktime() . '\', ' . - ' \'' . $row['id'] . '\', ' . ' \'' . $page_id . '\', ' . ! ' \'' . $admin . '\')'); } ?> --- 89,107 ---- function record_hit($admin, $page_id) { ! // assuming magic_quotes_gpc==1 ! ! $referrer = $_SERVER['HTTP_REFERER']; ! $ip = $_SERVER['REMOTE_ADDR']; ! $host = gethostbyaddr($ip); // Insert new hit record. mysql_query( ! 'INSERT INTO pagehits ( timestamp, pageid, adminpage, referrer, ip, host ) VALUES (' . ' \'' . mktime() . '\', ' . ' \'' . $page_id . '\', ' . ! ' \'' . $admin . '\', ' . ! ' \'' . $referrer . '\', ' . ! ' \'' . $ip . '\', ' . ! ' \'' . addslashes($host) . '\')'); } + ?> |