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"} + +
+ ({$dategroup.date|date_format:"%d.%m.%Y"}) {$entry.title|default:$entry.id} +
+ + {/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} + + {/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)

- - - - - 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)

- - - - - 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}&larr; {$CONST.PREVIOUS_PAGE}{else}&nbsp;{/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} &rarr;{else}&nbsp;{/if}{if $footer_next_page}</a>{/if}</li>
+        </ul>
+    </nav>
+{/if}
+    {serendipity_hookPlugin hook="entries_footer"}
+
+ +

 

+

Historie verz (ChangeLog)