Page 1 of 1

Photo Gallery Statistics

Posted: 28 Feb 2014, 00:22
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

Re: Photo Gallery Statistics

Posted: 01 Mar 2014, 10:56
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

Re: Photo Gallery Statistics

Posted: 02 Mar 2014, 16:02
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 :)

Re: Photo Gallery Statistics

Posted: 03 Mar 2014, 16:22
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;

Re: Photo Gallery Statistics

Posted: 04 Dec 2017, 20:59
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.

Re: Photo Gallery Statistics

Posted: 05 Dec 2017, 23:39
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

Re: Photo Gallery Statistics

Posted: 06 Dec 2017, 23:40
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.

Re: Photo Gallery Statistics

Posted: 09 Dec 2017, 14:39
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