public function addTag($tag_name)
 {
     $tag_hash = md5($tag_name);
     if (!LernmarktplatzTag::find($tag_hash)) {
         $tag = new LernmarktplatzTag();
         $tag->setId($tag_hash);
         $tag['name'] = $tag_name;
         $tag->store();
     }
     $statement = DBManager::get()->prepare("\n            INSERT IGNORE INTO lernmarktplatz_tags_material\n            SET tag_hash = :tag_hash,\n                material_id = :material_id\n        ");
     return $statement->execute(array('tag_hash' => $tag_hash, 'material_id' => $this->getId()));
 }
示例#2
0
?>
>
    <? $breadcrump_tags = array() ?>
    <li>
        <a href="<?php 
echo PluginEngine::getLink($plugin, array(), "market/overview");
?>
" data-tags="">
            <?php 
echo _("Zum Anfang");
?>
        </a>
    </li>
    <? foreach ($tag_history as $key => $tag) : ?>
        <li>
            <? $breadcrump_tags[] = $tag ?>
            <? $new_tag_history = implode(",", $breadcrump_tags) ?>
            <a href="<?php 
echo PluginEngine::getLink($plugin, array('tags' => $new_tag_history), "market/overview");
?>
"  data-tags="<?php 
echo $new_tag_history;
?>
">
                <?php 
echo htmlReady(LernmarktplatzTag::find($tag)->name);
?>
            </a>
        </li>
    <? endforeach ?>
</ol>