Exemplo n.º 1
0
 function generate_inner_html()
 {
     $inner_template = dirname(__FILE__) . '/center_inner_private.tpl';
     $inner_html_gen =& new Template($inner_template);
     $inner_html_gen->set('parameters', Ranking::get_parameters());
     $inner_html_gen->set('error', $this->error);
     $inner_html_gen->set('config_navigation_url', network_config_navigation('manage_ranking'));
     $inner_html = $inner_html_gen->fetch();
     return $inner_html;
 }
 function generate_inner_html()
 {
     $inner_template = PA::$blockmodule_path . '/' . get_class($this) . '/center_inner_private.tpl';
     $inner_html_gen = new Template($inner_template);
     $inner_html_gen->set('parameters', Ranking::get_parameters());
     $inner_html_gen->set('error', $this->error);
     $inner_html_gen->set('config_navigation_url', network_config_navigation('manage_ranking'));
     $inner_html = $inner_html_gen->fetch();
     return $inner_html;
 }
Exemplo n.º 3
0
function RankAllShow()
{
    print '<div style="margin:15px">' . "\n";
    print '<h4>Ranking - ' . date("Y年n月j日 G時i分s秒") . '</h4>' . "\n";
    include CLASS_RANKING;
    $Rank = new Ranking();
    $Rank->ShowRanking();
    print '</div>' . "\n";
}
Exemplo n.º 4
0
    function LoginForm($message = NULL)
    {
        ?>
<div style="width:730px;">
<!-- ログイン -->
<div style="width:350px;float:right">
<h4 style="width:350px">登录</h4>
<?php 
        print $message;
        ?>
<form action="<?php 
        print INDEX;
        ?>
" method="post" style="padding-left:20px">
<table><tbody>
<tr>
<td><div style="text-align:right">ID:</div></td>
<td><input type="text" maxlength="16" class="text" name="id" style="width:160px"<?php 
        print $_SESSION["id"] ? " value=\"{$_SESSION['id']}\"" : NULL;
        ?>
></td>
</tr>
<tr>
<td><div style="text-align:right">PASS:</div></td>
<td><input type="password" maxlength="16" class="text" name="pass" style="width:160px"></td>
</tr>
<tr><td></td><td>
<input type="submit" class="btn" name="Login" value="登录" style="width:80px"> 
<a href="?newgame">新玩家?</a>
</td></tr>
</tbody></table>
</form>

<h4 style="width:350px">排行榜</h4>
<?php 
        include_once CLASS_RANKING;
        $Rank = new Ranking();
        $Rank->ShowRanking(0, 4);
        ?>
</div>
<!-- 飾 -->
<div style="width:350px;padding:5px;float:left;">
<div style="width:350px;text-align:center">
<img src="./image/top01.gif" style="margin-bottom:20px" />
</div>
<div style="margin-left:20px">
<DIV class=u>这到底是什么游戏?</DIV>
<UL>
<LI>游戏的目的是得到第一、<BR>并且保持住第一的位置。 
<LI>虽然没有冒险的要素、<BR>但有点深奥的战斗系统。 </LI></UL>
<DIV class=u>战斗的感觉是什么?</DIV>
<UL>
<LI>5人的人物构成队伍 。 
<LI>各人物各持不同模式、<BR>根据战斗的状况来使用技能。 
<LI><A class=a0 href="?log">这边</A>可以回览战斗记录。 </LI></UL></DIV></DIV>

<div class="c-both"></div>
</div>

<!-- -------------------------------------------------------- -->

<div style="margin:15px">
<h4>提示</h4>
用户数: <?php 
        print UserAmount();
        ?>
 / <?php 
        print MAX_USERS;
        ?>
<br />
<?php 
        $Abandon = ABANDONED;
        print floor($Abandon / (60 * 60 * 24)) . "日中数据没变化的话数据将消失。";
        print "</div>\n";
    }
