$tactical_text .= '<tr align=left><td><i>' . $SETL_EVENTS[$d_setl['event_code']][0] . '</i></td>';
         $tactical_text .= $game->player['user_id'] == $d_setl['user_id'] ? '<td><i>(' . $d_setl['count_crit_ok'] . ' / ' . $d_setl['count_ok'] . ' / ' . $d_setl['count_ko'] . ' / ' . $d_setl['count_crit_ko'] . ')</i></td></tr>' : '</tr>';
     }
     $tactical_text .= '</table>';
 }
 $sql = 'SELECT log_code, timestamp, mood_modifier FROM settlers_relations
             WHERE `planet_id` = ' . $planet['planet_id'] . '
             AND user_id = ' . $game->player['user_id'] . '
             ORDER BY timestamp ASC';
 $q_setl = $db->query($sql);
 $rows = $db->num_rows($q_setl);
 if ($rows > 0) {
     $tactical_text .= '<table width=320 border=0 cellpadding= 0 cellspacing=0>';
     $q_d_setl = $db->fetchrowset($q_setl);
     foreach ($q_d_setl as $d_setl) {
         $tactical_text .= '<tr align=left><td>' . get_diplo_str($d_setl['log_code']) . '</td><td>' . date("d.m.y", $d_setl['timestamp']) . '</td><td>' . $d_setl['mood_modifier'] . '</td></tr>';
     }
     $tactical_text .= '</table>';
 }
 $planet_is_known = false;
 $sql = 'SELECT timestamp FROM starsystems_details
         WHERE system_id = ' . $planet['system_id'] . '
         AND user_id = ' . $game->player['user_id'];
 if ($game->player['user_auth_level'] == STGC_DEVELOPER || $db->queryrow($sql) == true) {
     $planet_is_known = true;
 }
 $last_update = constant($game->sprache("TEXT93"));
 if ($own_planet || $game->player['user_alliance'] == $planet_owner['alliance_id'] || $planet_is_known) {
     $_thumb = '<a href=' . $planet_thumb . ' target="_blank"><img src="' . $planet_thumb . '" width="80" height="80" border="0"></a><br>';
     $_name = '&nbsp;<b>' . $planet['planet_name'] . '</b>&nbsp;(' . $game->get_sector_name($planet['sector_id']) . ':' . $game->get_system_cname($planet['system_x'], $planet['system_y']) . ':' . ($planet['planet_distance_id'] + 1) . ')';
     $_planet_type = '&nbsp;<a href="' . parse_link('a=database&planet_type=' . $planet_type . '#' . $planet_type) . '">' . $planet_type . '</a>';
Example #2
0
 $sql = 'SELECT * FROM settlers_events WHERE planet_id = ' . $detail_id;
 $q3_detail = $db->queryrowset($sql);
 $game->out('
 <br><br><br>
 <center><span class="caption">' . constant($game->sprache("TEXT30")) . ' &#171;' . $q1_detail['planet_name'] . '&#187;</span><br><br>
 <table class="style_outer" width="90%" align="center" border="0" cellpadding="2" cellspacing="2">');
 foreach ($q3_detail as $q3_item) {
     if ($SETL_EVENTS[$q3_item['event_code']][1] && $game->player['user_id'] != $q3_item['user_id']) {
         continue;
     }
     $watch_on_planet = true;
     $game->out('<tr align=left><td><i>' . $SETL_EVENTS[$q3_item['event_code']][0] . '</i></td>');
     $game->out($game->player['user_id'] == $q3_item['user_id'] ? '<td><i>(' . $q3_item['count_crit_ok'] . ' / ' . $q3_item['count_ok'] . ' / ' . $q3_item['count_ko'] . ' / ' . $q3_item['count_crit_ko'] . ')</i></td></tr>' : '</tr>');
 }
 foreach ($q2_detail as $q2_item) {
     $game->out('<tr align=left><td>' . get_diplo_str((int) $q2_item['log_code']) . '</td><td>' . date("d.m.y", $q2_item['timestamp']) . '</td><td>' . $q2_item['mood_modifier'] . '</td></tr>');
 }
 $game->out('</table>');
 if ($watch_on_planet) {
     // Mood Section
     $index = 0;
     $sql = 'SELECT sr.user_id, u.user_name, a.alliance_tag, u.user_race, SUM(mood_modifier) as mood_value
             FROM (settlers_relations sr)
             LEFT JOIN (user u) ON sr.user_id = u.user_id
             LEFT JOIN (alliance a) ON a.alliance_id = u.user_alliance
             WHERE sr.planet_id = ' . $detail_id . '
                   GROUP BY sr.user_id ORDER BY mood_value
             LIMIT 0,10';
     $user_mood_query = $db->queryrowset($sql);
     $user_mood_data = array();
     foreach ($user_mood_query as $user_mood_item) {