Die Ausgabe macht jetzt was sie soll.
Ich habe in_array in der zweiten Schleife angewendet, da ich ja auch eine andere Tabelle referenziere.
Alle doppelten IDs werden jetzt ausgelassen.
PHP-Code:
<?php if (count($this->entries)): ?>
<?php $i = 0; $spalten = 5; ?>
<? $ids = array(); ?>
<table>
<?php foreach ($this->entries as $entry): ?>
<?php $i++; ?>
<?php foreach (array_unique($entry['data']) as $field=>$data): ?>
<?php if (strlen($data['raw']) && !in_array($field, array('catalog_name','parentJumpTo'))): ?>
<?php if (array_key_exists('ref', $data)): ?>
<?php foreach ($data['ref'] as $ref):
if (in_array($ref['id'], $ids)):
continue;
endif;
$ids[] = $ref['id']; ?>
<? if($i%$spalten > 0): echo ("<td width='140px'>"); else : echo ("<tr><td width='140px'>"); endif; ?>
<a href="<?php echo $ref['profil_url']; ?>"><img src="<?php echo $ref['Foto']; ?>"><br /><?php echo $ref['Name']; ?></a><br/><br/>
<?php endforeach; ?>
<?php endif; ?>
<?php endif; ?>
<?php endforeach; ?>
<?php endforeach; ?>
<? if($i%$spalten > 0): echo ("</td>"); else : echo ("</td></tr>"); endif; ?>
</table>
<?php else: ?>
<p class="info"><?php echo $this->noItemsMsg; ?></p>
<?php endif; ?>
Lesezeichen