News - Features - Downloads - Forum - Team - Support - Switch View: Screen
Login - Registrierung - Passwort vergessen

Antworten: 0
Seite [1]
Tom08 ClanSphere Team

Supporter
Supporter



Herkunft: Daheim
Beiträge: 2923
# Thema - 08.08.2009 um 15:37 Uhr
Hey,
ich will in der clans/list die jeweiligen Squads zu den Clans anzeigen.
Ich kann die Squads auch abfragen, aber die Namen wollen sich nicht anzeigen lassen.

Momentan sieht meine list.php so aus:
list.php +-
<?php
// ClanSphere 2009 - www.clansphere.net
// $Id$

$cs_lang = cs_translate('clans');
$op_clans = cs_sql_option(__FILE__,'clans');

empty($_REQUEST['start']) ? $start = 0 : $start = $_REQUEST['start'];
$cs_sort[1] = 'clans_name DESC';
$cs_sort[2] = 'clans_name ASC';
$cs_sort[3] = 'clans_short DESC';
$cs_sort[4] = 'clans_short ASC';
empty($_REQUEST['sort']) ? $sort = 2 : $sort = $_REQUEST['sort'];
$order = $cs_sort[$sort];
$clans_count = cs_sql_count(__FILE__,'clans');


$data['lang']['mod_name'] = $cs_lang[$op_clans['label']];


$data['lang']['all'] = $cs_lang['total'].': ';
$data['lang']['count'] = $clans_count;
$data['pages']['list'] = cs_pages('clans','list',$clans_count,$start,0,$sort);


$select = 'clans_name, clans_short, clans_id';
$cs_clans = cs_sql_select(__FILE__,'clans',$select,0,$order,$start,$account[' users_limit']);
$clans_loop = count($cs_clans);

$data['sort']['name'] = cs_sort('clans','list',$start,0,1,$sort);
$data['sort']['short'] = cs_sort('clans','list',$start,0,3,$sort);

if(empty($clans_loop)) {
$data['clans'] = '';
}

for($run=0; $run<$clans_loop; $run++) {
$data['clans'][$run]['name'] = cs_link(cs_secure($cs_clans[$run]['clans_name']),'clans',' view','id=' . $cs_clans[$run]['clans_id']);
$data['clans'][$run]['short'] = cs_secure($cs_clans[$run]['clans_short']);


$select_sqd = 'squads_name, squads_id';
$where_sqd = '"clans_id = '.$cs_clans[$run]['clans_id'] . '"';
$cs_squads = cs_sql_select(__FILE__,'squads',$select_sqd,$where_sqd,0,0,0);
$squads_loop = count($cs_squads);

echo $squads_loop;
echo $cs_squads['squads_name'];

if(empty($squads_loop)){
$data['squads']['squads_name'] = '';
$data['loop']['squads'] = '';
$data['stop']['squads'] = '';
}else{
for($run=0; $run<$squads_loop; $run++){
$data['squads'][$run]['squads_name'] = cs_link(cs_secure($cs_squads[$run]['squads_name']),'squads', 'view','id=' . $cs_squads['squads_id']);
}
}


$where = "clans_id='" . $cs_clans[$run]['clans_id'] . "'";
$data['clans'][$run]['squads'] = cs_sql_count(__FILE__,'squads',$where);
}

echo cs_subtemplate(__FILE__,$data,'clans','list');


So sieht die list.tpl aus:
list.tpl +-
<table class="forum" cellpadding="0" cellspacing="{page:cellspacing}" style="width:{page:width}">
<tr>
<td class="headb" colspan="2">{lang:mod_name} - {lang:head_list}</td>
</tr>
<tr>
<td class="leftb">{icon:contents} {lang:all} {lang:count}</td>
<td class="rightb">{pages:list}</td>
</tr>
</table>
<br />
<table class="forum" cellpadding="0" cellspacing="{page:cellspacing}" style="width:{page:width}">
<tr>
<td class="headb">{sort:name} {lang:name}</td>
<td class="headb">{sort:short} {lang:short} </td>
<td class="headb">{lang:squads} </td>
</tr>
{loop:clans}
<tr>
<td class="leftc" style="width:60%">{clans:name}</td>
<td class="leftc" style="width:25%">{clans:short}</td>
<td class="leftc" style="width:15%">{clans:squads}</td>
</tr>
<tr>
<td class="leftb" style="width: 100%" colspan="3">{loop:squads}{squads:squads_name}{ stop:squads}</td>
</tr>
{stop:clans}
</table>


Für eure Hilfe wäre ich dankbar,

Tom

/e: Jetzt das TPL eingefügt und nicht nochmal die list.php ...


------------------
Bei Problemen mit Code von mir bitte eine Private Nachricht an mich


Zuletzt editiert von Tom08 ClanSphere Team am 08.08.2009 um 15:45 Uhr (2x Editiert)
Inaktiv
Antworten: 0
Seite [1]


Sie müssen sich registrieren, um zu antworten.


ClanSphere Project - Mailus - Imprint - Disclaimer - Scriptinfo