Antworten: 3
Seite [1] |
|
1a Schnitzel Going for pro Beiträge: 518 |
# Thema - 16.12.2007 um 16:48 Uhr
Ich habe versucht diesen Codeschnipsel in meine view.php einzubauen damit ich die Spielerfotos anstelle der Spielernamen in der Waransicht habe, allerdings läuft das wohl nicht mit den aktuelleren Versionen von Clansphere. Sobalt ich den Codeschnipsel bei mir eingefügt habe wird bei mir nur noch eine weisse Seite angezeigt. Hat das schonmal jemand an 2007.4.x angepasst? Oder kann es vielleicht daran liegen das ich die veränderte Waransicht benutze? Hier mal meine view.php view.php <?php // ClanSphere 2007 - www.clansphere.net // $Id: view.php 267 2006-08-27 09:02:48Z duRiel $ $cs_lang = cs_translate('wars'); $wars_id = empty($_REQUEST['where']) ? $_GET['id'] : $_REQUEST['where']; settype($wars_id,'integer'); $cs_wars = cs_sql_select(__FILE__,'wars','*',"wars_id = '" . $wars_id . "'"); $wars['head']['topline'] = $cs_lang['body_view']; $gameicon = 'uploads/games/'.$cs_wars['games_id'].'.gif'; $where = "games_id = '" . $cs_wars['games_id'] . "'"; $cs_game = cs_sql_select(__FILE__,'games','games_name, games_id',$where); $wars['game']['icon'] = file_exists($gameicon) ? cs_html_img($gameicon) : ''; $wars['game']['link'] = cs_link($cs_game['games_name'],'games','view',' id=' . $cs_game['games_id']); $where = "categories_id = '" . $cs_wars['categories_id'] . "'"; $cs_cat = cs_sql_select(__FILE__,'categories','categories_name, categories_id',$where); $wars['lang']['category'] = $cs_lang['category']; $wars['category']['link'] = cs_link($cs_cat['categories_name'],'categories','view' ,'id=' . $cs_cat['categories_id']); $where = "clans_id = '" . $cs_wars['clans_id'] . "'"; $cs_clan = cs_sql_select(__FILE__,'clans','clans_name, clans_id, clans_picture',$where); $wars['enemy']['link'] = cs_link($cs_clan['clans_name'],'clans','view',' id=' . $cs_clan['clans_id']); $wars['wars']['opponents'] = cs_secure($cs_wars['wars_opponents'],0,0,0); $wars['enemy']['picture'] = cs_html_img('uploads/clans/'.$cs_clan['clans_picture']); $where = "squads_id = '" . $cs_wars['squads_id'] . "'"; $cs_squad = cs_sql_select(__FILE__,'squads','squads_name, squads_id, clans_id',$where); $wars['squad']['link'] = cs_link($cs_squad['squads_name'],'squads','view',' id=' . $cs_squad['squads_id']); $where = "clans_id = '".$cs_squad['clans_id'] ."'"; $cs_squads = cs_sql_select(__FILE__,'clans','clans_name, clans_id, clans_picture',$where); $wars['squad']['picture'] = cs_html_img('uploads/clans/'.$cs_squads['clans_picture']); $cells = 'pl.users_id AS users_id, usr.users_nick AS users_nick'; $tables = 'players pl INNER JOIN {pre}_users usr ON pl.users_id = usr.users_id'; $cond = 'pl.wars_id = \''.$wars_id.'\' AND pl.players_played = \'1\''; $players = cs_sql_select(__FILE__,$tables,$cells,$cond,'usr.users_nick',0,0); if (!empty($players)) { for ($run = 0; $run < count($players); $run++) { $wars['players'][$run]['url'] = cs_url('users','view','id='.$players[$run]['u sers_id']); $wars['players'][$run]['nick'] = cs_secure($players[$run]['users_nick']); } } else { $wars['players'] = ''; } if (empty($cs_wars['wars_players1']) && empty($cs_wars['wars_players2'])) { $wars['lang']['on'] = ''; $wars['wars']['players1'] = '-'; $wars['wars']['players2'] = ''; } else { $wars['wars']['players1'] = $cs_wars['wars_players1']; $wars['wars']['players2'] = $cs_wars['wars_players2']; } $wars['date']['show'] = cs_date('unix',$cs_wars['wars_date'],1); $wars_status = empty($cs_wars['wars_status']) ? 'upcoming' : $cs_wars['wars_status']; $wars['war']['status'] = $cs_lang[$wars_status]; $wars['war']['score1'] = $cs_wars['wars_score1']; $wars['war']['score2'] = $cs_wars['wars_score2']; $result = $cs_wars['wars_score1'] - $cs_wars['wars_score2']; $color1 = $result >= 1 ? 'green' : 'red'; $color2 = $result >= 1 ? 'red' : 'green'; $color1 = empty($result) ? 'grey' : $color1; $color2 = empty($result) ? 'grey' : $color2; $wars['result']['color1'] = $color1; $wars['result']['color2'] = $color2; $wars_url = cs_secure($cs_wars['wars_url']); $wars['url']['link'] = empty($wars_url) ? '-' : cs_html_link('http://' . $wars_url,$wars_url); $wars['pictures']['show'] = ''; if(empty($cs_wars['wars_pictures'])) { $wars['pictures']['show'] = '-'; } else { $wars_pics = explode("\n",$cs_wars['wars_pictures']); foreach($wars_pics AS $pic) { $link = cs_html_img('uploads/wars/thumb-' . $pic); $wars['pictures']['show'] .= cs_html_link('uploads/wars/picture-' . $pic,$link) . ' '; } } $wars['war']['report'] = empty($cs_wars['wars_report']) ? '-' : cs_secure($cs_wars['wars_report'],1,1); $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'; $wars['rounds'] = cs_sql_select(__FILE__,$tables2,$cells2,'rnd.wars_id = \''.$wars_id.'\'','rnd.rounds_order ASC',0,0); if(!empty($wars['rounds'])) { for ($run = 0; $run < count($wars['rounds']); $run++) { $wars['rounds'][$run]['mapurl'] = cs_url('maps','view','id='.$wars['rounds' ][$run]['maps_id']); $wars['rounds'][$run]['maps_name'] = cs_secure($wars['rounds'][$run]['maps_name']); $result2 = $wars['rounds'][$run]['rounds_score1'] - $wars['rounds'][$run]['rounds_score2']; $icon2 = $result2 >= 1 ? 'green' : 'red'; $icon2 = !empty($result2) ? $icon2 : 'grey'; $wars['rounds'][$run]['resulticon'] = cs_html_img('symbols/clansphere/' . $icon2 . '.gif'); $wars['rounds'][$run]['rounds_description'] = cs_secure($wars['rounds'][$run]['rounds_description'],1,1); } } else { $wars['rounds'] = ''; } echo cs_subtemplate(__FILE__,$wars,'wars','view'); if ($wars_status == 'upcoming') { $condition = 'users_id = \''.$account['users_id'].'\' AND squads_id = \''.$cs_squad['squads_id'].'\''; $squadmember = cs_sql_count(__FILE__,'members',$condition); $wars_access = empty($account['access_wars']) ? 0 : $account['access_wars']; if (!empty($squadmember) OR $wars_access >= 3) { echo cs_html_br(1); echo cs_html_table(1,'forum',1); echo cs_html_roco(1,'headb',0,3); echo $cs_lang['players']; echo cs_html_roco(0); echo cs_html_roco(1,'leftc'); echo $cs_lang['player']; echo cs_html_roco(2,'leftc'); echo $cs_lang['plays']; echo cs_html_roco(3,'leftc'); echo $cs_lang['date']; echo cs_html_roco(0); $tables = 'players ply INNER JOIN {pre}_users usr ON ply.users_id = usr.users_id'; $cells = 'ply.users_id AS users_id, ply.players_status AS players_status, ' .'ply.players_time AS players_time, usr.users_nick AS users_nick'; $players = cs_sql_select(__FILE__,$tables,$cells,'ply.wars_id = \''.$wars_id.'\'','ply.players_status DESC',0,0); if (empty($players)) { echo cs_html_roco(1,'leftb',0,3); echo $cs_lang['no_players']; echo cs_html_roco(0); } else { $in_list = 0; foreach ($players AS $player) { echo cs_html_roco(1,'leftb'); echo cs_link($player['users_nick'],'users','view',' id='.$player['users_id']); echo cs_html_roco(2,'leftb'); echo $cs_lang[$player['players_status']]; echo cs_html_roco(3,'leftb'); echo cs_date('unix',$player['players_time'],1); echo cs_html_roco(0); if ($player['users_id'] == $account['users_id']) { $in_list = 1; } } } if (!empty($squadmember)) { echo cs_html_roco(1,'centerc',0,3); if (empty($in_list)) { echo cs_link($cs_lang['join_war'],'wars','join','i d='.$wars_id); } else { echo cs_link($cs_lang['edit_status'],'wars','statusedit' ,'id='.$wars_id); } echo cs_html_roco(0); } echo cs_html_table(0); } } $where_com = "comments_mod = 'wars' AND comments_fid = '" . $cs_wars['wars_id'] . "'"; $count_com = cs_sql_count(__FILE__,'comments',$where_com); include_once('mods/comments/functions.php'); if(!empty($count_com)) { echo cs_html_br(1); echo cs_comments_view($wars_id,'wars','view',$count_com); } if(empty($cs_wars['wars_close'])) { echo cs_html_br(1); echo cs_comments_add($wars_id,'wars'); } ?> Zuletzt editiert von Spedie am 16.12.2007 um 16:49 Uhr (1x Editiert)
|
Inaktiv |
|
1a Schnitzel Thread-Ersteller Going for pro Beiträge: 518 |
# Antwort: 1 - 20.12.2007 um 17:43 Uhr
Keiner da der mir sagen kann wie ich die Spielerfotos in die Clanwaransicht bei CS2007.4.3 bekomme? |
Inaktiv |
|
Likka Rock the board Beiträge: 42 |
# Antwort: 2 - 23.12.2007 um 04:39 Uhr
Suche mal diese Zeilen bei Dir $cells = 'pl.users_id AS users_id, usr.users_nick AS users_nick'; $tables = 'players pl INNER JOIN {pre}_users usr ON pl.users_id = usr.users_id'; $cond = 'pl.wars_id = \''.$wars_id.'\' AND pl.players_played = \'1\''; $players = cs_sql_select(__FILE__,$tables,$cells,$cond,'usr.users_nick',0,0); if (!empty($players)) { for ($run = 0; $run < count($players); $run++) { $wars['players'][$run]['url'] = cs_url('users','view','id='.$players[$run]['u sers_id']); $wars['players'][$run]['nick'] = cs_secure($players[$run]['users_nick']); } } else { $wars['players'] = ''; } Und ersetze sie mal hiermit, bei mir geht es jedenfalls so. $cells = 'pl.users_id AS users_id, usr.users_nick AS users_nick, usr.users_picture AS users_picture'; $tables = 'players pl INNER JOIN {pre}_users usr ON pl.users_id = usr.users_id'; $cond = 'pl.wars_id = \''.$wars_id.'\' AND pl.players_played = \'1\''; $players = cs_sql_select(__FILE__,$tables,$cells,$cond,'usr.users_nick',0,0); if (!empty($players)) { for ($run = 0; $run < count($players); $run++) { $wars['players'][$run]['url'] = cs_url('users','view','id='.$players[$run]['u sers_id']); $wars['players'][$run]['nick'] = cs_secure($players[$run]['users_nick']); $wars['players'][$run]['picture'] = cs_html_img($place = 'uploads/users/' .$players[$run]['users_picture'],'91','70'); } } else { $wars['players']= ''; } Danach in der Theme-datei wars/view.tpl noch den Eintrag {players:picture} hinzufügen. Entweder lässt sich beides Anzeigen, Nick und Bild, oder Du ersetzt einfach den {players:nick} mit {players:picture}. je nach Bedarf. |
Inaktiv |
|
1a Schnitzel Thread-Ersteller Going for pro Beiträge: 518 |
# Antwort: 3 - 24.12.2007 um 01:02 Uhr
Danke schonmal, das klappt soweit nur die Verlinkung zu den Spieler Profilen klappt dann nicht mehr. EDIT: Problem gelöst und nun klappt alles, danke nochmal Kann :closed: Zuletzt editiert von Spedie am 24.12.2007 um 01:38 Uhr (1x Editiert) |
Inaktiv |
|
Dieses Thema wurde von Ramires geschlossen. |
|
Antworten: 3
Seite [1] |