summary refs log tree commit diff stats
path: root/includes/functions.php
diff options
context:
space:
mode:
authorStarla Insigna <hatkirby@fourisland.com>2008-12-10 16:27:32 -0500
committerStarla Insigna <hatkirby@fourisland.com>2008-12-10 16:27:32 -0500
commite7aa66fe5edf8dea9bf47c48efc197535c570962 (patch)
treec1d0c8aa809386c6d7c1fb7f5fbf641b37536c60 /includes/functions.php
parent2f85b606ccf161bb73370e85aead40318e9e216f (diff)
downloadfourisland-e7aa66fe5edf8dea9bf47c48efc197535c570962.tar.gz
fourisland-e7aa66fe5edf8dea9bf47c48efc197535c570962.tar.bz2
fourisland-e7aa66fe5edf8dea9bf47c48efc197535c570962.zip
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.
Diffstat (limited to 'includes/functions.php')
-rwxr-xr-xincludes/functions.php29
1 files changed, 29 insertions, 0 deletions
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')
251 $deltags2 = mysql_query($deltags); 251 $deltags2 = mysql_query($deltags);
252} 252}
253 253
254function unique_id()
255{
256 static $dss_seeded = false;
257
258 $getconfig = "SELECT * FROM config WHERE name = \"rand_seed\"";
259 $getconfig2 = mysql_query($getconfig);
260 $getconfig3 = mysql_fetch_array($getconfig2);
261
262 $val = $getconfig3['value'] . microtime();
263 $val = md5($val);
264 $rand_seed = md5($getconfig3['value'] . $val . $extra);
265
266 $getconfig = "SELECT * FROM config WHERE name = \"rand_seed_last_update\"";
267 $getconfig2 = mysql_query($getconfig);
268 $getconfig3 = mysql_fetch_array($getconfig2);
269 if ($dss_seeded !== true && ($getconfig3['value'] < time() - rand(1,10)))
270 {
271 $setconfig = "UPDATE config SET value = \"" . $rand_seed . "\" WHERE name = \"rand_seed\"";
272 $setconfig2 = mysql_query($setconfig);
273
274 $setconfig = "UPDATE config SET value = \"" . time() . "\" WHERE name = \"rand_seed_last_update\"";
275 $setconfig2 = mysql_query($setconfig);
276
277 $dss_seeded = true;
278 }
279
280 return substr($val, 4, 16);
281}
282
254?> 283?>