additional_plugins/serendipity_event_freetag/documentation_en.html
2014-09-28 10:40:31 +02:00

277 lines
14 KiB
HTML

<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Documentation: Freetag</title>
<style>
pre {
display: block;
padding: 5px;
border: solid 1px #333;
background-color: #ddd;
}
</style>
</head>
<body>
<h1>Documentation of the Freetag event plugin<br />
<small>(serendipity_event_freetag)</small></h1>
<p>Documentary added by Ian on 2014-09-27. Informations given in <a href="README">The most current README</a>, <a href="README.txt"> and older README.txt</a> a <a href="ChangeLog">and the most current ChangeLog file</a>.
<h2>Scripting changes by options</h2>
<h3>Option: Extendet Smarty</h3>
<p>When using extended smarty output, the following code illustrates how the smarty-variables could be used when dropped into the entries.tpl:
<pre class="prettyprint linenums lang-php " data-pbcklang="php" data-pbcktabsize="4">
{if isset($entry.freetag.extended) &amp;&amp; $entry.freetag.extended == 1}
{if $entry.freetag.tags.tags}
&lt;div class=&quot;serendipity_freeTag&quot;&gt;{$entry.freetag.tags.description}
{foreach from=$entry.freetag.tags.tags item=&quot;tag&quot;}
{$tag}
{/foreach}
&lt;/div&gt;
{if $is_single_entry or $is_preview}
{$entry.freetag.related.description}
&lt;ul class=&quot;serendipity_freeTag_related&quot;&gt;
{foreach from=$entry.freetag.related.entries item=&quot;link&quot;}
&lt;li&gt;{$link}&lt;/li&gt;
{/foreach}
&lt;/ul&gt;
{/if}
{/if}
{else}
{$entry.freetag}
{/if}
</pre>
<h3>Using this subquery you can convert existing categories to tags:</h3>
<pre class="prettyprint linenums lang-sql " data-pbcklang="sql" data-pbcktabsize="4">
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;
</pre>
<p>[quoted from: http://pixelated-dreams.com/archives/229-Spring-Cleaning.html]</p>
<h3>Or using this script you can convert existing categories to tags:</h3>
<pre class="prettyprint linenums lang-php " data-pbcklang="php" data-pbcktabsize="4">
&lt;?php
include &#39;serendipity_config.inc.php&#39;;
$rows = serendipity_db_query(&quot;SELECT e.id, e.title, c.category_name
FROM {$serendipity[&#39;dbPrefix&#39;]}entries AS e
JOIN {$serendipity[&#39;dbPrefix&#39;]}entrycat AS ec
ON ec.entryid = e.id
JOIN {$serendipity[&#39;dbPrefix&#39;]}category AS c
ON ec.categoryid = c.categoryid&quot;);
foreach($rows AS $row) {
serendipity_db_query(
sprintf(
&quot;REPLACE INTO {$serendipity[&#39;dbPrefix&#39;]}entrytags (entryid, tag) VALUES (%d, %s)&quot;,
(int)$row[&#39;id&#39;],
serendipity_db_escape_string($row[&#39;category_name&#39;])
)
);
printf(
&quot;Category &#39;%s&#39; added as Tag for Entry #%d, &#39;%s&#39;&lt;br /&gt;\n&quot;,
htmlspecialchars($row[&#39;category_name&#39;]),
(int)$row[&#39;id&#39;],
htmlspecialchars($row[&#39;title&#39;])
);
}</pre>
<p>&nbsp;</p>
<h3>Option: Tags-as-list</h3>
<p>The following code illustrates on how to change your templates entries.tpl file (all + lines, without '+ '):</p>
<pre class="prettyprint linenums lang-html " data-pbcklang="html" data-pbcktabsize="4">
{serendipity_hookPlugin hook=&quot;entries_header&quot; addData=&quot;$entry_id&quot;}
+ {if $taglist}
+ &lt;article id=&quot;taglistentries&quot; class=&quot;clearfix serendipity_entry&quot;&gt;
+ &lt;div class=&quot;clearfix content serendipity_entry_body&quot;&gt;
+ &lt;h2&gt;{$head_subtitle}&lt;/h2&gt;
+ {foreach from=$entries item=&quot;dategroup&quot;}
+ {foreach from=$dategroup.entries item=&quot;entry&quot;}
+
+ &lt;div class=&quot;static-entries-list&quot;&gt;
+ ({$dategroup.date|date_format:&quot;%d.%m.%Y&quot;}) &lt;a href=&quot;{$entry.link}&quot;&gt;{$entry.title|default:$entry.id}&lt;/a&gt;
+ &lt;/div&gt;
+
+ {/foreach}
+ {/foreach}
+
+ &lt;/div&gt;
+ &lt;/article&gt;
+
+ {else}
+
{foreach from=$entries item=&quot;dategroup&quot;}
{foreach from=$dategroup.entries item=&quot;entry&quot;}
{assign var=&quot;entry&quot; value=$entry scope=&quot;parent&quot;}
&lt;article id=&quot;post_{$entry.id}&quot; class=&quot;clearfix serendipity_entry{if $dategroup.is_sticky} sticky{/if}&quot;&gt;
&lt;header class=&quot;clearfix&quot;&gt;
&lt;h2&gt;&lt;a href=&quot;{$entry.link}&quot;&gt;{$entry.title}&lt;/a&gt;&lt;/h2&gt;
&lt;span class=&quot;serendipity_byline block_level&quot;&gt;&lt;span class=&quot;single_user&quot;&gt;{$CONST.POSTED_BY} &lt;a href=&quot;{$entry.link_author}&quot;&gt;{$entry.author}&lt;/a&gt; {$CONST.ON} &lt;/span&gt;&lt;time datetime=&quot;{$entry.timestamp|@serendipity_html5time}&quot;&gt;{$entry.timestamp|@formatTime:$template_option.date_format}&lt;/time&gt;{if $entry.is_entry_owner and not $is_preview} | &lt;a href=&quot;{$entry.link_edit}&quot;&gt;{$CONST.EDIT_ENTRY}&lt;/a&gt;{/if}&lt;/span&gt;
&lt;/header&gt;
&lt;div class=&quot;clearfix content serendipity_entry_body&quot;&gt;
{if $entry.categories}{foreach from=$entry.categories item=&quot;entry_category&quot;}{if $entry_category.category_icon}&lt;a href=&quot;{$entry_category.category_link}&quot;&gt;&lt;img class=&quot;serendipity_entryIcon&quot; title=&quot;{$entry_category.category_name|@escape}{$entry_category.category_description|@emptyPrefix}&quot; alt=&quot;{$entry_category.category_name|@escape}&quot; src=&quot;{$entry_category.category_icon}&quot;&gt;&lt;/a&gt;{/if}{/foreach}{/if}
{$entry.body}
{if $entry.has_extended and not $is_single_entry and not $entry.is_extended}
&lt;a class=&quot;read_more block_level&quot; href=&quot;{$entry.link}#extended&quot;&gt;{$CONST.VIEW_EXTENDED_ENTRY|@sprintf:$entry.title}&lt;/a&gt;
{/if}
&lt;/div&gt;
{if $entry.is_extended}
&lt;div id=&quot;extended&quot; class=&quot;clearfix content&quot;&gt;
{$entry.extended}
&lt;/div&gt;
{/if}
{if $entry.plugin_display_dat}
{$entry.plugin_display_dat}
{/if}
&lt;footer class=&quot;clearfix&quot;&gt;
{if $entry.categories}
&lt;span class=&quot;visuallyhidden&quot;&gt;{$CONST.CATEGORIES}: &lt;/span&gt;{foreach from=$entry.categories item=&quot;entry_category&quot; name=&quot;categories&quot;}&lt;a href=&quot;{$entry_category.category_link}&quot;&gt;{$entry_category.category_name|@escape}&lt;/a&gt;{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}, &lt;a href=&quot;{$entry.link}#trackbacks&quot;&gt;{$entry.trackbacks} {$entry.label_trackbacks}&lt;/a&gt;{/if}
{else}
&lt;a href=&quot;{$entry.link}#comments&quot; title=&quot;{$entry.comments} {$entry.label_comments}{if $entry.has_trackbacks}, {$entry.trackbacks} {$entry.label_trackbacks}{/if}&quot;&gt;{$entry.comments} {$entry.label_comments}&lt;/a&gt;
{/if}
{/if}
{if $entry.url_tweetthis}
| &lt;a href=&quot;{$entry.url_tweetthis}&quot; title=&quot;{$CONST.TWOK11_TWEET_THIS}&quot;&gt;Twitter&lt;/a&gt;
{/if}
{if $entry.url_dentthis}
| &lt;a href=&quot;{$entry.url_dentthis}&quot; title=&quot;{$CONST.TWOK11_DENT_THIS}&quot;&gt;Identica&lt;/a&gt;
{/if}
{if $entry.url_shorturl}
| &lt;a href=&quot;{$entry.url_shorturl}&quot; title=&quot;{$CONST.TWOK11_SHORT_URL_HINT}&quot; class=&quot;short-url&quot;&gt;{$CONST.TWOK11_SHORT_URL}&lt;/a&gt;
{/if}
{$entry.add_footer}
&lt;/footer&gt;
&lt;!--
&lt;rdf:RDF xmlns:rdf=&quot;http://www.w3.org/1999/02/22-rdf-syntax-ns#&quot;
xmlns:trackback=&quot;http://madskills.com/public/xml/rss/module/trackback/&quot;
xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot;&gt;
&lt;rdf:Description
rdf:about=&quot;{$entry.link_rdf}&quot;
trackback:ping=&quot;{$entry.link_trackback}&quot;
dc:title=&quot;{$entry.title_rdf|@default:$entry.title}&quot;
dc:identifier=&quot;{$entry.rdf_ident}&quot; /&gt;
&lt;/rdf:RDF&gt;
--&gt;
{if $is_single_entry and not $is_preview}
{if $CONST.DATA_UNSUBSCRIBED}
&lt;p class=&quot;serendipity_msg_notice&quot;&gt;{$CONST.DATA_UNSUBSCRIBED|@sprintf:$CONST.UNSUBSCRIBE_OK}&lt;/p&gt;
{/if}
{if $CONST.DATA_TRACKBACK_DELETED}
&lt;p class=&quot;serendipity_msg_notice&quot;&gt;{$CONST.DATA_TRACKBACK_DELETED|@sprintf:$CONST.TRACKBACK_DELETED}&lt;/p&gt;
{/if}
{if $CONST.DATA_TRACKBACK_APPROVED}
&lt;p class=&quot;serendipity_msg_notice&quot;&gt;{$CONST.DATA_TRACKBACK_APPROVED|@sprintf:$CONST.TRACKBACK_APPROVED}&lt;/p&gt;
{/if}
{if $CONST.DATA_COMMENT_DELETED}
&lt;p class=&quot;serendipity_msg_notice&quot;&gt;{$CONST.DATA_COMMENT_DELETED|@sprintf:$CONST.COMMENT_DELETED}&lt;/p&gt;
{/if}
{if $CONST.DATA_COMMENT_APPROVED}
&lt;p class=&quot;serendipity_msg_notice&quot;&gt;{$CONST.DATA_COMMENT_APPROVED|@sprintf:$CONST.COMMENT_APPROVED}&lt;/p&gt;
{/if}
&lt;section id=&quot;trackbacks&quot; class=&quot;serendipity_comments serendipity_section_trackbacks&quot;&gt;
&lt;h3&gt;{$CONST.TRACKBACKS}&lt;/h3&gt;
&lt;div id=&quot;trackback_url&quot; class=&quot;block_level&quot;&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;{$entry.link_trackback}&quot; title=&quot;{$CONST.TRACKBACK_SPECIFIC_ON_CLICK|@escape}&quot;&gt;{$CONST.TRACKBACK_SPECIFIC}&lt;/a&gt;&lt;/div&gt;
{serendipity_printTrackbacks entry=$entry.id}
&lt;/section&gt;
&lt;section id=&quot;comments&quot; class=&quot;serendipity_comments serendipity_section_comments&quot;&gt;
&lt;h3&gt;{$CONST.COMMENTS}&lt;/h3&gt;
&lt;p class=&quot;manage_comments&quot;&gt;{$CONST.DISPLAY_COMMENTS_AS}
{if $entry.viewmode eq $CONST.VIEWMODE_LINEAR}
{$CONST.COMMENTS_VIEWMODE_LINEAR} | &lt;a href=&quot;{$entry.link_viewmode_threaded}#comments&quot; rel=&quot;nofollow&quot;&gt;{$CONST.COMMENTS_VIEWMODE_THREADED}&lt;/a&gt;
{else}
&lt;a rel=&quot;nofollow&quot; href=&quot;{$entry.link_viewmode_linear}#comments&quot;&gt;{$CONST.COMMENTS_VIEWMODE_LINEAR}&lt;/a&gt; | {$CONST.COMMENTS_VIEWMODE_THREADED}
{/if}
&lt;/p&gt;
{serendipity_printComments entry=$entry.id mode=$entry.viewmode}
{if $entry.is_entry_owner}
&lt;p class=&quot;manage_comments&quot;&gt;
{if $entry.allow_comments}
&lt;a href=&quot;{$entry.link_deny_comments}&quot;&gt;{$CONST.COMMENTS_DISABLE}&lt;/a&gt;
{else}
&lt;a href=&quot;{$entry.link_allow_comments}&quot;&gt;{$CONST.COMMENTS_ENABLE}&lt;/a&gt;
{/if}
&lt;/p&gt;
{/if}
&lt;/section&gt;
&lt;a id=&quot;feedback&quot;&gt;&lt;/a&gt;
{foreach from=$comments_messagestack item=&quot;message&quot;}
&lt;p class=&quot;serendipity_msg_important&quot;&gt;{$message}&lt;/p&gt;
{/foreach}
{if $is_comment_added}
&lt;p class=&quot;serendipity_msg_notice&quot;&gt;{$CONST.COMMENT_ADDED}&lt;/p&gt;
{elseif $is_comment_moderate}
&lt;p class=&quot;serendipity_msg_notice&quot;&gt;{$CONST.COMMENT_ADDED}: {$CONST.THIS_COMMENT_NEEDS_REVIEW}&lt;/p&gt;
{elseif not $entry.allow_comments}
&lt;p class=&quot;serendipity_msg_important&quot;&gt;{$CONST.COMMENTS_CLOSED}&lt;/p&gt;
{/if}
&lt;section id=&quot;respond&quot; class=&quot;serendipity_section_commentform&quot;&gt;
&lt;h3&gt;{$CONST.ADD_COMMENT}&lt;/h3&gt;
{$COMMENTFORM}
&lt;/section&gt;
{/if}
{$entry.backend_preview}
&lt;/article&gt;
{/foreach}
{foreachelse}
{if not $plugin_clean_page}
&lt;p class=&quot;nocontent&quot;&gt;{$CONST.NO_ENTRIES_TO_PRINT}&lt;/p&gt;
{/if}
{/foreach}
+
+ {/if}{* not taglist end *}
+
{if $footer_info or $footer_prev_page or $footer_next_page}
&lt;nav class=&quot;serendipity_pagination block_level&quot;&gt;
&lt;h2 class=&quot;visuallyhidden&quot;&gt;{$CONST.TWOK11_PAG_TITLE}&lt;/h2&gt;
&lt;ul class=&quot;clearfix&quot;&gt;
{if $footer_info}
&lt;li class=&quot;info&quot;&gt;&lt;span&gt;{$footer_info}&lt;/span&gt;&lt;/li&gt;
{/if}
&lt;li class=&quot;prev&quot;&gt;{if $footer_prev_page}&lt;a href=&quot;{$footer_prev_page}&quot;&gt;{/if}{if $footer_prev_page}&amp;larr; {$CONST.PREVIOUS_PAGE}{else}&amp;nbsp;{/if}{if $footer_prev_page}&lt;/a&gt;{/if}&lt;/li&gt;
&lt;li class=&quot;next&quot;&gt;{if $footer_next_page}&lt;a href=&quot;{$footer_next_page}&quot;&gt;{/if}{if $footer_next_page}{$CONST.NEXT_PAGE} &amp;rarr;{else}&amp;nbsp;{/if}{if $footer_next_page}&lt;/a&gt;{/if}&lt;/li&gt;
&lt;/ul&gt;
&lt;/nav&gt;
{/if}
{serendipity_hookPlugin hook=&quot;entries_footer&quot;}
</pre>
<p>&nbsp;</p>
</body>
</html>