| | 109 | } |
|---|
| | 110 | |
|---|
| | 111 | function get_lastpostmodified() { |
|---|
| | 112 | global $tableposts, $cache_lastpostmodified, $use_cache, $pagenow, $wpdb; |
|---|
| | 113 | if ((!isset($cache_lastpostmodified)) OR (!$use_cache)) { |
|---|
| | 114 | $time_difference = get_settings('time_difference'); // for some weird reason the global wasn't set anymore? |
|---|
| | 115 | $now = date("Y-m-d H:i:s",(time() + ($time_difference * 3600))); |
|---|
| | 116 | |
|---|
| | 117 | $lastpostmodified = $wpdb->get_var("SELECT post_modified FROM $tableposts WHERE post_modified <= '$now' AND post_status = 'publish' ORDER BY post_modified DESC LIMIT 1"); |
|---|
| | 118 | $cache_lastpostmodified = $lastpostmodified; |
|---|
| | 119 | } else { |
|---|
| | 120 | $lastpostmodified = $cache_lastpostmodified; |
|---|
| | 121 | } |
|---|
| | 122 | return $lastpostmodified; |
|---|