EVGA

How-to: Dynamic Sig using GPU Tracker V2, EOC stats, EOC Graph

Page: < 12345.. > >> Showing page 3 of 7
Author
clifford_cooley
iCX Member
  • Total Posts : 463
  • Reward points : 0
  • Joined: 2010/11/03 18:40:27
  • Location: Arkansas, USA
  • Status: offline
  • Ribbons : 0
Re:How-to: Live Folding Signature 2011/01/22 19:16:36 (permalink)
What do you guys think about my first attempt?

Sleinous was kind enough to host my live signature.
Thanks Sleinous!!
 
  I have re-wrote the code a tad to show all clients that are not disabled. And instead of showing (Running, Stopped, Paused, or Disabled), the data is color coded depending on the state of the client.  Of coarse I only have two clients, so I shortened the signature width.
<?php  

$results = simpleXMLToArray(simplexml_load_file("status.xml"));

$oldppd=0;
$k=0;
$onoff=0;
for($i=0 ;$i<=9;$i++){
$newppd = $results['clients']['client'][$i]['ppd'];
if($newppd > $oldppd){
$oldppd=$newppd;
$k=$i;
}
}

$image = "evga-c_c.png";
$im = imagecreatefrompng($image);
$wc = ImageColorAllocate ($im, 255, 255, 255);
$black = ImageColorAllocate ($im, 0, 0, 0);
$green = ImageColorAllocate ($im, 0, 255, 0);
$red = ImageColorAllocate ($im, 223, 56, 5);
$yellow = ImageColorAllocate ($im, 255, 255, 0);

$leftalign=100;
$ColumnWidth=75;
$topalign=10;
$RowHeight=12;

ImageString($im, 4, $leftalign, $topalign+($RowHeight*1), 'Project:', $wc);
ImageString($im, 4, $leftalign, $topalign+($RowHeight*2), 'Points:', $wc);
ImageString($im, 4, $leftalign, $topalign+($RowHeight*3), 'Percent:', $wc);
ImageString($im, 4, $leftalign, $topalign+($RowHeight*4), 'PPD:', $wc);
ImageString($im, 4, $leftalign, $topalign+($RowHeight*5), 'TPF:', $wc);

$ECC=0;
for($i=0 ;$i<=9;$i++){$k=$i;
if($results['clients']['client'][$k]['status']!="Disabled"){$ECC++;
$ClientStatus = $results['clients']['client'][$k]['status'];
if($ClientStatus=="Running"){$CLR=$green;}; if($ClientStatus=="Paused"){$CLR=$yellow;};
if($ClientStatus=="Stopped"){$CLR=$red;}; if($ClientStatus=="Disabled"){$CLR=$wc;};
ImageString($im, 4, $leftalign+($ECC*$ColumnWidth), $topalign+($RowHeight*0), $results['clients']['client'][$k]['name'], $wc);
ImageString($im, 4, $leftalign+($ECC*$ColumnWidth), $topalign+($RowHeight*1), $results['clients']['client'][$k]['project'], $CLR);
ImageString($im, 4, $leftalign+($ECC*$ColumnWidth), $topalign+($RowHeight*2), $results['clients']['client'][$k]['points'], $CLR);
ImageString($im, 4, $leftalign+($ECC*$ColumnWidth), $topalign+($RowHeight*3), $results['clients']['client'][$k]['percent'], $CLR);
ImageString($im, 4, $leftalign+($ECC*$ColumnWidth), $topalign+($RowHeight*4), $results['clients']['client'][$k]['ppd'], $CLR);
ImageString($im, 4, $leftalign+($ECC*$ColumnWidth), $topalign+($RowHeight*5), $results['clients']['client'][$k]['tpf'], $CLR);
};
};


header("Content-Type: image/png");
Imagepng($im);
ImageDestroy ($im);
header("Content-Type: image/png");
Imagepng($im);
ImageDestroy ($im);

