How many photos exists on a category

Phoca Gallery - image gallery extension
MDK
Phoca Newbie
Phoca Newbie
Posts: 6
Joined: 13 May 2008, 18:48

I want to display in

Post by MDK »

I want to display in some cases only how many photos a category has... Exists one way to do this?

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

In category list, yo

Post by Jan »

In category list, you have the number of images in the category in ()
If you find Phoca extensions useful, please support the project
MDK
Phoca Newbie
Phoca Newbie
Posts: 6
Joined: 13 May 2008, 18:48

Yes, I know this...

Post by MDK »

Yes, I know this... but in my case this isn't the best...

Each post that I made, I put the 3 first images from a category (whithout buttons like for slideshow), and before the "Read more" link, the rest of the images, for the user see and the buttons to advance in images and see a slideshow.

But I note thta various users only see the initial 3 images and don't see the full article... I can write manually the number of the images in that post, but if exists something that show automatically this, is very useful (like: {phocagallery catedoryid=X|showtotal=1})

I have a adult blog... if you want to see what about I speak, I can send you the link

Thanks!
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

such parameter doesn

Post by Jan »

such parameter doesn't exist yet
If you find Phoca extensions useful, please support the project
MDK
Phoca Newbie
Phoca Newbie
Posts: 6
Joined: 13 May 2008, 18:48

I solve this running

Post by MDK »

I solve this running in the code (phocagallery.php) and inserting this in the line 779:

EDIT: UPDATING THE CODE (the old one had a bug that disallow you to show total and images on the same article...)

// Code for total number os images on a category, by MDK | www.mdkcore.da.ru
if ($view == 'total'){
// select all the images from 'catid' category
$queryc = 'SELECT * FROM #__phocagallery WHERE catid = ' .$catid;

$db->setQuery($queryc);
$outcome_data = $db->loadObjectList();

$total_counter = 0; // a simple counter
foreach ($outcome_data as $key => $value) $total_counter++;

$output = '';
$output .= $total_counter; // and the output is the total number of images
}
//



and change the follow:

$output .= '</div>';
if ($float == '')
{
$output .= '<div style="clear:both"> </div>';
}




to

if (!isset($total_counter)){ // added this to prevent '</div>'
$output .= '</div>';
if ($float == '')
{
$output .= '<div style="clear:both"> </div>';
}
}



and now works displaying the images and the total on the same article...

this isn't the best way, but do what I need by now...
I can use it with this line in my articles:

{phocagallery view=total|categoryid=X}

where X is the number of the category that I want to show the total number of pics..

Thanks for the help and thanks a lot for this greatest module/plugins that is PhocaGallery!!!
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Great

Post by Jan »

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