replace category with user galleries on the root page. replace category with user galleries on the root page.
 

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

replace category with user galleries on the root page.

Started by Hellblazer, April 16, 2011, 11:02:02 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Hellblazer

When you are in the root page this is what I would like to see

http://iluvatarsgrace.com/testforum2/Gallery/index.php?cat=1

instead of

http://iluvatarsgrace.com/testforum2/Gallery/index.php

Bassically, I'd like to have the user gallery already expanded with the user gallery humbnails. As it stands now, to see the user gallery you have to click on it in the catergory section, I don't like that.

Is there a way to change it so that on the root page, the category section doesn't show, but instead it is replaced right away with the user gallery section?

Αndré

Here's the solution of the same question asked in the German support board:
Open index.php, find
                    if ($breadcrumb != '' || count($cat_data) > 0) {
                        theme_display_cat_list($breadcrumb, $cat_data, $statistics);
                    }

and replace with
                    if ($breadcrumb != '' || count($cat_data) > 0) {
                        if (isset($cat) && $cat != USER_GAL_CAT) {
                            starttable(-1, 'Benutzeralben');
                            echo "<tr><td>";
                            list_users();
                            echo "</td></tr>";
                            endtable();
                        }
                        theme_display_cat_list($breadcrumb, $cat_data, $statistics);
                    }

Hellblazer

:) Thanks. I can't read german so I couldn't find it hehe, but thanks for helping out.

Hellblazer

Just tested it, It's almost that  :)

The category is still showing, where you have the line

Category:
Users Galleries                                                  1 album  4 pictures

I wand that to dissapear and only have the users galleries to show up. At the moment with the fix that you gave me the category is still showing, and when I click on one of the users albums that shows, it brings to an other page of Users Galleries that I have to press on the albums again to view their pictures.

Hellblazer

Sorry for the tripple consecutive post, there's no edit button so I can't add the info in the same post.

Here's what I'm talking about where you see the category section still.

http://iluvatarsgrace.com/testforum2/Gallery/index.php

Αndré

Remove / comment out
theme_display_cat_list($breadcrumb, $cat_data, $statistics);
to remove
Quote from: Hellblazer on April 18, 2011, 10:51:25 PM
Users Galleries                                                  1 album  4 pictures


Quote from: Hellblazer on April 18, 2011, 10:51:25 PM
when I click on one of the users albums that shows, it brings to an other page of Users Galleries that I have to press on the albums again to view their pictures.
That's intended as every user has its own category with personal albums. Do you want to display all user albums on the start page?

Hellblazer

Hmm. That's a very good question, if it displays all the user albums it could get very messy. Would there be a way to randomize the user galleries that is displayed?

Αndré

What exactly is a user gallery in your eyes? Do you mean the different user categories or the different albums that each user creates in his personal category?

Hellblazer

For me it's the albums. What I'm thinking is that on the root page of the gallery, where the user galeries are shown (since I've replaced the category section with your help) I would like to see a random 3 rows by 5 colums of random albums.

Also I was thinking that the title "Users galleries" which was previously named Benutzeralben in german, should be a link that would bring to the users gallery page where people see all the albums. Don't know if it's doable?

Αndré

Quote from: Hellblazer on April 19, 2011, 12:25:05 PM
Also I was thinking that the title "Users galleries" which was previously named Benutzeralben in german, should be a link that would bring to the users gallery page where people see all the albums. Don't know if it's doable?
Just add the link to the title, e.g.
Quotestarttable(-1, '<a href="index.php?cat=1">User galleries</a>');


Quote from: Hellblazer on April 19, 2011, 12:25:05 PM
I would like to see a random 3 rows by 5 colums of random albums.
I'd create a new meta album in that case, which you can add in the Coppermine config. I'll create the code soon.

Αndré

Here the instructions how you can display random user albums on your start page. I assume unmodified core files.

1. Open include/functions.inc.php, find
case 'random': // Random files
and above, add
    case 'randuseralb':

        $album_name = '<a href="index.php?cat=1">User galleries</a>';

        $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'
                AND a.category > 10000
                GROUP BY r.aid
                HAVING COUNT(r.pid) > 0
                ORDER BY RAND()
                $limit";
        $result = cpg_db_query($query);
        $count = mysql_num_rows($result);
        mysql_free_result($result);

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

        build_caption($rowset);

        $rowset = CPGPluginAPI::filter('thumb_caption_randuseralb', $rowset);

        return $rowset;
        break;



2. Open your theme's theme.php file and search the function theme_display_thumbnails. If it doesn't exist, copy it from themes/sample/theme.php. Then, find
'albums' => array('lastalb')
and replace with
'albums' => array('lastalb', 'randuseralb')


3. Add
randuseralb,3
to The content of the main page in the Coppermine config.


Maybe I'll add that album to the more_meta_albums plugin if I have some more spare time.

Αndré