Page 1 of 1

How to add additional image to Graphical Hit Counter

Posted: Tue Oct 21, 2008 1:12 am
by billyjoe
Hello Klemen:

I just discovered and tested your graphical hit counter script and I love it. However, before I incorporate it into my website, I would like to add an image of a guitar to display in conjunction with the counter numbers, similar to that shown in the image below:

Image

Designing the numbers to match the guitar neck (fretboard) is easy, but, how do you add the guitar parts on the left and right of the counter numbers to join perfectly?

The idea is not original. It's one of the choices given by a web counter service which I'd like to use it on my website.

I searched here on the forum for information on this but did not find any. When you get the opportunity would you please let me know what code is needed to add the left and right parts of the image to the counter section?

Thank you,

Posted: Wed Oct 22, 2008 5:44 pm
by Klemen
In graphcount.php you need to print out left and right guitar photos around digits. For example edit

Code: Select all

    for ($i=0;$i<$len;$i++) {
        echo 'document.write(\'<img src="'.$base_url . $style_dir . substr($count,$i,1) . '.' . $ext .'" border="0">\');';
    }
to something like

Code: Select all

    echo 'document.write(\'<img src="http://domain.com/guitar_left.gif" border="0">\');';
    for ($i=0;$i<$len;$i++) {
        echo 'document.write(\'<img src="'.$base_url . $style_dir . substr($count,$i,1) . '.' . $ext .'" border="0">\');';
    }
    echo 'document.write(\'<img src="http://domain.com/guitar_right.gif" border="0">\');';


Make sure you change image SRC URLs to your own images. And of course you need to create a style for the digits, but if I understand correctly you already did that.

Posted: Wed Oct 22, 2008 10:20 pm
by billyjoe

Klemen:

Thank you so much
for your reply and for the customization code.

As you can see it works perfectly. :D

http://www.billyjoeconor.com/home.html

Posted: Thu Oct 23, 2008 6:24 pm
by Klemen
You're welcome, thanks for the donation :D