additional_plugins/serendipity_event_freetag
2022-12-30 21:45:33 +01:00
..
img Migrate plugins 2011-12-13 12:29:05 +01:00
UTF-8 Korean translation added 2016-04-23 22:04:24 +09:00
.htaccess freetag decode fix and list option 2014-09-28 10:40:31 +02:00
ChangeLog freetag: document #147 2022-12-30 21:45:33 +01:00
documentation_cs.html freetag decode fix and list option 2014-09-28 10:40:31 +02:00
documentation_cz.html freetag decode fix and list option 2014-09-28 10:40:31 +02:00
documentation_en.html freetag decode fix and list option 2014-09-28 10:40:31 +02:00
jquery-1.11.1.min.js freetag minor fix for taglist and remove CDNs 2014-10-02 11:13:40 +02:00
jquery-migrate-1.2.1.min.js freetag minor fix for taglist and remove CDNs 2014-10-02 11:13:40 +02:00
jquery.autocomplete.css revert 22834c8 to 3.50 2014-03-14 16:30:54 +01:00
jquery.autocomplete.min.js revert 22834c8 to 3.50 2014-03-14 16:30:54 +01:00
lang_bg.inc.php also remove $Revision$ 2013-08-12 10:27:53 +02:00
lang_cs.inc.php czech translations - removed leading slash from first line (introduced erroneously in previous commit) 2013-12-28 21:43:44 +01:00
lang_cz.inc.php czech translations - removed leading slash from first line (introduced erroneously in previous commit) 2013-12-28 21:43:44 +01:00
lang_de.inc.php freetag decode fix and list option 2014-09-28 10:40:31 +02:00
lang_en.inc.php freetag decode fix and list option 2014-09-28 10:40:31 +02:00
lang_fr.inc.php also remove $Revision$ 2013-08-12 10:27:53 +02:00
lang_hu.inc.php also remove $Revision$ 2013-08-12 10:27:53 +02:00
lang_it.inc.php also remove $Revision$ 2013-08-12 10:27:53 +02:00
lang_ja.inc.php also remove $Revision$ 2013-08-12 10:27:53 +02:00
lang_ko.inc.php Korean translation added 2016-04-23 22:02:15 +09:00
lang_nl.inc.php also remove $Revision$ 2013-08-12 10:27:53 +02:00
lang_pl.inc.php also remove $Revision$ 2013-08-12 10:27:53 +02:00
lang_se.inc.php Proper file permissions for Swedish lang files. 2014-06-02 12:05:58 +02:00
plugin_freetag.tpl Migrate plugins 2011-12-13 12:29:05 +01:00
README freetag minor fix for taglist and remove CDNs 2014-10-02 11:13:40 +02:00
README.txt freetag minor fix for taglist and remove CDNs 2014-10-02 11:13:40 +02:00
serendipity_event_freetag.php Check that the tag GET variable is a string. (#147) 2022-12-30 21:43:22 +01:00
serendipity_plugin_freetag.php using serendipity_plugin_api::load_language() for some more plugins 2021-07-12 15:44:23 +02:00
swfobject.js Migrate plugins 2011-12-13 12:29:05 +01:00
tagcloud.swf Migrate plugins 2011-12-13 12:29:05 +01:00

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'])
    );
}