Exemplo n.º 5
0
 function generate_inner_html($links)
 {
     global $network_info;
     if ($this->market_report == TRUE) {
         // if marketting report is to be viewed
         $params = NULL;
         $inner_template = dirname(__FILE__) . '/center_inner_market_report.tpl';
         $next_prev_navigation = 'marketing_report';
         if ($this->email_sorting == NULL || $this->email_sorting == 'all') {
             $params = array('network_id' => $network_info->network_id, 'neglect_owner' => FALSE, 'cnt' => TRUE);
             // setting variables for pagination
             $this->Paging["count"] = Network::get_members($params);
             unset($params['cnt']);
             $params['show'] = $this->Paging['show'];
             $params['page'] = $this->Paging['page'];
             $users = Network::get_members($params);
             $this->email_addresses = $users['users_data'];
         } else {
             if ($this->email_sorting == 'dormant') {
                 $params = array("order_by" => 3);
                 // 3 for sort by dormant user
             }
             $this->Paging["count"] = Ranking::get_top_ranked_users(TRUE, $params);
             $params['show'] = $this->Paging['show'];
             $params['page'] = $this->Paging['page'];
             $this->email_addresses = Ranking::get_top_ranked_users(FALSE, $params);
         }
         // Set pagination variable
         $Pagination = new Pagination();
         $Pagination->setPaging($this->Paging);
         $this->page_first = $Pagination->getFirstPage();
         $this->page_last = $Pagination->getLastPage();
         $this->page_links = $Pagination->getPageLinks();
     } else {
         $inner_template = dirname(__FILE__) . '/center_inner_private.tpl';
         $next_prev_navigation = 'mis_count';
     }
     $obj_inner_template =& new Template($inner_template);
     $obj_inner_template->set('links', $links);
     $obj_inner_template->set('email_domain_array', $this->email_domain_array);
     $obj_inner_template->set('blog_post', $this->blog_post);
     $obj_inner_template->set('images', $this->images);
     $obj_inner_template->set('profile_views', $this->profile_views);
     $obj_inner_template->set('profile_visits_by_user', $this->profile_visits_by_user);
     $obj_inner_template->set('relationship_stats', $this->relationship_stats);
     $obj_inner_template->set('emails', $this->email_addresses);
     $obj_inner_template->set('page_first', $this->page_first);
     $obj_inner_template->set('page_last', $this->page_last);
     $obj_inner_template->set('page_links', $this->page_links);
     $obj_inner_template->set('parameters', Ranking::get_parameters());
     $obj_inner_template->set('config_navigation_url', network_config_navigation($next_prev_navigation));
     $inner_html = $obj_inner_template->fetch();
     return $inner_html;
 }
