From 67a5659ae66126985db4db341cf7330293bd2115 Mon Sep 17 00:00:00 2001
From: Ian
Date: Sun, 28 Sep 2014 10:40:31 +0200
Subject: [PATCH] freetag decode fix and list option
---
serendipity_event_freetag/.htaccess | 7 +
serendipity_event_freetag/ChangeLog | 11 +
serendipity_event_freetag/README | 52 ++
.../UTF-8/documentation_cs.html | 354 --------------
.../UTF-8/documentation_cz.html | 354 --------------
.../UTF-8/lang_de.inc.php | 17 +-
.../documentation_cs.html | 184 +++++++
.../documentation_cz.html | 184 +++++++
.../documentation_en.html | 277 +++++++++++
serendipity_event_freetag/lang_de.inc.php | 19 +-
serendipity_event_freetag/lang_en.inc.php | 17 +-
.../serendipity_event_freetag.php | 450 ++++++++++--------
12 files changed, 1007 insertions(+), 919 deletions(-)
create mode 100644 serendipity_event_freetag/.htaccess
delete mode 100644 serendipity_event_freetag/UTF-8/documentation_cs.html
delete mode 100644 serendipity_event_freetag/UTF-8/documentation_cz.html
create mode 100644 serendipity_event_freetag/documentation_en.html
diff --git a/serendipity_event_freetag/.htaccess b/serendipity_event_freetag/.htaccess
new file mode 100644
index 00000000..a88a85c7
--- /dev/null
+++ b/serendipity_event_freetag/.htaccess
@@ -0,0 +1,7 @@
+
+Allow from all
+
+
+
+RewriteEngine Off
+
diff --git a/serendipity_event_freetag/ChangeLog b/serendipity_event_freetag/ChangeLog
index 6bda3f8e..ccfcd153 100644
--- a/serendipity_event_freetag/ChangeLog
+++ b/serendipity_event_freetag/ChangeLog
@@ -1,3 +1,14 @@
+3.58:
+----
+* Fix doubled encoded umlaut taglinks by searchengines backlinks.
+* Added a new option to allow showing taglink entries as a linklist.
+ This adds a 'taglist' tag as a reserved command to tags,
+ which not allows this tag as a normal tag any further.
+ The addition can be done either by the preset taglink as "/plugin/taglist/"
+ or manually added by certain taglinks as "/plugin/tag/allyourtags/taglist".
+ This needs you to modify your templates entries.tpl file,
+ as described in the documentation file or the README.
+
3.57:
----
Stricter array check to prevent PHP notices
diff --git a/serendipity_event_freetag/README b/serendipity_event_freetag/README
index bca933ef..5d7beb22 100644
--- a/serendipity_event_freetag/README
+++ b/serendipity_event_freetag/README
@@ -63,3 +63,55 @@ foreach($rows AS $row) {
htmlspecialchars($row['title'])
);
}
+
+
+
+The following code illustrates on how to change your templates entries.tpl file in case of enabled option 'tags-as-list':
+
+{serendipity_hookPlugin hook="entries_header" addData="$entry_id"}
+
+{if $taglist}
+
+
+
{$head_subtitle}
+ {foreach from=$entries item="dategroup"}
+ {foreach from=$dategroup.entries item="entry"}
+
+
+
+ {/foreach}
+ {/foreach}
+
+
+
+
+{else}
+
+--- OLD CODE START-and keep --
+
+{foreach from=$entries item="dategroup"}
+ {foreach from=$dategroup.entries item="entry"}
+ {assign var="entry" value=$entry scope="parent"}
+ *** LONG CODE FOR THE entries output article ***
+ {/foreach}
+{foreachelse}
+ {if not $plugin_clean_page}
+ {$CONST.NO_ENTRIES_TO_PRINT}
+ {/if}
+{/foreach}
+
+--- OLD CODE END and keep---
+
+{/if}{* not taglist end *}
+
+--- OLD CODE FOOTER INFO START and keep ---
+
+{if $footer_info or $footer_prev_page or $footer_next_page}
+ *** inside CODE ***
+{/if}
+
+--- OLD CODE FOOTER INFO END and keep ---
+
+ {serendipity_hookPlugin hook="entries_footer"}
diff --git a/serendipity_event_freetag/UTF-8/documentation_cs.html b/serendipity_event_freetag/UTF-8/documentation_cs.html
deleted file mode 100644
index e75c927e..00000000
--- a/serendipity_event_freetag/UTF-8/documentation_cs.html
+++ /dev/null
@@ -1,354 +0,0 @@
-
-
-
- Dokumentace: Freetag
-
-
-
-
-
-Dokumentace k pluginu 'Freetag'
- (serendipity_event_freetag)
-
-Dokumentaci k tomuto pluginu přeložil do češtiny Vladimír Ajgl (vlada [zavinac] ajgl [tecka] cz) a naposledy zkontroloval dne 20.4.2013. Od té doby mohl být plugin pozměněn nebo mohly být rozšířené jeho funkce. Zkontrolujte pro jistotu i aktuální anglické "README" , "README.txt" a ChangeLog .
-
-
-
Popis pluginu
-
-Umožňuje libovolné přidávání klíčových slov k příspěvkům
-
-
- Užitečné skripty
-
-Následující kód ukazuje příklad, jak použít rozšířený výstup do smarty šablony. Takto může například vypadat šablona "entries.tpl"
-
-{if isset($entry.freetag.extended) && $entry.freetag.extended == 1}
- {if $entry.freetag.tags.tags}
- <div class="serendipity_freeTag">{$entry.freetag.tags.description}
- {foreach from=$entry.freetag.tags.tags item="tag"}
- {$tag}
- {/foreach}
- </div>
-
- {if $is_single_entry or $is_preview}
- {$entry.freetag.related.description}
- <ul class="serendipity_freeTag_related">
- {foreach from=$entry.freetag.related.entries item="link"}
- <li>{$link}</li>
- {/foreach}
- </ul>
- {/if}
- {/if}
-{else}
- {$entry.freetag}
-{/if}
-
-
-
-
-Pomocí následujícího sql dotazu můžete v databázi vytvořit tagy z existujících kategorií:
-
-INSERT INTO serendipity_entrytags (entryid, tag)
- SELECT serendipity_entries.id, serendipity_category.category_name
- FROM serendipity_entries, serendipity_category, serendipity_entrycat
- WHERE serendipity_entrycat.entryid = serendipity_entries.id
- AND serendipity_category.categoryid = serendipity_entrycat.categoryid;
-
-(převzato z http://pixelated-dreams.com/archives/229-Spring-Cleaning.html )
-
-
-A nebo můžete pro vytvoření tagů z kategorií použít následující skript:
-
-<?php
-include 'serendipity_config.inc.php';
-
-$rows = serendipity_db_query("SELECT e.id, e.title, c.category_name
- FROM {$serendipity['dbPrefix']}entries AS e
- JOIN {$serendipity['dbPrefix']}entrycat AS ec
- ON ec.entryid = e.id
- JOIN {$serendipity['dbPrefix']}category AS c
- ON ec.categoryid = c.categoryid");
-
-foreach($rows AS $row) {
- serendipity_db_query(
- sprintf(
- "REPLACE INTO {$serendipity['dbPrefix']}entrytags (entryid, tag) VALUES (%d, %s)",
- (int)$row['id'],
- serendipity_db_escape_string($row['category_name'])
- )
- );
-
- printf(
- "Category '%s' added as Tag for Entry #%d, '%s'<br />\n",
- htmlspecialchars($row['category_name']),
- (int)$row['id'],
- htmlspecialchars($row['title'])
- );
-}
-?>
-
-
-
-
-Historie verzí (ChangeLog)
-
-
-verze 3.43
-
- Statické opravy pro kompatibilitu freetag<->flattr (žádné chyby PHP5)
-
-verze 3.42
-
- Statické opravy pro generování spartacus
-
-verze 3.41
-
- Deklarace metody install() jako statické
-
-verze 3.39
-
- Přidána specifická kontrola is_array($eventData), díky uživateli [gregman]
-
-verze 3.38
-
- Přidán chybějící fieldset v případě, že není nastavený admin_show_taglist (díky uživateli [gregman])
-
-verze 3.37
-
- Při publikování příspěvku je nahrazení cat2tag provedeno, i když jsou tagy prázdné, takže název kategorie se v tagách objeví vždycky.
-
-verze 3.36
-
- Opraven [tag] v jedné instanci formulářového pole v HTML, díky uživateli [ascger] z diskuzního fóra
-
-verze 3.35
-
- Opraveno - Změna některých instancí [tag] na %5Btag%5D, který je kompatibilní s HTML - bug č.3427291
-
-verze 3.34
-
- Pro mysql použít pouze sql dotaz SHOW.
-
-verze 3.33
-
- Odkazy na https:// místo http://, aby správně fungoval backend na serverech se zapnutým SSL. Díky uživateli [Manko10].
-
-verze 3.30, 3.31, 3.32
-
- Aktualizováno - použitý přiložený tagcloud.swf od WP-Cumulus/Roy Tanck na verzi 1.23.
- Opraveno - Hrozba HTML injection nahlášená uživatelem [MustLive]
- Opraveno - Hrozba XSS (Cross Site Scripting) nahlášená uživatelem [Stefan Schurtz]
-
-verze 3.28
-
- Možnost použití konstrukce ?serendipity[tag]=Tag1;Tag2;Tag3
-
-verze 3.27
-
- Správná detekce porovnání (collation) v MySQL databázi
-
-verze 3.26
-
- Přidána kontrola is_array() [Timbalu]
-
-verze 3.25
-
- Oprava kódování databáze
-
-verze 3.24
-
- Přidáno kórování databáze (MySQL), oprava od uživatele [Vincent]
-
-verze 3.23
-
-verze 3.22
-
- Ošetřen možný XSS útok (Cross Site Scripting) reportovaný uživatelem [Stefan Schurtz] (SSCHADV2011-004)
-
-verze 3.21
-
- Přidán háček (event hook) "sort" pro plugin serendipity_event_sort (autor [lazybadger])
-
-verze 3.20
-
- Mrak tagů se zobrazuje jako smarty šablona "plugin_freetag.tpl". Pokud si chcete přizpůsobit výstup, zkopírujte tento soubor do adresáře vašeho stylu vzhledu a upravte ho dle sebe.
-
-verze 3.18
-
- Automatická detekce klíčových slov nyní funguje pouze vně html tagů, takže nic jako <a href="..//serendipity/"> nyní nebude detekováno jako klíčové slovo 'serendipity'
-
-verze 3.17
-
- Přidána funkce do administrátorské sekce: vyčištění tagů přiřazených k neexistujícím příspěvkům.
- Text potvrzovacího tlačítko ve formuláři pro přejmenování tagu už není zadán natvrdo, ale dá se přeložit.
- Opravena chyba v syntaxi HTML ve formuláři pro přejmenování tagu, a to použitím odpovídající HTML entity.
-
-verze 3.16
-
- Oprava chyby: Klíčová slova (meta-keywords) se nezobrazovala v příspěvcích.
-
-verze 3.15
-
- Odstraněna nesprávná chybová hláška "FATAL ERROR! Unrecognized type for
-serendipity_event_freetag:: !"
- (Fatální chyba! Neznámý typ pro serendipity_event_freetag:: !)
-
-verze 3.13, 3.14
-
- Přidáno volání funkce mb_internal_encoding() pro správný převod znaků na malá písmena.
-
-verze 3.12.1
-
- Nahrazeno "wick-based" automatické doplňování jquery pluginem (wick nefungoval v Opeře)
-
-verze 3.11.0
-
- Přidána volba, zda mají být tagy přidány na základě automatického hledání klíčových slov.
- Opraveny falešné výsledky při změně hledání na regulární výrazy.
-
-verze 3.10.5
-
- Chytání očekávaných chyb v tagcloud query.
-
-verze 3.10.4
-
- Přidána další kontrola na prázdný výsledek pro potlačení chybových hlášek databáze.
-
-verze 3.10.3
-
- Opraveny chybějící tagy v náhledu uloženého příspěvku v přehledu příspěvků.
- Opraveno připojování výstupu k náhledu v editoru.
-
-verze 3.10.2
-
- Opravena chybná detekce rozšířeného/jednoduchého příspěvku.
-
-verze 3.10
-
- Produkuje podobné články jako nečíslovaný seznam <ul>
- Zanoření o jeden krok níže při prohledávání podobných tagů.
- "Podobné tagy" je nyní odstavec <p> míst původního bloku <div>
- Zaveden rozšířený Smarty-Markup
- Vyčištění kódu v displayEntry()
-
-verze 3.09
-
- Opraveno chybějící escapování proměnných v SQL dotazech.
-
-verze 3.08 [Chessnut]
-
- Při prohlížení příspěvků podle tagů nejsou používána omezení kategoriemi (jako například v pluginu startcat)
-
-verze 3.07
-
- Kontrola, že se pole array vytvoří pouze při úspěšném provedení SQL dotazu.
-
-verze 3.06 [garvinhicking]
-
- Oprava automatického hledání dle klíčových slov i na tagy s velkými písmeny.
-
-verze 3.05 [garvinhicking]
-
- Používání pouze flash-bg/fg barev, pokud je flash cloud zapnut.
-
-verze 3.04 [garvinhicking]
-
-verze 3.03 [garvinhicking]
-
- Přidáno escapování databáze při čtení tagů.
- Opraven duplicitní řetězec LIMIT v SQl dotazu. (Díky uživateli [rupa])
-
-verze 3.01 [designor]
-
- Optimalizace výstupu, použití nejnovějšího SWFObject.
-
-verze 3.0 [lstrojny]
-
-verze 2.51 [lstrojny]
-
- Opraveno řazení tagů při použití se šablonou.
-
-verze 2.5 [lstrojny]
-
- Přidání možnosti použití Smarty šablony pro vykreslení postranního sloupce.
- Sjednocení čísel verzí.
-
-verze 2.105 [RobA]
-
- Opravy ve Flashi, omezování počtu tagů, výchozí hodnoty nastavení.
-
-verze 2.103 [RobA]
-
- Přidán rotující Flashový tagcloud (mrak tagů)
-
-verze 2.97 [garvinhicking]
-
- Možnost umístění tagů do smarty šablony pomocí {$entry.freetag}, pokud je nastaveno použití smarty.
-
-verze 2.96 [garvinhicking]
-
-verze 2.95 [garvinhicking]
-
- Přidán nastavitelný obrázek technorati
-
-verze 2.92/2.45 [brockhaus]
-
- Přidáno nastavení pro XML obrázek
-
-verze 2.88/2.44 [brockhaus]
-
- Přidán volitelný tag technorati za tagy v patičce příspěvku.
-
-verze 2.88/2.43 [brockhaus]
-
- Přidána možnost nastavení minimální/maximální velikosti fontu v postranním sloupci.
-
-verze 2.88/2.42 [garvinhicking]
-
- Řazení tagů v postranním sloupci bez ohledu na velikost písmen.
-
-verze 2.88/2.41 [brockhaus]
-
- Plugin pro postranní sloupec vždycky načetl prvních X tagů podle jména, ne podle příbuznosti (tagcount, počet tagů). Tedy příbuzné/podobné tagy tagy na konci abecedy se nezobrazovaly.
-
-verze 2.70
-
- Přidána možnost "automatické tagy". To znamená, které tagy přiřadit k příspěvku, pokud jsou v něm nalezena klíčová slova svázaná s tagem.
-
-verze 2.64
-
- Přidána volba pro převod kategorií na tagy.
-
-verze 2.48
-
- Nastavení pro převod na mlá písmena, oprava od [Lars Strojny]
-
-verze 2.47
-
- Lepší zobrazování meta-informací
-
-verze 2.44
-
- Zobrazování podobných příspěvků, oprava od [Stain]
- Změna místa zobrazování tagů, nyní nastavitelné uživatelem.
-
-
-
-
-
-
diff --git a/serendipity_event_freetag/UTF-8/documentation_cz.html b/serendipity_event_freetag/UTF-8/documentation_cz.html
deleted file mode 100644
index e75c927e..00000000
--- a/serendipity_event_freetag/UTF-8/documentation_cz.html
+++ /dev/null
@@ -1,354 +0,0 @@
-
-
-
- Dokumentace: Freetag
-
-
-
-
-
-Dokumentace k pluginu 'Freetag'
- (serendipity_event_freetag)
-
-Dokumentaci k tomuto pluginu přeložil do češtiny Vladimír Ajgl (vlada [zavinac] ajgl [tecka] cz) a naposledy zkontroloval dne 20.4.2013. Od té doby mohl být plugin pozměněn nebo mohly být rozšířené jeho funkce. Zkontrolujte pro jistotu i aktuální anglické "README" , "README.txt" a ChangeLog .
-
-
-
Popis pluginu
-
-Umožňuje libovolné přidávání klíčových slov k příspěvkům
-
-
- Užitečné skripty
-
-Následující kód ukazuje příklad, jak použít rozšířený výstup do smarty šablony. Takto může například vypadat šablona "entries.tpl"
-
-{if isset($entry.freetag.extended) && $entry.freetag.extended == 1}
- {if $entry.freetag.tags.tags}
- <div class="serendipity_freeTag">{$entry.freetag.tags.description}
- {foreach from=$entry.freetag.tags.tags item="tag"}
- {$tag}
- {/foreach}
- </div>
-
- {if $is_single_entry or $is_preview}
- {$entry.freetag.related.description}
- <ul class="serendipity_freeTag_related">
- {foreach from=$entry.freetag.related.entries item="link"}
- <li>{$link}</li>
- {/foreach}
- </ul>
- {/if}
- {/if}
-{else}
- {$entry.freetag}
-{/if}
-
-
-
-
-Pomocí následujícího sql dotazu můžete v databázi vytvořit tagy z existujících kategorií:
-
-INSERT INTO serendipity_entrytags (entryid, tag)
- SELECT serendipity_entries.id, serendipity_category.category_name
- FROM serendipity_entries, serendipity_category, serendipity_entrycat
- WHERE serendipity_entrycat.entryid = serendipity_entries.id
- AND serendipity_category.categoryid = serendipity_entrycat.categoryid;
-
-(převzato z http://pixelated-dreams.com/archives/229-Spring-Cleaning.html )
-
-
-A nebo můžete pro vytvoření tagů z kategorií použít následující skript:
-
-<?php
-include 'serendipity_config.inc.php';
-
-$rows = serendipity_db_query("SELECT e.id, e.title, c.category_name
- FROM {$serendipity['dbPrefix']}entries AS e
- JOIN {$serendipity['dbPrefix']}entrycat AS ec
- ON ec.entryid = e.id
- JOIN {$serendipity['dbPrefix']}category AS c
- ON ec.categoryid = c.categoryid");
-
-foreach($rows AS $row) {
- serendipity_db_query(
- sprintf(
- "REPLACE INTO {$serendipity['dbPrefix']}entrytags (entryid, tag) VALUES (%d, %s)",
- (int)$row['id'],
- serendipity_db_escape_string($row['category_name'])
- )
- );
-
- printf(
- "Category '%s' added as Tag for Entry #%d, '%s'<br />\n",
- htmlspecialchars($row['category_name']),
- (int)$row['id'],
- htmlspecialchars($row['title'])
- );
-}
-?>
-
-
-
-
-Historie verzí (ChangeLog)
-
-
-verze 3.43
-
- Statické opravy pro kompatibilitu freetag<->flattr (žádné chyby PHP5)
-
-verze 3.42
-
- Statické opravy pro generování spartacus
-
-verze 3.41
-
- Deklarace metody install() jako statické
-
-verze 3.39
-
- Přidána specifická kontrola is_array($eventData), díky uživateli [gregman]
-
-verze 3.38
-
- Přidán chybějící fieldset v případě, že není nastavený admin_show_taglist (díky uživateli [gregman])
-
-verze 3.37
-
- Při publikování příspěvku je nahrazení cat2tag provedeno, i když jsou tagy prázdné, takže název kategorie se v tagách objeví vždycky.
-
-verze 3.36
-
- Opraven [tag] v jedné instanci formulářového pole v HTML, díky uživateli [ascger] z diskuzního fóra
-
-verze 3.35
-
- Opraveno - Změna některých instancí [tag] na %5Btag%5D, který je kompatibilní s HTML - bug č.3427291
-
-verze 3.34
-
- Pro mysql použít pouze sql dotaz SHOW.
-
-verze 3.33
-
- Odkazy na https:// místo http://, aby správně fungoval backend na serverech se zapnutým SSL. Díky uživateli [Manko10].
-
-verze 3.30, 3.31, 3.32
-
- Aktualizováno - použitý přiložený tagcloud.swf od WP-Cumulus/Roy Tanck na verzi 1.23.
- Opraveno - Hrozba HTML injection nahlášená uživatelem [MustLive]
- Opraveno - Hrozba XSS (Cross Site Scripting) nahlášená uživatelem [Stefan Schurtz]
-
-verze 3.28
-
- Možnost použití konstrukce ?serendipity[tag]=Tag1;Tag2;Tag3
-
-verze 3.27
-
- Správná detekce porovnání (collation) v MySQL databázi
-
-verze 3.26
-
- Přidána kontrola is_array() [Timbalu]
-
-verze 3.25
-
- Oprava kódování databáze
-
-verze 3.24
-
- Přidáno kórování databáze (MySQL), oprava od uživatele [Vincent]
-
-verze 3.23
-
-verze 3.22
-
- Ošetřen možný XSS útok (Cross Site Scripting) reportovaný uživatelem [Stefan Schurtz] (SSCHADV2011-004)
-
-verze 3.21
-
- Přidán háček (event hook) "sort" pro plugin serendipity_event_sort (autor [lazybadger])
-
-verze 3.20
-
- Mrak tagů se zobrazuje jako smarty šablona "plugin_freetag.tpl". Pokud si chcete přizpůsobit výstup, zkopírujte tento soubor do adresáře vašeho stylu vzhledu a upravte ho dle sebe.
-
-verze 3.18
-
- Automatická detekce klíčových slov nyní funguje pouze vně html tagů, takže nic jako <a href="..//serendipity/"> nyní nebude detekováno jako klíčové slovo 'serendipity'
-
-verze 3.17
-
- Přidána funkce do administrátorské sekce: vyčištění tagů přiřazených k neexistujícím příspěvkům.
- Text potvrzovacího tlačítko ve formuláři pro přejmenování tagu už není zadán natvrdo, ale dá se přeložit.
- Opravena chyba v syntaxi HTML ve formuláři pro přejmenování tagu, a to použitím odpovídající HTML entity.
-
-verze 3.16
-
- Oprava chyby: Klíčová slova (meta-keywords) se nezobrazovala v příspěvcích.
-
-verze 3.15
-
- Odstraněna nesprávná chybová hláška "FATAL ERROR! Unrecognized type for
-serendipity_event_freetag:: !"
- (Fatální chyba! Neznámý typ pro serendipity_event_freetag:: !)
-
-verze 3.13, 3.14
-
- Přidáno volání funkce mb_internal_encoding() pro správný převod znaků na malá písmena.
-
-verze 3.12.1
-
- Nahrazeno "wick-based" automatické doplňování jquery pluginem (wick nefungoval v Opeře)
-
-verze 3.11.0
-
- Přidána volba, zda mají být tagy přidány na základě automatického hledání klíčových slov.
- Opraveny falešné výsledky při změně hledání na regulární výrazy.
-
-verze 3.10.5
-
- Chytání očekávaných chyb v tagcloud query.
-
-verze 3.10.4
-
- Přidána další kontrola na prázdný výsledek pro potlačení chybových hlášek databáze.
-
-verze 3.10.3
-
- Opraveny chybějící tagy v náhledu uloženého příspěvku v přehledu příspěvků.
- Opraveno připojování výstupu k náhledu v editoru.
-
-verze 3.10.2
-
- Opravena chybná detekce rozšířeného/jednoduchého příspěvku.
-
-verze 3.10
-
- Produkuje podobné články jako nečíslovaný seznam <ul>
- Zanoření o jeden krok níže při prohledávání podobných tagů.
- "Podobné tagy" je nyní odstavec <p> míst původního bloku <div>
- Zaveden rozšířený Smarty-Markup
- Vyčištění kódu v displayEntry()
-
-verze 3.09
-
- Opraveno chybějící escapování proměnných v SQL dotazech.
-
-verze 3.08 [Chessnut]
-
- Při prohlížení příspěvků podle tagů nejsou používána omezení kategoriemi (jako například v pluginu startcat)
-
-verze 3.07
-
- Kontrola, že se pole array vytvoří pouze při úspěšném provedení SQL dotazu.
-
-verze 3.06 [garvinhicking]
-
- Oprava automatického hledání dle klíčových slov i na tagy s velkými písmeny.
-
-verze 3.05 [garvinhicking]
-
- Používání pouze flash-bg/fg barev, pokud je flash cloud zapnut.
-
-verze 3.04 [garvinhicking]
-
-verze 3.03 [garvinhicking]
-
- Přidáno escapování databáze při čtení tagů.
- Opraven duplicitní řetězec LIMIT v SQl dotazu. (Díky uživateli [rupa])
-
-verze 3.01 [designor]
-
- Optimalizace výstupu, použití nejnovějšího SWFObject.
-
-verze 3.0 [lstrojny]
-
-verze 2.51 [lstrojny]
-
- Opraveno řazení tagů při použití se šablonou.
-
-verze 2.5 [lstrojny]
-
- Přidání možnosti použití Smarty šablony pro vykreslení postranního sloupce.
- Sjednocení čísel verzí.
-
-verze 2.105 [RobA]
-
- Opravy ve Flashi, omezování počtu tagů, výchozí hodnoty nastavení.
-
-verze 2.103 [RobA]
-
- Přidán rotující Flashový tagcloud (mrak tagů)
-
-verze 2.97 [garvinhicking]
-
- Možnost umístění tagů do smarty šablony pomocí {$entry.freetag}, pokud je nastaveno použití smarty.
-
-verze 2.96 [garvinhicking]
-
-verze 2.95 [garvinhicking]
-
- Přidán nastavitelný obrázek technorati
-
-verze 2.92/2.45 [brockhaus]
-
- Přidáno nastavení pro XML obrázek
-
-verze 2.88/2.44 [brockhaus]
-
- Přidán volitelný tag technorati za tagy v patičce příspěvku.
-
-verze 2.88/2.43 [brockhaus]
-
- Přidána možnost nastavení minimální/maximální velikosti fontu v postranním sloupci.
-
-verze 2.88/2.42 [garvinhicking]
-
- Řazení tagů v postranním sloupci bez ohledu na velikost písmen.
-
-verze 2.88/2.41 [brockhaus]
-
- Plugin pro postranní sloupec vždycky načetl prvních X tagů podle jména, ne podle příbuznosti (tagcount, počet tagů). Tedy příbuzné/podobné tagy tagy na konci abecedy se nezobrazovaly.
-
-verze 2.70
-
- Přidána možnost "automatické tagy". To znamená, které tagy přiřadit k příspěvku, pokud jsou v něm nalezena klíčová slova svázaná s tagem.
-
-verze 2.64
-
- Přidána volba pro převod kategorií na tagy.
-
-verze 2.48
-
- Nastavení pro převod na mlá písmena, oprava od [Lars Strojny]
-
-verze 2.47
-
- Lepší zobrazování meta-informací
-
-verze 2.44
-
- Zobrazování podobných příspěvků, oprava od [Stain]
- Změna místa zobrazování tagů, nyní nastavitelné uživatelem.
-
-
-
-
-
-
diff --git a/serendipity_event_freetag/UTF-8/lang_de.inc.php b/serendipity_event_freetag/UTF-8/lang_de.inc.php
index 2daf047c..7fef70c4 100644
--- a/serendipity_event_freetag/UTF-8/lang_de.inc.php
+++ b/serendipity_event_freetag/UTF-8/lang_de.inc.php
@@ -1,4 +1,4 @@
-
+
+
+Option: Tags-as-list
+
+The following code illustrates on how to change your templates entries.tpl file (all + lines, without '+ '):
+
+
+{serendipity_hookPlugin hook="entries_header" addData="$entry_id"}
++ {if $taglist}
++ <article id="taglistentries" class="clearfix serendipity_entry">
++ <div class="clearfix content serendipity_entry_body">
++ <h2>{$head_subtitle}</h2>
++ {foreach from=$entries item="dategroup"}
++ {foreach from=$dategroup.entries item="entry"}
++
++ <div class="static-entries-list">
++ ({$dategroup.date|date_format:"%d.%m.%Y"}) <a href="{$entry.link}">{$entry.title|default:$entry.id}</a>
++ </div>
++
++ {/foreach}
++ {/foreach}
++
++ </div>
++ </article>
++
++ {else}
++
+{foreach from=$entries item="dategroup"}
+ {foreach from=$dategroup.entries item="entry"}
+ {assign var="entry" value=$entry scope="parent"}
+ <article id="post_{$entry.id}" class="clearfix serendipity_entry{if $dategroup.is_sticky} sticky{/if}">
+ <header class="clearfix">
+
+ <h2><a href="{$entry.link}">{$entry.title}</a></h2>
+
+ <span class="serendipity_byline block_level"><span class="single_user">{$CONST.POSTED_BY} <a href="{$entry.link_author}">{$entry.author}</a> {$CONST.ON} </span><time datetime="{$entry.timestamp|@serendipity_html5time}">{$entry.timestamp|@formatTime:$template_option.date_format}</time>{if $entry.is_entry_owner and not $is_preview} | <a href="{$entry.link_edit}">{$CONST.EDIT_ENTRY}</a>{/if}</span>
+ </header>
+
+ <div class="clearfix content serendipity_entry_body">
+ {if $entry.categories}{foreach from=$entry.categories item="entry_category"}{if $entry_category.category_icon}<a href="{$entry_category.category_link}"><img class="serendipity_entryIcon" title="{$entry_category.category_name|@escape}{$entry_category.category_description|@emptyPrefix}" alt="{$entry_category.category_name|@escape}" src="{$entry_category.category_icon}"></a>{/if}{/foreach}{/if}
+ {$entry.body}
+ {if $entry.has_extended and not $is_single_entry and not $entry.is_extended}
+ <a class="read_more block_level" href="{$entry.link}#extended">{$CONST.VIEW_EXTENDED_ENTRY|@sprintf:$entry.title}</a>
+ {/if}
+ </div>
+ {if $entry.is_extended}
+ <div id="extended" class="clearfix content">
+ {$entry.extended}
+ </div>
+ {/if}
+ {if $entry.plugin_display_dat}
+ {$entry.plugin_display_dat}
+ {/if}
+
+ <footer class="clearfix">
+ {if $entry.categories}
+ <span class="visuallyhidden">{$CONST.CATEGORIES}: </span>{foreach from=$entry.categories item="entry_category" name="categories"}<a href="{$entry_category.category_link}">{$entry_category.category_name|@escape}</a>{if not $smarty.foreach.categories.last}, {/if}{/foreach}
+ {/if}
+ {if $entry.categories and ($entry.has_comments or $entry.has_disqus)} | {/if}
+ {if ($entry.has_comments or $entry.has_disqus)}
+ {if $entry.has_disqus }
+ {$entry.comments}{if $entry.has_trackbacks}, <a href="{$entry.link}#trackbacks">{$entry.trackbacks} {$entry.label_trackbacks}</a>{/if}
+ {else}
+ <a href="{$entry.link}#comments" title="{$entry.comments} {$entry.label_comments}{if $entry.has_trackbacks}, {$entry.trackbacks} {$entry.label_trackbacks}{/if}">{$entry.comments} {$entry.label_comments}</a>
+ {/if}
+ {/if}
+ {if $entry.url_tweetthis}
+ | <a href="{$entry.url_tweetthis}" title="{$CONST.TWOK11_TWEET_THIS}">Twitter</a>
+ {/if}
+ {if $entry.url_dentthis}
+ | <a href="{$entry.url_dentthis}" title="{$CONST.TWOK11_DENT_THIS}">Identica</a>
+ {/if}
+ {if $entry.url_shorturl}
+ | <a href="{$entry.url_shorturl}" title="{$CONST.TWOK11_SHORT_URL_HINT}" class="short-url">{$CONST.TWOK11_SHORT_URL}</a>
+ {/if}
+ {$entry.add_footer}
+ </footer>
+
+ <!--
+ <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"
+ xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <rdf:Description
+ rdf:about="{$entry.link_rdf}"
+ trackback:ping="{$entry.link_trackback}"
+ dc:title="{$entry.title_rdf|@default:$entry.title}"
+ dc:identifier="{$entry.rdf_ident}" />
+ </rdf:RDF>
+ -->
+
+ {if $is_single_entry and not $is_preview}
+ {if $CONST.DATA_UNSUBSCRIBED}
+ <p class="serendipity_msg_notice">{$CONST.DATA_UNSUBSCRIBED|@sprintf:$CONST.UNSUBSCRIBE_OK}</p>
+ {/if}
+ {if $CONST.DATA_TRACKBACK_DELETED}
+ <p class="serendipity_msg_notice">{$CONST.DATA_TRACKBACK_DELETED|@sprintf:$CONST.TRACKBACK_DELETED}</p>
+ {/if}
+ {if $CONST.DATA_TRACKBACK_APPROVED}
+ <p class="serendipity_msg_notice">{$CONST.DATA_TRACKBACK_APPROVED|@sprintf:$CONST.TRACKBACK_APPROVED}</p>
+ {/if}
+ {if $CONST.DATA_COMMENT_DELETED}
+ <p class="serendipity_msg_notice">{$CONST.DATA_COMMENT_DELETED|@sprintf:$CONST.COMMENT_DELETED}</p>
+ {/if}
+ {if $CONST.DATA_COMMENT_APPROVED}
+ <p class="serendipity_msg_notice">{$CONST.DATA_COMMENT_APPROVED|@sprintf:$CONST.COMMENT_APPROVED}</p>
+ {/if}
+
+ <section id="trackbacks" class="serendipity_comments serendipity_section_trackbacks">
+ <h3>{$CONST.TRACKBACKS}</h3>
+
+ <div id="trackback_url" class="block_level"><a rel="nofollow" href="{$entry.link_trackback}" title="{$CONST.TRACKBACK_SPECIFIC_ON_CLICK|@escape}">{$CONST.TRACKBACK_SPECIFIC}</a></div>
+
+ {serendipity_printTrackbacks entry=$entry.id}
+ </section>
+
+ <section id="comments" class="serendipity_comments serendipity_section_comments">
+ <h3>{$CONST.COMMENTS}</h3>
+
+ <p class="manage_comments">{$CONST.DISPLAY_COMMENTS_AS}
+ {if $entry.viewmode eq $CONST.VIEWMODE_LINEAR}
+ {$CONST.COMMENTS_VIEWMODE_LINEAR} | <a href="{$entry.link_viewmode_threaded}#comments" rel="nofollow">{$CONST.COMMENTS_VIEWMODE_THREADED}</a>
+ {else}
+ <a rel="nofollow" href="{$entry.link_viewmode_linear}#comments">{$CONST.COMMENTS_VIEWMODE_LINEAR}</a> | {$CONST.COMMENTS_VIEWMODE_THREADED}
+ {/if}
+ </p>
+
+ {serendipity_printComments entry=$entry.id mode=$entry.viewmode}
+ {if $entry.is_entry_owner}
+ <p class="manage_comments">
+ {if $entry.allow_comments}
+ <a href="{$entry.link_deny_comments}">{$CONST.COMMENTS_DISABLE}</a>
+ {else}
+ <a href="{$entry.link_allow_comments}">{$CONST.COMMENTS_ENABLE}</a>
+ {/if}
+ </p>
+ {/if}
+ </section>
+ <a id="feedback"></a>
+ {foreach from=$comments_messagestack item="message"}
+ <p class="serendipity_msg_important">{$message}</p>
+ {/foreach}
+ {if $is_comment_added}
+ <p class="serendipity_msg_notice">{$CONST.COMMENT_ADDED}</p>
+ {elseif $is_comment_moderate}
+ <p class="serendipity_msg_notice">{$CONST.COMMENT_ADDED}: {$CONST.THIS_COMMENT_NEEDS_REVIEW}</p>
+ {elseif not $entry.allow_comments}
+ <p class="serendipity_msg_important">{$CONST.COMMENTS_CLOSED}</p>
+ {/if}
+ <section id="respond" class="serendipity_section_commentform">
+ <h3>{$CONST.ADD_COMMENT}</h3>
+ {$COMMENTFORM}
+ </section>
+
+ {/if}
+ {$entry.backend_preview}
+ </article>
+ {/foreach}
+{foreachelse}
+ {if not $plugin_clean_page}
+ <p class="nocontent">{$CONST.NO_ENTRIES_TO_PRINT}</p>
+ {/if}
+{/foreach}
++
++ {/if}{* not taglist end *}
++
+{if $footer_info or $footer_prev_page or $footer_next_page}
+ <nav class="serendipity_pagination block_level">
+ <h2 class="visuallyhidden">{$CONST.TWOK11_PAG_TITLE}</h2>
+
+ <ul class="clearfix">
+ {if $footer_info}
+ <li class="info"><span>{$footer_info}</span></li>
+ {/if}
+ <li class="prev">{if $footer_prev_page}<a href="{$footer_prev_page}">{/if}{if $footer_prev_page}← {$CONST.PREVIOUS_PAGE}{else} {/if}{if $footer_prev_page}</a>{/if}</li>
+ <li class="next">{if $footer_next_page}<a href="{$footer_next_page}">{/if}{if $footer_next_page}{$CONST.NEXT_PAGE} →{else} {/if}{if $footer_next_page}</a>{/if}</li>
+ </ul>
+ </nav>
+{/if}
+ {serendipity_hookPlugin hook="entries_footer"}
+
+
+
+
Historie verz (ChangeLog)
+{serendipity_hookPlugin hook="entries_header" addData="$entry_id"}
++ {if $taglist}
++ <article id="taglistentries" class="clearfix serendipity_entry">
++ <div class="clearfix content serendipity_entry_body">
++ <h2>{$head_subtitle}</h2>
++ {foreach from=$entries item="dategroup"}
++ {foreach from=$dategroup.entries item="entry"}
++
++ <div class="static-entries-list">
++ ({$dategroup.date|date_format:"%d.%m.%Y"}) <a href="{$entry.link}">{$entry.title|default:$entry.id}</a>
++ </div>
++
++ {/foreach}
++ {/foreach}
++
++ </div>
++ </article>
++
++ {else}
++
+{foreach from=$entries item="dategroup"}
+ {foreach from=$dategroup.entries item="entry"}
+ {assign var="entry" value=$entry scope="parent"}
+ <article id="post_{$entry.id}" class="clearfix serendipity_entry{if $dategroup.is_sticky} sticky{/if}">
+ <header class="clearfix">
+
+ <h2><a href="{$entry.link}">{$entry.title}</a></h2>
+
+ <span class="serendipity_byline block_level"><span class="single_user">{$CONST.POSTED_BY} <a href="{$entry.link_author}">{$entry.author}</a> {$CONST.ON} </span><time datetime="{$entry.timestamp|@serendipity_html5time}">{$entry.timestamp|@formatTime:$template_option.date_format}</time>{if $entry.is_entry_owner and not $is_preview} | <a href="{$entry.link_edit}">{$CONST.EDIT_ENTRY}</a>{/if}</span>
+ </header>
+
+ <div class="clearfix content serendipity_entry_body">
+ {if $entry.categories}{foreach from=$entry.categories item="entry_category"}{if $entry_category.category_icon}<a href="{$entry_category.category_link}"><img class="serendipity_entryIcon" title="{$entry_category.category_name|@escape}{$entry_category.category_description|@emptyPrefix}" alt="{$entry_category.category_name|@escape}" src="{$entry_category.category_icon}"></a>{/if}{/foreach}{/if}
+ {$entry.body}
+ {if $entry.has_extended and not $is_single_entry and not $entry.is_extended}
+ <a class="read_more block_level" href="{$entry.link}#extended">{$CONST.VIEW_EXTENDED_ENTRY|@sprintf:$entry.title}</a>
+ {/if}
+ </div>
+ {if $entry.is_extended}
+ <div id="extended" class="clearfix content">
+ {$entry.extended}
+ </div>
+ {/if}
+ {if $entry.plugin_display_dat}
+ {$entry.plugin_display_dat}
+ {/if}
+
+ <footer class="clearfix">
+ {if $entry.categories}
+ <span class="visuallyhidden">{$CONST.CATEGORIES}: </span>{foreach from=$entry.categories item="entry_category" name="categories"}<a href="{$entry_category.category_link}">{$entry_category.category_name|@escape}</a>{if not $smarty.foreach.categories.last}, {/if}{/foreach}
+ {/if}
+ {if $entry.categories and ($entry.has_comments or $entry.has_disqus)} | {/if}
+ {if ($entry.has_comments or $entry.has_disqus)}
+ {if $entry.has_disqus }
+ {$entry.comments}{if $entry.has_trackbacks}, <a href="{$entry.link}#trackbacks">{$entry.trackbacks} {$entry.label_trackbacks}</a>{/if}
+ {else}
+ <a href="{$entry.link}#comments" title="{$entry.comments} {$entry.label_comments}{if $entry.has_trackbacks}, {$entry.trackbacks} {$entry.label_trackbacks}{/if}">{$entry.comments} {$entry.label_comments}</a>
+ {/if}
+ {/if}
+ {if $entry.url_tweetthis}
+ | <a href="{$entry.url_tweetthis}" title="{$CONST.TWOK11_TWEET_THIS}">Twitter</a>
+ {/if}
+ {if $entry.url_dentthis}
+ | <a href="{$entry.url_dentthis}" title="{$CONST.TWOK11_DENT_THIS}">Identica</a>
+ {/if}
+ {if $entry.url_shorturl}
+ | <a href="{$entry.url_shorturl}" title="{$CONST.TWOK11_SHORT_URL_HINT}" class="short-url">{$CONST.TWOK11_SHORT_URL}</a>
+ {/if}
+ {$entry.add_footer}
+ </footer>
+
+ <!--
+ <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"
+ xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <rdf:Description
+ rdf:about="{$entry.link_rdf}"
+ trackback:ping="{$entry.link_trackback}"
+ dc:title="{$entry.title_rdf|@default:$entry.title}"
+ dc:identifier="{$entry.rdf_ident}" />
+ </rdf:RDF>
+ -->
+
+ {if $is_single_entry and not $is_preview}
+ {if $CONST.DATA_UNSUBSCRIBED}
+ <p class="serendipity_msg_notice">{$CONST.DATA_UNSUBSCRIBED|@sprintf:$CONST.UNSUBSCRIBE_OK}</p>
+ {/if}
+ {if $CONST.DATA_TRACKBACK_DELETED}
+ <p class="serendipity_msg_notice">{$CONST.DATA_TRACKBACK_DELETED|@sprintf:$CONST.TRACKBACK_DELETED}</p>
+ {/if}
+ {if $CONST.DATA_TRACKBACK_APPROVED}
+ <p class="serendipity_msg_notice">{$CONST.DATA_TRACKBACK_APPROVED|@sprintf:$CONST.TRACKBACK_APPROVED}</p>
+ {/if}
+ {if $CONST.DATA_COMMENT_DELETED}
+ <p class="serendipity_msg_notice">{$CONST.DATA_COMMENT_DELETED|@sprintf:$CONST.COMMENT_DELETED}</p>
+ {/if}
+ {if $CONST.DATA_COMMENT_APPROVED}
+ <p class="serendipity_msg_notice">{$CONST.DATA_COMMENT_APPROVED|@sprintf:$CONST.COMMENT_APPROVED}</p>
+ {/if}
+
+ <section id="trackbacks" class="serendipity_comments serendipity_section_trackbacks">
+ <h3>{$CONST.TRACKBACKS}</h3>
+
+ <div id="trackback_url" class="block_level"><a rel="nofollow" href="{$entry.link_trackback}" title="{$CONST.TRACKBACK_SPECIFIC_ON_CLICK|@escape}">{$CONST.TRACKBACK_SPECIFIC}</a></div>
+
+ {serendipity_printTrackbacks entry=$entry.id}
+ </section>
+
+ <section id="comments" class="serendipity_comments serendipity_section_comments">
+ <h3>{$CONST.COMMENTS}</h3>
+
+ <p class="manage_comments">{$CONST.DISPLAY_COMMENTS_AS}
+ {if $entry.viewmode eq $CONST.VIEWMODE_LINEAR}
+ {$CONST.COMMENTS_VIEWMODE_LINEAR} | <a href="{$entry.link_viewmode_threaded}#comments" rel="nofollow">{$CONST.COMMENTS_VIEWMODE_THREADED}</a>
+ {else}
+ <a rel="nofollow" href="{$entry.link_viewmode_linear}#comments">{$CONST.COMMENTS_VIEWMODE_LINEAR}</a> | {$CONST.COMMENTS_VIEWMODE_THREADED}
+ {/if}
+ </p>
+
+ {serendipity_printComments entry=$entry.id mode=$entry.viewmode}
+ {if $entry.is_entry_owner}
+ <p class="manage_comments">
+ {if $entry.allow_comments}
+ <a href="{$entry.link_deny_comments}">{$CONST.COMMENTS_DISABLE}</a>
+ {else}
+ <a href="{$entry.link_allow_comments}">{$CONST.COMMENTS_ENABLE}</a>
+ {/if}
+ </p>
+ {/if}
+ </section>
+ <a id="feedback"></a>
+ {foreach from=$comments_messagestack item="message"}
+ <p class="serendipity_msg_important">{$message}</p>
+ {/foreach}
+ {if $is_comment_added}
+ <p class="serendipity_msg_notice">{$CONST.COMMENT_ADDED}</p>
+ {elseif $is_comment_moderate}
+ <p class="serendipity_msg_notice">{$CONST.COMMENT_ADDED}: {$CONST.THIS_COMMENT_NEEDS_REVIEW}</p>
+ {elseif not $entry.allow_comments}
+ <p class="serendipity_msg_important">{$CONST.COMMENTS_CLOSED}</p>
+ {/if}
+ <section id="respond" class="serendipity_section_commentform">
+ <h3>{$CONST.ADD_COMMENT}</h3>
+ {$COMMENTFORM}
+ </section>
+
+ {/if}
+ {$entry.backend_preview}
+ </article>
+ {/foreach}
+{foreachelse}
+ {if not $plugin_clean_page}
+ <p class="nocontent">{$CONST.NO_ENTRIES_TO_PRINT}</p>
+ {/if}
+{/foreach}
++
++ {/if}{* not taglist end *}
++
+{if $footer_info or $footer_prev_page or $footer_next_page}
+ <nav class="serendipity_pagination block_level">
+ <h2 class="visuallyhidden">{$CONST.TWOK11_PAG_TITLE}</h2>
+
+ <ul class="clearfix">
+ {if $footer_info}
+ <li class="info"><span>{$footer_info}</span></li>
+ {/if}
+ <li class="prev">{if $footer_prev_page}<a href="{$footer_prev_page}">{/if}{if $footer_prev_page}← {$CONST.PREVIOUS_PAGE}{else} {/if}{if $footer_prev_page}</a>{/if}</li>
+ <li class="next">{if $footer_next_page}<a href="{$footer_next_page}">{/if}{if $footer_next_page}{$CONST.NEXT_PAGE} →{else} {/if}{if $footer_next_page}</a>{/if}</li>
+ </ul>
+ </nav>
+{/if}
+ {serendipity_hookPlugin hook="entries_footer"}
+
+
+
+
Historie verz (ChangeLog)
+Please read more current Changelog!
verze 3.43
Statick opravy pro kompatibilitu freetag<->flattr (dn chyby PHP5)
diff --git a/serendipity_event_freetag/documentation_en.html b/serendipity_event_freetag/documentation_en.html
new file mode 100644
index 00000000..821f284d
--- /dev/null
+++ b/serendipity_event_freetag/documentation_en.html
@@ -0,0 +1,277 @@
+
+
+
+ Documentation: Freetag
+
+
+
+
+
+Documentation of the Freetag event plugin
+ (serendipity_event_freetag)
+
+Documentary added by Ian on 2014-09-27. Informations given in The most current README , and older README.txt a and the most current ChangeLog file .
+
+
Scripting changes by options
+
+Option: Extendet Smarty
+
+When using extended smarty output, the following code illustrates how the smarty-variables could be used when dropped into the entries.tpl:
+
+
+{if isset($entry.freetag.extended) && $entry.freetag.extended == 1}
+ {if $entry.freetag.tags.tags}
+ <div class="serendipity_freeTag">{$entry.freetag.tags.description}
+ {foreach from=$entry.freetag.tags.tags item="tag"}
+ {$tag}
+ {/foreach}
+ </div>
+
+ {if $is_single_entry or $is_preview}
+ {$entry.freetag.related.description}
+ <ul class="serendipity_freeTag_related">
+ {foreach from=$entry.freetag.related.entries item="link"}
+ <li>{$link}</li>
+ {/foreach}
+ </ul>
+ {/if}
+ {/if}
+{else}
+ {$entry.freetag}
+{/if}
+
+
+Using this subquery you can convert existing categories to tags:
+
+
+INSERT INTO serendipity_entrytags (entryid, tag)
+ SELECT serendipity_entries.id, serendipity_category.category_name
+ FROM serendipity_entries, serendipity_category, serendipity_entrycat
+ WHERE serendipity_entrycat.entryid = serendipity_entries.id
+ AND serendipity_category.categoryid = serendipity_entrycat.categoryid;
+
+
+[quoted from: http://pixelated-dreams.com/archives/229-Spring-Cleaning.html]
+
+Or using this script you can convert existing categories to tags:
+
+
+<?php
+include 'serendipity_config.inc.php';
+
+$rows = serendipity_db_query("SELECT e.id, e.title, c.category_name
+ FROM {$serendipity['dbPrefix']}entries AS e
+ JOIN {$serendipity['dbPrefix']}entrycat AS ec
+ ON ec.entryid = e.id
+ JOIN {$serendipity['dbPrefix']}category AS c
+ ON ec.categoryid = c.categoryid");
+
+foreach($rows AS $row) {
+ serendipity_db_query(
+ sprintf(
+ "REPLACE INTO {$serendipity['dbPrefix']}entrytags (entryid, tag) VALUES (%d, %s)",
+ (int)$row['id'],
+ serendipity_db_escape_string($row['category_name'])
+ )
+ );
+
+ printf(
+ "Category '%s' added as Tag for Entry #%d, '%s'<br />\n",
+ htmlspecialchars($row['category_name']),
+ (int)$row['id'],
+ htmlspecialchars($row['title'])
+ );
+}
+
+
+
+Option: Tags-as-list
+
+The following code illustrates on how to change your templates entries.tpl file (all + lines, without '+ '):
+
+
+{serendipity_hookPlugin hook="entries_header" addData="$entry_id"}
++ {if $taglist}
++ <article id="taglistentries" class="clearfix serendipity_entry">
++ <div class="clearfix content serendipity_entry_body">
++ <h2>{$head_subtitle}</h2>
++ {foreach from=$entries item="dategroup"}
++ {foreach from=$dategroup.entries item="entry"}
++
++ <div class="static-entries-list">
++ ({$dategroup.date|date_format:"%d.%m.%Y"}) <a href="{$entry.link}">{$entry.title|default:$entry.id}</a>
++ </div>
++
++ {/foreach}
++ {/foreach}
++
++ </div>
++ </article>
++
++ {else}
++
+{foreach from=$entries item="dategroup"}
+ {foreach from=$dategroup.entries item="entry"}
+ {assign var="entry" value=$entry scope="parent"}
+ <article id="post_{$entry.id}" class="clearfix serendipity_entry{if $dategroup.is_sticky} sticky{/if}">
+ <header class="clearfix">
+
+ <h2><a href="{$entry.link}">{$entry.title}</a></h2>
+
+ <span class="serendipity_byline block_level"><span class="single_user">{$CONST.POSTED_BY} <a href="{$entry.link_author}">{$entry.author}</a> {$CONST.ON} </span><time datetime="{$entry.timestamp|@serendipity_html5time}">{$entry.timestamp|@formatTime:$template_option.date_format}</time>{if $entry.is_entry_owner and not $is_preview} | <a href="{$entry.link_edit}">{$CONST.EDIT_ENTRY}</a>{/if}</span>
+ </header>
+
+ <div class="clearfix content serendipity_entry_body">
+ {if $entry.categories}{foreach from=$entry.categories item="entry_category"}{if $entry_category.category_icon}<a href="{$entry_category.category_link}"><img class="serendipity_entryIcon" title="{$entry_category.category_name|@escape}{$entry_category.category_description|@emptyPrefix}" alt="{$entry_category.category_name|@escape}" src="{$entry_category.category_icon}"></a>{/if}{/foreach}{/if}
+ {$entry.body}
+ {if $entry.has_extended and not $is_single_entry and not $entry.is_extended}
+ <a class="read_more block_level" href="{$entry.link}#extended">{$CONST.VIEW_EXTENDED_ENTRY|@sprintf:$entry.title}</a>
+ {/if}
+ </div>
+ {if $entry.is_extended}
+ <div id="extended" class="clearfix content">
+ {$entry.extended}
+ </div>
+ {/if}
+ {if $entry.plugin_display_dat}
+ {$entry.plugin_display_dat}
+ {/if}
+
+ <footer class="clearfix">
+ {if $entry.categories}
+ <span class="visuallyhidden">{$CONST.CATEGORIES}: </span>{foreach from=$entry.categories item="entry_category" name="categories"}<a href="{$entry_category.category_link}">{$entry_category.category_name|@escape}</a>{if not $smarty.foreach.categories.last}, {/if}{/foreach}
+ {/if}
+ {if $entry.categories and ($entry.has_comments or $entry.has_disqus)} | {/if}
+ {if ($entry.has_comments or $entry.has_disqus)}
+ {if $entry.has_disqus }
+ {$entry.comments}{if $entry.has_trackbacks}, <a href="{$entry.link}#trackbacks">{$entry.trackbacks} {$entry.label_trackbacks}</a>{/if}
+ {else}
+ <a href="{$entry.link}#comments" title="{$entry.comments} {$entry.label_comments}{if $entry.has_trackbacks}, {$entry.trackbacks} {$entry.label_trackbacks}{/if}">{$entry.comments} {$entry.label_comments}</a>
+ {/if}
+ {/if}
+ {if $entry.url_tweetthis}
+ | <a href="{$entry.url_tweetthis}" title="{$CONST.TWOK11_TWEET_THIS}">Twitter</a>
+ {/if}
+ {if $entry.url_dentthis}
+ | <a href="{$entry.url_dentthis}" title="{$CONST.TWOK11_DENT_THIS}">Identica</a>
+ {/if}
+ {if $entry.url_shorturl}
+ | <a href="{$entry.url_shorturl}" title="{$CONST.TWOK11_SHORT_URL_HINT}" class="short-url">{$CONST.TWOK11_SHORT_URL}</a>
+ {/if}
+ {$entry.add_footer}
+ </footer>
+
+ <!--
+ <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"
+ xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <rdf:Description
+ rdf:about="{$entry.link_rdf}"
+ trackback:ping="{$entry.link_trackback}"
+ dc:title="{$entry.title_rdf|@default:$entry.title}"
+ dc:identifier="{$entry.rdf_ident}" />
+ </rdf:RDF>
+ -->
+
+ {if $is_single_entry and not $is_preview}
+ {if $CONST.DATA_UNSUBSCRIBED}
+ <p class="serendipity_msg_notice">{$CONST.DATA_UNSUBSCRIBED|@sprintf:$CONST.UNSUBSCRIBE_OK}</p>
+ {/if}
+ {if $CONST.DATA_TRACKBACK_DELETED}
+ <p class="serendipity_msg_notice">{$CONST.DATA_TRACKBACK_DELETED|@sprintf:$CONST.TRACKBACK_DELETED}</p>
+ {/if}
+ {if $CONST.DATA_TRACKBACK_APPROVED}
+ <p class="serendipity_msg_notice">{$CONST.DATA_TRACKBACK_APPROVED|@sprintf:$CONST.TRACKBACK_APPROVED}</p>
+ {/if}
+ {if $CONST.DATA_COMMENT_DELETED}
+ <p class="serendipity_msg_notice">{$CONST.DATA_COMMENT_DELETED|@sprintf:$CONST.COMMENT_DELETED}</p>
+ {/if}
+ {if $CONST.DATA_COMMENT_APPROVED}
+ <p class="serendipity_msg_notice">{$CONST.DATA_COMMENT_APPROVED|@sprintf:$CONST.COMMENT_APPROVED}</p>
+ {/if}
+
+ <section id="trackbacks" class="serendipity_comments serendipity_section_trackbacks">
+ <h3>{$CONST.TRACKBACKS}</h3>
+
+ <div id="trackback_url" class="block_level"><a rel="nofollow" href="{$entry.link_trackback}" title="{$CONST.TRACKBACK_SPECIFIC_ON_CLICK|@escape}">{$CONST.TRACKBACK_SPECIFIC}</a></div>
+
+ {serendipity_printTrackbacks entry=$entry.id}
+ </section>
+
+ <section id="comments" class="serendipity_comments serendipity_section_comments">
+ <h3>{$CONST.COMMENTS}</h3>
+
+ <p class="manage_comments">{$CONST.DISPLAY_COMMENTS_AS}
+ {if $entry.viewmode eq $CONST.VIEWMODE_LINEAR}
+ {$CONST.COMMENTS_VIEWMODE_LINEAR} | <a href="{$entry.link_viewmode_threaded}#comments" rel="nofollow">{$CONST.COMMENTS_VIEWMODE_THREADED}</a>
+ {else}
+ <a rel="nofollow" href="{$entry.link_viewmode_linear}#comments">{$CONST.COMMENTS_VIEWMODE_LINEAR}</a> | {$CONST.COMMENTS_VIEWMODE_THREADED}
+ {/if}
+ </p>
+
+ {serendipity_printComments entry=$entry.id mode=$entry.viewmode}
+ {if $entry.is_entry_owner}
+ <p class="manage_comments">
+ {if $entry.allow_comments}
+ <a href="{$entry.link_deny_comments}">{$CONST.COMMENTS_DISABLE}</a>
+ {else}
+ <a href="{$entry.link_allow_comments}">{$CONST.COMMENTS_ENABLE}</a>
+ {/if}
+ </p>
+ {/if}
+ </section>
+ <a id="feedback"></a>
+ {foreach from=$comments_messagestack item="message"}
+ <p class="serendipity_msg_important">{$message}</p>
+ {/foreach}
+ {if $is_comment_added}
+ <p class="serendipity_msg_notice">{$CONST.COMMENT_ADDED}</p>
+ {elseif $is_comment_moderate}
+ <p class="serendipity_msg_notice">{$CONST.COMMENT_ADDED}: {$CONST.THIS_COMMENT_NEEDS_REVIEW}</p>
+ {elseif not $entry.allow_comments}
+ <p class="serendipity_msg_important">{$CONST.COMMENTS_CLOSED}</p>
+ {/if}
+ <section id="respond" class="serendipity_section_commentform">
+ <h3>{$CONST.ADD_COMMENT}</h3>
+ {$COMMENTFORM}
+ </section>
+
+ {/if}
+ {$entry.backend_preview}
+ </article>
+ {/foreach}
+{foreachelse}
+ {if not $plugin_clean_page}
+ <p class="nocontent">{$CONST.NO_ENTRIES_TO_PRINT}</p>
+ {/if}
+{/foreach}
++
++ {/if}{* not taglist end *}
++
+{if $footer_info or $footer_prev_page or $footer_next_page}
+ <nav class="serendipity_pagination block_level">
+ <h2 class="visuallyhidden">{$CONST.TWOK11_PAG_TITLE}</h2>
+
+ <ul class="clearfix">
+ {if $footer_info}
+ <li class="info"><span>{$footer_info}</span></li>
+ {/if}
+ <li class="prev">{if $footer_prev_page}<a href="{$footer_prev_page}">{/if}{if $footer_prev_page}← {$CONST.PREVIOUS_PAGE}{else} {/if}{if $footer_prev_page}</a>{/if}</li>
+ <li class="next">{if $footer_next_page}<a href="{$footer_next_page}">{/if}{if $footer_next_page}{$CONST.NEXT_PAGE} →{else} {/if}{if $footer_next_page}</a>{/if}</li>
+ </ul>
+ </nav>
+{/if}
+ {serendipity_hookPlugin hook="entries_footer"}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/serendipity_event_freetag/lang_de.inc.php b/serendipity_event_freetag/lang_de.inc.php
index ced50d2e..8937f746 100644
--- a/serendipity_event_freetag/lang_de.inc.php
+++ b/serendipity_event_freetag/lang_de.inc.php
@@ -1,4 +1,4 @@
-add('name', PLUGIN_EVENT_FREETAG_TITLE);
$propbag->add('description', PLUGIN_EVENT_FREETAG_DESC);
$propbag->add('stackable', false);
- $propbag->add('author', 'Garvin Hicking, Jonathan Arkell, Grischa Brockhaus, Lars Strojny, Malte Paskuda');
+ $propbag->add('author', 'Garvin Hicking, Jonathan Arkell, Grischa Brockhaus, Lars Strojny, Malte Paskuda, Ian');
$propbag->add('requirements', array(
'serendipity' => '0.8',
'smarty' => '2.6.7',
'php' => '4.1.0'
));
- $propbag->add('version', '3.57');
+ $propbag->add('version', '3.58');
$propbag->add('event_hooks', array(
'frontend_fetchentries' => true,
'frontend_fetchentry' => true,
@@ -103,7 +103,7 @@ class serendipity_event_freetag extends serendipity_event
$propbag->add('groups', array('BACKEND_EDITOR'));
$this->supported_properties = array('freetag_name', 'freetag_tagList');
$this->dependencies = array('serendipity_plugin_freetag' => 'keep');
- $propbag->add('configuration', array('cat2tag', 'keyword2tag', 'taglink', 'embed_footer', 'extended_smarty', 'show_tagcloud', 'min_percent', 'max_percent', 'max_tags', 'use_flash', 'flash_tag_color', 'flash_bg_trans', 'flash_bg_color', 'flash_width', 'flash_speed', 'meta_keywords', 'show_related', 'show_related_count', 'lowercase_tags', 'collation', 'send_http_header', 'admin_show_taglist', 'admin_ftayt', 'technorati_tag_link', 'technorati_tag_image'));
+ $propbag->add('configuration', array('cat2tag', 'keyword2tag', 'taglink', 'taglist', 'embed_footer', 'extended_smarty', 'show_tagcloud', 'min_percent', 'max_percent', 'max_tags', 'use_flash', 'flash_tag_color', 'flash_bg_trans', 'flash_bg_color', 'flash_width', 'flash_speed', 'meta_keywords', 'show_related', 'show_related_count', 'lowercase_tags', 'collation', 'send_http_header', 'admin_show_taglist', 'admin_ftayt', 'technorati_tag_link', 'technorati_tag_image'));
}
function introspect_config_item($name, &$propbag) {
@@ -143,16 +143,23 @@ class serendipity_event_freetag extends serendipity_event
break;
case 'extended_smarty':
- $propbag->add('type', 'boolean');
+ $propbag->add('type', 'boolean');
$propbag->add('name', PLUGIN_EVENT_FREETAG_EXTENDED_SMARTY);
$propbag->add('description', PLUGIN_EVENT_FREETAG_EXTENDED_SMARTY_DESC);
$propbag->add('default', false);
break;
+ case 'taglist':
+ $propbag->add('type', 'boolean');
+ $propbag->add('name', PLUGIN_EVENT_FREETAG_TAGSASLIST);
+ $propbag->add('description', PLUGIN_EVENT_FREETAG_TAGSASLIST_DESC);
+ $propbag->add('default', false);
+ break;
+
case 'taglink':
$propbag->add('type', 'string');
$propbag->add('name', PLUGIN_EVENT_FREETAG_TAGLINK);
- $propbag->add('description', '');
+ $propbag->add('description', PLUGIN_EVENT_FREETAG_TAGLINK_DESC);
$propbag->add('default', $serendipity['baseURL'] . ($serendipity['rewrite'] == 'none' ? $serendipity['indexFile'] . '?/' : '') . 'plugin/tag/');
break;
@@ -192,17 +199,17 @@ class serendipity_event_freetag extends serendipity_event
break;
case 'show_related':
- $propbag->add('type', 'boolean');
- $propbag->add('name', PLUGIN_EVENT_FREETAG_SHOW_RELATED);
- $propbag->add('description', '');
- $propbag->add('default', true);
+ $propbag->add('type', 'boolean');
+ $propbag->add('name', PLUGIN_EVENT_FREETAG_SHOW_RELATED);
+ $propbag->add('description', '');
+ $propbag->add('default', true);
break;
case 'show_related_count':
- $propbag->add('type', 'string');
- $propbag->add('name', PLUGIN_EVENT_FREETAG_SHOW_RELATED_COUNT);
- $propbag->add('description', '');
- $propbag->add('default', '5');
+ $propbag->add('type', 'string');
+ $propbag->add('name', PLUGIN_EVENT_FREETAG_SHOW_RELATED_COUNT);
+ $propbag->add('description', '');
+ $propbag->add('default', '5');
break;
case 'lowercase_tags':
@@ -302,7 +309,7 @@ class serendipity_event_freetag extends serendipity_event
$q = "select count(tag) from {$serendipity['dbPrefix']}" . $table;
$row = serendipity_db_query($q, true, 'num');
- if (!is_numeric($row[0])) { // if the response we got back was an SQL error.. :P
+ if (!is_numeric($row[0])) { // if the response we got back was an SQL error.. :P
return false;
} else {
return true;
@@ -312,7 +319,7 @@ class serendipity_event_freetag extends serendipity_event
static function upgradeFromVersion1() {
global $serendipity;
- $q = "select count(*) from {$serendipity['dbPrefix']}entryproperties where property = 'ep_freetag_name'";
+ $q = "SELECT count(*) FROM {$serendipity['dbPrefix']}entryproperties WHERE property = 'ep_freetag_name'";
$result = serendipity_db_query($q);
if ((int)$result[0] > 0) {
@@ -325,7 +332,7 @@ class serendipity_event_freetag extends serendipity_event
static function convertEntryPropertiesTags() {
global $serendipity;
- $q = "select entryid, value from {$serendipity['dbPrefix']}entryproperties where property = 'ep_freetag_name'";
+ $q = "SELECT entryid, value FROM {$serendipity['dbPrefix']}entryproperties WHERE property = 'ep_freetag_name'";
$result = serendipity_db_query($q);
if (!is_array($result)) {
@@ -340,7 +347,7 @@ class serendipity_event_freetag extends serendipity_event
echo ' ';
}
- $q = "delete from {$serendipity['dbPrefix']}entryproperties where property = 'ep_freetag_name'";
+ $q = "DELETE FROM {$serendipity['dbPrefix']}entryproperties WHERE property = 'ep_freetag_name'";
$result = serendipity_db_query($q);
}
@@ -358,7 +365,7 @@ class serendipity_event_freetag extends serendipity_event
global $serendipity;
if (!serendipity_event_freetag::tableCreated('entrytags')) {
- $q = "create table {$serendipity['dbPrefix']}entrytags (" .
+ $q = "CREATE TABLE {$serendipity['dbPrefix']}entrytags (" .
"entryid int(10) not null, " .
"tag varchar(50) not null, " .
"primary key (entryid, tag)" .
@@ -375,7 +382,7 @@ class serendipity_event_freetag extends serendipity_event
}
if (!serendipity_event_freetag::tableCreated('tagkeywords')) {
- $q = "create table {$serendipity['dbPrefix']}tagkeywords (" .
+ $q = "CREATE TABLE {$serendipity['dbPrefix']}tagkeywords (" .
"keywords text, " .
"tag varchar(50) not null, " .
"primary key (tag)" .
@@ -403,11 +410,11 @@ class serendipity_event_freetag extends serendipity_event
$taglink = $this->get_config('taglink');
}
- $links = array();
+ $links = array();
if (empty($tagString)) {
return array();
}
- $tags = explode(',', $tagString);
+ $tags = explode(',', $tagString);
foreach($tags as $tag) {
$tag = trim($tag);
if (empty($tag)) {
@@ -426,7 +433,7 @@ class serendipity_event_freetag extends serendipity_event
global $serendipity;
static $taglink = null;
- $links = array();
+ $links = array();
if ($taglink == null) {
$taglink = $this->get_config('taglink');
@@ -440,23 +447,22 @@ class serendipity_event_freetag extends serendipity_event
$technorati_img = $this->get_config('technorati_tag_image');
$img_url = $this->get_config('path_img',$serendipity['serendipityHTTPPath'] . 'plugins/serendipity_event_freetag/img/');
-
foreach($tags as $tag) {
$tag = trim($tag);
if (empty($tag)) {
- continue;
- }
- $links[] = '' . htmlspecialchars($tag) . ' ' .
- ($technorati?' ':'');
+ continue;
+ }
+ $links[] = '' . htmlspecialchars($tag) . ' ' .
+ ($technorati?' ':'');
- }
- if ($extended_smarty) {
- return $links;
- } else {
- return implode(', ', $links);
- }
+ }
+ if ($extended_smarty) {
+ return $links;
+ } else {
+ return implode(', ', $links);
+ }
}
function getRelatedEntries($tags, $postID) {
@@ -501,19 +507,19 @@ class serendipity_event_freetag extends serendipity_event
$entrylink = $serendipity['baseURL'] . ($serendipity['rewrite'] == 'none' ? $serendipity['indexFile'] . '?/' : '/');
- if ($extended_smarty) {
- $return = array();
- $return['description'] = PLUGIN_EVENT_FREETAG_RELATED_ENTRIES;
- foreach($entries AS $entryid => $title) {
- $return['entries'][] = '' . htmlspecialchars($title) . ' ';
- }
- } else {
- $return = '';
- }
+ if ($extended_smarty) {
+ $return = array();
+ $return['description'] = PLUGIN_EVENT_FREETAG_RELATED_ENTRIES;
+ foreach($entries AS $entryid => $title) {
+ $return['entries'][] = '' . htmlspecialchars($title) . ' ';
+ }
+ } else {
+ $return = '';
+ }
return $return;
}
@@ -533,7 +539,7 @@ class serendipity_event_freetag extends serendipity_event
$taglink = $cfg_taglink;
}
- $template = $cfg_template;
+ $template = $cfg_template;
if (!$template) {
serendipity_event_freetag::renderTags($tags, $xml, $nl, $scaling, $maxSize, $minSize, $useFlash, $flashbgtrans, $flashtagcolor, $flashbgcolor, $flashwidth, $flashspeed, $taglink, $xml_image);
} else {
@@ -674,7 +680,7 @@ class serendipity_event_freetag extends serendipity_event
echo ''. "\n";
- echo ''. "\n";
}
@@ -696,10 +702,41 @@ class serendipity_event_freetag extends serendipity_event
case 'external_plugin':
$uri_parts = explode('?', str_replace(array('&', '%FF'), array('&', '.'), $eventData));
- $param = explode('/', $uri_parts[0]);
+ $param = $taglist ? explode('/', str_replace('/taglist','',$uri_parts[0])) : explode('/', $uri_parts[0]);
$plugincode = array_shift($param);
+ $taglist = serendipity_db_bool($this->get_config('taglist', false));
+ $tagged_as_list = false;
+
+ // By option or manually added blogdomain.com/plugin/taglist/Serendipity/Blog/Plums - see below
+ if ($plugincode == "taglist") $plugincode = "tags";
if (($plugincode == "tag") || ($plugincode == "tags") || ($plugincode == "freetag")) {
+
+ // Manually added (last) parameter 'taglist" to view tags by list for certain taglinks eg. blogdomain.com/plugin/tag/Serendipity/Blog/Plums/taglist - both need a modified entries.tpl
+ if ($taglist && in_array('taglist', $serendipity['uriArguments'])) {
+ $param = array_map('urldecode', $param);
+ $param = array_map('urldecode', $param); // for doubled encoded tag umlauts via searchengines backlinks
+ $param = is_array($param) ? array_map('strip_tags', $param) : strip_tags($param);
+ $param = array_filter($param); // empty removed XSS by strip_tags
+
+ if (!is_object($serendipity['smarty'])) {
+ serendipity_smarty_init(); // to avoid member function assign() on a non-object error, start Smarty templating
+ }
+ if (false === serendipity_db_bool($this->get_config('show_tagcloud', true))) {
+ // Since this is extra stuff, we need to regular assign the subtitle header and not use $serendipity['head_subtitle'] !
+ if (count($param) > 1) {
+ $serendipity['smarty']->assign('head_subtitle', sprintf(PLUGIN_EVENT_FREETAG_USING, implode(' + ', array_map('htmlspecialchars', $param))));
+ } else {
+ $serendipity['smarty']->assign('head_subtitle', sprintf(PLUGIN_EVENT_FREETAG_USING, htmlspecialchars($param[0])));
+ }
+ }
+ $serendipity['smarty']->assign('taglist', true);
+ foreach($serendipity['uriArguments'] AS $uak => $uav) {
+ if ($uav == 'taglist') unset($serendipity['uriArguments'][$uak]);
+ }
+ $tagged_as_list = true;
+ }
+
/* Attempt to locate hidden variables within the URI */
foreach ($serendipity['uriArguments'] as $k => $v) {
if ($v[0] == 'P') { /* Page */
@@ -719,14 +756,28 @@ class serendipity_event_freetag extends serendipity_event
$this->displayTag = true;
$param = null;
} else if (count($param) == 1) {
- $param = urldecode($param[0]);
+ $param = urldecode($param[0]);
+ $param = urldecode($param); // for doubled encoded tag umlauts via searchengines backlinks
+ $param = strip_tags($param);
$serendipity['head_subtitle'] = sprintf(PLUGIN_EVENT_FREETAG_USING, htmlspecialchars($param));
$emit_404 = true;
} else {
+ if (!$tagged_as_list) {
+ $param = array_map('urldecode', $param);
+ $param = array_map('urldecode', $param); // for doubled encoded tag umlauts via searchengines backlinks in sprintf
+ }
+ $param = array_map('strip_tags', $param);
+ $param = array_filter($param); // empty removed XSS by strip_tags
$serendipity['head_subtitle'] = sprintf(PLUGIN_EVENT_FREETAG_USING, implode(' + ', array_map('htmlspecialchars', $param)));
- $param = array_map('urldecode', $param);
$emit_404 = true;
}
+ // for XSS secureness, while using doubled decode
+ $param = is_array($param) ? array_map('strip_tags', $param) : strip_tags($param);
+ if (is_array($param)) {
+ array_filter($param); // empty removed XSS by strip_tags
+ }
+ $param = is_array($param) ? array_map('htmlspecialchars', $param) : htmlspecialchars($param);
+
$this->tags['show'] = $param;
$serendipity['plugin_vars']['tag'] = $param;
if (is_array($param)) {
@@ -760,7 +811,7 @@ class serendipity_event_freetag extends serendipity_event
break;
case 'backend_sidebar_entries':
- if ($serendipity['version'][0] == '1') {
+ if ($serendipity['version'][0] < 2) {
?>
' : '') . '
+ ' . ($serendipity['version'][0] < 2 ? '' : '') . '
@@ -1003,7 +1054,7 @@ addLoadEvent(enableAutocomplete);
}
if ($upc != $lastletter)
echo " |".$upc.': ';
- if ($serendipity['version'][0] == '1') {
+ if ($serendipity['version'][0] < 2) {
echo "$tag , ";
} else {
echo "$tag , ";
@@ -1014,7 +1065,7 @@ addLoadEvent(enableAutocomplete);
';
}
}
- if ($serendipity['version'][0] == '1') {
+ if ($serendipity['version'][0] < 2) {
?>
@@ -1033,7 +1084,7 @@ addLoadEvent(enableAutocomplete);
@@ -1045,7 +1096,7 @@ addLoadEvent(enableAutocomplete);
1) {
$showtag = $arr_showtag;
@@ -1203,6 +1254,7 @@ addLoadEvent(enableAutocomplete);
// Is it a feature?
$this->displayEntry($eventData, $addData);
return true;
+ break; // Ian: shouldn't it break here? See upper question.
case 'xmlrpc_updertEntry':
if (isset($eventData['id']) && isset($eventData['mt_keywords'])) {
@@ -1245,95 +1297,97 @@ addLoadEvent(enableAutocomplete);
//echo real smarty-elements:
$show_related = serendipity_db_bool($this->get_config('show_related', true));
- $elements = count($eventData);
+ $elements = count($eventData);
- //If not using extended-smarty, we want related entries only when
- //showing only one entry
- if ($elements > 1) {
- $manyEntries = true;
- } else {
- $manyEntries = false;
- }
+ //If not using extended-smarty, we want related entries only when
+ //showing only one entry
+ if ($elements > 1) {
+ $manyEntries = true;
+ } else {
+ $manyEntries = false;
+ }
- for ($entry = 0; $entry < $elements; $entry++) {
- $tags = $this->getTagsForEntry($eventData[$entry]['id']);
+ for ($entry = 0; $entry < $elements; $entry++) {
+ $tags = $this->getTagsForEntry($eventData[$entry]['id']);
//when in preview, maybe there are no tags stored yet
if ($addData['preview'] && empty($tags)) {
- $tags = explode(',', $serendipity['POST']['properties']['freetag_tagList']);
- }
- $eventData = $this->addTags($entry, $tags, $eventData);
+ $tags = explode(',', $serendipity['POST']['properties']['freetag_tagList']);
+ }
+ $eventData = $this->addTags($entry, $tags, $eventData);
- if ($show_related) {
- $relatedEntries = $this->getRelatedEntries($tags, $eventData[$entry]['id']);
- $eventData = $this->addRelatedEntries($entry, $manyEntries, $relatedEntries, $eventData);
- }
- }
+ if ($show_related) {
+ $relatedEntries = $this->getRelatedEntries($tags, $eventData[$entry]['id']);
+ $eventData = $this->addRelatedEntries($entry, $manyEntries, $relatedEntries, $eventData);
+ }
+ }
}
- #
- # Add related entries to eventData[$entry]
- #
- # $entry: number of entry in $eventData
- # for use in displayEntry
+ /**
+ * Add related entries to eventData[$entry]
+ *
+ * $entry: number of entry in $eventData
+ * for use in displayEntry
+ */
function addRelatedEntries($entry, $manyEntries, $relatedEntries, $eventData) {
- if (is_array($relatedEntries)) {
- if ($this->get_config('extended_smarty', false)) {
- $eventData[$entry]['freetag']['extended'] = true;
- $eventData[$entry]['freetag']['related'] = $this->getRelatedEntriesHtml($relatedEntries, true);
- } else if (! $manyEntries){
- $field = $this->getField($eventData, $entry);
- //work with getFieldReference to prevent caching-issues
- $entryText =& $this->getFieldReference($field, $eventData[$entry]);
- $entryText .= $this->getRelatedEntriesHtml($relatedEntries);
- }
- }
- return $eventData;
- }
+ if (is_array($relatedEntries)) {
+ if ($this->get_config('extended_smarty', false)) {
+ $eventData[$entry]['freetag']['extended'] = true;
+ $eventData[$entry]['freetag']['related'] = $this->getRelatedEntriesHtml($relatedEntries, true);
+ } else if (! $manyEntries){
+ $field = $this->getField($eventData, $entry);
+ //work with getFieldReference to prevent caching-issues
+ $entryText =& $this->getFieldReference($field, $eventData[$entry]);
+ $entryText .= $this->getRelatedEntriesHtml($relatedEntries);
+ }
+ }
+ return $eventData;
+ }
- #
- # $entry: number of entry in $eventData
- # for use in displayEntry
- function addTags($entry, $tags, $eventData) {
- if (!is_array($eventData)) $eventData = array();
+ /**
+ * $entry: number of entry in $eventData
+ * for use in displayEntry
+ */
+ function addTags($entry, $tags, $eventData) {
+ if (!is_array($eventData)) $eventData = array();
- if ($this->get_config('extended_smarty', false)) {
- $eventData[$entry]['freetag']['extended'] = true;
- $eventData[$entry]['freetag']['tags']['description'] = str_replace('%s', '', PLUGIN_EVENT_FREETAG_LIST);
- $eventData[$entry]['freetag']['tags']['tags'] = $this->getTagHtml($tags, true);
- } else {
- if (!empty($tags)) {
- $field = $this->getField($eventData, $entry);
- $msg = '' . PLUGIN_EVENT_FREETAG_LIST . '
';
- //in preview, $eventData maybe don't contain the field - till now
- if (!isset($eventData[$entry][$field])) {
+ if ($this->get_config('extended_smarty', false)) {
+ $eventData[$entry]['freetag']['extended'] = true;
+ $eventData[$entry]['freetag']['tags']['description'] = str_replace('%s', '', PLUGIN_EVENT_FREETAG_LIST);
+ $eventData[$entry]['freetag']['tags']['tags'] = $this->getTagHtml($tags, true);
+ } else {
+ if (!empty($tags)) {
+ $field = $this->getField($eventData, $entry);
+ $msg = '' . PLUGIN_EVENT_FREETAG_LIST . '
';
+ //in preview, $eventData maybe don't contain the field - till now
+ if (!isset($eventData[$entry][$field])) {
$eventData[$entry][$field] = "";
}
- $entryText =& $this->getFieldReference($field, $eventData[$entry]);
+ $entryText =& $this->getFieldReference($field, $eventData[$entry]);
- $entryText .= sprintf($msg, $this->getTagHtml($tags));
- }
- }
- return $eventData;
- }
+ $entryText .= sprintf($msg, $this->getTagHtml($tags));
+ }
+ }
+ return $eventData;
+ }
- function getField($eventData, $entry) {
- $embed_footer = $this->get_config('embed_footer');
- if ($embed_footer === 'yes' || ($embed_footer !== 'no' && serendipity_db_bool($embed_footer))) {
- $field = 'add_footer';
- } else if ($embed_footer === 'smarty') {
- $field = 'freetag';
- } else {
- //The option is set to add to the entry, but where?
- if (strlen($eventData[$entry]['extended']) > 0) {
- $field = 'extended';
- } else {
- $field = 'body';
- }
- }
- return $field;
- }
+ function getField($eventData, $entry) {
+ $embed_footer = $this->get_config('embed_footer');
+ if ($embed_footer === 'yes' || ($embed_footer !== 'no' && serendipity_db_bool($embed_footer))) {
+ $field = 'add_footer';
+ } else if ($embed_footer === 'smarty') {
+ $field = 'freetag';
+ } else {
+ //The option is set to add to the entry, but where?
+ if (strlen($eventData[$entry]['extended']) > 0) {
+ $field = 'extended';
+ } else {
+ $field = 'body';
+ }
+ }
+ return $field;
+ }
/**
* Returns a list of all tags
@@ -1424,26 +1478,26 @@ addLoadEvent(enableAutocomplete);
echo $content;
}
- #
- # descend: if true, get the related tags of the related tags of given tag
- #
+ #
+ # descend: if true, get the related tags of the related tags of given tag
+ #
function getTagCloudTags($tag, $descend = true) {
$rows = serendipity_db_query($this->getTagCloudQuery('', $tag));
if (is_array($rows)) {
foreach((array)$rows as $r) {
- $tags[$r['tag']] = $r['total'];
+ $tags[$r['tag']] = $r['total'];
#get also tags which are related only by other tags
- if($descend) {
+ if($descend) {
$descended_tags = $this->getTagCloudTags($r['tag'], false);
if (is_array($descended_tags)) {
foreach($descended_tags AS $dtag => $value) {
$descended_tags[$dtag] = $value / 2;
- }
+ }
- #$tags = array_merge($tags, $descended_tags);
- $tags = $tags + $descended_tags;
+ #$tags = array_merge($tags, $descended_tags);
+ $tags = $tags + $descended_tags;
}
}
}
@@ -1605,13 +1659,13 @@ addLoadEvent(enableAutocomplete);
function getLeafTags($leafWeight=1) {
global $serendipity;
- $q = "SELECT tag, count(tag) as total
+ $q = "SELECT tag, count(tag) as total
FROM {$serendipity['dbPrefix']}entrytags
GROUP BY tag
HAVING count(tag) <= $leafWeight
ORDER BY tag";
- $rows = serendipity_db_query($q);
+ $rows = serendipity_db_query($q);
if (!is_array($rows)) {
echo $rows;
@@ -1714,7 +1768,7 @@ addLoadEvent(enableAutocomplete);
$this->install();
$this->set_config('dbversion', 2);
}
- if ($serendipity['version'][0] == '1') {
+ if ($serendipity['version'][0] < 2) {
?>
';
} else {
echo ' ' . DONE . ' ';
@@ -1875,7 +1929,7 @@ addLoadEvent(enableAutocomplete);
}
// Cycle all entries
- if ($serendipity['version'][0] == '2') {
+ if ($serendipity['version'][0] > 1) {
echo '';
}
foreach ($entries AS $id => $props) {
@@ -1896,7 +1950,7 @@ addLoadEvent(enableAutocomplete);
}
$this->addTagsToEntry($id, $newtags);
- if ($serendipity['version'][0] == '1') {
+ if ($serendipity['version'][0] < 2) {
printf(
PLUGIN_EVENT_FREETAG_GLOBALCAT2TAG_ENTRY . ' ',
$id,
@@ -1914,10 +1968,10 @@ addLoadEvent(enableAutocomplete);
echo '';
}
}
- if ($serendipity['version'][0] == '2') {
+ if ($serendipity['version'][0] > 1) {
echo ' ';
}
- if ($serendipity['version'][0] == '1') {
+ if ($serendipity['version'][0] < 2) {
echo PLUGIN_EVENT_FREETAG_GLOBALCAT2TAG . ' ';
} else {
echo ' ' . PLUGIN_EVENT_FREETAG_GLOBALCAT2TAG . ' ';
@@ -1970,7 +2024,7 @@ addLoadEvent(enableAutocomplete);
$r = serendipity_db_query($q);
if ($r === true) {
- if ($serendipity['version'][0] == '1') {
+ if ($serendipity['version'][0] < 2) {
echo PLUGIN_EVENT_FREETAG_MANAGE_UNTAGGED_NONE;
} else {
echo ' ' . PLUGIN_EVENT_FREETAG_MANAGE_UNTAGGED_NONE . ' ';
@@ -1978,11 +2032,11 @@ addLoadEvent(enableAutocomplete);
} else if (!is_array($r)) {
echo $r;
} else {
- if ($serendipity['version'][0] == '2') {
+ if ($serendipity['version'][0] > 1) {
echo '';
}
foreach ($r as $row) {
- if ($serendipity['version'][0] == '1') {
+ if ($serendipity['version'][0] < 2) {
echo ' ';
}
}
@@ -2017,7 +2071,7 @@ addLoadEvent(enableAutocomplete);
}
$url = FREETAG_MANAGE_URL . "&serendipity[tagview]=".htmlspecialchars($this->eventData['GET']['tagview']);
- if ($serendipity['version'][0] == '1') {
+ if ($serendipity['version'][0] < 2) {
echo ' ' . PLUGIN_EVENT_FREETAG_KEYWORDS_DESC . ' ';
} else {
echo ' ' . PLUGIN_EVENT_FREETAG_KEYWORDS_DESC . ' ';
@@ -2056,7 +2110,7 @@ addLoadEvent(enableAutocomplete);
?>
@@ -2298,16 +2352,16 @@ addLoadEvent(enableAutocomplete);
function cleanupTagAssignments() {
global $serendipity;
- if ($serendipity['version'][0] == '1') {
+ if ($serendipity['version'][0] < 2) {
echo " ";
}
// Search for inconsistencies
$q_search = "SELECT et.tag AS tag, et.entryid AS entryid, e.id ".
- "FROM {$serendipity['dbPrefix']}entrytags AS et LEFT JOIN {$serendipity['dbPrefix']}entries AS e ".
- "ON et.entryid = e.id ".
- "WHERE e.id IS NULL ".
- "ORDER BY et.tag ASC";
+ "FROM {$serendipity['dbPrefix']}entrytags AS et LEFT JOIN {$serendipity['dbPrefix']}entries AS e ".
+ "ON et.entryid = e.id ".
+ "WHERE e.id IS NULL ".
+ "ORDER BY et.tag ASC";
$mappings = serendipity_db_query($q_search, FALSE, 'assoc', TRUE);
if (is_array($mappings) && count($mappings) > 0) {
@@ -2327,14 +2381,14 @@ addLoadEvent(enableAutocomplete);
$cleanup = serendipity_db_query($q_cleanup);
if ($cleanup === TRUE) {
- if ($serendipity['version'][0] == '1') {
+ if ($serendipity['version'][0] < 2) {
echo "".PLUGIN_EVENT_FREETAG_MANAGE_CLEANUP_SUCCESSFUL." ";
} else {
echo ' ' . PLUGIN_EVENT_FREETAG_MANAGE_CLEANUP_SUCCESSFUL . ' ';
}
}
else {
- if ($serendipity['version'][0] == '1') {
+ if ($serendipity['version'][0] < 2) {
echo "".PLUGIN_EVENT_FREETAG_MANAGE_CLEANUP_FAILED." DB-Error: ".$cleanup;
} else {
echo ' ' . PLUGIN_EVENT_FREETAG_MANAGE_CLEANUP_FAILED . '
DB-Error: ' . $cleanup . '
';
@@ -2347,7 +2401,7 @@ addLoadEvent(enableAutocomplete);
foreach ($mappings as $mapping) {
$cleanup_tags[$mapping['tag']][] = $mapping['entryid'];
}
- if ($serendipity['version'][0] == '1') {
+ if ($serendipity['version'][0] < 2) {
echo PLUGIN_EVENT_FREETAG_MANAGE_CLEANUP_INFO." ";
} else {
echo ' ' . PLUGIN_EVENT_FREETAG_MANAGE_CLEANUP_INFO . ' ';
@@ -2365,9 +2419,9 @@ addLoadEvent(enableAutocomplete);
// Display submit form to start cleanup process
echo '