function simpleXMLToArray($xml,
$flattenValues=true,
$flattenAttributes = true,
$flattenChildren=true,
$valueKey='@value',
$attributesKey='@attributes',
$childrenKey='@children'){

$return=array();
if(!($xml instanceof SimpleXMLElement)){return $return;}
$name=$xml->getName();
$_value=trim((string)$xml);
if(strlen($_value)==0){$_value=null;};

if($_value!==null){
if(!$flattenValues){$return[$valueKey]=$_value;}
else{$return=$_value;}}

$children=array();
$first=true;
foreach($xml->children() as $elementName => $child){
$value=simpleXMLToArray($child, $flattenValues, $flattenAttributes, $flattenChildren, $valueKey, attributesKey, $childrenKey);
if(isset($children[$elementName])){
if($first){$temp=$children[$elementName];unset($children[$elementName]);$children[$elementName][]=$temp;$first=false;}
$children[$elementName][]=$value;}
else{$children[$elementName]=$value;}}
if(count($children)>0){
if(!$flattenChildren){$return[$childrenKey]=$children;}
else{$return=array_merge($return,$children);}}

$attributes = array();
foreach($xml->attributes() as $name=>$value){$attributes[$name]=trim($value);}
if(count($attributes)>0){
if(!$flattenAttributes){$return[$attributesKey]=$attributes;}
else{$return=array_merge($return, $attributes);}}

return $return;
}

?>

 
post edited by clifford_cooley - 2011/01/22 19:18:25
#61
unhappyelf
iCX Member
  • Total Posts : 321
  • Reward points : 0
  • Joined: 2008/09/24 19:55:01
  • Location: Houston, Tx
  • Status: offline
  • Ribbons : 1
Re:How-to: Live Folding Signature 2011/01/22 19:31:54 (permalink)
It looks good great job.
 
Its not an issue but this part
  header("Content-Type: image/png"); 
 Imagepng($im);
 ImageDestroy ($im);
 header("Content-Type: image/png");
 Imagepng($im);
 ImageDestroy ($im);

 
and be just
 header("Content-Type: image/png"); 
 Imagepng($im);
 ImageDestroy ($im);

 
You only need one per file.


#62
clifford_cooley
iCX Member
  • Total Posts : 463
  • Reward points : 0
  • Joined: 2010/11/03 18:40:27
  • Location: Arkansas, USA
  • Status: offline
  • Ribbons : 0
Re:How-to: Live Folding Signature 2011/01/22 19:43:27 (permalink)
Ahh - I never noticed that as I didn't really look at that part. 
Thanks :)
post edited by clifford_cooley - 2011/01/22 19:44:50
#63
Sleinous
EVGA Forum Moderator
  • Total Posts : 7663
  • Reward points : 0
  • Joined: 2010/06/12 12:22:01
  • Location: France
  • Status: offline
  • Ribbons : 32
Re:How-to: Live Folding Signature 2011/01/23 02:42:06 (permalink)
unhappyelf

It looks good great job.

Its not an issue but this part
  header("Content-Type: image/png");  
Imagepng($im);
ImageDestroy ($im);
header("Content-Type: image/png");
Imagepng($im);
ImageDestroy ($im);


and be just
 header("Content-Type: image/png");  
Imagepng($im);
ImageDestroy ($im);


You only need one per file.

 
Weird that, coz that bit that you said you only need one per file, on my original sig, when I only had one, it refused to work, when I put the relevant number it worked again. However, since the new sig youve given me it works a treat.
 
No probs about the hosting :)
 
Now for the log box ;)

My Affiliate Code: GL1IAAFWJF
#64
clifford_cooley
iCX Member
  • Total Posts : 463
  • Reward points : 0
  • Joined: 2010/11/03 18:40:27
  • Location: Arkansas, USA
  • Status: offline
  • Ribbons : 0
Re:How-to: Live Folding Signature 2011/01/23 02:52:25 (permalink)
This code will give you the log box.
$leftalign=10;  $topalign=1;  $RowHeight=9;