Exemplo n.º 6
0
$configure_permission = current_user_can('configure_network');
if (!$configure_permission) {
    set_error("Sorry! you are not authorized to view the content of this page");
}
if (isset($_POST['submit_ranking'])) {
    global $base_url;
    $error = "";
    require_once '../ext/Ranking/Ranking.php';
    $parameters["1"] = is_numeric($_POST['param_1']) ? $_POST['param_1'] : set_error('Only numbers are allowed');
    $parameters["2"] = is_numeric($_POST['param_2']) ? $_POST['param_2'] : set_error('Only numbers are allowed');
    $parameters["3"] = is_numeric($_POST['param_3']) ? $_POST['param_3'] : set_error('Only numbers are allowed');
    $parameters["4"] = is_numeric($_POST['param_4']) ? $_POST['param_4'] : set_error('Only numbers are allowed');
    $parameters["5"] = is_numeric($_POST['param_5']) ? $_POST['param_5'] : set_error('Only numbers are allowed');
    $parameters["6"] = is_numeric($_POST['param_6']) ? $_POST['param_6'] : set_error('Only numbers are allowed');
    if (empty($error)) {
        $obj = new Ranking();
        foreach ($parameters as $id => $point) {
            $obj->ranking_id = $id;
            $obj->point = $point;
            $obj->update_parameter();
        }
        set_error('Ranking has been saved successfully');
    }
}
$page = new PageRenderer("setup_module", PAGE_SITE_RANKING, "Site Ranking", "container_two_column.tpl", "header.tpl", PUB, HOMEPAGE, $network_info);
$page->html_body_attributes = 'class="no_second_tier network_config"';
uihelper_get_network_style();
uihelper_error_msg($error_msg);
echo $page->render();
function set_error($er)
{
Exemplo n.º 7
0
 /**
  * This function builds the list of the best players.
  *
  * @access private
  * @author kalmer
  * @param string  $parameters['suffix'] the suffix
  * @param integer $parameters['width']  the width of the <code>body</code>
  * 		in pixels
  * @return string the parsed list
  * @uses O_FOLDER to access the manager for errors
  * @uses View     for managing errors
  */
 private static function buildBestPlayers($parameters)
 {
     require_once O_FOLDER . 'errors/ErrorView.php';
     \PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array(new ErrorView(), 'raiseError'));
     require_once 'HTML/Template/IT.php';
     $tpl = new \HTML_Template_IT(O_FOLDER . 'assets/tpl');
     $tpl->loadTemplatefile('rankings.tpl');
     require_once O_FOLDER . 'konkureerimine/Ranking.php';
     $timestamps = Ranking::getTimestamps();
     if (sizeOf($timestamps) > 0) {
         $rankings = Ranking::getRankings($timestamps[0]);
         $atLeastAPlayer = FALSE;
         foreach ($rankings as $idRanking) {
             $ranking = new Ranking($idRanking);
             if ($ranking->getPos() > 1) {
                 break;
             } else {
                 require_once dirname(__FILE__) . '/../haldus/kasutajad/Human.php';
                 $user = new Human();
                 $user->setId($ranking->getIdHuman());
                 $user->setCompleteHuman($parameters);
                 if ($ranking->getIdSchool() > 0) {
                     require_once dirname(__FILE__) . '/../haldus/kasutajad/School.php';
                     $school = new School($ranking->getIdSchool());
                     $nameOSchool = $school->name;
                 } else {
                     $nameOSchool = '';
                 }
                 if ($ranking->getTypeOCompetition() == 'F') {
                     $tpl->setCurrentBlock('females');
                     $tpl->setVariable(array('FIRST-NAME-OF-FEMALE' => $user->firstName, 'LAST-NAME-OF-FEMALE' => $ranking->getLastName(), 'SCHOOL-OF-FEMALE' => $nameOSchool == '' ? '' : sprintf(' (%1$s)', $nameOSchool)));
                 } else {
                     $tpl->setCurrentBlock('males');
                     $tpl->setVariable(array('FIRST-NAME-OF-MALE' => $user->firstName, 'LAST-NAME-OF-MALE' => $ranking->getLastName(), 'SCHOOL-OF-MALE' => $nameOSchool == '' ? '' : sprintf(' (%1$s)', $nameOSchool)));
                 }
                 $tpl->parseCurrentBlock();
                 $atLeastAPlayer = TRUE;
             }
         }
         if ($atLeastAPlayer) {
             $tpl->setCurrentBlock('rankings');
             $tpl->setVariable(array('ADDITIONAL-CLASS' => $parameters['width'] > 1301 && $parameters['width'] < 1800 ? '  BoxInSidebar' : '', 'LOCATION-IN-NORMAL' => DOMAIN));
             $tpl->parseCurrentBlock();
             return $tpl->get('rankings');
         }
     }
     return '';
 }
