222f4f4653
References s9y/Serendipity#149 |
||
---|---|---|
.. | ||
img | ||
UTF-8 | ||
.htaccess | ||
ChangeLog | ||
documentation_cs.html | ||
documentation_cz.html | ||
documentation_en.html | ||
jquery-1.11.1.min.js | ||
jquery-migrate-1.2.1.min.js | ||
jquery.autocomplete.css | ||
jquery.autocomplete.min.js | ||
lang_bg.inc.php | ||
lang_cs.inc.php | ||
lang_cz.inc.php | ||
lang_de.inc.php | ||
lang_en.inc.php | ||
lang_fr.inc.php | ||
lang_hu.inc.php | ||
lang_it.inc.php | ||
lang_ja.inc.php | ||
lang_nl.inc.php | ||
lang_pl.inc.php | ||
lang_se.inc.php | ||
plugin_freetag.tpl | ||
README | ||
README.txt | ||
serendipity_event_freetag.php | ||
serendipity_plugin_freetag.php | ||
swfobject.js | ||
tagcloud.swf |
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']) ); }