本文整理汇总了PHP中Rank类的典型用法代码示例。如果您正苦于以下问题:PHP Rank类的具体用法?PHP Rank怎么用?PHP Rank使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Rank类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: saveRank
private function saveRank($playerId, $tournamentId, $score, $oRank)
{
if ($oRank instanceof Doctrine_Record) {
$oRank->score = $score;
$oRank->save();
} else {
$rank = new Rank();
$rank->Players_id = $playerId;
$rank->Tournaments_id = $tournamentId;
$rank->score = $score;
$rank->save();
}
}
示例2: addMember
public function addMember()
{
$rankObj = new Rank($this->MySQL);
$rankObj->selectByOrder(2);
$newMemRank = $rankObj->get_info("rank_id");
$appInfo = $this->get_info();
$arrColumns = array("username", "password", "password2", "rank_id", "email", "datejoined", "lastlogin", "lastseen");
$arrValues = array($appInfo['username'], $appInfo['password'], $appInfo['password2'], $newMemRank, $appInfo['email'], time(), time(), time());
if ($this->objMember->addNew($arrColumns, $arrValues)) {
$this->setMemberProfile();
$returnVal = $this->update(array("memberadded"), array(1));
$this->notifyNewMember();
}
return $returnVal;
}
示例3: getInstance
/**
* Singleton Pattern
*
* Auto Create Object Instance.
*
*/
public static function getInstance()
{
if (null === self::$_objInstance) {
self::$_objInstance = new Rank();
}
return self::$_objInstance;
}
示例4: getDivisionLeaders
/**
* @param $division_structure
* @return string
*/
private function getDivisionLeaders($division_structure)
{
$division_leaders = Division::findDivisionLeaders($this->game_id);
foreach ($division_leaders as $division_leader) {
$aod_url = Member::createAODlink(['member_id' => $division_leader->member_id, 'rank' => Rank::convert($division_leader->rank_id)->abbr, 'forum_name' => $division_leader->forum_name]);
$division_structure .= property_exists($division_leader, 'position_desc') ? "{$aod_url} - {$division_leader->position_desc}\r\n" : "{$aod_url}\r\n";
}
return $division_structure;
}
示例5: revokeRank
public function revokeRank($rank)
{
if (is_array($rank)) {
$revokeReason = $rank['reason'];
$rank = Rank::findOrFail($rank['model']->id);
}
if ($rank->count() && empty($rank->revoked_at)) {
$this->getRankPivotBuilder($rank->id)->update(['revoke_reason' => $revokeReason, 'revoked_at' => Carbon::now()]);
}
}
示例6: createView
/**
* Create view
*/
private function createView()
{
$this->oView->addData('titre', Language::translate('PERMISSIONS_ADMIN_TABLE_TITLE'));
$oTable = new TableGenerator();
$oTable->setId(md5('Access'));
$aRanks = Rank::getRanks();
$oTable->addColumn('');
foreach ($aRanks as $oRank) {
$oTable->addColumn($oRank->getName());
}
$aModules = Permission::getModules();
foreach ($aModules as $iId => $sName) {
$aBuffer = array();
$aBuffer[] = $sName;
foreach ($aRanks as $oRank) {
if ($oRank->checkAccess($sName)) {
$sIcon = 'fa-check';
$sStyle = 'success';
$sNewValue = 'false';
} else {
$sIcon = 'fa-times';
$sStyle = 'danger';
$sNewValue = 'true';
}
$oLabel = new View('minibutton');
$oLabel->addData('icon', $sIcon);
$oLabel->addData('style', $sStyle);
$oLabel->addData('link', 'index.php?p=adminpermissions&m=' . $iId . '&r=' . $oRank->getId() . '&v=' . $sNewValue);
$oLabel->create();
$aBuffer[] = $oLabel->getCode();
}
$oTable->addLine($aBuffer);
}
$oTable->setBottom('');
$oTable->create();
$this->oView->addData('content', $oTable->getCode());
$this->oView->Create();
}
示例7: elseif
} elseif ($memberInfo['promotepower'] == -1) {
$rankInfo['promotepower'] = 0;
}
$cID = $_GET['cID'];
$dispError = "";
$countErrors = 0;
if ($memberInfo['rank_id'] == 1) {
$maxOrderNum = $mysqli->query("SELECT MAX(ordernum) FROM " . $dbprefix . "ranks WHERE rank_id != '1'");
$arrMaxOrderNum = $maxOrderNum->fetch_array(MYSQLI_NUM);
if ($maxOrderNum->num_rows > 0) {
$result = $mysqli->query("SELECT rank_id FROM " . $dbprefix . "ranks WHERE ordernum = '" . $arrMaxOrderNum[0] . "'");
$row = $result->fetch_assoc();
$rankInfo['promotepower'] = $row['rank_id'];
}
}
$rankObj = new Rank($mysqli);
if ($_POST['submit']) {
$rankObj->select($rankInfo['promotepower']);
$maxRankInfo = $rankObj->get_info_filtered();
if ($rankInfo['rank_id'] == 1) {
$maxRankInfo['ordernum'] += 1;
}
$arrRanks = array();
$result = $mysqli->query("SELECT * FROM " . $dbprefix . "ranks WHERE ordernum <= '" . $maxRankInfo['ordernum'] . "' AND rank_id != '1' ORDER BY ordernum DESC");
while ($row = $result->fetch_assoc()) {
$arrRanks[] = $row['rank_id'];
if ($maxRankInfo['ordernum'] > $row['ordernum']) {
$arrMemRanks[] = $row['rank_id'];
}
}
// Check Member
示例8: createAddPopup
/**
* Créer la Popup d'ajout d'un utilisateur
* @param \Rank $p_aRanks Rangs possibles
* @return string
*/
private function createAddPopup($p_aRanks)
{
$oPopupAdd = new View('popup');
$oPopupAdd->addData('id', 'adduser');
$oPopupAdd->addData('buttonstyle', 'btn-success');
$oPopupAdd->addData('buttonicon', 'fa-plus');
$oPopupAdd->addData('buttontext', 'Ajouter');
$oPopupAdd->addData('title', 'Ajouter un utilisateur');
$oFormAdd = new FormGenerator();
$oFormAdd->setAction('index.php?p=adminusers');
$oFormAdd->addInput('Identifiant', 'login', true, false, 'text', 'Identifiant ...');
$oFormAdd->addInput('Password', 'password', true, false, 'password', 'Password ...');
$oFormAdd->addInput('Confirmation', 'confirmation', true, false, 'password', 'Confirmation ...');
$oFormAdd->addInput('Email', 'mail', true, false, 'text', 'Email ...');
$oFormAdd->addSelect('Rang', 'rank', $p_aRanks, Rank::getDefaultRank()->getId());
$oFormAdd->create();
$oPopupAdd->addData('content', $oFormAdd->getCode());
$oPopupAdd->create();
return $oPopupAdd->getCode();
}
示例9: thankyouAction
function thankyouAction()
{
$this->view->activeTab = 'Polls';
$this->view->title = $this->view->title = $this->view->translate("Wildfire") . " - " . $this->view->translate("Thanks_For_Poll");
$consumer = $this->_currentUser;
$id = (int) $this->_request->getParam('survey', 0);
$profileSurveyModel = new ProfileSurvey();
$profileSurvey = $profileSurveyModel->fetchRow("i2_survey_id =" . $id . " or " . "i2_survey_id_en =" . $id);
// $this->view->point = $profileSurvey->points;
//check history to prevent multiple participation
$db = Zend_Registry::get('db');
$select1 = $db->select();
$select1->from("poll_participation", "count(*)");
$select1->where("poll_participation.poll_id = ?", $profileSurvey->id);
$select1->where("poll_participation.consumer_id = ?", $consumer->id);
$participationCount = $db->fetchOne($select1);
if ($participationCount == 0) {
// check ws
$indicate2Connect = new Indicate2_Connect();
$ids = array($id);
$wsResult = $indicate2Connect->getAnswerSetCount($consumer->email, $ids);
// Zend_Debug::dump($wsResult."------------".$profileSurvey->points);die;
if ($wsResult > 0) {
// add poll participation
$currentTime = date("Y-m-d H:i:s");
$pollParticipationModel = new PollParticipation();
$pollParticipation = $pollParticipationModel->createRow();
$pollParticipation->poll_id = $profileSurvey->id;
$pollParticipation->consumer_id = $consumer->id;
$pollParticipation->date = $currentTime;
$pollParticipation->save();
// add points
$pointRecordModel = new RewardPointTransactionRecord();
$point = $pointRecordModel->createRow();
$point->consumer_id = $consumer->id;
$point->transaction_id = 3;
$point->date = $currentTime;
$point->point_amount = $profileSurvey->points;
$point->save();
//2011-05-13 change the rank of consumer
$rankModel = new Rank();
$rankModel->changeConsumerRank($consumer->id);
$this->view->point = $point->point_amount;
} else {
// add poll participation
$currentTime = date("Y-m-d H:i:s");
$pollParticipationModel = new PollParticipation();
$pollParticipation = $pollParticipationModel->createRow();
$pollParticipation->poll_id = $profileSurvey->id;
$pollParticipation->consumer_id = $consumer->id;
$pollParticipation->date = $currentTime;
$pollParticipation->save();
// add points
$pointRecordModel = new RewardPointTransactionRecord();
$point = $pointRecordModel->createRow();
$point->consumer_id = $consumer->id;
$point->transaction_id = 3;
$point->date = $currentTime;
$point->point_amount = $profileSurvey->points;
$point->save();
//2011-05-13 change the rank of consumer
$rankModel = new Rank();
$rankModel->changeConsumerRank($consumer->id);
$this->view->point = $point->point_amount;
}
}
}
示例10: Basic
// Classes needed for index.php
$ipbanObj = new Basic($mysqli, "ipban", "ipaddress");
if ($ipbanObj->select($IP_ADDRESS, false)) {
$ipbanInfo = $ipbanObj->get_info();
if (time() < $ipbanInfo['exptime'] or $ipbanInfo['exptime'] == 0) {
die("<script type='text/javascript'>window.location = '" . $MAIN_ROOT . "banned.php';</script>");
} else {
$ipbanObj->delete();
}
}
// Start Page
$PAGE_NAME = "Members - ";
$dispBreadCrumb = "";
include $prevFolder . "themes/" . $THEME . "/_header.php";
$member = new Member($mysqli);
$rankObj = new Rank($mysqli);
// Disable Members for Inactivity
if ($websiteInfo['maxdsl'] != 0) {
$maxDSLTime = time() - $websiteInfo['maxdsl'] * 86400;
$time = time();
$result = $mysqli->query("UPDATE " . $dbprefix . "members SET disabled = '1', disableddate = '" . $time . "' WHERE disabled = '0' AND rank_id != '1' AND onia = '0' AND lastlogin <= '" . $maxDSLTime . "'");
$result = $mysqli->query("SELECT member_id FROM " . $dbprefix . "members WHERE disableddate = '" . $time . "'");
while ($row = $result->fetch_assoc()) {
$arrLogColumns = array("member_id", "logdate", "message");
$arrLogValues = array($row['member_id'], $time, "Disabled due to inactivity.");
$logObj->addNew($arrLogColumns, $arrLogValues);
}
}
// Disable members who fail to be promoted for auto-disable ranks
$arrRanks = array();
$result = $mysqli->query("SELECT rank_id FROM " . $dbprefix . "ranks WHERE autodisable != '0'");
示例11: array
if ($memberObj->hasAccess($consoleOptionObj)) {
$shoutBoxPostLink = $MAIN_ROOT . "members/include/news/include/postshoutbox.php";
}
$arrSpecialMenuItems = array();
// TOP PLAYERS
$arrSpecialMenuItems['top-players'] = " <b>·</b> <a href='" . $MAIN_ROOT . "top-players/recruiters.php'>Recruiters</a><br>";
$hpGameObj = new Game($mysqli);
$arrGames = $hpGameObj->getGameList();
foreach ($arrGames as $gameID) {
$hpGameObj->select($gameID);
$arrSpecialMenuItems['top-players'] .= " <b>·</b> <a href='" . $MAIN_ROOT . "top-players/game.php?gID=" . $gameID . "'>" . $hpGameObj->get_info_filtered("name") . "</a><br>";
}
// NEWEST MEMBERS
$arrSpecialMenuItems['newmembers'] = "<div style='margin-left: 3px; margin-right: 3px; margin-top: 5px; margin-bottom: 20px'>";
$menuMemberObj = new Member($mysqli);
$menuMemberRankObj = new Rank($mysqli);
$counter = 0;
$result = $mysqli->query("SELECT member_id FROM " . $dbprefix . "members WHERE rank_id != '1' ORDER BY datejoined DESC LIMIT 5");
while ($row = $result->fetch_assoc()) {
$addCSS = "";
if ($counter == 0) {
$addCSS = " alternateBGColor";
$counter = 1;
} else {
$counter = 0;
}
$arrSpecialMenuItems['newmembers'] .= "<div class='dottedLine " . $addCSS . "' style='padding: 5px 5px'>";
$menuMemberObj->select($row['member_id']);
$newestMemberInfo = $menuMemberObj->get_info_filtered();
$checkURL = parse_url($newestMemberInfo['profilepic']);
if ((!isset($checkURL['scheme']) || $checkURL['scheme'] == "") && $newestMemberInfo['profilepic'] != "") {
示例12: next
public function next()
{
$rank = Rank::getRandomRank();
$card = new Card($rank);
return $card;
}
示例13: arrayToObject
echo $memberInfo->forum_name;
?>
</li>
</ul>
<div class='page-header vertical-align'>
<div class='col-xs-1 hidden-sm hidden-xs'>
<?php
echo Member::avatar($memberInfo->member_id, 'large');
?>
</div>
<div class='col-xs-5'>
<h2>
<strong><?php
echo Rank::convert($memberInfo->rank_id)->abbr . " " . $memberInfo->forum_name;
?>
</strong>
<span class="games_played">
<?php
if (count($gamesPlayed)) {
$gamesPlayed = arrayToObject($gamesPlayed);
?>
<?php
foreach ($gamesPlayed as $game) {
?>
<?php
$img = "assets/images/game_icons/16x16/{$game->short_name}.png";
?>
<?php
if (file_exists($img)) {
示例14: add_hierarchy_entry
function add_hierarchy_entry(&$row, $parent_hierarchy_entry_id, $ancestry, $branch_kingdom)
{
self::debug_iterations("Inserting taxon");
self::commit_iterations("Taxa", 500);
if ($this->archive_validator->has_error_by_line('http://rs.tdwg.org/dwc/terms/taxon', $row['archive_file_location'], $row['archive_line_number'])) {
write_to_resource_harvesting_log("ERROR: add_hierarchy_entry: has_error_by_line" . ",file_location:" . $row['archive_file_location'] . ",line_number:" . $row['archive_line_number']);
return false;
}
// make sure this taxon has a name, otherwise skip this branch
$scientific_name = @self::field_decode($row['http://rs.tdwg.org/dwc/terms/scientificName']);
$authorship = @self::field_decode($row['http://rs.tdwg.org/dwc/terms/scientificNameAuthorship']);
$kingdom = @self::field_decode($row['http://rs.tdwg.org/dwc/terms/kingdom']);
$genus = @self::field_decode($row['http://rs.tdwg.org/dwc/terms/genus']);
$rank_label = @self::field_decode($row['http://rs.tdwg.org/dwc/terms/taxonRank']);
// COL exception
if (strtolower($kingdom) == 'viruses') {
if (substr($scientific_name, -1) == ":") {
$scientific_name = substr($scientific_name, 0, -1);
}
if (preg_match("/^(.*) ICTV\$/i", $scientific_name, $arr)) {
$scientific_name = $arr[1];
}
}
// COL exception
if (strtolower($kingdom) == 'viruses' && $genus && strtolower($rank_label) != 'genus') {
if (stripos($scientific_name, $genus) == 0) {
$scientific_name = ucfirst(trim(substr($scientific_name, strlen($genus))));
}
} else {
if ($authorship && stripos($scientific_name, $authorship) === false) {
$scientific_name = trim($scientific_name . " " . $authorship);
}
}
if (!$scientific_name) {
return false;
}
$taxon_id = @self::field_decode($row['http://rs.tdwg.org/dwc/terms/taxonID']);
if (!$taxon_id) {
$taxon_id = @self::field_decode($row['http://purl.org/dc/terms/identifier']);
}
if (!$taxon_id) {
debug("ERROR - no taxon ID for {$scientific_name}, skipping");
return false;
}
if (isset($this->taxon_ids_inserted[$taxon_id])) {
// this taxon_id has already been inserted meaning this tree has a loop in it - so stop
debug("ERROR - taxon ID ({$taxon_id}) for {$scientific_name} already inserted; LOOP?");
return false;
}
$scientific_name = ucfirst($scientific_name);
$name = Name::find_or_create_by_string($scientific_name);
if (@(!$name->id)) {
debug("ERROR - Failed to insert name: {$scientific_name}");
return false;
}
$phylum = @self::field_decode($row['http://rs.tdwg.org/dwc/terms/phylum']);
$class = @self::field_decode($row['http://rs.tdwg.org/dwc/terms/class']);
$order = @self::field_decode($row['http://rs.tdwg.org/dwc/terms/order']);
$family = @self::field_decode($row['http://rs.tdwg.org/dwc/terms/family']);
$rank = Rank::find_or_create_by_translated_label($rank_label);
$dataset_id = @self::field_decode($row['http://rs.tdwg.org/dwc/terms/datasetID']);
$taxonomic_status = @self::field_decode($row['http://rs.tdwg.org/dwc/terms/taxonomicStatus']);
$source_url = @self::field_decode($row['http://rs.tdwg.org/ac/terms/furtherInformationURL']);
if (!$source_url) {
$source_url = @self::field_decode($row['http://purl.org/dc/terms/source']);
}
if (!$source_url) {
$source_url = @self::field_decode($row['http://purl.org/dc/terms/references']);
}
if (!$source_url) {
$source_url = @self::field_decode($row['http://purl.org/dc/terms/isReferencedBy']);
}
if (isset($row['http://rs.tdwg.org/dwc/terms/taxonRemarks'])) {
$taxon_remarks = @self::field_decode($row['http://rs.tdwg.org/dwc/terms/taxonRemarks']);
} else {
$taxon_remarks = NULL;
}
if (!$taxon_remarks && strtolower($taxonomic_status) == 'provisionally accepted name') {
$taxon_remarks = "provisionally accepted name";
}
// TODO: This block is somewhat confusing. Clearly, it's clearing the
// rank that's currently being read, but shouldn't it also clear all of
// the ranks below that?
if (strtolower($rank_label) == 'kingdom') {
$kingdom = null;
}
if (strtolower($rank_label) == 'phylum') {
$phylum = null;
}
if (strtolower($rank_label) == 'class') {
$class = null;
}
if (strtolower($rank_label) == 'order') {
$order = null;
}
if (strtolower($rank_label) == 'family') {
$family = null;
}
if (strtolower($rank_label) == 'genus') {
$genus = null;
//.........这里部分代码省略.........
示例15: Basic
// Classes needed for index.php
$ipbanObj = new Basic($mysqli, "ipban", "ipaddress");
if ($ipbanObj->select($IP_ADDRESS, false)) {
$ipbanInfo = $ipbanObj->get_info();
if (time() < $ipbanInfo['exptime'] or $ipbanInfo['exptime'] == 0) {
die("<script type='text/javascript'>window.location = '" . $MAIN_ROOT . "banned.php';</script>");
} else {
$ipbanObj->delete();
}
}
// Start Page
$PAGE_NAME = "Ranks - ";
$dispBreadCrumb = "";
include $prevFolder . "themes/" . $THEME . "/_header.php";
$member = new Member($mysqli);
$rankObj = new Rank($mysqli);
$rankCatObj = new RankCategory($mysqli);
$breadcrumbObj->setTitle("Ranks");
$breadcrumbObj->addCrumb("Home", $MAIN_ROOT);
$breadcrumbObj->addCrumb("Ranks");
include $prevFolder . "include/breadcrumb.php";
?>
<table id='rankPageTable' class='formTable' style='width: 75%; margin-left: auto; margin-right: auto'>
<?php
$result = $mysqli->query("SELECT rankcategory_id FROM " . $dbprefix . "rankcategory WHERE hidecat = '0' ORDER BY ordernum DESC");
while ($row = $result->fetch_assoc()) {
$rankCatObj->select($row['rankcategory_id']);
$rankCatInfo = $rankCatObj->get_info_filtered();
if ($rankCatInfo['useimage'] == 1 && $rankCatInfo['imageurl'] != "") {