Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

Graphical Counter Panel

Asked Modified Viewed 7,769 times
S
smokeman
S
  • Veteran Member, joined since
  • Contributed 920 posts on the community forums.
  • Started 79 threads in the forums
  • Started this discussions
asked
Veteran Member

[mp]121[/mp]
0 replies

4 posts

P
PolarFox
P
  • Veteran Member, joined since
  • Contributed 1,633 posts on the community forums.
  • Started 29 threads in the forums
answered
Veteran Member

Quote

$showcounter = '';
$pics = $settings['counter'];
for($i=0;$i<strlen($pics);$i++) {
$showcounter .='<img src="'.INFUSIONS.'graphical_counter_panel/images/'.$pics[$i].'.png" border="0" alt="'.$pics{$i}.'" />';
}
echo $showcounter.'<br/>';

Cleaned code smile You can use it as your own.
Edited by PolarFox on 13-01-2011 22:23,
0 replies
S
smokeman
S
  • Veteran Member, joined since
  • Contributed 920 posts on the community forums.
  • Started 79 threads in the forums
  • Started this discussions
answered
Veteran Member

Hi PolarFox.

Great man! - Ty for that!

I'll write you as CO-Author then - if it's ok with you ?

Thx again m8.
0 replies
P
PolarFox
P
  • Veteran Member, joined since
  • Contributed 1,633 posts on the community forums.
  • Started 29 threads in the forums
answered
Veteran Member

As you wish, I like to be useful :D
0 replies
S
SimpleVision
S
  • Member, joined since
  • Contributed 63 posts on the community forums.
  • Started 11 threads in the forums
answered
Member

There is no need to have a new image for every number!

Quote


Minimize HTTP Requests
Reducing the number of HTTP requests in your page is the place to start. This is the most important guideline for improving performance for first time visitors. As described in Tenni Theurer's blog post Browser Cache Usage - Exposed!, 40-60% of daily visitors to your site come in with an empty cache. Making your page fast for these first time visitors is key to a better user experience.


css sprite

[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]
openside($locale['gcp100']);

$showcounter = "";
$pics = "".$settings['counter']."";

for($i=0;$i<strlen($pics);$i++) {
$showcounter .="<li class=\"n".$pics{$i}."\"></li>";
}

echo "
<style>
.counter {display:block;}
.counter li { width: 15px; height: 20px;
background: url(".INFUSIONS."graphical_counter_panel/csg-4d31cd6690d35.png) no-repeat top left;display:inline-block;
}
li.n1{ background-position: 0 0; width: 15px; height: 20px; }
li.n2{ background-position: 0 -21px;}
li.n3{ background-position: 0 -42px; }
li.n4{ background-position: 0 -63px; }
li.n5{ background-position: 0 -84px; }
li.n6{ background-position: 0 -105px;}
li.n7{ background-position: 0 -126px;}
li.n8{ background-position: 0 -147px;}
li.n9{ background-position: 0 -168px;}
li.n0{ background-position: 0 -189px;}
</style>

<div><ul class='counter'>".$showcounter."</ul></div>";

closeside();
[/syntaxhighlighter]

download image counter
0 replies

Labels

None yet

Statistics

  • Views 0 views
  • Posts 4 posts
  • Votes 0 votes
  • Topic users 3 members

0 participants

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet