Photo Gallery Statistics

Phoca Gallery - image gallery extension
pyrosteve
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 30 Jan 2013, 13:39

Photo Gallery Statistics

Post by pyrosteve »

Hi all,

I posted this around a year ago now, wondering if anyone can help at all yet....I am looking for a way display gallery statistics in Joomla, ideally in a module box..I would like to display "Total Number of Photos Online: XXXXXX" and "Total Albums Online: XXXXXX" which updates as I add more images to the gallery - I am thinking this is most likely fairly straight forward to pull the info out of MySQL...but no idea how!

Any help or ideas would be great :)

Steve
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49144
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Photo Gallery Statistics

Post by Jan »

Hi, what you exactly mean with "total number of photos online"? Do you mean all images inside Phoca Gallery which are published? (resp. categories)

Jan
If you find Phoca extensions useful, please support the project
pyrosteve
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 30 Jan 2013, 13:39

Re: Photo Gallery Statistics

Post by pyrosteve »

Yes, the total number published photos in all of the catergories, like a global photo stats sort of module is what I am after :)
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49144
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Photo Gallery Statistics

Post by Jan »

Hi, then you need to do new module or customize some other and add sql to this (with loading the items and displaying them in html)

something like:

Code: Select all

SELECT COUNT (*) AS NumberOfImages FROM #__phocagallery WHERE published = 1;
or for categories:

Code: Select all

SELECT COUNT (*) AS NumberOfCategories FROM #__phocagallery_categories WHERE published = 1;
If you find Phoca extensions useful, please support the project
pmonstad
Phoca Newbie
Phoca Newbie
Posts: 9
Joined: 06 Nov 2015, 21:58

Re: Photo Gallery Statistics

Post by pmonstad »

I have found a plugin to insert code into an artice. There is an example: $db = JFactory::getDbo();

$query = $db->getQuery(true);
$query->select($db->quoteName(array('favorite_color')))
->from($db->quoteName('colors'))
->where($db->quoteName('name') . ' = '. $db->quote('bob'));
$db->setQuery($query);
$rows = $db->loadObjectList();

foreach ($rows as $row) {
echo $row->favorite_color;
}

How can I implement your code to show number of photos uploaded? I really need a code to show how many photos my gallary contains.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49144
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Photo Gallery Statistics

Post by Jan »

Hi, which code you mean? I added SQL example how to get the counts from database, but not a module code :idea:

Jan
If you find Phoca extensions useful, please support the project
pmonstad
Phoca Newbie
Phoca Newbie
Posts: 9
Joined: 06 Nov 2015, 21:58

Re: Photo Gallery Statistics

Post by pmonstad »

Yes, you supplied the SQL query example. I supplied some code I found in anouther joomla plugin to add custom code in an article. I ask if your examples can be added in the supplied code or if you can supply a working code like the example I posted. I really need some code to show total number of photos available in my gallery.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49144
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Photo Gallery Statistics

Post by Jan »

Hi, the code needs to be directly customized on your site - on place where you exactly want to display the statistics. On this place you should implement the sql query to get the statistics and display the outcome - unfortunately I don't know your site and the place where you want to display it - coding is about directly implementing and testing the changes on server - so this needs to be customized directly on the server (with testing, etc.) :idea:

Jan
If you find Phoca extensions useful, please support the project
Post Reply