Update of /cvs/scoop/scoop/struct/patch-files/current In directory lithium.sabren.com:/tmp/cvs-serv14235/struct/patch-files/current Modified Files: README Added Files: patch-21-Tags.sql Log Message: Bug 165: Tag categories. -janra Index: README =================================================================== RCS file: /cvs/scoop/scoop/struct/patch-files/current/README,v retrieving revision 1.111 retrieving revision 1.112 diff -C2 -d -r1.111 -r1.112 *** README 28 May 2005 01:56:29 -0000 1.111 --- README 10 Sep 2005 01:13:46 -0000 1.112 *************** *** 98,101 **** --- 98,104 ---- Updates the story post messages and the story post form action + Sep 9 4:30 patch-21-Tags.sql + Adds tag categorization. + Any problems, email scoop-help at lists.kuro5hin.org (don't forget to join!) join here: http://lists.kuro5hin.org/mailman/listinfo/scoop-help --- NEW FILE: patch-21-Tags.sql --- CREATE TABLE story_tags ( sid varchar(20) NOT NULL default '', tag varchar(255) NOT NULL default '', tag_order int(11) NOT NULL default '0', PRIMARY KEY (sid,tag), KEY sid_idx (sid), KEY tag_idx (tag) ); UPDATE box SET content = INSERT(content, locate('}\r\n}\r\n\r\nreturn ',content), 4, '}\r\n} elsif ($op eq \'tag\') {\r\n my $tag = $S->cgi->param(\'tag\');\r\n $content = ($tag) ? qq{Tag: $tag} : \'\';\r\n}') WHERE boxid = 'section_title'; UPDATE blocks SET block = INSERT(block, locate('%%spellcheck%%\r\n<tr>',block), 14, '%%spellcheck%%\r\n%%tags%%') WHERE bid='edit_story_form'; UPDATE blocks SET block = INSERT(block, locate('%%time%%%%smallfont_end%%',block), 8, '%%time%%\r\n%%tags%%') WHERE bid='story_summary'; INSERT INTO `ops` VALUES ('tag', 'index_template', 'show_storiesbytag', 0, 1, '', 'tags', '/tag/page/', 'Lists the stories, with intros, that are in a specified tag'); INSERT INTO `vars` VALUES ('tag_threshold_classes', '1,tag-popularity-1\r\n5,tag-popularity-5\r\n10,tag-popularity-10\r\n15,tag-popularity-15\r\n', 'Tag Count Threshholds for altering the font styling for each tag on the all tags page depending on what story count threshold it meets. Each threshold is on a line by itself, and consists of two parts: the number of stories associated with a given tag, and the CSS class name used for that tag. The styling of the CSS classes named here is done in the block <B>main_css</B>.', 'tarea', 'Tags'); INSERT INTO `vars` VALUES ('use_tags', '0', 'Turns the "tag" categorization system on or off. Tags are user-input freeform story categories. Any story can have any number of associated tags. Tags are input as a simple comma-delimited string of words, and can only consist of alphanumeric characters (a-z, A-Z, 0-9).', 'bool', 'Tags'); INSERT INTO `pref_items` VALUES ('tag_sort', 'Story tag sorting', 'Choose between sorting tags by popularity (count) or name (alpha)', '0', '0', '', '', 'use_tags', '0', 'count', '5', '^(alpha|count)$', 'Interface', '%%BOX,pref_selectbox,tag_sort,%%value%%,alpha,count%%','22','selectbox_pref','','0','normal'); INSERT INTO `blocks` VALUES ('story_edit_tags', '<tr>\r\n<td valign="top">tags:</td>\r\n<td valign="top"><input type="text" name="tags" value="%%value%%" size="50"></td>\r\n</tr>', '1', 'Field for tag input in story edit form. This only shows up if the Site Control <B>use_tags</B> is set. \r\n<p>\r\nSpecial keys:\r\n<ul><li> value: the list of tags, as a comma-delimited string</ul>', 'Stories,Tags', 'default', 'en'); INSERT INTO `blocks` VALUES ('tag_item_format', '<a href="%%rootdir%%/tag/%%urltag%%">%%tag%%</a>', '1', 'A single item in the list of tags. \r\n<p>\r\nSpecial keys:\r\n<ul>\r\n<li> tag: the tag\r\n<li> urltag: the tag, escaped for use in a url\r\n</ul>', 'Stories,Tags', 'default', 'en'); INSERT INTO `blocks` VALUES ('tag_list_format', '<br>Tags: %%tags_list%% (<a href="%%rootdir%%/tag">all tags</a>)', '1', 'The overall formatting for the tag display list, used in story_summary. Only appears if the Site Control <B>use_tags</B> is set.\r\n<p>\r\nSpecial keys:\r\n<ul><li> list: The list of tags, formatted according to <B>tag_item_format</B> and joined together with <B>tag_list_joinwith</B>.</ul>', 'Stories,Tags', 'default', 'en'); INSERT INTO `blocks` VALUES ('tag_list_joinwith', ', ', '1', 'When the tag list is built for display, the formatted tag items will be joined together with this block. Especially useful for commas and such, but whatever you can think of to do with it.', 'Stories,Tags', 'default', 'en'); INSERT INTO `blocks` VALUES ('tag_page_format', '%%title_font%%All Tags:%%title_font_end%%\r\n<ul class="cloud">\r\n%%tags_list%%\r\n</ul>', '1', 'Page formatting for the tags cloud page generated by the tag OP. The only special key found here is <b>tags_list</b>', 'Tags', 'default', 'en'); INSERT INTO `blocks` VALUES ('tag_page_item', '<li class="%%cssclass%%"><a href="/tag/%%urltag%%">%%tag%%</a> (%%num%%)</li>', '1', 'A single item on the tags cloud page. Special keys:\n<ul><li>cssclass: the CSS class name taken from the site control <B>tag_threshold_classes</B></li>\n<li>tag: the tag</li>\n<li>urltag: the tag, filtered for use in a URL</li></ul>', 'Tags', 'default', 'en'); INSERT INTO `blocks` VALUES ('tag_page_joinwith', ' ', '1', 'When the list of tags on the tags cloud page is built, the formatted tags will be joined together with this block.', 'Tags', 'default', 'en'); UPDATE `blocks` SET block = CONCAT(block,'\r\n\r\n/* tag-cloud styles */\r\n\r\n.cloud li { list-style-type: none; display: inline; margin-right: 8px; }\r\n\r\n.cloud .tag-popularity-1 { font-size: 80%; }\r\n\r\n.cloud .tag-popularity-5 { font-size: 90%; }\r\n\r\n.cloud .tag-popularity-10 { font-size: 100%; }\r\n\r\n.cloud .tag-popularity-15 { font-size: 110%; }') WHERE `bid` = 'main_css' AND `theme` = 'default' AND `language` = 'en';