WordPress.org

Ready to get started?Download WordPress

Forums

124

WP 1.2, Statistics (113 posts)

  1. carthik
    Member
    Posted 10 years ago #

    Thanks for the plugin. Perhaps you can link to it from the plugins page at the wiki for easy access and reference.

  2. Nick Momrik
    Member
    Posted 10 years ago #

    The link for the file is linking to this forum....

  3. unoamigo
    Member
    Posted 10 years ago #

    Whoops, thats what I get for copying and pasting code from my web page!
    Thanks MtDew.
    I'll go add it to Wiki now.

  4. solarpunk
    Member
    Posted 10 years ago #

    Hello,
    A Few things i notice, first all i dont have acces to my .htaccess or either dont know where it is locate. is there a way to make easy in which all the change that need to be done is in index.php?
    Thanks
    Victor

  5. Mark (podz)
    Support Maven
    Posted 10 years ago #

    Wonderful plugin ! Thank you!!
    @solarpunk - the index.php changes can be made through the Templates editing box.

  6. solarpunk
    Member
    Posted 10 years ago #

    I know, i can make changes to the index.php but this part of the instruction is what i am wondering about:
    4) Add this to your .htaccess file:
    RewriteRule ^stats/author/(.*)?/page/?(.*)?/?$ /b2/index.php?wp_stats=1&author=$1&page=$2 [QSA]
    RewriteRule ^stats/author/?(.*) /b2/index.php?wp_stats=1&author=$1 [QSA]
    RewriteRule ^stats/ /b2/index.php?wp_stats=1 [QSA]
    RewriteRule ^stats /b2/index.php?wp_stats=1 [QSA]
    thank you,
    Victor

  7. carthik
    Member
    Posted 10 years ago #

    solarpunk, your .htaccess file is a text file named .htaccess If you dont have one in a subdirectory or the root directory create one and upload it.

  8. solarpunk
    Member
    Posted 10 years ago #

    Thanks,
    i notice that i dont need the .htaccess file at all. :). the stats is working perfectly with the latest build of WP.
    Thank
    Victor

  9. pstew21
    Member
    Posted 10 years ago #

    One little thing... I get this at the end:
    » Link Categories Stats
    Array
    Links, 10 Links

    I don't have any Categories assigned to my links, is that why?

  10. unoamigo
    Member
    Posted 10 years ago #

    pstew221
    The Array bit was from a debug line I forgot to delete.
    Links, 10 Links is correct. The first Links - is the name of your category. "10 Links" is the number of links.
    However, I did stumble across a little bug if you have more than 1 link category where everything would be put on one line (in list mode). That is now fixed, and the debug line is removed.
    Changes are availible in the same spot.

  11. unoamigo
    Member
    Posted 10 years ago #

    SolarPunk, without the ModRewrite rules almost everything will work fine being accessed using: index.php?wp_stats=1
    However the links back to the comment author stats will not work, they are currently only printing in the form /stats/author/AuthName, this will give you a not found error when you click them.
    Hopefully in the next few days (might be longer, finals week), I can just make using mod_rewrite an option. For now though I opted for the cleaner URIs.
    Author stats w/o the Rewrites will load using:
    index.php?wp_stats=1&author=AuthName
    with an optional:
    &page=X where X is the page number you want to load.
    So yeah, it almost works if your not using the rewrite rules.

  12. pstew21
    Member
    Posted 10 years ago #

    Thanks, it now works, nice plugin... Well documented install. Thanks!

  13. unoamigo
    Member
    Posted 10 years ago #

    Fixed the stats/ bit, not sure how I managed to do that one. ;-)
    Thresholds are now fixed on the commenter statistics. Thanks for pointing that out, it also affected values other than 1.
    The download file is now updated.
    Hopefully by the time WP 1.2 is released all the kinks are worked out.
    Beel, you might also prefer to simply call the functions yourself, rather than using the generic print out from get_stats().
    Thanks for pointing out the bugs!
    Ryan

  14. unoamigo
    Member
    Posted 10 years ago #

    Fixed, the interesting thing about setting the threshold to 1, is that a value of 1 is essentially disabled. 0 or -1 work great for that.
    Although, I suppose not having that

    could cause a few problems with the design of your page! ;-)
    How is htmlspecialchars messing up your post_title? Which part of the stats page? It's in there in a couple places.
    htmlspecialchars is used to make sure code is valid. If you can define more clearly (with an example) of what is being messed up and where, hopefully we can come up with a good solution. For now it remains unchanged.
    Let me know if you encounter any other glitches.
    Thanks

  15. Stuart
    Member
    Posted 10 years ago #

    I've installed the latest version and everything looks fine but the links from the commentors to their comments just throws up a 404 error. I have added the extra lines to .htaccess and modified them to suit. Any thoughts??

  16. Beel
    Member
    Posted 10 years ago #

    I put all the htmlspecialchars back so you can check my stats. I have a trackback from Wump Blog that displays » as part of "the author" but you are right, it should be less of an issue. I am more interested in discovering why I get an error when trying to view that particular comment.

  17. unoamigo
    Member
    Posted 10 years ago #

    Geesh, that is an evil commenters name.
    Dump the htmlspecialchars on the author and see if the link works then. I suppose I'll have to do that as well, since it is apparently an issue that pops up.
    That htmlspecialchars functioni is probably working against you. Since » is not recognized by the web browser, that is what it is using for the URI.
    Apache does not translate such things so it's trying to load a page that quite naturally does not exist.
    If getting rid of htmlspecialchars, does not alleviate the problem. We will work out a solution.

  18. unoamigo
    Member
    Posted 10 years ago #

    In light of the problems Beel has discovered due to the use of htmlspecialchars() I've decided to remove the use of the function from the code entirely.
    This has the potential to make code invalid, but I imagine most authors concerned with the validity of their code will use the html special char code instead of relying on a php script.
    Anyone else run into some fun bugs for me? :-D
    Or feature requests/alterations? Things that should be clarified in the install directions?

  19. bruce2004
    Member
    Posted 10 years ago #

    Just to report, installed it in latest nightly, works awesomely. Calling it by using:
    index.php?wp_stats=1
    Great work!
    Thank you! Recently switched to WordPress, and it's great.

  20. unoamigo
    Member
    Posted 10 years ago #

    Excellent. Thank you!
    Just so you know, currently if your not using the Mod Rewrites the links into the comment author pages won't work correctly (yet).
    Everything else should be fine though.
    Enjoy WordPress, I've been using it since it was b2 - well over a year now. It's treated me fantastically the whole way through!

  21. Stuart
    Member
    Posted 10 years ago #

    Hi again. Here's what I've entered into my .htaccess file :-
    RewriteRule ^stats/author/(.*)?/page/?(.*)?/?$ /weblog.php?wp_stats=1&author=$1&page=$2 [QSA]
    RewriteRule ^stats/author/?(.*) /weblog.php?wp_stats=1&author=$1 [QSA]
    RewriteRule ^stats/ /weblog.php?wp_stats=1 [QSA]
    RewriteRule ^stats /weblog.php?wp_stats=1 [QSA]
    I was sure I got it right.

  22. unoamigo
    Member
    Posted 10 years ago #

    It is almost right. I made the assumption that everyone would be using the nice permalinks feature of WP 1.2. Maybe this was foolish, either way. I should clarify. The first line you will need in your .htaccess file is:
    RewriteEngine On
    Without it, everything is a bust.
    If that doesn't work (or you already have that line), I'll have to have an experiment in re-naming my weblog.
    In case you haven't noticed, your page is viewable here:
    http://thebombsite.com/weblog.php?wp_stats=1
    With the only thing not working are the links to info on your comment authors (they must have the RewriteRules to link correctly).
    Hope this clears everything up for you.

  23. unoamigo
    Member
    Posted 10 years ago #

    Actually, this is more of a issue with how your calling your css sheet. Give the full path to it, instead of a referential path.
    Instead of using ../style.css or style.css, use /style.css or /path/to/style.css
    If you look at the generated URIs I'm sure you will easily note that at: /stats/author/Stuart there is no style sheet! ;-)
    There really isn't a good solution I can implement that will be clean across the board for everyone. The best thing here is just good clean code.
    Good to hear things are looking up.

  24. Stuart
    Member
    Posted 10 years ago #

    Thankyou. Everything seems to be working fine now. :) I've sorted out weblog.php and all the menu links as well. Now if you'd told me this a week ago I could have done the whole site while I went through it validating to XHTML1.0!! Never mind eh. I'll work through it slowly. On most pages it's only the calls to the CSS and the header logo that need sorting. I use the WP menu throughout the site which I've just gone through. There are odd links in the content to site pages but not that many.

  25. unoamigo
    Member
    Posted 10 years ago #

    A week ago, I was worrying about making a robot move about and draw a map. Not random blog statistics. ;-)
    Glad everything is working fine. Hopefully you have a better insight into how some of WordPress works now.

  26. unoamigo
    Member
    Posted 10 years ago #

    Good deal.
    Thanks.
    Your stats page looks excellent. ;-)

  27. Beel
    Member
    Posted 10 years ago #

    statistics.php was interfering with some of my other hacks so I made a fix you might want to add to the file...
    just below:
    $page = intval($_GET['page']);
    add:
    if ($page<1) $page=1;
    This is so $page does not equal 0

  28. unoamigo
    Member
    Posted 10 years ago #

    Interesting, would it be better to just call it $stats_page?
    Since were using nice urls, changing the variable name shouldn't cause you any troubles.
    Or was something else happening?

  29. unoamigo
    Member
    Posted 10 years ago #

    Aight. I'll probably implement your change as well as change the naming. That way, future problems will be better avoided.
    In the future, it probably would be a good habit to make sure variable names and functions identify with the plugin they are in.
    Will post changes sometime tomorrow. Test is a little more pressing.

  30. Anonymous
    Unregistered
    Posted 10 years ago #

    I'm having a problem with the .htaccess file.
    RewriteRule ^stats/author/(.*)?/page/?(.*)?/?$ /b2/index.php?wp_stats=1&author=$1&page=$2 [QSA]
    RewriteRule ^stats/author/?(.*) /b2/index.php?wp_stats=1&author=$1 [QSA]
    RewriteRule ^stats/ /b2/index.php?wp_stats=1 [QSA]
    RewriteRule ^stats /b2/index.php?wp_stats=1 [QSA]
    Is stats/author/ off the root of the server in this example? So it's http://www.mysite.com/stats/author/?
    And then is /b2/index.php off the root too? So it is http://www.mysite.com/b2/index.php?
    My problem is I still do not have a folder created called stats off my root. Is this folder auto-generated?
    Thanks,
    John

124

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.