Nur, es reagiert auch nicht wenn es "sonnenschein" entspricht
Ich kann mir eine Lösung vorstellen, in der es nur entsprechen muss und nicht nur vorkommen, in dem ich dafür ein Modul fremdgebrauche.
<? if ($item->description): ?>
<li>
<strong class="caption"><?= t("Description:") ?></strong>
<?= nl2br(html::purify($item->description)) ?>
</li>
<? endif ?>
<ul>
<li><a href="https://maps.google.com/maps?q=<?=$latitude; ?>,<?=$longitude; ?>" target="_blank"><?=$latitude; ?>,<?=$longitude; ?></a>
</ul>
// Display Tags on Thumbnails
if (module::is_active("tag")) {
$tags = ORM::factory("tag")
->join("items_tags", "tags.id", "items_tags.tag_id")
->where("items_tags.item_id", "=", $item->id)
->find_all();
if (count($tags) > 0) {
$results .= "<li>";
$results .= t("Tags:") . " ";
$anchors = array();
foreach ($tags as $tag) {
$anchors[] = "<a href=" . $tag->url() . ">" . html::clean($tag->name) . "</a>";
}
$results .= join(", ", $anchors) . "</li>";
}
}
// End Display Tags on Thumbnails
<?
$item_tags = ORM::factory("tag")
->join("items_tags", "tags.id", "items_tags.tag_id", "left")
->where("items_tags.item_id", "=", $item->id)
->find_all();
if ($item_tags->count()) {
echo '<div class="g-description">';
echo 'Tags: ';
$tc = 0;
foreach ($item_tags as $t) {
echo ($tc++ == 0) ? '' : ', ';
echo '<a href="' . $t->url() . '">' . html::clean($t->name) . '</a>';
}
echo '</div>';
}
?>
<?
$item_tags = ORM::factory("tag")
->join("items_tags", "tags.id", "items_tags.tag_id", "left")
->where("items_tags.item_id", "=", $item->id)
->find_all();
?>
<? foreach ($item_tags as $t) ?>
<? if ($t->name == "regen")
{
echo "regen";
}
else
{
echo "sonne";
}
?>
<?
$item_tags = ORM::factory("tag")
->join("items_tags", "tags.id", "items_tags.tag_id", "left")
->where("items_tags.item_id", "=", $item->id)
->find_all();
?>
<? foreach ($item_tags as $t) ?>
<? if ($t->name == "regen") : ?>
regen
<? else : ?>
sonne
<? endif ?>
Kommentar