Member
Member
Fotoman   2009-08-10, 20:27
#1

Hi at zenphoto forums!

I just saw that's possible to have a hit counter for the images, galleries on the page. How can that be done? I saw that I can reset the counter on the admin page but it does not appear on my site. I'm using 1.2.5 and default theme with some modifications. There's no "enable hit couter" button as far as I see.

I just tried this: http://www.zenphoto.org/support/topic.php?id=4812#post-28263 , but the counter does not show up.

What do I have to do to make the hit counter appear? I noticed that it's already included but needs to be activated.

Thanks for help,
FM

Member
Member
sbillard   2009-08-10, 22:24
#2

place echo getHitcounter(); where you want the counter to appear.

Member
Member
Fotoman   2009-08-11, 06:37
#3

Hi sbillard!

Thanks for the quick answer. Nope, it doesn't appear.
I placed it between the div tags in line 57/58 in the image.php of my (default) theme. So it should be below the image before the comment form, right?

Honestly I must admit that I know HTML, but my knowledge in php is pretty llimited.

Is it really echo getHitcounter(); or is it
``

My best regards,
FM

Administrator
Administrator
acrylian   2009-08-11, 08:11
#4

Within html code of course the second...

Member
Member
Fotoman   2009-08-11, 09:11
#5

Okay, tested this already. I doesn't show up. Can it be that difficult?
...

Administrator
Administrator
acrylian   2009-08-11, 10:49
#6

The question is also where exactly you placed the call. It needs to be in an image or album context. Otherwise it will not work.

Member
Member
Fotoman   2009-08-11, 11:29
#7

As said: in the image.php, line 58, 59 of the default zenphoto theme.

`

 |  | 
 /> 
Administrator
Administrator
acrylian   2009-08-11, 11:46
#8

IF that code is right, you got a space between the question mark and the "php". This actually should result in an error.

Anyway, it is working as expected with the recent release. I just tried.

Member
Member
Fotoman   2009-08-11, 12:02
#9

Sorry no, there is no space between the question mark and the "php". Pasting code here is a little tricky. The counter's just not showing up. Can I check some other things that are connected to the counter appearence in the page?

Looks like this: http://img18.imageshack.us/img18/6766/zwischenablage01xso.jpg

I believe you that it works. It's just not working on my page, so I try to find out why ...

Administrator
Administrator
acrylian   2009-08-11, 12:07
#10

Alright, just wanted to be sure.

Did you look at the database? Does that image actually have a hitcount? Are there any errors in the error log? I have no other ideas.

Member
Member
Fotoman   2009-08-11, 12:24
#11

I has. I just has 10 hits. In the database, too. No error logs. As I see the php doesn't make it to the hatml generated page. Have you a page, where I can have a look at the hit counter?

One more question to make shure we're talking about the same thing: Is the hit counter the thing with the stars taht float to yellow wenn hovering them? The rating tool like "I give three of five stars for that image." or is the hit ounter - tht I don't see - something that tells me "100 People have already seen this picture", so it pints out "100" below the image?

I'd name the first one rating tool the other one hit counter.

Member
Member
sbillard   2009-08-11, 14:21
#12

Well, no. The hitcounter is just a number--the number of visits (by non-admin users) toi the site. The Effervescence+ theme has hitcounters in the footer of the pages.

Member
Member
Fotoman   2009-08-11, 20:18
#13

Okay, seen that.
For that theme it appears on the image page.

They realized it by a special part by an extra customfunctions.php.

`

`
I placed that in my image.php and index.php. Still no positve result.
Where is getHitcounter declared, so that it can be echoed on the page?
I'm still on it.

Member
Member
sbillard   2009-08-11, 23:17
#14

So, if you select the Effervescence+ theme, do the hitcounters show up in the footer? getHitcounter() is declared in the template-functions.php script. Zenphoto Functions Guide in the User Guide section of the Zenphoto WEB site which would have told you this.)

The above code will echo something so long as you are on an image or album page. So if you are not seeing any output only two things can be wrong. You are not on an image or album page or you have place the code somewhere that is being hidden. I suggest you look at the page HTML to see if the text is there.

Member
Member
Fotoman   2009-08-12, 06:20
#15

Hi sbillard!

Well, I placed the counter call over twenty times in the image.php and album.php page. It doesn't show up. It even doesn't make it to the HTML page. There's no indication in the source code.

At the end of page I have the following:
`

`

Member
Member
sbillard   2009-08-12, 15:34
#16

You must be making some basic error. As I said above, the echo statement will display something even if it does not display the counter. Since you get nothing. You must not be actually doing what you think you are doing.

So, be sure that you are making the changes to the theme you are actually running, etc.

Member
Member
Fotoman   2009-08-13, 15:29
#17

NOW!
I got it. You're right, sbillard. I was editing the wrong theme AND didn't made any modification due to the album layout theme.

The album layout theme was set to [blank] = no theme selected.
I made my changes to the image.php and album.php on ..\default.
As the album indecated "zenpage-dault" as the choosen theme I thought I was right. But as I had choosen [blank] to any album as selected theme, it didn't made it to the page.

Now after I recognized tthat there's a 'default' theme and a 'zenpage-default' theme I finally realized that I was editing 'default' all the time and not 'zenpage-default'. Setting every album to 'zenpage-default' and editing the image.php and album.php of THIS theme in ..\zenpage-default brought the counter on the page.

Thanks for the directions!
Now I have to struggle setting it up to the right appearence layout.

Greetz,
FM

Member
Member
darek_l   2016-08-17, 18:45
#18

I putted this one and works well

[
px ]

[ ]

http://darek.fr/

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.