From e7aa66fe5edf8dea9bf47c48efc197535c570962 Mon Sep 17 00:00:00 2001 From: Starla Insigna Date: Wed, 10 Dec 2008 16:27:32 -0500 Subject: Created own bbcode system To be able to test for Internet Explorer troubles, the dependency on the bbcode PECL module had to be dropped, and so it has been. Hopefully this BBCode module works. --- includes/functions.php | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'includes/functions.php') diff --git a/includes/functions.php b/includes/functions.php index 73a6e17..64628a5 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -251,4 +251,33 @@ function removeTags($id, $type = 'published') $deltags2 = mysql_query($deltags); } +function unique_id() +{ + static $dss_seeded = false; + + $getconfig = "SELECT * FROM config WHERE name = \"rand_seed\""; + $getconfig2 = mysql_query($getconfig); + $getconfig3 = mysql_fetch_array($getconfig2); + + $val = $getconfig3['value'] . microtime(); + $val = md5($val); + $rand_seed = md5($getconfig3['value'] . $val . $extra); + + $getconfig = "SELECT * FROM config WHERE name = \"rand_seed_last_update\""; + $getconfig2 = mysql_query($getconfig); + $getconfig3 = mysql_fetch_array($getconfig2); + if ($dss_seeded !== true && ($getconfig3['value'] < time() - rand(1,10))) + { + $setconfig = "UPDATE config SET value = \"" . $rand_seed . "\" WHERE name = \"rand_seed\""; + $setconfig2 = mysql_query($setconfig); + + $setconfig = "UPDATE config SET value = \"" . time() . "\" WHERE name = \"rand_seed_last_update\""; + $setconfig2 = mysql_query($setconfig); + + $dss_seeded = true; + } + + return substr($val, 4, 16); +} + ?> -- cgit 1.4.1