More meta albums for cpg1.5.x - Page 2 More meta albums for cpg1.5.x - Page 2
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

More meta albums for cpg1.5.x

Started by Αndré, February 11, 2010, 03:34:53 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Αndré

Sorry I was a little bit briefly and just had a look at the page title and not the title of the table. Seems that something went wrong while creating the package. Please try the updated package from the initial post.

mipavluk


Αndré

Version 1.5 attached to initial post. New meta albums 'panorama', 'randalb', 'randuseralb' and 'randpublicalb'.

profili

Something is not working properly here. For the meta album "Movie" it show only the first uploaded videos (in my case 4 videos) and not the new ones. My default order for the thumbnails is data descending.

Another problem is the fact that under the thumbnails is the album name, not the file name.

http://www.galsh.com/
http://www.galsh.com/pic-movie.html

Αndré

Quote from: profili on August 22, 2011, 12:23:16 AM
For the meta album "Movie" it show only the first uploaded videos (in my case 4 videos) and not the new ones.
Seems to work as expected in my gallery and I also can see 6 videos in your gallery.


Quote from: profili on August 22, 2011, 12:23:16 AM
My default order for the thumbnails is data descending.
The current version disregards that setting. Maybe it will use it in a future version.


Quote from: profili on August 22, 2011, 12:23:16 AM
Another problem is the fact that under the thumbnails is the album name, not the file name.
Confirmed.

profili

QuoteThe current version disregards that setting. Maybe it will use it in a future version.

Can't you write a hack that would solve this?  :)

Αndré

Quote from: profili on August 22, 2011, 10:44:03 PM
Can't you write a hack that would solve this?  :)
Sure, but I'm currently very busy and it's not on top of my to-do list, sorry.

mayhem72

Hi thanks for this.

Is there a way to show the number of album views under the thumbnail when using 'newalb'? At the moment it is showing the number of views of the image used for the album's thumbnail.

Αndré

Version 1.6 (attached to initial post) fixes the thumbnail titles issue and the number of views for the 'newalb' meta album.

mayhem72


scifiguy

Can you provide an example of how I use the meta albums this plugin creates? The references I find the docs don't provide any detail.

Αndré

You can use them exactly as the built-in meta albums of cpg1.5.x. That means you can add them to "The content of the main page" or access them directly via:
Quotethumbnails.php?album=<meta album name>

scifiguy

That's what I thought, but I kept getting critical errors so I thought I must be doing something wrong. I've tested it again and now realize that its only the randalb, randuseralb, and randpublicalb choices that give critical errors (database error) but the others work. I wanted to use randuseralb to pull some pics from user galleries to the home page.

My gallery (bridged with phpbb3) is at: http://speculativevision.com/art/index.php

Works: http://speculativevision.com/art/thumbnails.php?album=portrait

Fails: http://speculativevision.com/art/thumbnails.php?album=randuseralb


Αndré

Please enable debug mode for everyone.

Hanna.

The link in the main post isnt working for me? :/

Αndré

Quote from: Hanna. on November 15, 2011, 05:24:51 PM
The link in the main post isnt working for me? :/
Works for me as expected. However, this plugin is also available in our plugin download section.

scifiguy


Αndré

Open codebase.php, find (right at the end)
        case 'randalb': // Random albums
        case 'randuseralb': // Random albums in user categories
        case 'randpublicalb': // Random albums in public categories
            $condition = array(
                'randalb' => '',
                'randuseralb' => 'AND a.category > '.FIRST_USER_CAT,
                'randpublicalb' => 'AND a.category < '.FIRST_USER_CAT
            );

            $album_name = cpg_fetch_icon('alb_mgr', 2)." ".$lang_plugin_more_meta_albums[$meta['album'].'_title'];
            if ($CURRENT_CAT_NAME) {
                $album_name .= " - $CURRENT_CAT_NAME";
            }

            $query = "SELECT COUNT(*)
                    FROM {$CONFIG['TABLE_PICTURES']} AS r
                    INNER JOIN {$CONFIG['TABLE_ALBUMS']} AS a ON a.aid = r.aid
                    $RESTRICTEDWHERE
                    AND approved = 'YES'
                    {$condition[$meta['album']]}
                    GROUP BY r.aid
                    HAVING COUNT(r.pid) > 0
                    ORDER BY RAND()";
            $result = cpg_db_query($query);
            $count = mysql_num_rows($result);
            mysql_free_result($result);

            $query = "SELECT p.*
                    FROM {$CONFIG['TABLE_PICTURES']} AS r
                    INNER JOIN {$CONFIG['TABLE_ALBUMS']} AS a ON a.aid = r.aid
                    $RESTRICTEDWHERE
                    AND approved = 'YES'
                    {$condition[$meta['album']]}
                    GROUP BY r.aid
                    HAVING COUNT(r.pid) > 0
                    ORDER BY RAND()
                    {$meta['limit']}";
            $result = cpg_db_query($query);
            $rowset = cpg_db_fetch_rowset($result);
            mysql_free_result($result);

            build_caption($rowset, array('ctime'));
            break;

and replace with
        case 'randalb': // Random albums
        case 'randuseralb': // Random albums in user categories
        case 'randpublicalb': // Random albums in public categories
            $condition = array(
                'randalb' => '',
                'randuseralb' => 'AND r.category > '.FIRST_USER_CAT,
                'randpublicalb' => 'AND r.category < '.FIRST_USER_CAT
            );

            $album_name = cpg_fetch_icon('alb_mgr', 2)." ".$lang_plugin_more_meta_albums[$meta['album'].'_title'];
            if ($CURRENT_CAT_NAME) {
                $album_name .= " - $CURRENT_CAT_NAME";
            }

            $query = "SELECT COUNT(*)
                    FROM {$CONFIG['TABLE_PICTURES']} AS p
                    INNER JOIN {$CONFIG['TABLE_ALBUMS']} AS r ON r.aid = p.aid
                    $RESTRICTEDWHERE
                    AND approved = 'YES'
                    {$condition[$meta['album']]}
                    GROUP BY p.aid
                    HAVING COUNT(p.pid) > 0
                    ORDER BY RAND()";
            $result = cpg_db_query($query);
            $count = mysql_num_rows($result);
            mysql_free_result($result);

            $query = "SELECT p.*
                    FROM {$CONFIG['TABLE_PICTURES']} AS p
                    INNER JOIN {$CONFIG['TABLE_ALBUMS']} AS r ON r.aid = p.aid
                    $RESTRICTEDWHERE
                    AND approved = 'YES'
                    {$condition[$meta['album']]}
                    GROUP BY p.aid
                    HAVING COUNT(p.pid) > 0
                    ORDER BY RAND()
                    {$meta['limit']}";
            $result = cpg_db_query($query);
            $rowset = cpg_db_fetch_rowset($result);
            mysql_free_result($result);

            build_caption($rowset, array('ctime'));
            break;

scifiguy


Αndré

Version 1.7 attached to initial post.

Changelog:

  • Fixed meta albums 'randalb', 'randuseralb', 'randpublicalb'
  • Added meta album 'lastcommented'
  • Added meta album 'toprateda'