MarkvanDark
Forum Replies Created
-
Thank you, now its working fine.
I set this topic to resolved.
Hi,
yes, this is really strange. Do you use the %today% tag? If yes then this is the problem that you cannot reproduce it. For testing I also defined once %today% and everything worked afterwards by I do not want to present the date to the visitors. When you are looking at the code you can see the problem with the variable, as the line
$today = gmdate('Ymd', current_time('timestamp'));
defines the variable needed.
I have tried it again with the following text in my widget:
Visitors online: %visitorsonline%<br> Visitors today: %todayvisitors%<br> Visitors total: %totalvisitors%
The second line is empty, so the SQL does not return anything becuase the querystring is empty as you use the querey
select ... where date = $today and ...
(only a short snipped and not PHP conform)Best regards,
Markus
Hi,
I updated today to version 1.4 and found that the tags are still not working.
I checked again the
statpress.php
and detected that the issue still exists. Here are my suggestions again, I tested it and as far as I can see it does not break any functionality:Change the following code from:
function luc_StatPress_Vars($body) {global $wpdb; $table_name = $wpdb->prefix . "statpress"; if (strpos(strtolower($body), "%today%") !== false) {$today = gmdate('Ymd', current_time('timestamp')); $body = str_replace("%today%", luc_hdate($today), $body); } ...
to:
function luc_StatPress_Vars($body) {global $wpdb; $table_name = $wpdb->prefix . "statpress"; $today = gmdate('Ymd', current_time('timestamp')); if (strpos(strtolower($body), "%today%") !== false) { $body = str_replace("%today%", luc_hdate($today), $body); } ...
This makes all SQL queries work that use $today which is currently not the case!
Best regards,
Markus
Hi,
I never said that it does not work. It works perfectly fine but only the today tags are not working.
And the background style of the widgets are only a question of style. I resolved this problem by putting around the text withing the widget the list-tags from HTML and it works fine.
Best regards,
Markus
Today I had time to check the plugin. I found the error:
in line 1049 the variable today is set like the following: “$today = gmdate(‘Ymd’, current_time(‘timestamp’));”
The problem is, that the variable $today is needed for the SQL query for “todaysvisitors”, “todayspageviews” etc.
$today is only filled if the tag %today% is used somewhere.
If you move line 1049 to line 1047 which means that today is always set the plugin works as suspected.
The only thing I am still working on is the background as the widget used
<li></li>
instead of<li> <ul></ul> </li>
which tells wordpress to use another style from the CSS.
Best regards,
Markus