posts . ".* FROM " . $wpdb->posts . " WHERE " . $wpdb->posts . ".post_author = $current_user->ID AND " . $wpdb->posts . ".post_type = '$post_type' AND (" . $wpdb->posts . ".post_status = 'publish' OR " . $wpdb->posts . ".post_status = 'pending') ORDER BY " . $wpdb->posts . ".`ID` DESC"; $query = $wpdb->query( $sql ); // Get total of Num rows from the database query if ( isset( $_GET['pn'] ) ) { // Get pn from URL vars if it is present $pn = preg_replace( '#[^0-9]#i', '', $_GET['pn'] ); // filter everything but numbers for security(new) } else { // If the pn URL variable is not present force it to be value of page number 1 $pn = 1; } $itemsPerPage = 20; $lastPage = ceil( $query / $itemsPerPage ); if ( $pn < 1 ) { // If it is less than 1 $pn = 1; // force if to be 1 } else if ( $pn > $lastPage ) { // if it is greater than $lastpage $pn = $lastPage; // force it to be $lastpage's value } $centerPages = ""; $sub1 = $pn - 1; $sub2 = $pn - 2; $add1 = $pn + 1; $add2 = $pn + 2; if ( $pn == 1 ) { $centerPages .= ' ' . $pn . ' '; $centerPages .= ' ' . $add1 . ' '; } else if ( $pn == $lastPage ) { $centerPages .= ' ' . $sub1 . ' '; $centerPages .= ' ' . $pn . ' '; } else if ( $pn > 2 && $pn < ($lastPage - 1) ) { $centerPages .= ' ' . $sub2 . ' '; $centerPages .= ' ' . $sub1 . ' '; $centerPages .= ' ' . $pn . ' '; $centerPages .= ' ' . $add1 . ' '; $centerPages .= ' ' . $add2 . ' '; } else if ( $pn > 1 && $pn < $lastPage ) { $centerPages .= ' ' . $sub1 . ' '; $centerPages .= ' ' . $pn . ' '; $centerPages .= ' ' . $add1 . ' '; } $limit = 'LIMIT ' . ($pn - 1) * $itemsPerPage . ',' . $itemsPerPage; $listings = $wpdb->get_results( "SELECT " . $wpdb->posts . ".* FROM " . $wpdb->posts . " WHERE " . $wpdb->posts . ".post_author = $current_user->ID AND " . $wpdb->posts . ".post_type = '$post_type' AND (" . $wpdb->posts . ".post_status = 'publish' OR " . $wpdb->posts . ".post_status = 'pending') ORDER BY " . $wpdb->posts . ".`ID` DESC $limit" ); $paginationDisplay = ""; // Initialize the pagination output variable if ( $lastPage != "1" ) { $paginationDisplay .= 'Page ' . $pn . ' of ' . $lastPage . ' '; if ( $pn != 1 ) { $previous = $pn - 1; $paginationDisplay .= ' Back '; } $paginationDisplay .= '' . $centerPages . ''; if ( $pn != $lastPage ) { $nextPage = $pn + 1; $paginationDisplay .= ' Next '; } } ?>
| Listings | Type | Date | Expires |
|---|---|---|---|
| post_title; ?> ID ); ?>"> | ID ); ?>"> | |
ID, 'geocraft_listing_type', true ); if ( $listing_type == 'pro' ): echo "Featured"; else: echo "Free"; endif; ?> | post_date ) ); ?>
post_status ); ?> |
ID, 'gc_listing_duration', true );
if ( $listing_expiry ) {
printf( "%s \n", date( get_option( 'date_format' ), strtotime( $listing_expiry ) ) );
echo " "; printf( "\n%s", gc_timeleft( strtotime( $listing_expiry ) ) ); } ?> |
| post_title; ?> ID ); ?>"> | ID); ?>"> |
post_title&action=free_renew&pid=" . $listing->ID ); ?>"> post_title&action=renew&pid=" . $listing->ID ); ?>"> | |
| listing_title; ?>
ID ); ?>"> |
user_name; ?> | email; ?> | phone_no; ?> | message; ?> |
Password doesn't match!
"; } } endif; ?>| comment_author; ?> comment_author_email; ?> | Submitted on comment_date; ?> comment_content; ?> | comment_count; ?>post_title; ?> |