function show_author_select() { global $wpdb, $tableusers, $author; $users = $wpdb->get_results("SELECT * FROM $tableusers WHERE user_level > 0", ARRAY_A); $output .= 'All Authors'.NL; foreach ($users as $user) { $output .= ''.NL; } $output = ''.NL.$output.''.NL; echo $output; }
function show_orderby_select() { global $orderby; $orderby = explode(' ', $orderby); $orderby = $orderby[0]; if ($orderby == 'date') { $output .= 'Date'.NL; } else { $output .= 'Date'.NL; } if ($orderby == 'title') { $output .= 'Title'.NL; } else { $output .= 'Title'.NL; } if ($orderby == 'category') { $output .= 'Category'.NL; } else { $output .= 'Category'.NL; } $output = ''.NL.$output.''.NL; echo $output; }
function show_order_select() { global $order; if ($order == 'ASC') { $output .= 'Ascending'.NL; } else { $output .= 'Ascending'.NL; } if ($order == 'DESC') { $output .= 'Descending'.NL; } else { $output .= 'Descending'.NL; } $output = ''.NL.$output.''.NL; echo $output; }
function archive_header($before='', $after='') { global $post, $orderby, $month, $previous, $siteurl, $blogfilename, $archiveheadstart, $archiveheadend, $category_name; $orderby = explode(' ', $orderby); $orderby = $orderby[0]; if ('date' == $orderby || empty($orderby)) { $thismonth = mysql2date('m', $post->post_date); $thisyear = mysql2date('Y', $post->post_date); $thisdate = $thisyear.$thismonth; if ($thisdate != $previous) { $thismonth = mysql2date('m', $post->post_date); $output .= '
'.$month[$thismonth].' '.$thisyear.''; } $previous = $thisdate; } elseif ('title' == $orderby) { preg_match('/[a-z0-9]{1}/i', $post->post_title, $match); $thisletter = ucfirst($match[0]); if ($thisletter != $previous) { $output .= "
".$thisletter; } $previous = $thisletter; } elseif ('category' == $orderby) { $thiscategory = $category_name; if ($thiscategory != $previous) { $output .= '
'.get_catname($thiscategory).''; } $previous = $thiscategory; } if (!empty($output)) { $output = $before.$output.$after.NL; echo $output; } }
function archive_date($format='Y-m-d H:i:s') { global $post; echo mysql2date($format, $post->post_date); }
?>
get_var("SELECT ID FROM $tableusers WHERE user_nicename='".$author_name."'"); $whichauthor .= ' AND (post_author = '.intval($author).')'; } if (!empty($year)) $where .= ' AND YEAR(post_date)=' . $year; if (!empty($whichauthor)) $where .= $whichauthor; ?>
Sort By:
get_results("SELECT * FROM $tablecategories WHERE 1=1 ORDER BY cat_name $order"); foreach ($dogs as $catt) { $categories = $wpdb->get_results("SELECT * FROM $tablepost2cat WHERE category_id = $catt->cat_ID"); if ($categories) { foreach ($categories as $post2category) { $posts = $wpdb->get_results("SELECT * FROM $tableposts WHERE $post2category->post_id = ID".$where); //$category_realname = $wpdb->get_row("SELECT cat_name FROM $tablecategories WHERE cat_ID = $post2category->category_id"); //print_r($category_realname); global $category_name; $category_name = $post2category->category_id; if ($posts) { foreach ($posts as $post) { start_wp(); archive_header('
'); archive_date('m-d-Y h:iA') ?>:
', '
') ?> :