Topic: Display number of images in a gallery on Index page.

(This message is probably best answered by the developer of svmanager, but if anybody knows the answer thanks in advance!)

I would like to display a count of the images in each gallery on the svmanager generated index page.

To cut down on development time I wanted to know if there is a  function already defined in svmanager that i can use to count the images in a directory.

/rg

Last edited by dreamrg (2010-02-23 00:43:26)

Re: Display number of images in a gallery on Index page.

You could hack into the svManager code but if you are familiar with php then I'd do it a different way. I'd write a short php script to count the number of image tags in the gallery xml file. This should be fairly easy, especially if you are running php 5 which has much better xml support than php 4. I guess you could also do it in javascript. This way, you wouldn't have to redo the hack when you upgrade svManager.

jack

Jack Hardie
SimpleViewer Support Team.

Re: Display number of images in a gallery on Index page.

Thanks. I can write a the code and include in indexpage.php nested under your foreach statement.

Is there any benefit for counting the xml tags versus the amount of .jpg in the images subdir?

Also speaking of .XML - i see some of my galleries have an "imagedata.xml"  file and others have an "gallery.xml" file, is this normal?

Great script.

/rg

Re: Display number of images in a gallery on Index page.

Is there any benefit for counting the xml tags versus the amount of .jpg in the images subdir?

I could think of some theoretical benefits but in practice do whichever is easier.

i see some of my galleries have an "imagedata.xml" file...

The imagedata.xml file is an old format that is not is use any more. New galleries created with svManager will use the newer gallery.xml file. You should update your old galleries to the latest viewer before you import them into svManager. Or just create again them from new in svManager.

jack

Jack Hardie
SimpleViewer Support Team.

Re: Display number of images in a gallery on Index page.

Jack,
I took your advice and did code the php to read the  gallery.xml file (concatenated with your $href var) in indexpage.php. 

Now my index page shows how many images i have in each gallery.

Thanks.

Re: Display number of images in a gallery on Index page.

Hi dreamrg,

this sounds interesting - do you want to post your code here?

Thx, Sky