Exemplo n.º 8
0
include ROOT . 'model/Curtida.php';
include ROOT . 'model/Ranking.php';
//carregar parametros da noticia
$noticia_cdg = isset($_GET['n']) ? $_GET['n'] : -1;
$noticia_cdg = $noticia_cdg == '' ? -1 : $noticia_cdg;
$noticia_cdg = !is_numeric($noticia_cdg) ? -1 : $noticia_cdg;
$noticia_url = isset($_GET['n_url']) ? $_GET['n_url'] : '-1';
$noticia_url = $noticia_url == '' ? '-1' : $noticia_url;
if (is_numeric($noticia_cdg) || $noticia_url != '-1') {
    //carregar classes
    $Noticia = new Noticia($noticia_cdg, $noticia_url);
    //echo $Noticia->noticia_cdg;
    $Curtida = new Curtida(-1, $Noticia->noticia_cdg, 1);
    $Comentario = new Comentario($Noticia->noticia_cdg);
    $SEO = new SEO();
    $Ranking = new Ranking();
    //carregar colecoes
    $Noticia->adicionar_view();
    $comentarios = $Comentario->lista_comentarios_noticia($Noticia->noticia_cdg);
    $ranking = $Ranking->lista_ranking_usuarios();
    $noticias_relacionadas = $Noticia->lista_noticias_relacionadas($Noticia->tags, 5);
    //carregar textos para SEO
    $SEO->setTitle($Noticia->titulo . ' - Notícias Diretório Mogi ');
    $SEO->setDescription($Noticia->resumo);
    // ta indo 200 letras
    $SEO->setUrl('http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']);
    if (trim($Noticia->imagem) != '') {
        $SEO->setImage($Noticia->imagem);
    }
    //css botoes sociais
    $posicao_botoes = 'centro';
 if (isset($load_more)) {
     $load_more = true;
 } else {
     $load_more = false;
 }
 if ($_POST["cross_data_download"] == "true") {
     $donwload = true;
     $load_more = true;
 }
 $ano_h = $fk_ano;
 //IF para corrigir demonstração de ano via js no título do ranking
 if (($espc == 'udh' || $espc == 'rm') && $fk_ano == 1) {
     //Para rm e udh o ano será somente 2010
     $ano_h = 3;
 }
 $ranking = new Ranking($ordem_id, $ordem, $pagina, $espc, $start, $estado, $estados_pos, $load_more, $donwload, $fk_ano, $lang_mng);
 if ($espc == "estadual") {
     $compTitle = "- {$lang_mng->getString("rankin_title_02")}";
 } else {
     if ($espc == 'municipal') {
         if ($estado == 0) {
             $compTitle = "- {$lang_mng->getString("rankin_title_01")}";
         } else {
             $compTitle = "- " . $ranking->getEstadoNome();
         }
     } else {
         if ($espc == 'rm') {
             $compTitle = "- {$lang_mng->getString("rankin_title_03")}";
         } else {
             if ($espc == 'udh') {
                 if ($estado == 0) {
Exemplo n.º 10
0
 function DeleteUser($DeleteFromRank = true)
 {
     //ランキングからまず消す。
     if ($DeleteFromRank) {
         include_once CLASS_RANKING;
         $Ranking = new Ranking();
         if ($Ranking->DeleteRank($this->id)) {
             $Ranking->SaveRanking();
         }
     }
     $dir = USER . $this->id;
     $files = glob("{$dir}/*");
     $this->fpCloseAll();
     foreach ($files as $val) {
         unlink($val);
     }
     rmdir($dir);
 }
Exemplo n.º 11
0
/**
 * Created by PhpStorm.
 * User: Marvin
 * Date: 23.07.2015
 * Time: 12:52
 */
require_once './lib/Member.class.php';
require_once './lib/Ranking.class.php';
if (isset($_GET['page'])) {
    $db_connect = Database::getInstance();
    $data = array();
    $db_request = $db_connect->prepare('SELECT userId FROM statistic');
    $db_request->execute();
    while ($array = $db_request->fetch()) {
        foreach ($array as $key => $value) {
            if (is_integer($key)) {
                $data[] = $value;
            }
        }
    }
    $member_array = array();
    foreach ($data as $id) {
        $member_array[$id] = new Member((int) $id);
    }
    $ranking = new Ranking($member_array);
    $html = $ranking->to_html();
    $tpl->assign('ranking', $html);
    $tpl->assign('tpl_name', $_GET['page'] . '.tpl');
} else {
    echo "Kein Zugriff";
}
Exemplo n.º 12
0
 public function equals(Ranking $ranking)
 {
     return $this->getRankingLeague() == $ranking->getRankingLeague() && $this->getRankingGroup() == $ranking->getRankingGroup() && $this->getRankingNr() == $ranking->getRankingNr();
 }
Exemplo n.º 13
0
    function LoginForm($message = NULL)
    {
        ?>
<div style="width:730px;">
<!-- ログイン -->
<div style="width:350px;float:right">
<h4 style="width:350px">Login</h4>
<?php 
        echo $message;
        ?>
<form action="<?php 
        echo INDEX;
        ?>
" method="post" style="padding-left:20px">
<table><tbody>
<tr>
<td><div style="text-align:right">ID:</div></td>
<td><input type="text" maxlength="16" class="text" name="id" style="width:160px"<?php 
        echo $_SESSION["id"] ? " value=\"{$_SESSION['id']}\"" : NULL;
        ?>
></td>
</tr>
<tr>
<td><div style="text-align:right">PASS:</div></td>
<td><input type="password" maxlength="16" class="text" name="pass" style="width:160px"></td>
</tr>
<tr><td></td><td>
<input type="submit" class="btn" name="Login" value="login" style="width:80px">&nbsp;
<a href="?newgame">NewGame?</a>
</td></tr>
</tbody></table>
</form>

<h4 style="width:350px">Ranking</h4><?php 
        include_once CLASS_RANKING;
        $Rank = new Ranking();
        $Rank->ShowRanking(0, 4);
        ?>
</div>
<!-- 飾 -->
<div style="width:350px;padding:15px;float:left;">
<div style="width:350px;text-align:center">
<img src="./image/top01.gif" style="margin-bottom:20px" />
</div>
<div style="margin-left:20px">
<div class="u">これってどんなゲーム?</div>
<ul>
<li>ゲームの目的はランキング1位になり、<br />1位を守る事です。</li>
<li>冒険要素はないですが、<br />ちょっと深い戦闘システムが売りです。</li>
</ul>
<div class="u">戦闘はどんな感じ?</div>
<ul>
<li>5人のキャラクターでパーティーを編成。</li>
<li>各キャラが行動パターンを持ち、<br />戦闘の状況に応じて技を使い分けます。</li>
<li><a href="?log" class="a0">こちら</a>で戦闘ログが回覧できます。</li>
</ul>
</div>
</div>
<div class="c-both"></div>
</div>

<!-- -------------------------------------------------------- -->

<div style="margin:15px">
<h4>info.</h4>
Users : <?php 
        echo UserAmount();
        ?>
 / <?php 
        echo MAX_USERS;
        ?>
<br />
<?php 
        $Abandon = ABANDONED;
        print floor($Abandon / (60 * 60 * 24)) . "日データに変化無しでデータ消える。";
        print "</div>\n";
    }
Exemplo n.º 14
0
			return $expected;
		}
		
		function k_factor($player)
		{
			// do something dependant on the player
			
			return 20;
		}
	
	}
	



	$ranking = new Ranking;
	
	$player1 = array(
		'name'		=>	'Nathaniel',
		'ranking'	=>	1527
	);
	
	$player2 = array(
		'name'		=>	'Chris',
		'ranking'	=>	1272
	);
	
	
	echo 'Match: ' . $player1['name'] . '(' . $player1['ranking'] . ') <strong>1</strong> vs 0 ' . $player2['name'] . ' (' . $player2['ranking'] . ')<br>';
	$new = $ranking->match($player1, 1, $player2, 0);
	$player1['ranking'] = $new['p1'];