Display Stats - Page 2 Display Stats - Page 2
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Display Stats

Started by haters, February 16, 2014, 06:03:45 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

haters


allvip

I think you see a old version of your page because I see that it worked.
it only needs to be in the right position (without all that space around it.I will help you to do that),more width to #showStats maybe 10% and if the number will be bigger then like 10.000 even 30%

thanks for allowing me to see your website.is easier to help you this way.

haters

Quote from: allvip on February 28, 2014, 08:35:10 PM
I think you see a old version of your page because I see that it worked.
it only needs to be in the right position (without all that space around it.I will help you to do that),more width to #showStats maybe 10% and if the number will be bigger then like 10.000 even 30%

thanks for allowing me to see your website.is easier to help you this way.
I've set it to 8% (will update as I get to double figures). Any way to get it as the same colour, text and size as the other text in the box where it is? Also there's a huge gap above and below the numbers. How do we fix that? :D

allvip

Yes.I am going to do all now.please wait 10 minutes to make the code for you.

haters

Quote from: allvip on February 28, 2014, 08:44:25 PM
Yes.I am going to do all now.please wait 10 minutes to make the code for you.
Alright. Thank you :)

allvip

I just realised that you don't need to load all the .statlink div but just the strong tag.

replace my code from reply#2 with:


<script src="js/jquery-1.11.0.min.js" type="text/javascript"></script>
<script>
        $(document).ready( function() {
          $( "#showStats" ).load( "http://allvip.us/cpg/test/index.php .statlink strong" );
});
</script>


replace my code from reply#14 with:


#showStats{display:inline;padding:0 0.5rem 0 0.5rem;}
#showStats strong{display:none;}#showStats strong:first-child{display:inline;font-weight:normal;font-family:Arial,sans-serif;font-size:11px;color:#666;line-height:18px;}

allvip

I think you can delete:


<script src="js/jquery-1.11.0.min.js" type="text/javascript"></script>


from the code.I see your website already has jquery 1.7.1 and 1.6 loding on the page so my code should work with out that line from the code.

please try:


<script>
        $(document).ready( function() {
          $( "#showStats" ).load( "http://allvip.us/cpg/test/index.php .statlink strong" );
});
</script>


haters

Quote from: allvip on February 28, 2014, 09:18:38 PM
I just realised that you don't need to load all the .statlink div but just the strong tag.

replace my code from reply#2 with:


<script src="js/jquery-1.11.0.min.js" type="text/javascript"></script>
<script>
        $(document).ready( function() {
          $( "#showStats" ).load( "http://allvip.us/cpg/test/index.php .statlink strong" );
});
</script>


replace my code from reply#14 with:


#showStats{display:inline;padding:0 0.5rem 0 0.5rem;}
#showStats strong{display:none;}#showStats strong:first-child{display:inline;font-weight:normal;font-family:Arial,sans-serif;font-size:11px;color:#666;line-height:18px;}

Just one thing, there'a bit of a gap to the side of it. Is there any way to fix that? I'm happy with how it is though now anyways.

Thank you SO MUCH. I really do appreciate your help!

allvip

#28
With this code you don't need to update if the number will be 10 000


allvip

#29
Do you want the number to stand out from the text:change font-weight:normal; to font-weight:bold;

you can change even font-size:11px; to font-size:20px; if you want the number to be bigger.
you can underline it or add a border dotted under it,or a background color.
If you want anything diffrent you can always ask.is no trouble.

I like how your website and gallery looks.nice work.

allvip

#30
QuoteJust one thing, there'a bit of a gap to the side of it. Is there any way to fix that?

change padding:0 0.5rem 0 0.5rem; to padding:0 0.2rem 0 0.2rem;
you can use even pixels:padding:0 5px 0 5px;
or just delete padding:0 0.5rem 0 0.5rem; from the code.I think is ok even without.

haters

Quote from: allvip on February 28, 2014, 09:46:02 PM
change padding:0 0.5rem 0 0.5rem; to padding:0 0.2rem 0 0.2rem;
you can use even pixels:padding:0 5px 0 5px;
or just delete padding:0 0.5rem 0 0.5rem; from the code.I think is ok even without.
I changed it to 0.0.1 and it looks much neater. Thank you again for all your help!

allvip

#32
You can even change padding:0 0.5rem 0 0.5rem; to padding:0px;This way will have 0px padding for all 4 values(top,right,bottom,left.).

padding:0 0.5rem 0 0.5rem; means 0 gap to top,0.5 gap to right 0 gap to bottom and 0.5 gap to left.

You can add even margin:0px; to the code.

Αndré

Please keep in mind that allvip's solution just works if your users have JavaScript enabled.

ninouee

hello

Thank you for your informations.

but i have questions about the function <p id="showStats"></p>

I put on my index page the different elements and it's ok but the informations is on a line.

Can you explaine-me where i can find the element in order to change it.

My goal is show the informations like that:
- 12,611 photos
- 805 albums
- 45 catégories...
=> http://ddstv.fr/ on my index i write the informations manually.

I'm sorry i y do mistakes in english, i'm french.

allvip

I can see jquery 1.4.2 is loding on your page.

1.add in the head of your page (<head></head> tags):


<script>
        $(document).ready( function() {
          $( "#showStats" ).load( "http://ddstv.fr/galerie/index.php .statlink" );
});
</script>


2.add to your_page_style.css:


.statlink p {
    display: block;
    margin: 0px;
    padding: 0px;
}
.statlink p strong {
    display: inline;
}
.statlink strong {
    display: none;
}


3.add: <p id="showStats"></p> where you want the stats to show on your page.


4.Open http://ddstv.fr/galerie/lang/english.php find:


$lang_list_categories['stat1'] = '[pictures] files in [albums] albums and [cat] categories with [comments] comments viewed [views] times'; // do not translate the stuff in square brackets
 

and replace with:


$lang_list_categories['stat1'] = '<p>[pictures] files </p><strong>in</strong> <p>[albums] albums </p><strong>and</strong> <p>[cat] categories </p><strong>with</strong> <p>[comments] comments</p><p> viewed [views] times</p>'; // do not translate the stuff in square brackets


5.add to themes/curve/style.css :


.statlink p,.statlink strong {
    display: inline;
}

allvip

If your users can view your gallery in their own language (Autodetect language is ON in Config) then you need to edit all the language files.
I don't know any other way.
If you don't want to edit english.php then follow step1,step2 and step 3 and replace step 3 with:


.statlink strong {
    display: block;
}

and you will have: see  the image I attached.

ninouee

Hello!

Thank you for your help it's working on mys page test! Now i have to do my new style.

:)