예제 #1
0
 public function setAttributes($attributes)
 {
     foreach ($attributes as $key => $value) {
         if ($value != '') {
             $key = gettype($key) === 'string' ? FuncHelp::utf8ify($key) : $key;
             $this->{$key} = gettype($value) === 'string' ? FuncHelp::utf8ify($value) : $value;
         }
     }
 }
예제 #2
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;
 }
예제 #3
0
 public static function toImage($path, $name, $htmlOptions = array())
 {
     $image = IMG_PATH . $path . '/' . FuncHelp::safeName($name) . '.png';
     if (TPP_DEBUG) {
         if (!file_exists($_SERVER['DOCUMENT_ROOT'] . $image)) {
             $image = 'http://twitchplayspokemon.org/img/' . $path . '/' . FuncHelp::safeName($name) . '.png';
         }
     }
     $return = '<img src="' . $image . '"';
     if (!empty($htmlOptions)) {
         foreach ($htmlOptions as $key => $value) {
             $return .= ' ' . $key . '="' . $value . '"';
         }
     }
     if (!isset($htmlOptions['title'])) {
         $return .= ' title="' . $name . '"';
     }
     if (!isset($htmlOptions['alt'])) {
         $return .= ' alt="' . $name . '"';
     }
     $return .= '>';
     return $return;
 }
예제 #4
0
 public function showImage()
 {
     return '<i class="sprite-trainer sprite-trainer-' . FuncHelp::safeName($this->name) . '" title="' . $this->name . '" alt="' . $this->name . '"></i>';
 }
예제 #5
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);
?>
예제 #6
0
 public function getMoves()
 {
     $return = array();
     if (isset($this->moves)) {
         $hms = FuncHelp::getHmMoves();
         foreach ($this->moves as $move) {
             if (in_array($move->name, $hms)) {
                 $return[] = '<strong>' . $move->name . '</strong>';
             } else {
                 $return[] = $move->name;
             }
         }
     }
     return $return;
 }
예제 #7
0
					<tr><?php 
foreach ($badges as $b) {
    ?>

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

					</tr>