Index: af-extended-live-archive-include.php --- af-extended-live-archive-include.php.orig 2006-06-17 19:04:56 +0200 +++ af-extended-live-archive-include.php 2007-10-01 19:16:47 +0200 @@ -43,7 +43,6 @@ class af_ela_classGenerator { var $cache; - var $utwCore; var $yearTable = array(); var $monthTable = array(); var $catsTable = array(); @@ -56,9 +55,7 @@ * Helper Function : class constructor * ***********************************/ function af_ela_classGenerator() { - global $utw_is_present; $this->cache = new af_ela_classCacheFile(''); - if($utw_is_present) $this->utwCore = new UltimateTagWarriorCore; return true; } /* *********************************** @@ -66,13 +63,13 @@ * updated post. * ***********************************/ function buildPostToGenerateTable($exclude, $id, $commentId = false) { - global $wpdb, $tabletags, $tablepost2tag, $utw_is_present; + global $wpdb; if (!empty($exclude)) { $excats = preg_split('/[\s,]+/',$exclude); if (count($excats)) { foreach ($excats as $excat) { - $exclusions .= ' AND category_id <> ' . intval($excat) . ' '; + $exclusions .= ' AND tr.term_taxonomy_id <> ' . intval($excat) . ' '; } } } @@ -82,40 +79,39 @@ $dojustid = ' AND ID = ' . intval($id) . ' ' ; } - $query = "SELECT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, category_id - FROM $wpdb->posts - INNER JOIN $wpdb->post2cat ON ($wpdb->posts.ID = $wpdb->post2cat.post_id) + $query = "SELECT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, tr.term_taxonomy_id AS `term_taxonomy_id` + FROM $wpdb->posts p + INNER JOIN $wpdb->term_relationships tr ON (p.ID = tr.object_id) + INNER JOIN $wpdb->term_taxonomy tt ON (tr.term_taxonomy_id = tt.term_taxonomy_id) WHERE post_date > 0 + AND taxonomy = 'category' $exclusions $dojustid ORDER By post_date DESC"; logthis("SQL Query :".$query, __FUNCTION__, __LINE__); $results = $wpdb->get_results($query); if ($results) { foreach($results as $result) { - $this->postToGenerate['category_id'][] = $result->category_id; + $this->postToGenerate['term_taxonomy_id'][] = $result->term_taxonomy_id; } } $this->postToGenerate['new_year']= $results[0]->year; $this->postToGenerate['new_month']= $results[0]->month; - // For UTW - if($utw_is_present) { - $query = "SELECT tag_id - FROM $wpdb->posts - INNER JOIN $wpdb->post2cat ON ($wpdb->posts.ID = $wpdb->post2cat.post_id) - INNER JOIN $tablepost2tag ON ($wpdb->posts.ID = $tablepost2tag.post_id) - WHERE post_date > 0 - $exclusions $dojustid - ORDER By post_date DESC"; - logthis("SQL Query :".$query, __FUNCTION__, __LINE__); - $results = $wpdb->get_results($query); - if ($results) { - foreach($results as $result) { - $this->postToGenerate['tag_id'][] = $result->tag_id; - } + $query = "SELECT tr.term_taxonomy_id + FROM $wpdb->posts p + INNER JOIN $wpdb->term_relationships tr ON (p.ID = tr.object_id) + INNER JOIN $wpdb->term_taxonomy tt ON (tr.term_taxonomy_id = tt.term_taxonomy_id) + WHERE post_date > 0 + AND tt.taxonomy = 'post_tag' + $exclusions $dojustid + ORDER By post_date DESC"; + logthis("SQL Query :".$query, __FUNCTION__, __LINE__); + $results = $wpdb->get_results($query); + if ($results) { + foreach($results as $result) { + $this->postToGenerate['term_taxonomy_id'][] = $result->term_taxonomy_id; } } - // End of stuff for UTW return true; } else { @@ -130,9 +126,9 @@ $dojustid = ' AND ID = ' . intval($id) . ' ' ; } - $query = "SELECT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, category_id - FROM $wpdb->posts - INNER JOIN $wpdb->post2cat ON ($wpdb->posts.ID = $wpdb->post2cat.post_id) + $query = "SELECT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, tr.term_taxonomy_id AS `term_taxonomy_id` + FROM $wpdb->posts p + INNER JOIN $wpdb->term_relationships tr ON (p.ID = tr.object_id) WHERE post_date > 0 $exclusions $dojustid ORDER By post_date DESC"; @@ -140,14 +136,14 @@ $results = $wpdb->get_results($query); if($results) { foreach($results as $result) { - $this->postToGenerate['category_id'][]=$result->category_id; + $this->postToGenerate['term_taxonomy_id'][]=$result->term_taxonomy_id; } $this->postToGenerate['post_id'] = $id; $this->postToGenerate['new_year']= $results[0]->year; $this->postToGenerate['new_month'] = $results[0]->month; $this->yearTable = array($this->postToGenerate['new_year'] => 0); $this->monthTable[$this->postToGenerate['new_year']] = array($this->postToGenerate['new_month'] => 0); - $this->catsTable = $this->postToGenerate['category_id']; + $this->catsTable = $this->postToGenerate['term_taxonomy_id']; return true; } } @@ -164,7 +160,7 @@ $excats = preg_split('/[\s,]+/',$exclude); if (count($excats)) { foreach ($excats as $excat) { - $exclusions .= ' AND p2c.category_id <> ' . intval($excat) . ' '; + $exclusions .= ' AND tr.term_taxonomy_id <> ' . intval($excat) . ' '; } } } @@ -172,7 +168,7 @@ $query = "SELECT DISTINCT YEAR(p.post_date) AS `year` FROM $wpdb->posts p - INNER JOIN $wpdb->post2cat p2c ON (p.ID = p2c.post_id) + INNER JOIN $wpdb->term_relationships tr ON (p.ID = tr.object_id) WHERE p.post_date > 0 $exclusions ORDER By p.post_date DESC"; @@ -182,9 +178,10 @@ foreach( $year_results as $year_result ) { $query = "SELECT p.ID FROM $wpdb->posts p - INNER JOIN $wpdb->post2cat p2c ON (p.ID = p2c.post_id) + INNER JOIN $wpdb->term_relationships tr ON (p.ID = tr.object_id) WHERE YEAR(p.post_date) = $year_result->year $exclusions + AND p.post_type = 'post' AND p.post_status = 'publish' AND p.post_date_gmt < '$now' GROUP BY p.ID"; @@ -219,7 +216,7 @@ $excats = preg_split('/[\s,]+/',$exclude); if (count($excats)) { foreach ($excats as $excat) { - $exclusions .= ' AND p2c.category_id <> ' . intval($excat) . ' '; + $exclusions .= ' AND tr.term_taxonomy_id <> ' . intval($excat) . ' '; } } } @@ -228,7 +225,7 @@ foreach( $this->yearTable as $year => $y ) { $query = "SELECT DISTINCT MONTH(p.post_date) AS `month` FROM $wpdb->posts p - INNER JOIN $wpdb->post2cat p2c ON (p.ID = p2c.post_id ) + INNER JOIN $wpdb->term_relationships tr ON (p.ID = tr.object_id ) WHERE YEAR(p.post_date) = $year $exclusions AND p.post_date_gmt < '$now' @@ -239,10 +236,11 @@ foreach( $month_results as $month_result ) { $query = "SELECT p.ID FROM $wpdb->posts p - INNER JOIN $wpdb->post2cat p2c ON (p.ID = p2c.post_id) + INNER JOIN $wpdb->term_relationships tr ON (p.ID = tr.object_id) WHERE YEAR(p.post_date) = $year $exclusions AND MONTH(p.post_date) = $month_result->month + AND p.post_type = 'post' AND p.post_status = 'publish' AND p.post_date_gmt < '$now' GROUP BY p.ID"; @@ -282,7 +280,7 @@ $excats = preg_split('/[\s,]+/',$exclude); if (count($excats)) { foreach ($excats as $excat) { - $exclusions .= ' AND category_id <> ' . intval($excat) . ' '; + $exclusions .= ' AND term_taxonomy_id <> ' . intval($excat) . ' '; } } } @@ -297,6 +295,7 @@ FROM $wpdb->posts WHERE YEAR(post_date) = $year AND MONTH(post_date) = $month + AND post_type = 'post' AND post_status = 'publish' AND post_date_gmt < '$now' ORDER By post_date DESC"; @@ -304,9 +303,9 @@ $post_results = $wpdb->get_results($query); if( $post_results ) { foreach( $post_results as $post_result ) { - $query = "SELECT category_id - FROM $wpdb->post2cat - WHERE post_id = $post_result->ID + $query = "SELECT term_taxonomy_id + FROM $wpdb->term_relationships + WHERE object_id = $post_result->ID $exclusions"; logthis("SQL Query :".$query, __FUNCTION__, __LINE__); $posts_in_cat_results = $wpdb->get_results($query); @@ -364,7 +363,7 @@ if (!empty($diffcats)) { $this->catsTable = $diffcats; } else { - $this->catsTable = $this->postToGenerate['category_id']; + $this->catsTable = $this->postToGenerate['term_taxonomy_id']; } } } @@ -378,17 +377,20 @@ $excats = preg_split('/[\s,]+/',$exclude); if (count($excats)) { foreach ($excats as $excat) { - $exclusions .= ' AND c.cat_ID <> ' . intval($excat) . ' '; + $exclusions .= ' AND tt.term_taxonomy_id <> ' . intval($excat) . ' '; } } } if (intval($categories)==0){ - $sort_column = 'c.cat_'.$sort_column; + $sort_column = 'tt.term_taxonomy_'.$sort_column; - $query = "SELECT cat_ID, cat_name, category_nicename, category_parent - FROM $wpdb->categories c - WHERE c.cat_ID > 0 $exclusions $dojustid + $query = "SELECT tt.term_taxonomy_id, t.name, t.slug, tt.parent + FROM $wpdb->terms t + INNER JOIN $wpdb->term_taxonomy tt ON (t.term_id = tt.term_id) + WHERE t.term_id > 0 + AND tt.taxonomy = 'category' + $exclusions $dojustid ORDER BY $sort_column $sort_order"; logthis("SQL Query :".$query, __FUNCTION__, __LINE__); $categories = $wpdb->get_results($query); @@ -396,39 +398,41 @@ if (!count($category_posts)) { $now = current_time('mysql', 1); - $query = "SELECT c.cat_ID, - COUNT(distinct p2c.post_id) AS cat_count - FROM $wpdb->categories c - INNER JOIN $wpdb->post2cat p2c ON (c.cat_ID = p2c.category_id) - INNER JOIN $wpdb->posts p ON (p.ID = p2c.post_id) + $query = "SELECT tr.term_taxonomy_id, + COUNT(tr.object_id) AS cat_count + FROM $wpdb->term_taxonomy tt + INNER JOIN $wpdb->term_relationships tr ON (tt.term_taxonomy_id = tr.term_taxonomy_id) + INNER JOIN $wpdb->posts p ON (p.ID = tr.object_id) WHERE p.post_status = 'publish' + AND p.post_type = 'post' AND p.post_date_gmt < '$now' + AND tt.taxonomy = 'category' $exclusions - GROUP BY p2c.category_id"; + GROUP BY tr.term_taxonomy_id"; logthis("SQL Query :".$query, __FUNCTION__, __LINE__); $cat_counts = $wpdb->get_results($query); if (! empty($cat_counts)) { foreach ($cat_counts as $cat_count) { if (1 != intval($hide_empty) || $cat_count > 0) { - $category_posts[$cat_count->cat_ID] = $cat_count->cat_count; + $category_posts[$cat_count->term_taxonomy_id] = $cat_count->cat_count; } } } } foreach ($categories as $category) { - if ((intval($hide_empty) == 0 || isset($category_posts[$category->cat_ID])) && (!$hierarchical || $category->category_parent == $child_of) ) { - $this->catsTable[$category->cat_ID] = array( $category->cat_ID, - $category->cat_name, - $category->category_nicename, - $category_posts["$category->cat_ID"], - $category->category_parent); + if ((intval($hide_empty) == 0 || isset($category_posts[$category->term_taxonomy_id])) && (!$hierarchical || $category->parent == $child_of) ) { + $this->catsTable[$category->term_taxonomy_id] = array( $category->term_taxonomy_id, + $category->name, + $category->slug, + $category_posts["$category->term_taxonomy_id"], + $category->parent); if ($hierarchical && $children) { $this->buildCatsList( $sort_column, $sort_order, $hide_empty, $children, - $category->cat_ID, + $category->term_taxonomy_id, $categories, $exclude, $hierarchical); @@ -452,7 +456,7 @@ $excats = preg_split('/[\s,]+/',$exclude); if (count($excats)) { foreach ($excats as $excat) { - $exclusions .= ' AND category_id <> ' . intval($excat) . ' '; + $exclusions .= ' AND term_taxonomy_id <> ' . intval($excat) . ' '; } } } @@ -460,23 +464,26 @@ logthis($this->catsTable); foreach( $this->catsTable as $category ) { $posts_in_cat[$category[0]] = array(); - $query = "SELECT post_id - FROM $wpdb->post2cat - WHERE category_id = $category[0] - $exclusions"; + $query = "SELECT object_id AS post_id + FROM $wpdb->term_relationships tr + INNER JOIN $wpdb->posts p + ON tr.object_id = p.ID + WHERE tr.term_taxonomy_id = $category[0] + AND p.post_type = 'post' + AND p.post_status = 'publish' + AND p.post_date_gmt <= '$now' + $exclusions + ORDER BY p.post_date DESC"; logthis("SQL Query :".$query, __FUNCTION__, __LINE__); $posts_in_cat_results = $wpdb->get_results($query); if( $posts_in_cat_results ) { - $posts_in_cat_results = array_reverse($posts_in_cat_results); + //$posts_in_cat_results = array_reverse($posts_in_cat_results); foreach( $posts_in_cat_results as $post_in_cat_result ) { $query = "SELECT ID, post_title, post_date as `day`, comment_status FROM $wpdb->posts - WHERE ID = $post_in_cat_result->post_id - AND post_status = 'publish' - AND post_date_gmt <= '$now' - ORDER By post_date"; + WHERE ID = $post_in_cat_result->post_id "; logthis("SQL Query :".$query, __FUNCTION__, __LINE__); $post_results = $wpdb->get_results($query); if( $post_results ) { @@ -503,73 +510,72 @@ * Helper Function : build Tags. * ***********************************/ function buildTagsTable($exclude='', $id = false, $order = false, $orderparam = 0) { - global $utw_is_present; - if($utw_is_present) { - global $wpdb, $tabletags, $tablepost2tag; - - if (!empty($exclude)) { - $excats = preg_split('/[\s,]+/',$exclude); - if (count($excats)) { - foreach ($excats as $excat) { - $exclusions .= ' AND p2c.category_id <> ' . intval($excat) . ' '; - } + global $wpdb; + + if (!empty($exclude)) { + $excats = preg_split('/[\s,]+/',$exclude); + if (count($excats)) { + foreach ($excats as $excat) { + $exclusions .= ' AND tr.term_taxonomy_id <> ' . intval($excat) . ' '; } } - - switch($order) { - case 2: // X is the min number of post per tag - $ordering = "HAVING tag_count >= ". $orderparam . " ORDER BY tag_count DESC"; - break; - case 1: // X is the number of tag to show - $ordering = "ORDER BY tag_count DESC LIMIT ". $orderparam; - break; - case 0: - default: - $ordering = ""; - break; - } - - $now = current_time('mysql', 1); + } + + switch($order) { + case 2: // X is the min number of post per tag + $ordering = "HAVING tag_count >= ". $orderparam . " ORDER BY tag_count DESC"; + break; + case 1: // X is the number of tag to show + $ordering = "ORDER BY tag_count DESC LIMIT ". $orderparam; + break; + case 0: + default: + $ordering = ""; + break; + } + + $now = current_time('mysql', 1); - $query = "SELECT t.tag_id, t.tag, count(distinct p2t.post_id) as tag_count - FROM $tabletags t - INNER JOIN $tablepost2tag p2t ON t.tag_id = p2t.tag_id - INNER JOIN $wpdb->posts p ON p2t.post_id = p.ID - INNER JOIN $wpdb->post2cat p2c ON p2t.post_id = p2c.post_ID - WHERE p.post_date_gmt < '$now' - AND p.post_status = 'publish' - $exclusions - GROUP BY t.tag - $ordering"; - logthis("SQL Query :".$query, __FUNCTION__, __LINE__); - $tagsSet = $wpdb->get_results($query); - $tagged_posts = 0; - $posted_tags = 0; - if( !empty($tagsSet) ) { - foreach($tagsSet as $tag) { - if ($tag->tag_count) { - $this->tagsTable[$tag->tag_id] = array($tag->tag_id, $tag->tag, $tag->tag_count ); - $tagged_posts++; - if (intval($posted_tags) < intval($tag->tag_count)) $posted_tags = $tag->tag_count; - } - } - if ($order!= false ) { - $this->tagsTable = $this->arraySort($this->tagsTable, 1); + $query = "SELECT tt.term_taxonomy_id, t.name, count(distinct tr.object_id) as tag_count + FROM $wpdb->terms t + INNER JOIN $wpdb->term_taxonomy tt ON t.term_id = tt.term_id + INNER JOIN $wpdb->term_relationships tr ON tt.term_taxonomy_id = tr.term_taxonomy_id + INNER JOIN $wpdb->posts p ON tr.object_id = p.ID + WHERE p.post_date_gmt < '$now' + AND tt.taxonomy = 'post_tag' + AND p.post_type = 'post' + AND p.post_status = 'publish' + $exclusions + GROUP BY t.name + $ordering"; + logthis("SQL Query :".$query, __FUNCTION__, __LINE__); + $tagsSet = $wpdb->get_results($query); + $tagged_posts = 0; + $posted_tags = 0; + if( !empty($tagsSet) ) { + foreach($tagsSet as $tag) { + if ($tag->tag_count) { + $this->tagsTable[$tag->term_taxonomy_id] = array($tag->term_taxonomy_id, $tag->name, $tag->tag_count ); + $tagged_posts++; + if (intval($posted_tags) < intval($tag->tag_count)) $posted_tags = $tag->tag_count; } - - $this->tagsTable[0] = array($tagged_posts, $posted_tags); - - $this->cache->contentIs($this->tagsTable); - $this->cache->writeFile('tags.dat'); - - if($id) { - $this->cache->readFile('tags.dat'); - $difftags = array_diff_assoc($this->cache->readFileContent, $this->tagsTable); - if (!empty($difftags)) { - $this->tagsTable = $difftags; - } else { - $this->tagsTable = $this->postToGenerate['tag_id']; - } + } + if ($order!= false ) { + $this->tagsTable = $this->arraySort($this->tagsTable, 1); + } + + $this->tagsTable[0] = array($tagged_posts, $posted_tags); + + $this->cache->contentIs($this->tagsTable); + $this->cache->writeFile('tags.dat'); + + if($id) { + $this->cache->readFile('tags.dat'); + $difftags = array_diff_assoc($this->cache->readFileContent, $this->tagsTable); + if (!empty($difftags)) { + $this->tagsTable = $difftags; + } else { + $this->tagsTable = $this->postToGenerate['term_taxonomy_id']; } } } @@ -581,65 +587,65 @@ * Tags * ***********************************/ function buildPostsInTagsTable($exclude='',$hide_ping_and_track) { - global $utw_is_present; - if($utw_is_present) { - global $wpdb, $tabletags, $tablepost2tag; - - if( 1 == $hide_ping_and_track ) { - $ping = "AND comment_type NOT LIKE '%pingback%' AND comment_type NOT LIKE '%trackback%'"; - } else { - $ping = ''; - } - - if (!empty($exclude)) { - $excats = preg_split('/[\s,]+/',$exclude); - if (count($excats)) { - foreach ($excats as $excat) { - $exclusions .= ' AND p2c.category_id <> ' . intval($excat) . ' '; - } + global $wpdb; + + if( 1 == $hide_ping_and_track ) { + $ping = "AND comment_type NOT LIKE '%pingback%' AND comment_type NOT LIKE '%trackback%'"; + } else { + $ping = ''; + } + + if (!empty($exclude)) { + $excats = preg_split('/[\s,]+/',$exclude); + if (count($excats)) { + foreach ($excats as $excat) { + $exclusions .= ' AND tr.term_taxonomy_id <> ' . intval($excat) . ' '; } } - - $now = current_time('mysql', 1); - foreach( $this->tagsTable as $tag) { - $posts_in_tags[$tags[0]] = array(); - $query = "SELECT p2t.post_id - FROM $tablepost2tag p2t - INNER JOIN $wpdb->post2cat p2c ON p2t.post_id = p2c.post_ID - WHERE p2t.tag_id = $tag[0] - $exclusions"; - logthis("SQL Query :".$query, __FUNCTION__, __LINE__); - $posts_in_tag_results = $wpdb->get_results($query); + } - if( $posts_in_tag_results ) { - $posts_in_tag_results = array_reverse($posts_in_tag_results); - foreach( $posts_in_tag_results as $posts_in_tag_result ) { - - $query = "SELECT ID, post_title, post_date as `day`, comment_status - FROM $wpdb->posts - WHERE ID = $posts_in_tag_result->post_id - AND post_status = 'publish' - AND post_date_gmt <= '$now' - ORDER By post_date"; - logthis("SQL Query :".$query, __FUNCTION__, __LINE__); - $post_results = $wpdb->get_results($query); - if( $post_results ) { - foreach( $post_results as $post_result ) { - $query = "SELECT COUNT(comment_ID) - FROM $wpdb->comments - WHERE comment_post_ID = $post_result->ID - AND comment_approved = '1' - $ping"; - logthis("SQL Query :".$query, __FUNCTION__, __LINE__); - $num_comments = $wpdb->get_var($query); - $this->postsInTagsTable[$tag[0]][$post_result->ID] = array($post_result->day, $post_result->post_title, get_permalink($post_result->ID), $num_comments, $post_result->comment_status); - } + $now = current_time('mysql', 1); + foreach( $this->tagsTable as $tag) { + $posts_in_tags[$tags[0]] = array(); + $query = "SELECT p.ID AS post_id + FROM $wpdb->posts p + INNER JOIN $wpdb->term_relationships tr ON p.ID = tr.object_id + INNER JOIN $wpdb->term_taxonomy tt ON tr.term_taxonomy_id = tt.term_taxonomy_id + WHERE tr.term_taxonomy_id = $tag[0] + AND tt.taxonomy = 'post_tag' + $exclusions"; + logthis("SQL Query :".$query, __FUNCTION__, __LINE__); + $posts_in_tag_results = $wpdb->get_results($query); + + if( $posts_in_tag_results ) { + $posts_in_tag_results = array_reverse($posts_in_tag_results); + foreach( $posts_in_tag_results as $posts_in_tag_result ) { + + $query = "SELECT ID, post_title, post_date as `day`, comment_status + FROM $wpdb->posts + WHERE ID = $posts_in_tag_result->post_id + AND post_type = 'post' + AND post_status = 'publish' + AND post_date_gmt <= '$now' + ORDER By post_date"; + logthis("SQL Query :".$query, __FUNCTION__, __LINE__); + $post_results = $wpdb->get_results($query); + if( $post_results ) { + foreach( $post_results as $post_result ) { + $query = "SELECT COUNT(comment_ID) + FROM $wpdb->comments + WHERE comment_post_ID = $post_result->ID + AND comment_approved = '1' + $ping"; + logthis("SQL Query :".$query, __FUNCTION__, __LINE__); + $num_comments = $wpdb->get_var($query); + $this->postsInTagsTable[$tag[0]][$post_result->ID] = array($post_result->day, $post_result->post_title, get_permalink($post_result->ID), $num_comments, $post_result->comment_status); } } - if ($this->postsInTagsTable[$tag[0]]) { - $this->cache->contentIs($this->postsInTagsTable[$tag[0]]); - $this->cache->writeFile('tag-' . $tag[0] . '.dat'); - } + } + if ($this->postsInTagsTable[$tag[0]]) { + $this->cache->contentIs($this->postsInTagsTable[$tag[0]]); + $this->cache->writeFile('tag-' . $tag[0] . '.dat'); } } } Index: af-extended-live-archive-options.php --- af-extended-live-archive-options.php.orig 2006-06-22 07:56:38 +0200 +++ af-extended-live-archive-options.php 2007-10-01 19:16:44 +0200 @@ -93,6 +93,12 @@ 'paged_post_next' => 'next posts >>', 'paged_post_prev' => '<< previous posts', + // tags related stuff + 'most_popular_color' => '#444444', + 'most_popular_font_size' => 250, + 'least_popular_color' => '#cccccc', + 'least_popular_font_size' => 70, + 'font_size_unit' => '%', // default text for the tab buttons 'menu_order' => 'chrono,cats', @@ -185,6 +191,13 @@ if( isset($_POST['paged_post_next']) ) $settings['paged_post_next'] = urldecode($_POST['paged_post_next']); if( isset($_POST['paged_post_prev']) ) $settings['paged_post_prev'] = urldecode($_POST['paged_post_prev']); + // tags related stuff + if( isset($_POST['most_popular_color']) ) $settings['most_popular_color'] = urldecode($_POST['most_popular_color']); + if( isset($_POST['most_popular_font_size']) ) $settings['most_popular_font_size'] = urldecode($_POST['most_popular_font_size']); + if( isset($_POST['least_popular_color']) ) $settings['least_popular_color'] = urldecode($_POST['least_popular_color']); + if( isset($_POST['least_popular_font_size']) ) $settings['least_popular_font_size'] = urldecode($_POST['least_popular_font_size']); + if( isset($_POST['font_size_unit']) ) $settings['font_size_unit'] = urldecode($_POST['font_size_unit']); + // default text for the tab buttons if( isset($_POST['menu_order']) ) { $comma =''; @@ -203,7 +216,7 @@ if( isset($_POST['idle_content']) ) $settings['idle_content'] = urldecode($_POST['idle_content']); $current_mode = get_option('af_ela_option_mode'); - $asides_cats = $wpdb->get_results("SELECT * from $wpdb->categories"); + $asides_cats = $wpdb->get_results("SELECT tt.term_taxonomy_id, t.name, t.slug from $wpdb->terms t, $wpdb->term_taxonomy tt WHERE t.term_id = tt.term_id AND tt.taxonomy = 'category'"); $comma =''; if (!isset($_POST['excluded_categories'])) {?>
What's the point of not showing up any categories at all ?