$LogText0=$results['log']['text'][0];
$LogText1=$results['log']['text'][1];
$LogText2=$results['log']['text'][2];
$LogText3=$results['log']['text'][3];
$LogText4=$results['log']['text'][4];
$LogText5=$results['log']['text'][5];
$LogText6=$results['log']['text'][6];
$LogText7=$results['log']['text'][7];
$LogText8=$results['log']['text'][8];
$LogText9=$results['log']['text'][9];

ImageString($im, 2, $leftalign, $topalign+($RowHeight*0), $LogText0, $wc);
ImageString($im, 2, $leftalign, $topalign+($RowHeight*1), $LogText1, $wc);
ImageString($im, 2, $leftalign, $topalign+($RowHeight*2), $LogText2, $wc);
ImageString($im, 2, $leftalign, $topalign+($RowHeight*3), $LogText3, $wc);
ImageString($im, 2, $leftalign, $topalign+($RowHeight*4), $LogText4, $wc);
ImageString($im, 2, $leftalign, $topalign+($RowHeight*5), $LogText5, $wc);
ImageString($im, 2, $leftalign, $topalign+($RowHeight*6), $LogText6, $wc);
ImageString($im, 2, $leftalign, $topalign+($RowHeight*7), $LogText7, $wc);
ImageString($im, 2, $leftalign, $topalign+($RowHeight*8), $LogText8, $wc);
ImageString($im, 2, $leftalign, $topalign+($RowHeight*9), $LogText9, $wc);


#65
Sleinous
EVGA Forum Moderator
  • Total Posts : 7663
  • Reward points : 0
  • Joined: 2010/06/12 12:22:01
  • Location: France
  • Status: offline
  • Ribbons : 32
Re:How-to: Live Folding Signature 2011/01/23 02:58:34 (permalink)
Im guessing I save it as a .png again?
 
EDIT: Nope that doesnt work :P
 
Does it get added to my current signature then? ^.^
post edited by Sleinous - 2011/01/23 03:00:18

My Affiliate Code: GL1IAAFWJF
#66
clifford_cooley
iCX Member
  • Total Posts : 463
  • Reward points : 0
  • Joined: 2010/11/03 18:40:27
  • Location: Arkansas, USA
  • Status: offline
  • Ribbons : 0
Re:How-to: Live Folding Signature 2011/01/23 03:09:04 (permalink)
Sleinous

Im guessing I save it as a .png again?

EDIT: Nope that doesnt work :P

Does it get added to my current signature then? ^.^

 
The ten lines that you duplicated, replace those lines with the above lines and then save as a different php.png.
#67
Sleinous
EVGA Forum Moderator
  • Total Posts : 7663
  • Reward points : 0
  • Joined: 2010/06/12 12:22:01
  • Location: France
  • Status: offline
  • Ribbons : 32
Re:How-to: Live Folding Signature 2011/01/23 03:14:41 (permalink)
You mean, all of the bit about stats?
 
Ohh I see! :P
 

post edited by Sleinous - 2011/01/23 03:16:33

My Affiliate Code: GL1IAAFWJF
#68
unhappyelf
iCX Member
  • Total Posts : 321
  • Reward points : 0
  • Joined: 2008/09/24 19:55:01
  • Location: Houston, Tx
  • Status: offline
  • Ribbons : 1
Re:How-to: Live Folding Signature 2011/01/23 09:15:27 (permalink)
Looks great you guys, good job.


#69
Sleinous
EVGA Forum Moderator
  • Total Posts : 7663
  • Reward points : 0
  • Joined: 2010/06/12 12:22:01
  • Location: France
  • Status: offline
  • Ribbons : 32
Re:How-to: Live Folding Signature 2011/01/23 09:21:49 (permalink)
Mine is working as it was meant to now thanks to both of you :D i will have to add extra parametres as new WUs come out. I also spotted a 474 instead of the usual 481, but I doubt that will need to be parametred as its tpf is similar to the 481 pointers.
 
Next step: a live protein folder :P Watch as the proteins are simulated!

