FAP SUPPORT - Display Pics Inside ALL Subcategories »  Show posts from    to     

Icy Phoenix


Archived phpBB Topics (Styles, Mods, Support) - FAP SUPPORT - Display Pics Inside ALL Subcategories



solotreni [ Tue 06 Apr, 2010 21:37 ]
Post subject: FAP SUPPORT - Display Pics Inside ALL Subcategories
Hello guys,
we are using Icy on an italian railway fansite (solotreni.net).

We've got a album organized in many levels of categories, like:
A
|--- B
|---C
|---D

We'd like to display, when opening one specific category, not only the pictures inside THAT category but also the pictures inside ALL its subcategories..
For example:
A displays A, B, C, D pics
B displays B, C, D pics
C displays C, D pics
D displays D pics

Is there a way to do that?

Thank you very much for your support.

Alessandro Bariatti
SoloTreni.net


Mighty Gorgon [ Sat 17 Apr, 2010 10:09 ]
Post subject: Re: Display Pics Inside ALL Subcategories
Hi,
do you need the pictures to be shown in the category page?

If you are confident with PHP we may try to help you in that.


solotreni [ Tue 20 Apr, 2010 21:22 ]
Post subject: Re: Display Pics Inside ALL Subcategories
Yes, i need to show on the bottom of the page of a specific category not only the pics from that category but also all the images of ALL its subcategories.

I'm quite confident with PHP.. no problems.

Thank you very much.


Mighty Gorgon [ Sat 08 May, 2010 12:12 ]
Post subject: Re: Display Pics Inside ALL Subcategories
You have several ways for doing this.

The best way is querying all the subfolders of your current folder and then add a new SQL which gets the pictures using the IN sql command.

Some functions are already available for this goal:

Code: [Hide] [Select]
function album_build_tree(&$cats, &$parents, $level = ALBUM_ROOT_CATEGORY, $parent = ALBUM_ROOT_CATEGORY)

function album_get_sub_cat_ids($cur_cat_id = ALBUM_ROOT_CATEGORY, &$cats, $auth_key = ALBUM_AUTH_VIEW, $include_cur_cat_id = false)

function album_get_tree_option($selected_cat_id = ALBUM_ROOT_CATEGORY, $auth_key = ALBUM_AUTH_VIEW, $options = ALBUM_SELECTBOX_INCLUDE_ROOT)


All these functions are in includes/album_mod/album_hierarchy_functions.php, you can try to look through album code to check how these functions are used so you can create a list of all subcategories and finally with a single SQL obtain all pictures from them.




Powered by Icy Phoenix