1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
| 1. / 2. / ...
<?php
// ClanSphere 2009 - www.clansphere.net
// $Id$
$cs_lang = cs_translate('maps');
$data = array();
if(empty($_GET['id'])) {
$data['maps']['link'] = cs_url('maps','manage');
$data['maps']['action'] = $cs_lang['details'];
echo cs_subtemplate(__FILE__,$data,'maps','no_selection');
} else {
$maps_id = (int) $_GET['id'];
$cells = 'games_id, maps_name, maps_text, maps_picture';
$select = cs_sql_select(__FILE__,'maps',$cells,'maps_id = \''.$maps_id.'\'');
$select2 = cs_sql_select(__FILE__,'games','games_id, games_name','games_id = \''.$select['games_id'].'\'');
$data['maps'] = $select;
$url = 'uploads/games/' . $select2['games_id'] . '.gif';
$data['games']['games_picture'] = !file_exists($url) ? '' : cs_html_img($url);
$data['games']['games_name'] = cs_link($select2['games_name'],'games','view','id='.$select2['games_id']);
$data['maps']['maps_text'] = cs_secure($select['maps_text'],1,1);
$data['if']['picture_set_map'] = empty($select['maps_picture']) ? false : true;
$data['maps']['maps_picture'] = empty($select['maps_picture']) ? '' : cs_html_img('uploads/maps/' . $select['maps_picture']);
$tables2 = 'rounds rnd INNER JOIN {pre}_maps mps ON rnd.maps_id = mps.maps_id';
$cells2 = 'rnd.rounds_score1 AS rounds_score1, rnd.rounds_score2 AS rounds_score2, '
. 'rnd.rounds_description AS rounds_description, mps.maps_name AS maps_name, '
. 'rnd.maps_id AS maps_id';
$data['rounds'] = cs_sql_select(__FILE__,$tables2,$cells2,'rnd.maps_id = \''.$maps_id.'\'','rnd.rounds_order ASC',0,0);
$count_rounds = count($data['rounds']);
for ($run = 0; $run < $count_rounds; $run++) {
$data['rounds'][$run]['mapurl'] = cs_url('maps','view','id='.$data['rounds'][$run]['maps_id']);
$data['rounds'][$run]['maps_name'] = cs_secure($data['rounds'][$run]['maps_name']);
$result2 = $data['rounds'][$run]['rounds_score1'] - $data['rounds'][$run]['rounds_score2'];
$icon2 = $result2 >= 1 ? 'green' : 'red';
$icon2 = !empty($result2) ? $icon2 : 'grey';
$data['rounds'][$run]['resulticon'] = cs_html_img('symbols/clansphere/' . $icon2 . '.gif');
$data['rounds'][$run]['rounds_description'] = cs_secure($data['rounds'][$run]['rounds_description'],1,1);
}
echo cs_subtemplate(__FILE__,$data,'maps','view');
}
|