'.wordwrap(print_r($cat,true),150,"\n").''; } } function aw_print_debug2($cat) { $toReturn = '
';
    if (is_array($cat)) {
        echo '';
        foreach ($cat as $key => $item) {
            echo '';
        }
        echo '
'.$key.''; if (is_array($item)) { aw_print_debug2($item); } else { echo $item; } echo '
'; } else { echo ''; echo ''; echo '
'; echo $cat; echo '
'; } $toReturn .= '
'; return $toReturn; } function aw_get_posts($count = 10,$input_args = array()) { mysql_select_db(DB_NAME); $default_args = array( 'numberposts' => $count, 'offset' => 0, 'category' => '', 'orderby' => 'post_date', 'order' => 'DESC', 'include' => '', 'exclude' => '', 'meta_key' => '', 'meta_value' => '', 'post_type' => 'post', 'post_mime_type' => '', 'post_parent' => '', 'post_status' => 'publish' ); $args = array_merge($input_args, $default_args); return get_posts($args); } function aw_get_all_posts($count = 10,$input_args = array()) { mysql_select_db(DB_NAME); $default_args = array( 'numberposts' => $count, 'offset' => 0, 'category' => '', 'orderby' => 'post_date', 'order' => 'DESC', 'include' => '', 'exclude' => '', 'meta_key' => '', 'meta_value' => '', 'post_type' => 'post', 'post_mime_type' => '', 'post_parent' => '', 'post_status' => array('draft', 'publish') ); $args = array_merge($input_args, $default_args); return get_posts($args); } function aw_get_drafts($count = 10,$input_args = array()) { mysql_select_db(DB_NAME); $default_args = array( 'numberposts' => $count, 'offset' => 0, 'category' => '', 'orderby' => 'post_date', 'order' => 'DESC', 'include' => '', 'exclude' => '', 'meta_key' => '', 'meta_value' => '', 'post_type' => 'post', 'post_mime_type' => '', 'post_parent' => '', 'post_status' => array('draft') ); $args = array_merge($input_args, $default_args); return get_posts($args); } function aw_get_post($postID) { $args = array( 'post_status' => array('post') ); return get_posts($args); } function aw_get_site_url() { mysql_select_db(DB_NAME); return get_bloginfo('url'); } function aw_count_posts($post = 'post') { mysql_select_db(DB_NAME); return wp_count_posts($post); } ?>