coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 themes/skins/templates => Topic started by: dke on July 17, 2006, 06:48:54 PM

Title: Could anyone help me modifying "First level of albums of a category" in my theme
Post by: dke on July 17, 2006, 06:48:54 PM
Hi all,

im using the mac osx theme, and i only have one thing that i need to change. When someone clicks lets say category "pictures" they will get this view
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fhem.bredband.net%2Fb215244%2Fcategory_album_view.jpg&hash=49471dd11e6585e3db71dda818853bd8f584d1c4)

this looks good, but i have way to many pictures on my gallery to have statistics enabled, and when i remove the statistics code

SELECT a.aid, count( p.pid )  AS pic_count, max( p.pid )  AS last_pid, max( p.ctime )  AS last_upload, a.keyword FROM cpg147_albums AS a  LEFT JOIN cpg147_pictures AS p ON a.aid = p.aid AND p.approved =  'YES' WHERE a.aid IN (4, 3, 5, 6, 7, 8, 9, 10, 11, 12, 17)GROUP BY a.aid

the thumbnails for the albums are gone, and it ends up looking bad. So what i wanted to do is to remove everything but the album name and ofcourse remove the space between that was saved for the thumbnail so it looks real good.

my guess is that its this code i need to modify to get that result, but how to actually do that i need expert help!

Title: Re: Could anyone help me modifying "First level of albums of a category" in my t
Post by: dke on July 17, 2006, 07:18:47 PM
the code above is probably wrong, the code that needs to be changed is probably the one in index.php

Title: Re: Could anyone help me modifying "First level of albums of a category" in my t
Post by: Gizmo on July 18, 2006, 01:31:43 PM
Are you just trying to remove the Statistics from the page? You're explaination is rather cumbersome and hard to follow but check out this post and see if it's what you want - http://forum.coppermine-gallery.net/index.php?topic=32833.0 (http://forum.coppermine-gallery.net/index.php?topic=32833.0).

Please use the "insert code" tags when you want to paste code into a post. It's the second row of icons and has the "#" sign on it. Also, it's hard to see your photo so attach it next time with a larger one. You do this under the "Additional Options" below the post window.
Title: Re: Could anyone help me modifying "First level of albums of a category" in my t
Post by: dke on July 18, 2006, 04:34:55 PM
its hard to explain why i would like to remove the thumbnails, maybe there is another way. The problem i have is that my index.php is loading rather slowly. Im down to 3.7 seconds now but there is one thing that bothers me and its taking up 2.2 seconds of that time. If i check the debug its this code:

    [21] => SELECT a.aid, count( p.pid )  AS pic_count, max( p.pid )  AS last_pid, max( p.ctime )  AS last_upload, a.keyword FROM cpg147_albums AS a  LEFT JOIN cpg147_pictures AS p ON a.aid = p.aid AND p.approved =  'YES' WHERE a.aid IN (4, 3, 5, 6, 7, 8, 9, 10, 11, 12, 17)GROUP BY a.aid (2.191s)

so i disabled that from loading by putting /* */ on this part of the code in index.php (2 places)

    //This query will fetch album stats and keyword for the albums
    $sql = "SELECT a.aid, count( p.pid )  AS pic_count, max( p.pid )  AS last_pid, max( p.ctime )  AS last_upload, a.keyword" .
            " FROM {$CONFIG['TABLE_ALBUMS']} AS a " .
            " LEFT JOIN {$CONFIG['TABLE_PICTURES']} AS p ON a.aid = p.aid AND p.approved =  'YES' ".
            "WHERE a.aid IN $album_set" . "GROUP BY a.aid";
    $alb_stats_q = cpg_db_query($sql);
    $alb_stats = cpg_db_fetch_rowset($alb_stats_q);
    mysql_free_result($alb_stats_q);


this does remove the loading time, but also it removes my thumbnails on my albums, and all the albums seem "empty" with 0 files reported, but once you click em they are still there. So i wanted to modify the look of the albumlist cause of this. But if there is another way (maybe buy modifying the code i disabeled and only disable the parts that causing the long load time) i would clearly like to do that insted, i just though it would be much more simple to modify the theme.

Thanks for your help!
Title: Re: Could anyone help me modifying "First level of albums of a category" in my t
Post by: Gizmo on July 18, 2006, 07:54:31 PM
OK... now we're getting to the bottom of your request. You are now saying you have a slow load time and you tried to fix it my editing the code. This is not my area of expertise in CPG (well... none is for that fact...) but you mentioned in your first post that you have a lot of pictures and albums in your gallery. On your main page, are you loading the "random" and "latest" photos? Check out this post - http://forum.coppermine-gallery.net/index.php?topic=33967.0 (http://forum.coppermine-gallery.net/index.php?topic=33967.0) and see a quote from Nibbler,
Quote
Try disabling 'Show number of linked files'  in config.
Also do a search on tweaking Coppermine.

My fault for not asking in the first place but post a link to your gallery and a debug report - http://coppermine-gallery.net/demo/cpg14x/docs/index.htm#debug_mode (http://coppermine-gallery.net/demo/cpg14x/docs/index.htm#debug_mode). If you've mangled any files other than what's in your theme folder, put them back before generating the debug report.