Hi, ich versuche gerade einen zähler-plugin hinzuzufügen, aber die aktivierung funktioniert nicht...ich bekomme immer einen heavy trigger error. Der code entspringt folgender quelle: cheekyboots · WordPress Plugin: Display number of days since first post
PHP
<?php
/*
Plugin Name: Days are gone...
Plugin URI: http://www.cheekyboots.com/?page_id=15
Description: Outputs the total number of days since first blog post.
Author: Emma M.
Version: 1.0
Author URI: http://www.cheekyboots.com/
*/
<p>function days_since_birth() {<br />
global $wpdb;<br />
$now = gmdate(”Y-m-d H:i:s”,time());<br />
$first_post = $wpdb->get_results(”SELECT post_date_gmt FROM $wpdb->posts WHERE post_status = ‘publish’ AND post_date < '$now' ORDER BY post_date ASC Limit 1");<br />
if ($first_post) {<br />
foreach ($first_post as $post) { </p>
<p> $first_day=strtotime($post->post_date_gmt);<br />
$now=strtotime($now);</p>
<p> //Then you subtract the lower date from the higher.<br />
$between = $now - $first_day;</p>
<p> //Finally your divide the result by the number of seconds on a day.<br />
$days_old = $between / (24*3600); </p>
<p> }<br />
} else {<br />
$days_old=0;<br />
}<br />
echo round($days_old);<br />
}<br />
?>
Alles anzeigen