Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- This function checks how long it is since the blog was last updated
- */
- function rob_get_blog_last_update(){
- global $wpdb;
- $newest = $wpdb->get_row("select post_modified from $wpdb->posts
- where post_type in ('page', 'post') and post_status = 'publish' order by post_modified desc");
- //echo mysql2date('d/m/Y',$newest->post_modified);
- //print_r($newest);
- return($newest->post_modified);
- }
- /*
- This function checks if you should show the add or not
- */
- function rob_display_old_blog_ads(){
- $checktime = date("Y-m-d H:i:s",time()-2592000); // How many seconds old the blog has to be
- $updatedtime = rob_get_blog_last_update();
- //echo "<!-- Updated:". $updatedtime." check: ".$checktime."-->";
- global $blog_id;
- if($updatedtime < $checktime){
- // echo "<!-- true -->"; // Show add
- return true;
- }else{
- // echo "<!-- false -->"; // Don't show add
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement