Thread Rating:
  • 2 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
HitCount Plugin
is still 0
http://neowebtime.ru/0/
Reply
Oleg06 Wrote:is still 0
http://neowebtime.ru/0/

I don't understand russian, but at least the following download path has an additional directory pandusy, so the rule will not match:
http://neowebtime.ru/0/pandusy/data/uploads/comm.zip
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
as the slider does not work and the schedule does not drawn
[Image: hit.jpg]
Reply
Oleg06 Wrote:as the slider does not work and the schedule does not drawn

Any Javascript errors?
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
perhaps you are tired today Smile
Reply
Oleg06 Wrote:as the slider does not work and the schedule does not drawn
I think it just doesn't work with just one day. Now it should work.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
Yes, the slider and the schedule of work
Reply
Two questions – I am moving my blog from Posterous to GetSimple using the GS Blog plugin (http://get-simple.info/extend/plugin/gs-blog/462/). As a part of the transition I would like to not lose my post's hits, how do I artificially boost the hit count for pages? [and yes I understand that this could make the graphs look poor.]

The second – currently HitCount shows all hits on the blog page and hits on the individual blog posts as a single page. Can HitCount be upgraded so that it supports the posts using the GS Blog plugin?
Reply
michaellindahl Wrote:Two questions – I am moving my blog from Posterous to GetSimple using the GS Blog plugin (http://get-simple.info/extend/plugin/gs-blog/462/). As a part of the transition I would like to not lose my post's hits, how do I artificially boost the hit count for pages? [and yes I understand that this could make the graphs look poor.]

Currently hitcount both increases a counter for the current page (data/other/hitcount/hits_pageslug.txt) in order to allow you to display hit counters on your pages and it writes an entry to a log file, which is then used for the graphs.

You can simply change the number in the hits_*.txt files, but this will only affect the hit counts, not the graphs.
For the log file you could create dummy log files or just dummy entries in one of the log files in the format
Code:
UnixTimeStamp SessionNumber Slug Referer UserAgent
e.g.
Code:
1298046412 0 my-slug http://mysite.com/ Mozilla/5.0
(the given timestamp is one of February 2011)

michaellindahl Wrote:The second – currently HitCount shows all hits on the blog page and hits on the individual blog posts as a single page. Can HitCount be upgraded so that it supports the posts using the GS Blog plugin?

I could probably add some functionality to Hitcount to allow other plugins to change the slug, but it probably would not be used by the plugin authors - so far even the hooks in I18N Search are used only by one plugin (HideFuturePages), as far as I know :-(

But I think, you could add a call to hitcount_init($slug) to your page template for the blog, where the parameter is e.g. the blog page slug concatenated with the blog entries slug/name, like (I didn't test it):
Code:
<?php
  $entryslug = ...; // I don't use the blog plugin, so you need to find out how to get the entries name/slug
  @hitcount_init(return_page_slug().'-'.$entryslug);
?>
Of course this would mean that hits to your blog page are counted twice, the normal page hit and the additional hit, so the total site hits in the admin part would be wrong.

Edit: there is one plugin that uses the I18N Search hooks: HideFuturePages.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
mvlcek Wrote:
michaellindahl Wrote:The second – currently HitCount shows all hits on the blog page and hits on the individual blog posts as a single page. Can HitCount be upgraded so that it supports the posts using the GS Blog plugin?

I could probably add some functionality to Hitcount to allow other plugins to change the slug, but it probably would not be used by the plugin authors - so far even the hooks in I18N Search are not used by any plugin, as far as I know :-(

But I think, you could add a call to hitcount_init($slug) to your page template for the blog, where the parameter is e.g. the blog page slug concatenated with the blog entries slug/name, like (I didn't test it):
Code:
<?php
  $entryslug = ...; // I don't use the blog plugin, so you need to find out how to get the entries name/slug
  @hitcount_init(return_page_slug().'-'.$entryslug);
?>
Of course this would mean that hits to your blog page are counted twice, the normal page hit and the additional hit, so the total site hits in the admin part would be wrong.

The plug does have the option of "Use pretty urls" which requires the .htacess file to be as so:
Code:
AddDefaultCharset UTF-8
Options -Indexes

# blocks direct access to the XML files - they hold all the data!
<Files ~ "\.xml$">
    Order allow,deny
    Deny from all
    Satisfy All
</Files>
<Files sitemap.xml>
    Order allow,deny
    Allow from all
    Satisfy All
</Files>

RewriteEngine on

# Usually RewriteBase is just '/', but
# replace it with your subdirectory path -- IMPORTANT -> if your site is located in subfolder you need to change this to reflect (eg: /subfolder/)
RewriteBase /

RewriteRule ^blog/post/([^/.]+)/?$ index.php?id=blog&post=$1 [L]
RewriteRule ^blog/tag/([^/.]+)/?$ index.php?id=blog&tag=$1 [L]
RewriteRule ^blog/page/([^/.]+)/?$ index.php?id=blog&page=$1 [L]
RewriteRule ^blog/archive/([^/.]+)/?$ index.php?id=blog&archive=$1 [L]
RewriteRule ^blog/category/([^/.]+)/?$ index.php?id=blog&category=$1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule /?([A-Za-z0-9_-]+)/?$ index.php?id=$1 [QSA,L]

This simply makes the url be .com/blog/post/post_slug without it the url is .com/index.php?id=blog&post=post_slug

The plugin also supports these php calls:
Code:
Get URL To Blog Areas: <?php $Blog->get_blog_url('post'); ?>
ex (get url of post): <?php echo $Blog->get_blog_url('post').$post->slug; ?>
The first returns: .com/blog/post/
The second returns: .com/blog/post/post_slug
Code:
<?php echo $post->slug; ?>
Can be used to return the post slug.

However, with all of these calls, none of them will say if the end user is on the blog page or on a blog posts page. It would be nice for the software to add a hit when the user is on /blog/ to the blog page and the detect if the user is in /blog/post/slug and if so then only add a hit to the $post->slug page. This could be done using the following:

Code:
if get_page_slug() != blog { do hit normally }
else if $_SERVER['REQUEST_URI']; == /blog/ { add hit to blog }
else { add hit to /blog/post/$post->slug }

The final question would be how do I get the correct hit count <?php echo return_hitcount_hits(return_page_slug()); ?> returns the hit count for blog not a blog post
Reply
You can get the post name with $_GET['post'].
You can patch the hitcount plugin as you described for your installation, but as it is dependent on the installation (e.g. there are multiple blog and news manager plugins, the blog/news page is often configurable, etc.) there is no generally feasible solution that I can include in the hitcount plugin.
(That - hitcount, search, navigation - is why my blog/news plugin - I18N Special Pages - uses normal pages for each blog/news entry)
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
mvlcek Wrote:You can get the post name with $_GET['post'].
You can patch the hitcount plugin as you described for your installation, but as it is dependent on the installation (e.g. there are multiple blog and news manager plugins, the blog/news page is often configurable, etc.) there is no generally feasible solution that I can include in the hitcount plugin.
(That - hitcount, search, navigation - is why my blog/news plugin - I18N Special Pages - uses normal pages for each blog/news entry)

Yes that is true, could you assist me in finding the place where I would need to patch the plugin for my specific use? Thanks.
Reply
michaellindahl Wrote:Yes that is true, could you assist me in finding the place where I would need to patch the plugin for my specific use? Thanks.

hitcount.php, function hitcount_init_page (not tested):
Code:
function hitcount_init_page() {
  global $url;
  $post = @$_GET['post'];
  if ($url == 'blog' && $post) {
    hitcount_init($url.'-'.$post);
  } else {
    hitcount_init($url);
  }
}
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
mvlcek Wrote:
michaellindahl Wrote:Yes that is true, could you assist me in finding the place where I would need to patch the plugin for my specific use? Thanks.

hitcount.php, function hitcount_init_page (not tested):
Code:
function hitcount_init_page() {
  global $url;
  $post = @$_GET['post'];
  if ($url == 'blog' && $post) {
    hitcount_init($url.'-'.$post);
  } else {
    hitcount_init($url);
  }
}

Awesome! Thanks, that works perfectly. I have tried to modify the following to retrieve the hits on specific blog pages and from my testing this works:

Code:
function return_hitcount_hits($slugOrFile) {
  $post = @$_GET['post'];
    if ($slugOrFile == 'blog' && $post) {
        $hits = @file(GSDATAOTHERPATH . HITCOUNT_DIR . 'hits_' . preg_replace('/[^A-Za-z0-9\.-]+/','_',$slugOrFile).'-'.preg_replace('/[^A-Za-z0-9\.-]+/','_',$post)  . '.txt');
    } else {
        $hits = @file(GSDATAOTHERPATH . HITCOUNT_DIR . 'hits_' . preg_replace('/[^A-Za-z0-9\.-]+/','_',$slugOrFile) . '.txt');  
    }
    return $hits ? $hits[0] : 0;
}
Reply
michaellindahl Wrote:I have tried to modify the following to retrieve the hits on specific blog pages and from my testing this works:

Code:
function return_hitcount_hits($slugOrFile) {
  $post = @$_GET['post'];
    if ($slugOrFile == 'blog' && $post) {
        $hits = @file(GSDATAOTHERPATH . HITCOUNT_DIR . 'hits_' . preg_replace('/[^A-Za-z0-9\.-]+/','_',$slugOrFile).'-'.preg_replace('/[^A-Za-z0-9\.-]+/','_',$post)  . '.txt');
    } else {
        $hits = @file(GSDATAOTHERPATH . HITCOUNT_DIR . 'hits_' . preg_replace('/[^A-Za-z0-9\.-]+/','_',$slugOrFile) . '.txt');  
    }
    return $hits ? $hits[0] : 0;
}

You could also do this directly where you call return_hitcount_hits (e.g. in your template) without the need to modify the plugin, e.g.
Code:
$post = @$_GET['post'];
  if (return_page_slug() == 'blog' && $post) {
    $numHits = return_hitcount_hits(return_page_slug().'-'.$post);
  } else {
    $numHits = return_hitcount_hits(return_page_slug());
  }
  // do something with $numHits
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
mvlcek Wrote:You could also do this directly where you call return_hitcount_hits (e.g. in your template) without the need to modify the plugin, e.g.
Code:
$post = @$_GET['post'];
  if (return_page_slug() == 'blog' && $post) {
    $numHits = return_hitcount_hits(return_page_slug().'-'.$post);
  } else {
    $numHits = return_hitcount_hits(return_page_slug());
  }
  // do something with $numHits

Good call. However because I already have to modify the hitcount_init_page() method above it, I might as well modify the code below it. Unless there is a way that I don't have to modify the hitcount_init_page() above it?
Reply
What's the best way to see which URLs are generating 404s? I was hoping this plugin could give this info.
Modern UI Admin for GetSimple
Watch the demo. Install this plugin. Use this CSS. Enjoy.
Reply
Hello, hoping you can help with this strange issue.

After updating to the latest version of GS, I'm finding that the graph doesn't load when viewing the HitCount statistics - though everything else appears to work, in terms of counting page views.

When I inspect the page, it tells me there's a 404 for these files:
/plugins/hitcount/js/jquery-ui-1.8.16.custom.min.js
/plugins/hitcount/js/jquery.jqplot.min.js
/plugins/hitcount/js/jqplot.dateAxisRenderer.min.js
/plugins/hitcount/js/jqplot.highlighter.min.js
/plugins/hitcount/css/jquery-ui-1.8.16.custom.css
/plugins/hitcount/css/jquery.jqplot.min.css

They're definitely on the server, in the same place as they were before the update - but I can't even open them individually in the browser, like I can with other js files. Is this a familiar issue? Is it likely to be a permissions issue somewhere?

For example:
domain.com/plugins/i18n_gallery/js/s3Slider.js works but domain.com/plugins/hitcount/js/jqplot.dateAxisRenderer.min.js does not. I assure you, the latter file exists on the server.

If it helps, I'm using Chrome on Mac OS X 10.7.5. I'm going to try some different browsers/computers in case it's a cache issue.

Hope you can help!

Thank you so much.

-------

Update: okay, I think I have found the cause. I have a .htaccess file on the root of my plugins folder that simply says 'Deny from all'. When I comment out this line, everything works perfectly.

I've looked at the contents of GS 3.2.0 and there's no .htaccess file at this location during a fresh install, so I'm going to assume it's a rogue file for now. I've also looked at the download of HitCount and there does not appear to be a .htaccess file needed there either, so I've deleted the rogue file from my server.

If you know better than me (which is likely!), please advise and let me know what the .htaccess should contain. Blush

Thanks again!
Reply
(2013-02-27, 19:10:37)trmash Wrote: Hello, hoping you can help with this strange issue.

After updating to the latest version of GS, I'm finding that the graph doesn't load when viewing the HitCount statistics - though everything else appears to work, in terms of counting page views.

When I inspect the page, it tells me there's a 404 for these files:
/plugins/hitcount/js/jquery-ui-1.8.16.custom.min.js
/plugins/hitcount/js/jquery.jqplot.min.js
/plugins/hitcount/js/jqplot.dateAxisRenderer.min.js
/plugins/hitcount/js/jqplot.highlighter.min.js
/plugins/hitcount/css/jquery-ui-1.8.16.custom.css
/plugins/hitcount/css/jquery.jqplot.min.css
...

Update: okay, I think I have found the cause. I have a .htaccess file on the root of my plugins folder that simply says 'Deny from all'. When I comment out this line, everything works perfectly.

The .htaccess in /plugins should be no problem as in /plugins/hitcount/js and /plugins/hitcount/css there should be .htaccess files with "Allow from all". Maybe you didn't copy them?
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
Since I updated GetSimple to 3.2 and want to have a look at the statistics, I get this on top of the page:

Warning: Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of json_encode(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. in /home/###/public_html/plugins/hitcount/backend.php on line 179 Warning: Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of json_encode(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. in /home/###/public_html/plugins/hitcount/backend.php on line 180 Warning: Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of json_encode(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. in /home/###/public_html/plugins/hitcount/backend.php

### = my website name

Why does this error message appear and how can I get rid of it without doing what it suggests? Do I need to update something in the Hitcount plugin? I didn't have that error with the older version of GetSimple.
Reply
(2013-03-06, 18:54:09)bugmenot Wrote: Since I updated GetSimple to 3.2 and want to have a look at the statistics, I get this on top of the page:

Warning: Call-time pass-by-reference has been deprecated; ..............

Why does this error message appear and how can I get rid of it without doing what it suggests? Do I need to update something in the Hitcount plugin? I didn't have that error with the older version of GetSimple.

The PHP warning refers to the &ambersands in lines 179-181 of "..../plugins/hitcount/backend.php" as pasted below

var hits = <?php echo json_encode(&$hits['country']); ?>;
var visits = <?php echo json_encode(&$visits['country']); ?>;
var titles = <?php echo json_encode(&$titles); ?>;

You can just remove the ambersands. They have been superflous since the advent of PHP 5 many years ago and are now deprecated as the warning says.
Reply
reason does not work http://getsimplecms.ru/plaginy-dlya-gets...-hitcount/
component zips
Code:
<?php
  global $args;  
  echo return_hitcount_hits('plugins/$args[0].zip');
?><br />
<?php echo return_hitcount_hits('plugins/hitcount.zip'); ?>
Code:
{% zips hitcount %}
Reply
Hurrah, I won
Code:
<?php
  global $args;
echo return_hitcount_hits('plugins/'. $args[0] .'.zip');
?>
Reply
(2013-04-09, 17:02:11)Oleg06 Wrote: Hurrah, I won
Code:
<?php
  global $args;
echo return_hitcount_hits('plugins/'. $args[0] .'.zip');
?>
Or (double quotes!):
Code:
<?php
  global $args;  
  echo return_hitcount_hits("plugins/$args[0].zip");
?>
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
Is it possible to somehow attach it to i18n special pages?
Reply




Users browsing this thread: 2 Guest(s)