Example #1
0
function form_categories_links($where, $tags_post)
{
    $tags = list_all_tags($where, FALSE);
    $html = '';
    if (!empty($tags)) {
        $html = '<datalist id="htmlListTags">' . "\n";
        foreach ($tags as $i => $tag) {
            $html .= "\t" . '<option value="' . addslashes($tag['tag']) . '">' . "\n";
        }
        $html .= '</datalist>' . "\n";
    }
    $html .= '<ul id="selected">' . "\n";
    $list_tags = explode(',', $tags_post);
    // remove diacritics, so that "ééé" does not passe after "zzz" and reindexes
    foreach ($list_tags as $i => $tag) {
        $list_tags[$i] = array('t' => trim($tag), 'tt' => diacritique(trim($tag), FALSE, FALSE));
    }
    $list_tags = array_reverse(tri_selon_sous_cle($list_tags, 'tt'));
    foreach ($list_tags as $i => $tag) {
        $list_tags[$i] = $tag['t'];
    }
    foreach ($list_tags as $mytag => $mtag) {
        if (!empty($mtag)) {
            $html .= "\t" . '<li><span>' . trim($mtag) . '</span><a href="javascript:void(0)" onclick="removeTag(this.parentNode)">×</a></li>' . "\n";
        }
    }
    $html .= '</ul>' . "\n";
    return $html;
}
Example #2
0
function encart_categories($mode)
{
    if ($GLOBALS['activer_categories'] == '1') {
        $where = $mode == 'links' ? 'links' : 'articles';
        $ampmode = $mode == 'links' ? '&amp;mode=links' : '';
        $liste = list_all_tags($where, '1');
        // attach non-diacritic versions of tag, so that "ééé" does not pass after "zzz" and re-indexes
        foreach ($liste as $tag => $nb) {
            $liste[$tag] = array(diacritique(trim($tag), FALSE, FALSE), $nb);
        }
        // sort tags according non-diacritics versions of tags
        $liste = array_reverse(tri_selon_sous_cle($liste, 0));
        $uliste = '<ul>' . "\n";
        // remove diacritics: array is now (arr)liste { (str)tag=> (in)nb }
        foreach ($liste as $tag => $nb) {
            $liste[$tag] = $nb[1];
        }
        // create the <UL> with "tags (nb) "
        foreach ($liste as $tag => $nb) {
            $tagurl = urlencode(trim($tag));
            $uliste .= "\t" . '<li><a href="' . basename($_SERVER['PHP_SELF']) . '?tag=' . $tagurl . $ampmode . '" rel="tag">' . ucfirst($tag) . ' (' . $nb . ')</a></li>' . "\n";
        }
        $uliste .= '</ul>' . "\n";
        return $uliste;
    }
}
Example #3
0
    foreach ($autotags as $tag) {
        if ($description[$tag] != '') {
            $descr = $description[$tag];
        } else {
            // Permissions and Description not supported
            $descr = "Part of the " . $plugins_tags[$tag] . " plugin";
        }
        $display .= "<TR><TD>{$tag}</TD><TD>{$descr}</TD></TR>\n";
    }
    $display .= '</TABLE>';
    return $display;
}
$mode = '';
if (isset($_GET['mode'])) {
    $mode = COM_applyFilter($_GET['mode']);
}
$display = '';
if ($mode == 'popup') {
    // if you want to put the list of tags in a popup window, use
    // this mode.
    $display = '<html><body>' . '<div style="text-align:right"><a href="javascript:window.close()">' . $LANG_AUTO['window_close'] . '</a></div>';
    $display .= list_all_tags();
    $display .= '</body></html>';
} else {
    $display .= COM_siteHeader('menu', $LANG_AUTO['list_all_title']);
    $display .= COM_startBlock($LANG_AUTO['list_all_title']);
    $display .= list_all_tags();
    $display .= COM_endBlock();
    $display .= COM_siteFooter();
}
echo $display;
Example #4
0
function encart_categories($mode)
{
    if ($GLOBALS['activer_categories'] == '1') {
        $where = $mode == 'links' ? 'links' : 'articles';
        $ampmode = $mode == 'links' ? '&amp;mode=links' : '';
        $liste = list_all_tags($where, '1');
        // remove diacritics, so that "ééé" does not passe after "zzz" and re-indexes
        foreach ($liste as $i => $tag) {
            $liste[$i]['diac'] = diacritique(trim($tag['tag']), FALSE, FALSE);
        }
        $liste = array_reverse(tri_selon_sous_cle($liste, 'diac'));
        $uliste = '<ul>' . "\n";
        foreach ($liste as $tag) {
            $tagurl = urlencode(trim($tag['tag']));
            $uliste .= "\t" . '<li><a href="' . $_SERVER['PHP_SELF'] . '?tag=' . $tagurl . $ampmode . '" rel="tag">' . ucfirst($tag['tag']) . ' (' . $tag['nb'] . ')</a></li>' . "\n";
        }
        $uliste .= '</ul>' . "\n";
        return $uliste;
    }
}