当前位置: 首页>>代码示例>>PHP>>正文


PHP api::getCharacterID方法代码示例

本文整理汇总了PHP中api::getCharacterID方法的典型用法代码示例。如果您正苦于以下问题:PHP api::getCharacterID方法的具体用法?PHP api::getCharacterID怎么用?PHP api::getCharacterID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在api的用法示例。


在下文中一共展示了api::getCharacterID方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setImageLinks

 private function setImageLinks()
 {
     // Load the API for the user.
     $api = new api($this->ID);
     // Set/Get the image.
     if ($api->valid()) {
         $this->smallPicUrl = "<img src=\"https://image.eveonline.com/Character/" . $api->getCharacterID() . "_64.jpg\">";
         $this->largePicUrl = "<img src=\"https://image.eveonline.com/Character/" . $api->getCharacterID() . "_256.jpg\">";
     }
 }
开发者ID:nuxi,项目名称:MiningBuddy,代码行数:10,代码来源:profile_class.php

示例2: __construct

 public function __construct()
 {
     // Construct a different html for ingame and the out-of-game browser.
     global $IGB;
     global $VERSION;
     global $MySelf;
     global $TIDY_ENABLE;
     global $width;
     global $URL;
     global $IGB_VISUAL;
     // Enable tidy, if we want to.
     $this->useTidy = $TIDY_ENABLE;
     // In case we are not logged in, or the object does not exist yet.
     if (!is_object($MySelf)) {
         $MySelf = new user(false, false);
     }
     if ($IGB && $IGB_VISUAL) {
         // Use IGB, set header and footer.
         $this->isIGB = true;
         //			$this->header = file_get_contents('./include/ingame/igb-header.txt');
         $this->header = file_get_contents('./include/ingame/igb-header.php');
         if ($MySelf->isValid()) {
             $this->header .= makeMenu();
             $this->header = str_replace("%%RANK%%", $MySelf->getRankName(), $this->header);
             $this->header = str_replace("%%CREDITS%%", number_format(getCredits($MySelf->getID()), 2) . " ISK", $this->header);
             $this->header = str_replace("%%USERNAME%%", ucfirst($MySelf->getUsername()), $this->header);
         }
         $this->header = str_replace("%%SITENAME%%", getConfig("sitename"), $this->header);
         //			$this->footer = file_get_contents('./include/ingame/igb-footer.txt');
         $this->footer = file_get_contents('./include/ingame/igb-footer.php');
         $this->footer = str_replace("%%VERSION%%", $VERSION, $this->footer);
     } else {
         // Use normal browser.
         $this->isIGB = false;
         if ($MySelf->isValid() == 1) {
             //				$this->header = file_get_contents('./include/html/header.txt');
             $this->header = file_get_contents('./include/html/header.php');
         } else {
             //				$this->header = file_get_contents('./include/html/header-notloggedin.txt');
             $this->header = file_get_contents('./include/html/header-notloggedin.php');
         }
         //			$this->footer = file_get_contents('./include/html/footer.txt');
         $domainroot = $_SERVER['HTTP_HOST'];
         // Add page footer
         // use proper footer for sponcered sites.
         if ($domainroot == "miningbuddy.us" or $domainroot == "miningbuddy.de" or $domainroot == "miningbuddy.net") {
             $this->footer = file_get_contents('./include/html/mbh-footer.php');
         } else {
             $this->footer = file_get_contents('./include/html/footer.php');
         }
         // Generate the images.
         $mainLogo = new graphic("title");
         $mainLogo->setText(getConfig("sitename"));
         $mainLogo->setBGColor("2D2D37");
         // this is here to retain some code. Image caching seemed to be pretty useless.
         $imageCaching = false;
         if ($imageCaching) {
             $loginLogo = new graphic("standard");
             $loginLogo->setText(ucfirst($MySelf->getUsername()));
             $loginLogo->setBGColor("2D2D37");
             $loginLogo->setPrefixed(false);
             $versionLogo = new graphic("long");
             $versionLogo->setText($VERSION);
             $versionLogo->setBGColor("2D2D37");
             $versionLogo->setPrefixed(false);
             $rankLogo = new graphic("standard");
             $rankLogo->setText($MySelf->getRankName());
             $rankLogo->setBGColor("2D2D37");
             $rankLogo->setPrefixed(false);
             $moneyLogo = new graphic("standard");
             $moneyLogo->setText(number_format(getCredits($MySelf->getID()), 2) . " ISK");
             $moneyLogo->setDirect(true);
             $moneyLogo->setBGColor("2D2D37");
             $moneyLogo->setPrefixed(false);
         }
         // Replace variables in the header.
         $this->header = str_replace("%%SITENAME%%", getConfig("sitename") . " - " . $VERSION, $this->header);
         $this->header = makeMenu($this->header);
         $thisCharacterID = "";
         if ($MySelf->isValid()) {
             $api = new api($MySelf->getID());
             $thisCharacterID = $api->getCharacterID();
         }
         if ($thisCharacterID == "") {
             $this->header = str_replace("%%PILOT64%%", "", $this->header);
         } else {
             $this->header = str_replace("%%PILOT64%%", "<img width='64' height='64' align='left' src='https://image.eveonline.com/Character/" . $api->getCharacterID() . "_64.jpg' />", $this->header);
         }
         $this->header = str_replace("%%LOGO%%", $mainLogo->render(), $this->header);
         if ($imageCaching) {
             $this->header = str_replace("%%LOGGEDIN%%", $loginLogo->render(), $this->header);
             //
             $this->header = str_replace("%%RANK%%", $rankLogo->render(), $this->header);
             $this->header = str_replace("%%CREDITS%%", $moneyLogo->render(), $this->header);
             $this->footer = str_replace("%%IMG%%", $versionLogo->render(), $this->footer);
         } else {
             $this->header = str_replace("%%LOGGEDIN%%", "&nbsp;&nbsp;" . ucfirst($MySelf->getUsername()), $this->header);
             $this->header = str_replace("%%RANK%%", "&nbsp;&nbsp;" . $MySelf->getRankName(), $this->header);
             $this->header = str_replace("%%CREDITS%%", "&nbsp;&nbsp;" . number_format(getCredits($MySelf->getID()), 2) . " ISK", $this->header);
             $this->footer = str_replace("%%IMG%%", $VERSION, $this->footer);
//.........这里部分代码省略.........
开发者ID:nuxi,项目名称:MiningBuddy,代码行数:101,代码来源:html_class.php

示例3: profile


//.........这里部分代码省略.........
    	// Now query it.
    	$totalOREDB = $DB->query("$SQL");
    	
    
    if (DB::isError($totalOREDB)) {
        *
         * This is not what you would really want to do in
         * your program.  It merely demonstrates what kinds
         * of data you can get back from error objects.
         *
        echo 'Standard Message: ' . $totalOREDB->getMessage() . "\n";
        echo '\n ';
        echo 'Standard Code: ' . $totalOREDB->getCode() . "\n";
        echo '\n ';
        echo 'DBMS/User Message: ' . $totalOREDB->getUserInfo() . "\n";
        echo '\n ';
        echo 'DBMS/Debug Message: ' . $totalOREDB->getDebugInfo() . "\n";
        echo '\n ';
        exit;
    }
    
    	// Create table.
    	$totalOre_table = new table(2, true);
    	$totalOre_table->addHeader(">> Total ore hauled");
    
    	// Loop through the result (single result!)
    	if ($totalOREDB->numRows() > 0) {
    		while ($totalORE = $totalOREDB->fetchRow()) {
    			// Now check each ore type.
    			foreach ($ORENAMES as $ORE) {
    				// And ignore never-hauled ore
    				if ($totalORE[total . $ORE] > 0) {
    					// We got some ore!
    					$totalOre_table->addRow();
    					$totalOre_table->addCol("<img width=\"20\" height=\"20\" src=\"./images/ores/" . $ORE . ".png\">Total " . $ORE . " hauled:");
    					$totalOre_table->addCol(number_format($totalORE[total . $ORE]));
    					$gotOre = true;
    				}
    			}
    		}
    		if ($gotOre) {
    			$oretable_r = "<br>" . $totalOre_table->flush();
    		}
    	}
    */
    // Image thingy.
    // We serve small images IGB.
    global $IGB;
    global $IGB_VISUAL;
    if ($IGB && $IGB_VISUAL) {
        $image = "<img src=\"portrait:" . $api->getCharacterID() . "\" SIZE=\"128\">";
    } else {
        $image = $profile->getImage("large");
    }
    $picTable = new table(true, 1);
    $picTable->addHeader(">> Picture of " . $username);
    $picTable->addRow();
    $picTable->addCol($image);
    $imageTable = $picTable->flush();
    // About
    if ($profile->GetAbout() && !$profile->isOwn()) {
        $aboutTable = new table(1, true);
        $aboutTable->addHeader(">> " . $username . " says...");
        $aboutTable->addRow();
        $aboutTable->addCol(nl2br($profile->GetAbout()));
        $aboutTable = "<br>" . $aboutTable->flush();
    }
    if ($profile->isOwn()) {
        $aboutTable = new table(1, true);
        $aboutTable->addHeader(">> Enter a public viewable text here");
        $aboutTable->addRow();
        $form = "<form action=\"index.php\" method=\"POST\">";
        $form .= "<input type=\"hidden\" name=\"check\" value=\"true\">";
        $form .= "<input type=\"hidden\" name=\"action\" value=\"modprofile\">";
        $form .= "<input type=\"hidden\" name=\"id\" value=\"" . $ID . "\">";
        $aboutTable->addCol("<textarea rows=\"18\" cols=\"80\" name=\"about\">" . $profile->GetAbout() . "</textarea>");
        $aboutTable->addHeaderCentered("<input type=\"submit\" name=\"submit\" value=\"Update about\">");
        $aboutTable = "<br>" . $form . $aboutTable->flush() . "</form>";
    }
    // quick "jump to" -thingy.
    $peeps = $DB->query("SELECT DISTINCT username,id FROM users WHERE deleted = 0 AND canLogin = 1 ORDER BY username ASC");
    if ($peeps->numRows() > 0) {
        while ($p = $peeps->fetchRow()) {
            if ($ID == $p[id]) {
                $pdm .= "<option SELECTED value=\"" . $p[id] . "\">" . ucfirst($p[username]) . " (current)</option>";
            } else {
                $pdm .= "<option value=\"" . $p[id] . "\">" . ucfirst($p[username]) . "</option>";
            }
        }
        $pdm = "<select name=\"id\">" . $pdm . "</select></form>";
        $quickChooser = new table(1, true);
        $quickChooser->addHeader(">> Quick jump to profile");
        $quickChooser->addRow();
        $quickChooser->addCol($pdm);
        $quickChooser->addHeaderCentered("<input type=\"submit\" name=\"submit\" value=\"Switch\">");
        $quickChooser = "<form action=\"index.php\" method=\"GET\"><input type=\"hidden\" name=\"action\" value=\"profile\">" . $quickChooser->flush() . "</form>";
    }
    $page = "<h2>View profile</h2>" . $quickChooser . $imageTable . "<br>" . $table->flush() . "<br>" . $stats->flush() . $oretable_r . $aboutTable;
    return $page;
}
开发者ID:nuxi,项目名称:MiningBuddy,代码行数:101,代码来源:profile.php

示例4: listUser


//.........这里部分代码省略.........
                $table->addCol("<b>WARNING!</b><br> The User has not yet verified this email yet! If you choose to enable" . " this account at this time, be very sure that you know the person requesting the account!", array("bgcolor" => "#662222"));
            } else {
                $table->addCol("<br><br><b>The user validated the email address.</b><br>");
            }
        } else {
            $table->addRow();
            $table->addCol("This account has been confirmed.");
            if ("{$row['emailvalid']}" == "0") {
                $table->addCol("<font color=\"#ff0000\">WARNING!</b></font><br> The User has not verified this email but the account has been confirmed!");
                // Add a "confirm email" checkbox.
                $table->addRow();
                $table->addCol("Mark users email as valid:");
                $table->addCol("<input type=\"checkbox\" name=\"SetEmailValid\" value=\"true\">");
            } else {
                $table->addCol("The user validated the supplied email address.");
            }
        }
        /*
         * API Goodness
         */
        $api = new api($row[id], true);
        $apit = new table(2, true);
        $apit->addHeader(">> Api information for " . ucfirst($row[username]));
        $apit->addRow();
        $apit->addCol("API Key in database:");
        if ($api->getApiID() && $api->getApiKey()) {
            $apit->addCol(yesno(1, true));
            $apit->addRow();
            $apit->addCol("API valid:");
            $apit->addCol(yesno($api->valid(), true));
            if ($api->valid()) {
                $apit->addRow();
                $apit->addCol("Character ID:");
                $apit->addCol($api->getCharacterID());
                $apit->addRow();
                $apit->addCol("Validated on:");
                $apit->addCol(date("d.m.Y H:i:s", $api->validatedOn()));
            }
            $apit->addRow();
            $apit->addCol("Remove API key from database:");
            $apit->addCol("[<a href=\"index.php?action=delapi&id={$id}\">delete api key</a>]");
        } else {
            $apit->addCol(yesno(0));
        }
        // Permissions matrix
        $perms = array("canLogin" => "log in", "canJoinRun" => "join mining Ops", "canCreateRun" => "create new mining Ops", "canCloseRun" => "close mining Ops", "canDeleteRun" => "delete mining Ops", "canAddHaul" => "haul from/to mining Ops", "canSeeEvents" => "view scheduled events", "canDeleteEvents" => "can delete events", "canEditEvents" => "add and delete scheduled events", "canChangePwd" => "change his own password", "canChangeEmail" => "change his own email", "canChangeOre" => "manage ore prices and enable/disable them.", "canAddUser" => "add new accounts", "canSeeUsers" => "see other accounts", "canDeleteUser" => "delete other accounts.", "canEditRank" => "edit other peoples ranks.", "canManageUser" => "grant and take permissions.", "isOfficial" => "create official mining runs (with payout).", "isAdmin" => "edit site settings.", "isLottoOfficial" => "administrate the lottery", "canPlayLotto" => "play Lotto!", "isAccountant" => "edit other users credits.", "optIn" => "User has opt-in to eMails.");
        // Create a seperate permissions table.
        $perm_table = new table(2, true);
        $perm_table->addHeader(">> " . ucfirst($row[username]) . " has permission to... ");
        $perm_keys = array_keys($perms);
        $LoR = 1;
        foreach ($perm_keys as $key) {
            if ($LoR) {
                $perm_table->addRow();
            }
            if ($row[$key]) {
                $perm_table->addCol("<input type=\"checkbox\" name=\"{$key}\" checked> " . $perms[$key]);
            } else {
                $perm_table->addCol("<input type=\"checkbox\" name=\"{$key}\"> " . $perms[$key]);
            }
            $LoR = 1 - $LoR;
        }
        if (!$LoR) {
            $perm_table->addCol();
        }
        // Delete User
