Multi-level categories

Combining functions method: function dropdown_cats() { global $table_prefix; $main_cats = "SELECT cat_id, cat_name FROM ${table_prefix}categories WHERE cat_parent = 0"; $cats = mysql_query($main_cats); while ( $main_cat_list = mysql_fetch_array($cats) ) { $main_cat = stripslashes($main_cat_list['cat_name']); echo '<option value="' . $main_cat_list['cat_id'] . "\\">$main_cat</option>\\n"; dropdown_sub_cats($main_cat_list['cat_id']); } } function dropdown_sub_cats($main_cat_id, $level = 1) { global $table_prefix; $query = "SELECT cat_id, cat_name… Continue reading Multi-level categories

“Regex Spellcheck” for Vietnamese (continued)

"Regex Spellcheck" (step 2a) 😀 #! /bin/sh # Vietnamese-initial-sounds splitter # This script will split the Vietnamese syllables list (named 'LIST') # into initial-sound-based lists. Each list (stored in one *.txt file) # contains syllables that begin with one individual initial sound # (presented in Quốc ngữ writing system). # NOTICE: The initial sound /?-/… Continue reading “Regex Spellcheck” for Vietnamese (continued)

“Regex Spellcheck” for Vietnamese

"Regex Spellcheck" (step 1) 😆 (ch|gh|kh|ngh|ng|nh|p|ph|th|tr|b|c|d|đ|g|h|gi|k|l|m|n|q|r|s|t|v|x)? ( ( [uo] )? ( ( [aàảãáạăằẳẵắặâầẩẫấậeèẻẽéẹêềểễếệiìỉĩíịoòỏõóọôồổỗốộơờởỡớợuùủũúụưừửữứựyỳỷỹýỵ] ) | ( y[aàảãáạêềểễếệ] ) ) | ( ia|ìa|ỉa|ĩa|ía|ịa|iê|iề|iể|iễ|iế|iệ|ưa|ừa|ửa|ữa|ứa|ựa|ươ|ườ|ưở|ưỡ|ướ|ượ|ua|ùa|ủa|ũa|úa|ụa ) ) ( (i|o|u|y|m|n|ng|nh|p|t|c|ch)? ) 😛