예제 #1
0
 public static function getMilestones()
 {
     $getMilestones = TPP::db()->query("SELECT `id`, `name`, `time` FROM `milestone` WHERE `visible` = 1 ORDER BY `time`") or die(TPP::db()->error);
     while ($mile = $getMilestones->fetch_assoc()) {
         $newMilestone = new self();
         $newMilestone->setAttributes($mile);
         $newMilestone->time = FuncHelp::getDateTime($newMilestone->time);
         $return[] = $newMilestone;
     }
     return $return;
 }
예제 #2
0
 public static function getPokemon($where = null, $order = null, $limit = null)
 {
     if (!is_null($where)) {
         $where = ' WHERE ' . $where;
     }
     if (!is_null($order)) {
         $order = ' ORDER BY ' . $order;
     }
     if (!is_null($limit)) {
         $limit = ' LIMIT ' . $limit;
     }
     $getPokemon = TPP::db()->query("SELECT\r\n\t\t\tp.`id`, p.`pokemon`, p.`name`, p.`level`, p.`nickname`, p.`gender`, p.`hold_item`, p.`status`, p.`box_id`, p.`poke_ball`, p.`comment`,\r\n\t\t\tGROUP_CONCAT(DISTINCT m.`name` SEPARATOR ',') as `moves`,\r\n\t\t\ts.`status` as `status_name`\r\n\t\t\tFROM `pokemon` p\r\n\t\t\tLEFT JOIN `move` m\r\n\t\t\tON m.`pokemon` = p.`id`\r\n\t\t\tJOIN `status` s\r\n\t\t\tON s.`id` = p.`status`\r\n\t\t\t" . $where . " GROUP BY p.`id`" . $order . $limit) or die(TPP::db()->error);
     while ($pok = $getPokemon->fetch_assoc()) {
         $newPokemon = new self();
         $newPokemon->setAttributes(array('id' => $pok['id'], 'name' => $newPokemon->setName($pok['name'], $pok['pokemon']), 'pokemon' => $newPokemon->setPokemon($pok['pokemon']), 'level' => $newPokemon->setLevel($pok['level']), 'nickname' => $newPokemon->setNickname($pok['nickname']), 'poke_ball' => $newPokemon->setPokeBall($pok['poke_ball']), 'gender' => $newPokemon->setGender($pok['gender']), 'hold_item' => $newPokemon->setHoldItem($pok['hold_item']), 'status' => $pok['status_name'], 'comment' => FuncHelp::getDateTime($pok['comment']), 'moves' => $newPokemon->setMoves($pok['moves'])));
         $newPokemon->setAttributes($newPokemon->getFields());
         $return[] = $newPokemon;
     }
     return $return;
 }
예제 #3
0
			<div class="tpp-app tpp-app-header">
				<div class="page-header">
					<h1>
						<a href="http://www.twitch.tv/twitchplayspokemon"><!--
							--><strong><i class="fa fa-external-link"></i>Twitch Plays Pok&eacute;mon</strong><!--
						--></a><!--
						--><a href="" class="pop-out btn btn-danger btn-xs"><i class="fa fa-expand"></i>Pop out</a>

						<span class="pull-right last-update">Last update: <?php 
echo FuncHelp::getDateTime($general->last_update);
?>
</span>
					</h1><?php 
if (!empty($messages)) {
    $this->render('general/_messages', array('messages' => $messages));
}
?>

			<div class="pull-left current-status">
				<p>Current Goal: <strong><?php 
echo utf8_decode($general->current_goal);
?>
</strong></p>
				<p>Optional Goal: <strong><?php 
echo !empty($general->optional_goal) ? utf8_decode($general->optional_goal) : '-';
?>
</strong></p>
				<p>Current Location: <strong><?php 
echo utf8_decode($general->current_location);
?>
예제 #4
0
					<tr><?php 
foreach ($badges as $b) {
    ?>

						<td><?php 
    echo isset($b->time) ? FuncHelp::getDateTime($b->time) : '<em>Not yet</em>';
    ?>
</td><?php 
}
?>

					</tr>