How to add additional image to Graphical Hit Counter

All other scripts belong here
Post Reply
billyjoe
Posts: 7
Joined: Tue Oct 21, 2008 12:26 am

How to add additional image to Graphical Hit Counter

Post 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,
Last edited by billyjoe on Fri Oct 24, 2008 7:34 am, edited 3 times in total.
billyjoe
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post 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.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
billyjoe
Posts: 7
Joined: Tue Oct 21, 2008 12:26 am

Post 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
Last edited by billyjoe on Fri Oct 24, 2008 7:22 am, edited 1 time in total.
billyjoe
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

You're welcome, thanks for the donation :D
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Post Reply