Changeset 192345
- Timestamp:
- 01/10/2010 08:43:34 PM (16 years ago)
- Location:
- afterread/trunk/suggestions
- Files:
-
- 3 edited
-
dynamic_prior_next_tag_default.php (modified) (2 diffs)
-
dynamic_prior_next_tag_styled_1.php (modified) (2 diffs)
-
dynamic_prior_next_tag_styled_2.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
afterread/trunk/suggestions/dynamic_prior_next_tag_default.php
r192157 r192345 9 9 10 10 foreach ($afterRead_raw_posttags as $afterRead_raw_posttags_temp){ 11 $afterRead_posttags[]= $afterRead_raw_posttags_temp->term_ taxonomy_id;11 $afterRead_posttags[]= $afterRead_raw_posttags_temp->term_id; 12 12 } 13 13 $afterRead_posts_by_tags = get_objects_in_term($afterRead_posttags,"post_tag"); … … 21 21 $afterRead_time_of_post = strtotime($post->post_date_gmt); 22 22 23 for ($i = 0, $size = sizeof($afterRead_posts); $i < $size; $i++){ 23 // foreach ($afterRead_posts as $afterRead_postsd) { 24 // echo $afterRead_postsd-> post_id.' : '.$afterRead_postsd-> time; 25 // echo '<br />'; 26 // } 27 28 $afterRead_sorting_newer-> time = 99999999999999999; 29 for ( $i = sizeof($afterRead_posts) -1; $i >= 0; $i--){ 24 30 if ($afterRead_time_of_post < $afterRead_posts[$i]-> time) { 25 $afterRead_next_post = $afterRead_posts[$i]-> post_id;26 $ s = $i + 2;27 $afterRead_previous_post = $afterRead_posts[$s]-> post_id;28 break 1;31 if ($afterRead_sorting_newer-> time > $afterRead_posts[$i]-> time) { 32 $afterRead_sorting_newer = $afterRead_posts[$i]; 33 } 34 //$afterRead_next_post = $afterRead_posts[$i]-> post_id; 29 35 } 30 36 } 37 $afterRead_next_post = $afterRead_sorting_newer-> post_id; 38 39 $afterRead_sorting_older-> time = 0; 40 for ($i = 0, $size = sizeof($afterRead_posts); $i < $size; $i++){ 41 if ($afterRead_time_of_post > $afterRead_posts[$i]-> time) { 42 if ($afterRead_sorting_older-> time < $afterRead_posts[$i]-> time) { 43 $afterRead_sorting_older = $afterRead_posts[$i]; 44 } 45 //$afterRead_next_post = $afterRead_posts[$i]-> post_id; 46 } 47 } 48 $afterRead_previous_post = $afterRead_sorting_older-> post_id; 49 50 31 51 if ($afterRead_previous_post) { 32 $afterRead_previous_post = get_post($afterRead_previous_post); 52 $afterRead_previous_post = get_post($afterRead_previous_post); 53 if ($afterRead_previous_post->post_status !== publish) { 54 $afterRead_previous_post=""; 55 } 33 56 } 34 57 if ($afterRead_next_post) { 35 $afterRead_next_post = get_post($afterRead_next_post); 58 $afterRead_next_post = get_post($afterRead_next_post); 59 if ($afterRead_next_post->post_status !== publish) { 60 $afterRead_next_post=""; 61 } 36 62 } 37 63 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -
afterread/trunk/suggestions/dynamic_prior_next_tag_styled_1.php
r192157 r192345 9 9 10 10 foreach ($afterRead_raw_posttags as $afterRead_raw_posttags_temp){ 11 $afterRead_posttags[]= $afterRead_raw_posttags_temp->term_ taxonomy_id;11 $afterRead_posttags[]= $afterRead_raw_posttags_temp->term_id; 12 12 } 13 13 $afterRead_posts_by_tags = get_objects_in_term($afterRead_posttags,"post_tag"); … … 21 21 $afterRead_time_of_post = strtotime($post->post_date_gmt); 22 22 23 for ($i = 0, $size = sizeof($afterRead_posts); $i < $size; $i++){ 23 // foreach ($afterRead_posts as $afterRead_postsd) { 24 // echo $afterRead_postsd-> post_id.' : '.$afterRead_postsd-> time; 25 // echo '<br />'; 26 // } 27 28 $afterRead_sorting_newer-> time = 99999999999999999; 29 for ( $i = sizeof($afterRead_posts) -1; $i >= 0; $i--){ 24 30 if ($afterRead_time_of_post < $afterRead_posts[$i]-> time) { 25 $afterRead_next_post = $afterRead_posts[$i]-> post_id;26 $ s = $i + 2;27 $afterRead_previous_post = $afterRead_posts[$s]-> post_id;28 break 1;31 if ($afterRead_sorting_newer-> time > $afterRead_posts[$i]-> time) { 32 $afterRead_sorting_newer = $afterRead_posts[$i]; 33 } 34 //$afterRead_next_post = $afterRead_posts[$i]-> post_id; 29 35 } 30 36 } 37 $afterRead_next_post = $afterRead_sorting_newer-> post_id; 38 39 $afterRead_sorting_older-> time = 0; 40 for ($i = 0, $size = sizeof($afterRead_posts); $i < $size; $i++){ 41 if ($afterRead_time_of_post > $afterRead_posts[$i]-> time) { 42 if ($afterRead_sorting_older-> time < $afterRead_posts[$i]-> time) { 43 $afterRead_sorting_older = $afterRead_posts[$i]; 44 } 45 //$afterRead_next_post = $afterRead_posts[$i]-> post_id; 46 } 47 } 48 $afterRead_previous_post = $afterRead_sorting_older-> post_id; 49 50 31 51 if ($afterRead_previous_post) { 32 $afterRead_previous_post = get_post($afterRead_previous_post); 52 $afterRead_previous_post = get_post($afterRead_previous_post); 53 if ($afterRead_previous_post->post_status !== publish) { 54 $afterRead_previous_post=""; 55 } 33 56 } 34 57 if ($afterRead_next_post) { 35 $afterRead_next_post = get_post($afterRead_next_post); 58 $afterRead_next_post = get_post($afterRead_next_post); 59 if ($afterRead_next_post->post_status !== publish) { 60 $afterRead_next_post=""; 61 } 36 62 } 63 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 64 //Beyond this line is only styling, should this suggestion need updating all you need to do is copy the above and replace the similar code in the styled suggestions 65 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 37 66 38 67 if ($afterRead_previous_post) { -
afterread/trunk/suggestions/dynamic_prior_next_tag_styled_2.php
r192157 r192345 9 9 10 10 foreach ($afterRead_raw_posttags as $afterRead_raw_posttags_temp){ 11 $afterRead_posttags[]= $afterRead_raw_posttags_temp->term_ taxonomy_id;11 $afterRead_posttags[]= $afterRead_raw_posttags_temp->term_id; 12 12 } 13 13 $afterRead_posts_by_tags = get_objects_in_term($afterRead_posttags,"post_tag"); … … 21 21 $afterRead_time_of_post = strtotime($post->post_date_gmt); 22 22 23 for ($i = 0, $size = sizeof($afterRead_posts); $i < $size; $i++){ 23 // foreach ($afterRead_posts as $afterRead_postsd) { 24 // echo $afterRead_postsd-> post_id.' : '.$afterRead_postsd-> time; 25 // echo '<br />'; 26 // } 27 28 $afterRead_sorting_newer-> time = 99999999999999999; 29 for ( $i = sizeof($afterRead_posts) -1; $i >= 0; $i--){ 24 30 if ($afterRead_time_of_post < $afterRead_posts[$i]-> time) { 25 $afterRead_next_post = $afterRead_posts[$i]-> post_id;26 $ s = $i + 2;27 $afterRead_previous_post = $afterRead_posts[$s]-> post_id;28 break 1;31 if ($afterRead_sorting_newer-> time > $afterRead_posts[$i]-> time) { 32 $afterRead_sorting_newer = $afterRead_posts[$i]; 33 } 34 //$afterRead_next_post = $afterRead_posts[$i]-> post_id; 29 35 } 30 36 } 37 $afterRead_next_post = $afterRead_sorting_newer-> post_id; 38 39 $afterRead_sorting_older-> time = 0; 40 for ($i = 0, $size = sizeof($afterRead_posts); $i < $size; $i++){ 41 if ($afterRead_time_of_post > $afterRead_posts[$i]-> time) { 42 if ($afterRead_sorting_older-> time < $afterRead_posts[$i]-> time) { 43 $afterRead_sorting_older = $afterRead_posts[$i]; 44 } 45 //$afterRead_next_post = $afterRead_posts[$i]-> post_id; 46 } 47 } 48 $afterRead_previous_post = $afterRead_sorting_older-> post_id; 49 50 31 51 if ($afterRead_previous_post) { 32 $afterRead_previous_post = get_post($afterRead_previous_post); 52 $afterRead_previous_post = get_post($afterRead_previous_post); 53 if ($afterRead_previous_post->post_status !== publish) { 54 $afterRead_previous_post=""; 55 } 33 56 } 34 57 if ($afterRead_next_post) { 35 $afterRead_next_post = get_post($afterRead_next_post); 58 $afterRead_next_post = get_post($afterRead_next_post); 59 if ($afterRead_next_post->post_status !== publish) { 60 $afterRead_next_post=""; 61 } 36 62 } 63 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 64 //Beyond this line is only styling, should this suggestion need updating all you need to do is copy the above and replace the similar code in the styled suggestions 65 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 66 37 67 38 68 if ($afterRead_previous_post) {
Note: See TracChangeset
for help on using the changeset viewer.