WordPress.org

Ready to get started?Download WordPress

Forums

NewStatPress
[resolved] Print function %totalpageviews% (4 posts)

  1. CockpitSeeker
    Member
    Posted 2 years ago #

    Hi there,
    I went for your plugin as it saved me the database fixing (which I must say looks good), but I must also say that I miss the %totalpageview% printing function.
    That's right, it is not on the original StatPress plugin BUT I can't remember how I added it and which file I modified at that time...
    Me being me (lazy, retired far from my best geeking days), I'd appreciate if you could recall me which php file to modify and the line to drop!! ;)

    Cheers

    http://wordpress.org/extend/plugins/newstatpress/

  2. CockpitSeeker
    Member
    Posted 2 years ago #

    Yeah nevermind, I did it (I can be such a lazy bum sometimes)!

    In case someone wants to do it:

    • open the newstatpress.php file
    • you'll find all the functions and calls listed between the line 1555:function iri_NewStatPress_Vars($body) { and the closing tag } line 1729
    • drop the lines:
      if(strpos(strtolower($body),"%totalpageviews%") !== FALSE) {
      $qry = $wpdb->get_results("SELECT count(id) as pageview FROM $table_name WHERE spider='' and feed='';");
      $body = str_replace("%totalpageviews%", $qry[0]->pageview, $body);
      }
      anywhere you want between those lines (not breaking the other functions)
    • tadaaa
  3. ice00
    Member
    Plugin Author

    Posted 2 years ago #

    Hi,

    I have add it into my developed version of the plugin, so on next upate you will have it inside without modification.

  4. CockpitSeeker
    Member
    Posted 2 years ago #

    lol
    shit man, you're gonna make me update it! :P

    Just kidding, 'thanks for the plugin, keep perfecting it!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic