These forums have been archived and are now read-only.
The new forums are live and can be found at https://forums.eveonline.com/
Shares Programm help
$corporationurl="https://api.eveonline.com/corp/CorporationSheet.xml.aspx?corporationID=".$corpid;
$walleturl="https://api.eveonline.com/corp/AccountBalance.xml.aspx?keyID=".$key."&vcode=".$vcode."&characterID=".$character;
$shareholdersurl="https://api.eveonline.com/corp/Shareholders.xml.aspx?keyID=".$key."&vcode=".$vcode."&characterID=".$character;
$walletsql="insert into balance (balance,shares,pointtime) values (?,?,DATE_SUB(DATE_SUB(now(), INTERVAL MINUTE(now()) MINUTE ),INTERVAL SECOND(now()) SECOND))";$stmt = $dbh->prepare($walletsql);$stmt->execute(array($balance,$shares));$shareholderres=get($shareholdersurl);$shareholderxml=new SimpleXMLElement($shareholderres);$charactershareholders=$shareholderxml->xpath('//rowset[@name="characters"]');$corpshareholders=$shareholderxml->xpath('//rowset[@name="corporations"]');$checksum=md5(json_encode($charactershareholders)).md5(json_encode($corpshareholders));$checksumsql="select checksum from shareholderchecksum order by id desc limit 1";$stmt = $dbh->prepare($checksumsql);$stmt->execute();if ($row=$stmt->fetchObject()){ if ( $row->checksum==$checksum) { # Shareholders haven't changed since last time. exit; }}$checksumsql="insert into shareholderchecksum (checksum) values (?)";$stmt = $dbh->prepare($checksumsql);$stmt->execute(array($checksum));$addshareholder="insert into shareholders (type,name,eveid,shares,lastupdate) values (?,?,?,?,now())";$stmt = $dbh->prepare($addshareholder);foreach ($charactershareholders[0]->row as $character){ $stmt->execute(array(0,$character->attributes()->shareholderName,$character->attributes()->shareholderID,$character->attributes()->shares));}foreach ($corpshareholders[0]->row as $corp){ $stmt->execute(array(1,$corp->attributes()->shareholderName,$corp->attributes()->shareholderID,$corp->attributes()->shares));}
Developer of EVEmail