prepare( "SELECT p.`ID`, p.`post_title`, p.`post_content`, p.`post_date`, mcw.`meta_value` as possible_winners, p.`comment_count` FROM `{$wpdb->posts}` p INNER JOIN `{$wpdb->postmeta}` mic ON mic.`meta_key` = %s AND mic.`post_ID` = p.`ID` INNER JOIN `{$wpdb->postmeta}` mcw ON mcw.`meta_key` = %s AND mcw.`post_ID` = p.`ID` WHERE p.`comment_count` > 0 ", ATWI_POST_META_IS_CONTEST, ATWI_POST_META_NUMBER_OF_WINNERS ); if ( !empty( $search ) ) { $query = $wpdb->prepare( $query . "AND p.`post_title` LIKE %s ", "%$search%" ); $search_link = $link . "&s=$search"; } $query .= "ORDER BY p.`post_date` DESC;"; $posts = $wpdb->get_results( $query ); $posts_per_page = 3; $total = count( $posts ); $total_pages = intval( ceil( $total / $posts_per_page ) ); $page = ( isset( $_GET[ "paged" ] ) ) ? intval( $_GET[ "paged" ] ) : 1; $paged = ( isset( $_GET[ "paged" ] ) ) ? "&paged=" . $_GET[ "paged" ] : ""; $start = ( ( $page - 1 ) * $posts_per_page ) + 1; $end = $start + $posts_per_page - 1; if ( $end > $total ) { $end = $total; } ?>
|
post_title, null, null, $post->ID ); ?>
format( "m/d/Y" ); ?> |
post_content ), 0, 400 ); ?>… GetNumberOfWinnersPossible(); $i++) { ?>
GetCommentBlock(); } ?>
|
GetNumberOfEntries(); ?> | GetNumberOfWinnersPossible(); ?> |