WordPress.org

Forums

Mechanic Visitor Counter
[resolved] counter has domain problem (4 posts)

  1. ronthai
    Member
    Posted 1 year ago #

    I think the counter does not work because my domain name ends with .......18.com

    This is how the counter looks with all 8's as images also from the counter:

    8.com/tgt/wp-content/plugins/mechanic-visitor-counter/styles/image/web/1.gif' alt='1'>8.com/tgt/wp-content/plugins/mechanic-visitor-counter/styles/image/web/0.gif' alt='0'>8.com/tgt/wp-content/plugins/mechanic-visitor-counter/styles/image/web/1.gif' alt='1'>8.com/tgt/wp-content/plugins/mechanic-visitor-counter/styles/image/web/0.gif' alt='0'>8.com/tgt/wp-content/plugins/mechanic-visitor-counter/styles/image/web/1.gif' alt='1'>8.com/tgt/wp-content/plugins/mechanic-visitor-counter/styles/image/web/0.gif' alt='0'>8.com/tgt/wp-content/plugins/mechanic-visitor-counter/styles/image/web/1.gif' alt='1'>8.com/tgt/wp-content/plugins/mechanic-visitor-counter/styles/image/web/0.gif' alt='0'>8.com/tgt/wp-content/plugins/mechanic-visitor-counter/styles/image/web/1.gif' alt='1'>8.com/tgt/wp-content/plugins/mechanic-visitor-counter/styles/image/web/1.gif' alt='1'>

    All other statictics work fine

    http://wordpress.org/plugins/mechanic-visitor-counter/

  2. Jack All
    Member
    Posted 1 year ago #

    I experienced the same in v2.7.
    The code is buggy, because there's a str_replace() function active for the counter images. I wouldn't do that, ever.
    I changed my script, by replacing the following code starting at line 168 of wp-statsmechanic.php:

    //image print
    	$tothitsgbr = sprintf("%06d", $tothitsgbr);
    	for ($i = 0; $i <= 9; $i++) {
    		  $tothitsgbr = str_replace($i, "<img src='http://demo.balimechanicweb.net/counter/styles/$style/$i$ext' alt='$i'>", $tothitsgbr);
    }

    By:

    //image print
    	$tothitsgbr = sprintf("%06d", $tothitsgbr);
    	$tothitsstring = "";
    	$arr = str_split($tothitsgbr);
    	foreach ($arr as &$value) {
    		$tothitsstring = $tothitsstring . "<img src='/wp-content/plugins/mechanic-visitor-counter/styles/$style/$value$ext' alt='$value'>";
    }
    $tothitsgbr = $tothitsstring;

    Good luck!

  3. ronthai
    Member
    Posted 1 year ago #

    Thanks, but I just removed the main counter with <!--<div id="mvccount"><?php echo $tothitsgbr ?></div>-->
    and re-ordered the statistics in the php.
    It also has a Total Hits/Views, so I just put that one at the top.

  4. ronthai
    Member
    Posted 1 year ago #

    I actually tried your adjustment, but does not work in this version.
    There are changes made in that part of the code.

    It gets rid of the error I got, but the counter shows as only text.
    Not sure what it counts, but is not the TOTAL Hits, number was to low.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Mechanic Visitor Counter
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.