My Affiliate Code: GL1IAAFWJF
#70
unhappyelf
iCX Member
  • Total Posts : 321
  • Reward points : 0
  • Joined: 2008/09/24 19:55:01
  • Location: Houston, Tx
  • Status: offline
  • Ribbons : 1
Re:How-to: Live Folding Signature 2011/01/23 09:24:45 (permalink)
Sleinous
Next step: a live protein folder :P Watch as the proteins are simulated!

That would be cool, but i don't know if it can be done.


#71
Sleinous
EVGA Forum Moderator
  • Total Posts : 7663
  • Reward points : 0
  • Joined: 2010/06/12 12:22:01
  • Location: France
  • Status: offline
  • Ribbons : 32
Re:How-to: Live Folding Signature 2011/01/23 10:01:58 (permalink)
Very much doubt it :P I think we've pretty much exhausted what the status.xml has to offer us btw. I didnt bother with timestamp but thats basically all the info it gives us :P

My Affiliate Code: GL1IAAFWJF
#72
tedster59
SSC Member
  • Total Posts : 815
  • Reward points : 0
  • Joined: 2010/02/19 19:03:21
  • Status: offline
  • Ribbons : 4
Re:How-to: Live Folding Signature 2011/01/23 18:52:05 (permalink)
EDIT: Nevermind, just saw the other thread.
 
post edited by tedster59 - 2011/01/23 18:53:12

Ted. folding paused temporarily (except on SR-2)
Splitting folding between EVGA and MPCHow to bake your GPU's

  
#73
clifford_cooley
iCX Member
  • Total Posts : 463
  • Reward points : 0
  • Joined: 2010/11/03 18:40:27
  • Location: Arkansas, USA
  • Status: offline
  • Ribbons : 0
Re:How-to: Live Folding Signature 2011/01/23 19:37:07 (permalink)
If anyone is interested in rotating the background image, here is the code that will do that.
 
Instead of placing your image name in this code.
$image = "image.png";

Place all images in an array. Replace the above code with this code.
 $img = array("image1.png","image2.png","image3.png");   $imgcnt = count($img)-1; $RndNum=rand(0, $imgcnt); $image = $img[$RndNum]; 
 
 
#74
Sleinous
EVGA Forum Moderator
  • Total Posts : 7663
  • Reward points : 0
  • Joined: 2010/06/12 12:22:01
  • Location: France
  • Status: offline
  • Ribbons : 32
Re:How-to: Live Folding Signature 2011/01/24 06:08:25 (permalink)
tedster59

EDIT: Nevermind, just saw the other thread.


Im guessing you mean HFM ;) You'd already edited before i'd had time to read what you'd originally put.
 
Nice slideshow btw clifford :)

My Affiliate Code: GL1IAAFWJF
#75
clifford_cooley
iCX Member
  • Total Posts : 463
  • Reward points : 0
  • Joined: 2010/11/03 18:40:27
  • Location: Arkansas, USA
  • Status: offline
  • Ribbons : 0
Re:How-to: Live Folding Signature 2011/02/28 18:57:24 (permalink)
Bump for those that did not see this thread.
#76
jedi95
SSC Member
  • Total Posts : 773
  • Reward points : 0
  • Joined: 2008/03/04 05:43:23
  • Status: offline
  • Ribbons : 18
Re:How-to: Live Folding Signature 2011/02/28 20:02:07 (permalink)
Sleinous

Very much doubt it :P I think we've pretty much exhausted what the status.xml has to offer us btw. I didnt bother with timestamp but thats basically all the info it gives us :P

 
I can add more info to it if needed, but I don't know what else you would want to have.

Main Rig: Ryzen 9 5950X|EVGA RTX 3090 FTW3 Ultra|32 GB DDR4 3800 CL14

#77
clifford_cooley
iCX Member
  • Total Posts : 463
  • Reward points : 0
  • Joined: 2010/11/03 18:40:27
  • Location: Arkansas, USA
  • Status: offline
  • Ribbons : 0
Re:How-to: Live Folding Signature 2011/03/01 06:35:57 (permalink)
The EOC stats would be nice. :D
#78
Sleinous
EVGA Forum Moderator
  • Total Posts : 7663
  • Reward points : 0
  • Joined: 2010/06/12 12:22:01
  • Location: France
  • Status: offline
  • Ribbons : 32
Re:How-to: Live Folding Signature 2011/03/01 07:18:59 (permalink)
Yep EOC, umm, total points folded for particular team as well as 24h would be fantastic :P

My Affiliate Code: GL1IAAFWJF
#79
unhappyelf
iCX Member
  • Total Posts : 321
  • Reward points : 0
  • Joined: 2008/09/24 19:55:01
  • Location: Houston, Tx
  • Status: offline
  • Ribbons : 1
Re:How-to: Live Folding Signature 2011/03/01 09:17:27 (permalink)
I would add EOC but I need to redo the code to keep track of the time because to use EOC's xml file it can only be accessed once an hour.


#80
Sleinous
EVGA Forum Moderator
  • Total Posts : 7663
  • Reward points : 0
  • Joined: 2010/06/12 12:22:01
  • Location: France
  • Status: offline
  • Ribbons : 32
Re:How-to: Live Folding Signature 2011/03/01 09:26:05 (permalink)
hmmm thats still ok :D

My Affiliate Code: GL1IAAFWJF
#81
clifford_cooley
iCX Member
  • Total Posts : 463
  • Reward points : 0
  • Joined: 2010/11/03 18:40:27
  • Location: Arkansas, USA
  • Status: offline
  • Ribbons : 0
Re:How-to: Live Folding Signature 2011/03/01 16:33:18 (permalink)
unhappyelf

I would add EOC but I need to redo the code to keep track of the time because to use EOC's xml file it can only be accessed once an hour.

Thats why it would be nice for Jedi to access the EOC stats once an hour and then add the data to his XML output file.
#82
unhappyelf
iCX Member
  • Total Posts : 321
  • Reward points : 0
  • Joined: 2008/09/24 19:55:01
  • Location: Houston, Tx
  • Status: offline
  • Ribbons : 1
Re:How-to: Live Folding Signature 2011/03/01 16:39:05 (permalink)
if jedi can do that then awesome. If not I could give it a shot


#83
unhappyelf
iCX Member
  • Total Posts : 321
  • Reward points : 0
  • Joined: 2008/09/24 19:55:01
  • Location: Houston, Tx
  • Status: offline
  • Ribbons : 1
Re:How-to: Live Folding Signature 2011/03/05 19:24:12 (permalink)
Sleinous

Yep EOC, umm, total points folded for particular team as well as 24h would be fantastic :P

 
Ok, yall I got what you wanted working. However this does require the use of a sql database to store the EOC values to.This script will check EOC every 3 hours for new information.Here is a little how-to. 
 
Requirements:
Already Working Stats Banner as described on the first page
MySQL
 
1. Paste All of this above the rest of your program in your php file and change the variables $eoc_id, $db_user and $db_pass.
 
 
 
   
//******************************************************************************************************************************
//Everything From Here to the stars is for the mysql database
//eoc id
$eoc_id = "Put Folding # here"; 
//mysql information
$db_ip = "localhost";
$db_user = "Put Database Username here";
$db_pass = "Put DataBase password heref";
//connect to database
$con = mysql_connect($db_ip,$db_user,$db_pass);
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
//does datatbase exist
mysql_query("CREATE DATABASE IF NOT EXISTS my_db",$con);
//does table exist
mysql_select_db("my_db", $con);
$sql = "CREATE TABLE IF NOT EXISTS Time(Lasttimequeried int,Username varchar(15),Points int,PointsToday int, PointsWeek int, PointsAvg int, TeamRank int, Workunits int)";
// Execute query
mysql_query($sql,$con);
//PHP time and insert time
$time = time();
$result = mysql_query("SELECT * FROM Time");
$row = mysql_fetch_array($result);
if($row['Lasttimequeried'] == NULL){
$eoc = simpleXMLToArray(simplexml_load_file("http://folding.extremeoverclocking.com/xml/user_summary.php?s=&u=$eoc_id"));
$un = $eoc['user']['User_Name'];
$pts = $eoc['user']['Points'];
$ptsday = $eoc['user']['Points_Today'];
$ptsweek = $eoc['user']['Points_Week'];
$ptsavg = $eoc['user']['Points_24hr_Avg'];
$teamrank = $eoc['user']['Team_Rank'];
$wu = $eoc['user']['WUs'];
mysql_query("INSERT INTO Time(Lasttimequeried, Username, Points, PointsToday, PointsWeek, PointsAvg, TeamRank, Workunits) VALUES('$time', '$un', '$pts', '$ptsday', '$ptsweek', '$ptsavg', '$teamrank', '$wu')");
}
if($time > ($row['Lasttimequeried']+10800)){ 
$eoc = simpleXMLToArray(simplexml_load_file("http://folding.extremeoverclocking.com/xml/user_summary.php?s=&u=$eoc_id")); 
$pts = $eoc['user']['Points']; 
$ptsday = $eoc['user']['Points_Today']; 
$ptsweek = $eoc['user']['Points_Week']; 
$ptsavg = $eoc['user']['Points_24hr_Avg']; 
$teamrank = $eoc['user']['Team_Rank']; 
$wu = $eoc['user']['WUs']; 
mysql_query("UPDATE Time SET Lasttimequeried=$time"); 
mysql_query("UPDATE Time SET Points=$pts"); 
mysql_query("UPDATE Time SET PointsToday=$ptsday"); 
mysql_query("UPDATE Time SET PointsWeek=$ptsweek"); 
mysql_query("UPDATE Time SET PointsAvg=$ptsavg"); 
mysql_query("UPDATE Time SET TeamRank=$teamrank"); 
mysql_query("UPDATE Time SET Workunits=$wu"); 
$row = mysql_fetch_array($result); 
}
mysql_close($con);
//***********************************************************************************************************************************



2. Now Put this in with the rest of your ImageStrings
 
   
//***********************************************************************************************************************************
//this is also for the database
ImageString($im, 3, 420, 5, "Total Points", $wc);
ImageString($im, 3, 420, 20, "24h Points", $wc);
ImageString($im, 3, 420, 35, "Weekly Points", $wc);
ImageString($im, 3, 420, 50, "Team Rank", $wc);
ImageString($im, 3, 420, 65, "WUs", $wc);
ImageString($im, 3, 520, 5, $row['Points'], $wc);
ImageString($im, 3, 520, 20, $row['PointsToday'], $wc);
ImageString($im, 3, 520, 35, $row['PointsWeek'], $wc);
ImageString($im, 3, 520, 50, $row['TeamRank'], $wc);
ImageString($im, 3, 520, 65, $row['Workunits'], $wc);
//***********************************************************************************************************************************


3. Change above numbers to suit your banner

4. Done Enjoy
 
Let me know if there are any problems as this is pretty fresh code and largely untested.
Thanks
Elf
post edited by unhappyelf - 2011/03/06 21:58:45


#84
jedi95
SSC Member
  • Total Posts : 773
  • Reward points : 0
  • Joined: 2008/03/04 05:43:23
  • Status: offline
  • Ribbons : 18
Re:How-to: Live Folding Signature 2011/03/05 22:20:26 (permalink)
Adding EOC stats to status.xml would require quite a bit of work because the Tracker doesn't get EOC stats. I  might add it eventually, but only if I do a full EOC stats implementation in the Tracker's GUI.
post edited by jedi95 - 2011/03/05 22:22:58

Main Rig: Ryzen 9 5950X|EVGA RTX 3090 FTW3 Ultra|32 GB DDR4 3800 CL14

#85
MrAsh
iCX Member
  • Total Posts : 358
  • Reward points : 0
  • Joined: 2010/06/25 23:39:22
  • Location: Australia
  • Status: offline
  • Ribbons : 2