开发者ID:nuxi,项目名称:MiningBuddy,代码行数:67,代码来源:listUser.php

示例5: payout

function payout()
{
    // Some globals needed.
    global $DB;
    global $TIMEMARK;
    global $MySelf;
    global $IGB;
    global $IGB_VISUAL;
    // Are we allowed to do this?
    if (!$MySelf->isAccountant()) {
        makeNotice("You are not an accountant to your corporation. Access denied.", "error", "Access denied");
    }
    /*
     * Amount of ISK owned.
     */
    $iskOwned = new table(2, true);
    $iskOwned->addHeader(">> Outstanding ISK");
    // Load all unique members from the database.
    $uniqeMembers = $DB->query("SELECT DISTINCT id FROM users WHERE deleted='0' ORDER BY username ASC");
    // Create a row for each member.
    while ($id = $uniqeMembers->fetchRow()) {
        $playerCreds = getCredits($id['id']);
        // We need this later on...
        $allPeeps[$id['id']] = ucfirst(idToUsername($id['id']));
        // if the member has more or less than zero isk, list him.
        if ($playerCreds != 0) {
            $iskOwned->addRow();
            $iskOwned->addCol("<a href=\"index.php?action=showTransactions&id=" . $id['id'] . "\">" . $allPeeps[$id['id']] . "</a>");
            $iskOwned->addCol(number_format($playerCreds, 2) . " ISK");
        }
    }
    // Show the total isk owned.
    $outstanding = totalIskOwned();
    $iskOwned->addRow("#060622");
    $iskOwned->addCol(">> Total Outstanding ISK:");
    $iskOwned->addCol(totalIskOwned() . " ISK");
    /*
     * Show a drop down menu to create a menu to see everyones transaction log.
     */
    $freeSelect = new table(2, true);
    $freeSelect->addHeader(">> Lookup specific transaction log");
    // Create a PDM for all the peoples.
    foreach ($allPeeps as $peep) {
        $pdm .= "<option value=\"" . array_search($peep, $allPeeps) . "\">{$peep}</option>";
    }
    $freeSelect->addRow();
    $freeSelect->addCol("Show log of ", array("align" => "right"));
    $freeSelect->addCol("<select name=\"id\">{$pdm}</select>");
    $freeSelect->addHeaderCentered("<input type=\"submit\" name=\"submit\" value=\"Lookup log in Database\">");
    unset($pdm);
    /*
     * Show current requests
     */
    $requests = $DB->query("SELECT * FROM payoutRequests WHERE payoutTime IS NULL ORDER BY time DESC");
    if ($IGB && $IGB_VISUAL) {
        $table = new table(6, true);
    } else {
        $table = new table(5, true);
    }
    $table->addHeader(">> Pending payout requests");
    $table->addRow("#060622");
    $table->addCol("request");
    $table->addCol("applicant");
    if ($IGB && $IGB_VISUAL) {
        $table->addCol("right click menu");
    }
    $table->addCol("time");
    $table->addCol("amount");
    $table->addCol("Payout");
    while ($request = $requests->fetchRow()) {
        if ($IGB && $IGB_VISUAL) {
            $api = new api($request['applicant']);
            //			$profile = new profile($request['applicant']);
            if ($api->valid() && ($IGB && $IGB_VISUAL)) {
                $rcm = " [<a href=\"showinfo:1378//" . $api->getCharacterID() . "\">RCM</a>]";
            }
        }
        $table->addRow();
        $table->addCol("#" . str_pad($request['request'], "5", "0", STR_PAD_LEFT));
        $table->addCol("<a href=\"index.php?action=showTransactions&id={$request['applicant']}\">" . ucfirst(idToUsername($request['applicant'])) . "</a>");
        if ($IGB && $IGB_VISUAL) {
            $table->addCol($rcm);
        }
        $table->addCol(date("d.m.y H:i:s", $request['time']));
        if (getCredits($request['applicant']) < $request['amount']) {
            $class .= "red";
        }
        if ($IGB && $IGB_VISUAL) {
            $table->addCol("<input type=\"text\" class=\"{$class}\" name=\"dumb\" readonly value=\"" . number_format($request['amount'], 2) . "\"> ISK");
        } else {
            $table->addCol(number_format($request['amount'], 2) . " ISK", array("class" => $class));
        }
        // Can the user still cover his request with cash?
        $table->addCol("<input type=\"checkbox\" name=\"" . $request['request'] . "\" value=\"true\">");
        $haveRequest = true;
        //} else {
        //	$table->addCol("<i>not enough ISK</i>");
        //}
    }
    $table->addHeaderCentered("<input type=\"submit\" name=\"submit\" value=\"Mark as paid\">");
//.........这里部分代码省略.........
开发者ID:nuxi,项目名称:MiningBuddy,代码行数:101,代码来源:payout.php

示例6: makePreferences


//.........这里部分代码省略.........
    $page .= "<input type=\"hidden\" name=\"check\" value=\"check\">";
    $page .= "<input type=\"hidden\" name=\"action\" value=\"optIn\"></form>";
    $page .= "<form action=\"index.php\" method=\"POST\">";
    $page .= $sir_table->flush();
    $page .= "<input type=\"hidden\" name=\"check\" value=\"check\">";
    $page .= "<input type=\"hidden\" name=\"action\" value=\"sirchange\"></form>";
    if ($MySelf->canChangeEmail()) {
        $page .= "<form action=\"index.php\" method=\"post\">";
        $page .= $email_table->flush();
        $page .= "<input type=\"hidden\" name=\"action\" value=\"changeemail\">";
        $page .= "<input type=\"hidden\" name=\"check\" value=\"check\">";
        $page .= "</form>";
    }
    if ($MySelf->canChangePwd()) {
        $page .= "<form action=\"index.php\" method=\"post\">";
        $page .= $password_table->flush();
        $page .= "<input type=\"hidden\" name=\"action\" value=\"changepw\">";
        $page .= "<input type=\"hidden\" name=\"check\" value=\"check\">";
        $page .= "<input type=\"hidden\" name=\"username\" value=\"%%USERNAME%%\">";
        $page .= "</form>";
    }
    // Api Keys
    // Load possible current keys.
    $api = new api($MySelf->getID());
    $api_key = $api->getApiKey();
    $api_id = $api->getApiID();
    if (!$api->valid()) {
        $api->authorizeApi();
    }
    // Do the api table.
    $api_table = new table(2, true);
    $api_table->addHeader(">> Api key management");
    $api_table->addRow();
    $api_table->addCol("Here you can supply your limited-access API-Key. Its used for quick-login for now.", array("colspan" => 2));
    if ($api_id && $api->valid()) {
        $s1 = "<input type =\"hidden\" name=\"apiID\" value=\"{$api_id}\">{$api_id}";
    } else {
        $s1 = "<input type=\"text\" name=\"apiID\" value=\"{$api_id}\">";
        $doApiLink = true;
    }
    if ($api_key && $api->valid()) {
        $s2 = "<input type =\"hidden\" name=\"apiKey\" value=\"{$api_key}\">{$api_key}";
    } else {
        $s2 = "<input type=\"text\" size=\"80\" name=\"apiKey\" value=\"{$api_key}\">";
        $doApiLink = true;
    }
    $api_table->addRow();
    $api_table->addCol("API ID:");
    $api_table->addCol($s1);
    $api_table->addRow();
    $api_table->addCol("Verification Code:");
    $api_table->addCol($s2);
    // Add the API link to eve online.
    global $IGB;
    global $IGB_VISUAL;
    if ($doApiLink && (!$IGB || $IGB && $IGB_VISUAL)) {
        $api_table->addRow();
        $api_table->addCol("Get your API key here:");
        $api_table->addCol("<a href=\"http://support.eveonline.com/api/default.asp\">http://support.eveonline.com/api/default.asp</a>");
    }
    if ($api_key) {
        $api_table->addRow();
        $api_table->addCol("API Key validated:");
        if (!$api->valid()) {
            $hint = " (If your key is not validated, hit update API key button.)";
        }
        $api_table->addCol(yesno($api->valid(), yes) . $hint);
        if ($api->valid()) {
            $api_table->addRow();
            $api_table->addCol("Validated on:");
            $api_table->addCol(date("d.m.Y H:i:s", $api->validatedOn()));
            $api_table->addRow();
            $api_table->addCol("Next verification at:");
            $api_table->addCol(date("d.m.Y H:i:s", $api->nextValidation()));
            $api_table->addRow();
            $api_table->addCol("API keys are valid for:");
            $days = getConfig("api_keys_valid");
            if ($days <= 1) {
                $days = "1 day.";
            } else {
                $days = $days . " days.";
            }
            $api_table->addCol($days);
            $api_table->addRow();
            $api_table->addCol("Character ID:");
            $api_table->addCol($api->getCharacterID());
        }
        $api_table->addRow();
        $api_table->addCol("Remove Key:");
        $api_table->addCol("<input type=\"checkbox\" name=\"deleteKey\" value=\"true\"> Tick box to remove the API key from the Database.");
    }
    $api_table->addHeaderCentered("<input type=\"submit\" name=\"update_api\" value=\"Update API Key\">");
    $api_form .= "<form action=\"index.php\" method=\"POST\">";
    $api_form .= $api_table->flush();
    $api_form .= "<input type=\"hidden\" name=\"action\" value=\"update_api\">";
    $api_form .= "<input type=\"hidden\" name=\"check\" value=\"check\"></form>";
    $page .= $api_form;
    // We are done here.
    return $page;
}
开发者ID:nuxi,项目名称:MiningBuddy,代码行数:101,代码来源:makePreferences.php


注:本文中的api::getCharacterID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。