[ zurück ] Stickies! (902 Bytes, 16 x 16, icon_sticky.png) 1266955497247.png !ADMIN 23.02.10 (Di) 20:04 Nr.38 !ADMIN 23.02.10 (Di) 20:04 Nr.38 Stickies funktionieren jetzt! Einen Sticky kann nur ein !MOD oder !ADMIN setzen. Der Sticky-Thread bleibt dann immer an erster Stelle. Es gab dafür mehrere Änderungen in imgboard.php. Das Herzstück ist die neue Funktion sticksort (): function sticksort () { $fp = fopen (TREEFILE, 'r+'); flock ($fp, 2); rewind ($fp); $buf = fread ($fp, 1000000); if ($buf == '') { error (ERR_LOG_CORRUPT, $dest); } $line = explode ("\n", $buf); $countline = count ($line); $datfilename = 'THREADSTATES'; $lines = @explode ("\n", @file_get_contents ($datfilename) ); if ($lines[1] != '') { $stick = explode (',', $lines[1]); } $countsticks = count ($stick); $sticksfirst = ''; for ($i = 0; $i < $countline; $i ++) { $collectline = explode (',', $line[$i]); if ($collectline[0] != '') { for ($j = 0; $j < $countsticks; $j ++) { if ($collectline[0] == $stick[$j]) { $sticksfirst[$j] = $line[$i]; unset($line[$i]); } } } } $sticksfirst = ltrim (implode ("\n", $sticksfirst) . "\n" . implode ("\n", $line)); $fp = fopen (TREEFILE, 'w+'); set_file_buffer ($fp, 0); rewind ($fp); fputs ($fp, $sticksfirst); fclose ($fp); @chmod ($datfilename, 0666); unset ($sticksfirst); unset ($countline); unset ($countsticks); unset ($collectline); } >> !MOD 24.02.10 (Mi) 10:13 Nr.40 (8.95 Kb, 244 x 251, 1265573391640.jpg) 1267006404146.jpg Testing Sticky thread function. To see if !ADMIN worked to our satisfaction. >> !ADMIN 24.02.10 (Mi) 10:27 Nr.41 >>40 !MOD, I ♥ you... >> !MOD 24.02.10 (Mi) 10:47 Nr.42 >>41 !ADMIN, I ♥ you, too. >> Anonymous 24.02.10 (Mi) 10:49 Nr.43 >>41 >>42 this is the meaning of 'samefaggotry' [ Seitenanfang ]