Support » Plugin: Mechanic Visitor Counter » counter has domain problem

  • Resolved ronthai


    I think the counter does not work because my domain name ends with ……

    This is how the counter looks with all 8’s as images also from the counter:’ alt=’1′>’ alt=’0′>’ alt=’1′>’ alt=’0′>’ alt=’1′>’ alt=’0′>’ alt=’1′>’ alt=’0′>’ alt=’1′>’ alt=’1′>

    All other statictics work fine

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='$style/$i$ext' alt='$i'>", $tothitsgbr);


    //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!

    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.

    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.