Re:How-to: Live Folding Signature 2011/03/06 02:07:07 (permalink)
I have been playing with this and got it working, but I am now trying to use the number_format function in php to get commas in the numbers for easier reading.
$pointsdec = number_format('Points');

then I changed the image  string to
ImageString($im,4, 510, 140, $row['$Pointsdec'], $wc);

Am I going in the right direction with this or is it something that cannot be done with this code?  I have basically nill to FA knowledge in coding so any help would be appreciated.


#86
Sleinous
EVGA Forum Moderator
  • Total Posts : 7663
  • Reward points : 0
  • Joined: 2010/06/12 12:22:01
  • Location: France
  • Status: offline
  • Ribbons : 32
Re:How-to: Live Folding Signature 2011/03/06 02:38:57 (permalink)
no probs on the sql database, my server can also make one infact I just deleted one thats no longer needed.

My Affiliate Code: GL1IAAFWJF
#87
unhappyelf
iCX Member
  • Total Posts : 321
  • Reward points : 0
  • Joined: 2008/09/24 19:55:01
  • Location: Houston, Tx
  • Status: offline
  • Ribbons : 1
Re:How-to: Live Folding Signature 2011/03/06 08:02:55 (permalink)
MrAsh

I have been playing with this and got it working, but I am now trying to use the number_format function in php to get commas in the numbers for easier reading.
$pointsdec = number_format('Points');

then I changed the image  string to
ImageString($im,4, 510, 140, $row['$Pointsdec'], $wc);

Am I going in the right direction with this or is it something that cannot be done with this code?  I have basically nill to FA knowledge in coding so any help would be appreciated.

 
If I had to guess I would bet it was
$pointsdec = number_format($row['Points']);

 
then
ImageString($im,4, 510, 140, $Pointsdec, $wc);
 
 
or you could just do it all in one line
ImageString($im,4, 510, 140, number_format($row['Points']), $wc);

post edited by unhappyelf - 2011/03/06 08:35:54


#88
MrAsh
iCX Member
  • Total Posts : 358
  • Reward points : 0
  • Joined: 2010/06/25 23:39:22
  • Location: Australia
  • Status: offline
  • Ribbons : 2
Re:How-to: Live Folding Signature 2011/03/06 12:20:41 (permalink)
Thanks that has done the job, I had tried putting the number_format into the string but didn't know where it had to go or where to put the brackets.


#89
unhappyelf
iCX Member
  • Total Posts : 321
  • Reward points : 0
  • Joined: 2008/09/24 19:55:01
  • Location: Houston, Tx
  • Status: offline
  • Ribbons : 1
Re:How-to: Live Folding Signature 2011/03/06 19:29:15 (permalink)
Sorry for some reason I can edit the code without it turning into one line.
 
Change the if statement with "if($time > ($row['Lasttimequeried']+10800))" to:
 

if($time > ($row['Lasttimequeried']+10800)){
$eoc = simpleXMLToArray(simplexml_load_file("http://folding.extremeoverclocking.com/xml/user_summary.php?s=&u=$eoc_id"));
$pts = $eoc['user']['Points'];
$ptsday = $eoc['user']['Points_Today'];
$ptsweek = $eoc['user']['Points_Week'];
$ptsavg = $eoc['user']['Points_24hr_Avg'];
$teamrank = $eoc['user']['Team_Rank'];
$wu = $eoc['user']['WUs'];
mysql_query("UPDATE Time SET Lasttimequeried=$time");
mysql_query("UPDATE Time SET Points=$pts");
mysql_query("UPDATE Time SET PointsToday=$ptsday");
mysql_query("UPDATE Time SET PointsWeek=$ptsweek");
mysql_query("UPDATE Time SET PointsAvg=$ptsavg");
mysql_query("UPDATE Time SET TeamRank=$teamrank");
mysql_query("UPDATE Time SET Workunits=$wu");
$row = mysql_fetch_array($result);
}



#90
Page: < 12345.. > >> Showing page 3 of 7
Jump to:
  • Back to Mobile