Page 1 of 1

I want to display in

Posted: 04 Jun 2008, 13:59
by MDK
I want to display in some cases only how many photos a category has... Exists one way to do this?

thanks

In category list, yo

Posted: 04 Jun 2008, 19:33
by Jan
In category list, you have the number of images in the category in ()

Yes, I know this...

Posted: 04 Jun 2008, 20:22
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!

such parameter doesn

Posted: 04 Jun 2008, 20:57
by Jan
such parameter doesn't exist yet

I solve this running

Posted: 05 Jun 2008, 16:24
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!!!

Great

Posted: 05 Jun 2008, 18:00
by Jan
Great