[ yot | yob ] [ Home | Admin | Hilfe ]
psychoSOTOSOysis 

Antwortmodus

 Zum Löschen
Regeln
  • Erlaubte Formate: GIF, JPG, PNG
  • Maximale Dateigröße: 4.096 Kb
  • Bilder über 300 x 300 Pixel werden verkleinert (Antworten 200 x 200)
  • Lies diese Regeln und FAQ vor der Teilnahme
  • Erlaubter BBCode: [b][i][u][s]
  • Die Inhalte dieser Seite sind prinzipiell nicht ernst zu nehmen
  • 97 Posts mit 49 Bildern in 25 Threads von 37 Besuchern
>>>>>>

 [ zurück ]

Stickies!

(902 Bytes, 16 x 16, icon_sticky.png) 1266955497247.png
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 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 Nr.41
>>40 !MOD, I you...
>>
!MOD Nr.42
>>41 !ADMIN, I you, too.
>>
Anonymous Nr.43
>>41 >>42 this is the meaning of 'samefaggotry'

Passwort    [  ] 
[ zurück ]
[ Home | Admin | Hilfe ]