• Resolved ronthai

    (@ronthai)


    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

    https://www.ads-software.com/plugins/mechanic-visitor-counter/

Viewing 3 replies - 1 through 3 (of 3 total)
  • 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='https://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!

    Thread Starter ronthai

    (@ronthai)

    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.

    Thread Starter ronthai

    (@ronthai)

    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.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘counter has domain problem’ is closed to new replies.