| 1 | 214c214
|
|---|
| 2 | < $sqlcat = '';
|
|---|
| 3 | ---
|
|---|
| 4 | > $join = '';
|
|---|
| 5 | 216c216,222
|
|---|
| 6 | < $sqlcat = " AND post_category = '$current_category' ";
|
|---|
| 7 | ---
|
|---|
| 8 | > $join = " INNER JOIN $wpdb->post2cat ON $wpdb->posts.ID= $wpdb->post2cat.post_id ";
|
|---|
| 9 | > $cat_array = $wpdb->get_col("SELECT category_id FROM $wpdb->post2cat WHERE post_id = $post->ID");
|
|---|
| 10 | > $join .= ' AND (category_id = ' . intval($cat_array[0]);
|
|---|
| 11 | > for ($i = 1; $i < (count($cat_array)); $i++) {
|
|---|
| 12 | > $join .= ' '.$andor.' category_id '.$eq.' '.intval($cat_array[$i]);
|
|---|
| 13 | > }
|
|---|
| 14 | > $join .= ')';
|
|---|
| 15 | 228c234
|
|---|
| 16 | < return @$wpdb->get_row("SELECT ID, post_title FROM $wpdb->posts WHERE post_date < '$current_post_date' AND post_status = 'publish' $sqlcat $sql_exclude_cats ORDER BY post_date DESC LIMIT 1");
|
|---|
| 17 | ---
|
|---|
| 18 | > return @$wpdb->get_row("SELECT ID, post_title FROM $wpdb->posts $join WHERE post_date < '$current_post_date' AND post_status = 'publish' $sql_exclude_cats ORDER BY post_date DESC LIMIT 1");
|
|---|
| 19 | 241c247
|
|---|
| 20 | < $sqlcat = '';
|
|---|
| 21 | ---
|
|---|
| 22 | > $join = '';
|
|---|
| 23 | 243c249,255
|
|---|
| 24 | < $sqlcat = " AND post_category = '$current_category' ";
|
|---|
| 25 | ---
|
|---|
| 26 | > $join = " INNER JOIN $wpdb->post2cat ON $wpdb->posts.ID= $wpdb->post2cat.post_id ";
|
|---|
| 27 | > $cat_array = $wpdb->get_col("SELECT category_id FROM $wpdb->post2cat WHERE post_id = $post->ID");
|
|---|
| 28 | > $join .= ' AND (category_id = ' . intval($cat_array[0]);
|
|---|
| 29 | > for ($i = 1; $i < (count($cat_array)); $i++) {
|
|---|
| 30 | > $join .= ' '.$andor.' category_id '.$eq.' '.intval($cat_array[$i]);
|
|---|
| 31 | > }
|
|---|
| 32 | > $join .= ')';
|
|---|
| 33 | 257c269
|
|---|
| 34 | < return @$wpdb->get_row("SELECT ID,post_title FROM $wpdb->posts WHERE post_date > '$current_post_date' AND post_date < '$now' AND post_status = 'publish' $sqlcat $sql_exclude_cats AND ID != $post->ID ORDER BY post_date ASC LIMIT 1");
|
|---|
| 35 | ---
|
|---|
| 36 | > return @$wpdb->get_row("SELECT ID,post_title FROM $wpdb->posts $join WHERE post_date > '$current_post_date' AND post_date < '$now' AND post_status = 'publish' $sql_exclude_cats AND ID != $post->ID ORDER BY post_date ASC LIMIT 1");
|
|---|
| 37 | 506c518
|
|---|
| 38 | < ?>
|
|---|
| 39 | \ No newline at end of file
|
|---|
| 40 | ---
|
|---|
| 41 | > ?>
|
|---|