Thanks V@no, i never thought teaching something to you, i have follow many of your MODs, and yes, this MOD have many issues:
Also I have a few issue to comment:
1) your code have no filter regarding visitor's permissions, which mean visitors might see categories they are not supposed to see.
2) since you don't use 4images built-in database class, its not compatible with integrated 4images or if someone uses non-mysql database.
That's because on my site everyone can see any photo, maybe finishing my first attempt this can be fixed, someone want to help with code?
3) the code doesn't use template class for links, this will create problem for people using SEO mod
Actually I'm using the SEO mod, people just need to change
Example
<a href=categories.php?cat_id={$row['CAT_ID']}>
for
"<a href=modelos_mujeres_{$row['CAT_ID']}.htm>#" -with correspondig keywords-
This is not the best way, but it works
4) All data for each category is already loaded into $cat_cache array, you don't need query database for that. Because of that each of your database query can be simplified to query 4images_images table only.
Let me research about it
Thanks!