Seite 1 von 1

Problem mit Templateklasse von phpBB

Verfasst: 15.10.2006 18:13
von killerbees19
Für meinen neuen Adminbereich von meinen Scripten habe ich die phpBB-Templateklasse eingebaut, funktioniert alles perfekt.

Nur an einer Stelle kommt leider kein Ergebnis:

Code: Alles auswählen

$id = $result[$i]['id'];
      $name = htmlentities($result[$i]['name']);
      $count = $result[$i]['count'];
      $count1 = $result[$i]['count1'];
      $count2 = $result[$i]['count2'];
      $count3 = $result[$i]['count3'];
      $file = $result[$i]['file'];
    
      $count_gesamt = $count1+$count2+$count3;

      $template->assign_block_vars("search_result", array(
        'now_id' => $id,
        'now_name' => $name,
        'now_gesamt' => $count_gesamt,
        'now_count' => $count,
        'now_count1' => $count1,
        'now_count2' => $count2,
        'now_count3' => $count3,
        'now_file' => $file
        ));
Ich habe das in eine while-Schleife gepackt, jedoch bleiben die Spalten der Tabelle leer.
Was mache ich falsch? Die Variablen sind verfügbar...
Habe ich den Sinn der Templatefunktion an dieser Stelle falsch verstanden?

Bitte um Hilfe.


MfG Christian

Verfasst: 15.10.2006 18:26
von Fabse
Hallo!

Zeig mal die dazugehörige tpl Datei.

Lg
Fabse

Verfasst: 15.10.2006 19:25
von killerbees19
search_result.tpl

Code: Alles auswählen

<table width="100%" cellpadding="3" cellspacing="1" border="0" class="forumline">
	<tr>
	  <th height="25" class="thCornerL" nowrap="nowrap">{count_id}</th>
	  <th class="thTop" nowrap="nowrap">{count_name}</th>
	  <th class="thTop" nowrap="nowrap">{count_gesamt}</th>
	  <th class="thTop" nowrap="nowrap">{count_count1}</th>
	  <th class="thTop" nowrap="nowrap">{count_count2}</th>
	  <th class="thTop" nowrap="nowrap">{count_count3}</th>
	  <th class="thTop" nowrap="nowrap">{count_file}</th>
	</tr>
	<!-- BEGIN search_result -->
  <tr>
	  <td class="row1" align="center"><span class="gen">&nbsp;{now_id}&nbsp;</span></td>
	  <td class="row1" align="center" >&nbsp;{now_name}&nbsp;</td>
	  <td class="row1" align="center" valign="middle">&nbsp;{now_gesamt}&nbsp;</td>
	  <td class="row1" align="center" valign="middle">&nbsp;{now_count1}&nbsp;</td>
	  <td class="row1" align="center" valign="middle">&nbsp;{now_count2}&nbsp;</td>
	  <td class="row1" align="center" valign="middle">&nbsp;{now_count3}&nbsp;</td>
	  <td class="row1" align="center">&nbsp;{now_file}&nbsp;</td>
	</tr>
	<!-- END search_result -->
</table>

MfG Christian

Verfasst: 15.10.2006 19:28
von Fabse

Code: Alles auswählen

<table width="100%" cellpadding="3" cellspacing="1" border="0" class="forumline">
   <tr>
     <th height="25" class="thCornerL" nowrap="nowrap">{count_id}</th>
     <th class="thTop" nowrap="nowrap">{count_name}</th>
     <th class="thTop" nowrap="nowrap">{count_gesamt}</th>
     <th class="thTop" nowrap="nowrap">{count_count1}</th>
     <th class="thTop" nowrap="nowrap">{count_count2}</th>
     <th class="thTop" nowrap="nowrap">{count_count3}</th>
     <th class="thTop" nowrap="nowrap">{count_file}</th>
   </tr>
   <!-- BEGIN search_result -->
  <tr>
     <td class="row1" align="center"><span class="gen">&nbsp;{search_result.now_id}&nbsp;</span></td>
     <td class="row1" align="center" >&nbsp;{search_result.now_name}&nbsp;</td>
     <td class="row1" align="center" valign="middle">&nbsp;{search_result.now_gesamt}&nbsp;</td>
     <td class="row1" align="center" valign="middle">&nbsp;{search_result.now_count1}&nbsp;</td>
     <td class="row1" align="center" valign="middle">&nbsp;{search_result.now_count2}&nbsp;</td>
     <td class="row1" align="center" valign="middle">&nbsp;{search_result.now_count3}&nbsp;</td>
     <td class="row1" align="center">&nbsp;{search_result.now_file}&nbsp;</td>
   </tr>
   <!-- END search_result -->
</table>
Versuch mal so.

Gruß, Fabse

Verfasst: 15.10.2006 19:36
von killerbees19
:grin: Danke.
Nun funktioniert es.
Habe wohl wirklich vergessen, wie man das richtig verwendet.
Beim nächsten mal sollte ich auch schauen wie es im Template ist, nicht nur an den PHP-Dateien ein Beispiel nehmen.


MfG Christian