Seen too many teams brake up in seti
Seen too many teams brake up in seti
Someone left a note on a piece of cake in the fridge that said, "Do not eat!". I ate the cake and left a note saying, "Yuck, who the hell eats paper ?
quackers - i take it that in order to have a sig like yours (the OCuk sig scripty thingy) you have to be part of the OCuk team - it doesnt make it clear, but i couldnt get the bastard thing working no matter how hard i tried are there any alternatives other than the OCuk image one, because i havent managed to find any...
mark
his is the same as mineOriginally Posted by streetster
if you want I could host it for you (I already host 30 odd for TPR)
Just send me the image you want used, seti email address and text you want before/after the WU count
Someone left a note on a piece of cake in the fridge that said, "Do not eat!". I ate the cake and left a note saying, "Yuck, who the hell eats paper ?
Need GD installed on your server to run it.
PHP Code:
<?php
//Setup Variables For Sig
$UserEmail="seti email address ";
$PreText="pretest";
$PostText="posttest";
$TextRed=255;
$TextGreen=255;
$TextBlue=255;
$FontSize=15;
$TextX=60;
$TextY=40;
$ImageURL="path to image";
$UpdatePeriod=900; //Maximum frequency in seconds at which the script will poll Berkeley
//Setup Variables For Webspace - Must be absolute paths
$LocalFile="WUTotal.dat";
$FontFile="discognate.ttf";
if(!file_exists($LocalFile) or !FileMTime($LocalFile) or time()-FileMTime($LocalFile)>$UpdatePeriod)
{
//Get Total Number Of WUs from personal stats page at Berkeley
$fp =@fopen ("http://setiathome.ssl.berkeley.edu/fcgi-bin/fcgi?email=" . $UserEmail . "&cmd=user_stats_new", "r");
if ($fp)
{
while (!feof($fp))
{
$WebPage.=fgets($fp,200);
}
fclose($fp);
if (strpos($WebPage,"No user with that name was found")==0)
{
$TotalStart=strpos($WebPage,"Results Received");
$StartPos=strpos($WebPage,"<td>",$TotalStart)+4;
$EndPos=strpos($WebPage,"</td>",$StartPos);
$WUs=ltrim(rtrim(substr($WebPage,$StartPos,$EndPos
-$StartPos)));
}
else
{
$WUs="User not found.";
}
//Update Local File With Total
$Output = fopen ($LocalFile, "a");
ftruncate ($Output, 0);
fseek($Output,0);
fwrite($Output, $WUs);
fclose($Output);
}
}
//Read Total from Local File
$Local=@fopen ($LocalFile, "r");
$WUs=fgets($Local,200);
fclose($Local);
//Build Text String
$Text=$PreText . "\r\n" . $WUs . " " . $PostText;
//Create Image
$size = ImageTTFBbox ($FontSize, 0, $FontFile , $Text);
$im_x=abs($size[4]-$size[0]);
$im_y=abs($size[5]-$size[1]);
if (substr($ImageURL,strlen($ImageURL)-3,3)=="jpg")
{
//Create a Sig image based on a JPEG
Header("Content-type: image/jpeg");
Header("Expires: " . gmdate("D, d M Y H:i:s", time() + 900) . " GMT");
$im_size = GetImageSize ($ImageURL);
$imageWidth = $im_size[0];
$imageHeight = $im_size[1];
$im = ImageCreateFromJPEG($ImageURL);
$text_color = imagecolorclosest ($im, $TextRed, $TextGreen, $TextBlue);
if ($TextX+$im_x>$imageWidth){$TextX=$imageWidth-$im_x-2;}
if ($TextY>$imageHeight){$TextY=$imageHeight-2;}
imagettftext ($im, $FontSize, 0, $TextX, $TextY, $text_color, $FontFile, $Text);
ImageJpeg ($im);
ImageDestroy ($im);
}
elseif (substr($ImageURL,strlen($ImageURL)-3,3)=="png")
{
//Create a Sig image based on a PNG
Header("Content-type: image/png");
Header("Expires: " . gmdate("D, d M Y H:i:s", time() + 900) . " GMT");
$im_size = GetImageSize ($ImageURL);
$imageWidth = $im_size[0];
$imageHeight = $im_size[1];
$im = ImageCreateFromPNG($ImageURL);
$text_color = imagecolorclosest ($im, $TextRed, $TextGreen, $TextBlue);
if ($TextX+$im_x>$imageWidth){$TextX=$imageWidth-$im_x-2;}
if ($TextY>$imageHeight){$TextY=$imageHeight-2;}
imagettftext ($im, $FontSize, 0, $TextX, $TextY, $text_color, $FontFile, $Text);
ImagePNG ($im);
ImageDestroy ($im);
}
?>
Someone left a note on a piece of cake in the fridge that said, "Do not eat!". I ate the cake and left a note saying, "Yuck, who the hell eats paper ?
whats GD?
might have a butchers when i get home, i've got PHP installed, but thats about it... is it just a copy and paste job of all that code into a file called like 'seti.php' ?
mark
edit - found http://php.weblogs.com/GD i guess thats it then
cheers barry, got it all sorted even without being able to code php, managed to work out what was going on (well a bit anyhow),
basically Big Al, download php 4.3.3 (7.15mb) which includes all the GD stuff, then copy and paste all that code barry put into notepad and save into a file like 'seti.php', edit the bit at the top - ie
that bit, and you might want to change the 'font' bit to something like tahoma (the default one didnt work for me..) and you are sortedCode://Setup Variables For Sig $UserEmail="big_al@hotmail.com"; $PreText="work units completed :"; $PostText="something here maybe"; $TextRed=255; $TextGreen=255; $TextBlue=255; $FontSize=15; $TextX=60; $TextY=40; $ImageURL="http://www.bigal.com/woop.jpg";
mark
im glad you got it working streetster, im not sure exactly how the php in my sig works.
It's the same php code, Just modified by buff on OCUK to allow a frontendOriginally Posted by quackers
Someone left a note on a piece of cake in the fridge that said, "Do not eat!". I ate the cake and left a note saying, "Yuck, who the hell eats paper ?
Originally Posted by Barry
Someone left a note on a piece of cake in the fridge that said, "Do not eat!". I ate the cake and left a note saying, "Yuck, who the hell eats paper ?
There are currently 1 users browsing this thread. (0 members and 1 guests)