• Welcome to the Chevereto user community!

    Here users from all over the world gather around to learn the latest about Chevereto and contribute with ideas to improve the software.

    Please keep in mind:

    • ๐Ÿ˜Œ This community is user driven. Be polite with other users.
    • ๐Ÿ‘‰ Is required to purchase a Chevereto license to participate in this community (doesn't apply to Pre-sales).
    • ๐Ÿ’ธ Purchase a Pro Subscription to get access to active software support and faster ticket response times.
  • Chevereto Support CLST

    Support response

    Support checklist

    • Got a Something went wrong message? Read this guide and provide the actual error. Do not skip this.
    • Confirm that the server meets the System Requirements
    • Check for any available Hotfix - your issue could be already reported/fixed
    • Read documentation - It will be required to Debug and understand Errors for a faster support response

albums on homepage

Check route dashboard, there is an album list there that you can copy elsewhere.
 
Check route dashboard, there is an album list there that you can copy elsewhere.
couldn't understand your reply...route.dashboard in cpanel got more than thousand lines so where to change settings and if u saying about route dashboard on website than it just tell the name of routing of images and albums.....so please make it clear
 
There, route.albums.php

PHP:
<?php

/* --------------------------------------------------------------------

  Chevereto
  http://chevereto.com/

  @author    Rodolfo Berrios A. <http://rodolfoberrios.com/>
            <inbox@rodolfoberrios.com>

  Copyright (C) Rodolfo Berrios A. All rights reserved.
 
  BY USING THIS SOFTWARE YOU DECLARE TO ACCEPT THE CHEVERETO EULA
  http://chevereto.com/license

  --------------------------------------------------------------------- */

$route = function($handler) {
    try {
       
        $logged_user = CHV\Login::getUser();
       
        if(!CHV\getSetting('website_explore_page') && !$logged_user['is_admin']) {
            return $handler->issue404();
        }
       
        if($handler->isRequestLevel(2)) return $handler->issue404(); // Allow only 3 levels
       
        // Build the tabs
        $tabs = [
            [
                'list'        => true,
                'tools'        => true,
                'label'        => _s('Most recent'),
                'id'        => 'list-most-recent',
                'params'    => 'list=albums&sort=date_desc&page=1',
                'current'    => $_REQUEST['sort'] == 'date_desc' or !$_REQUEST['sort'] ? true : false,
            ],
            [
                'list'        => true,
                'tools'        => true,
                'label'        => _s('Oldest'),
                'id'        => 'list-most-oldest',
                'params'    => 'list=albums&sort=date_asc&page=1',
                'current'    => $_REQUEST['sort'] == 'date_asc',
            ]
        ];

        $current = FALSE;
        foreach($tabs as $k => $v) {
            if($v['current']) {
                $current = TRUE;
            }
            $tabs[$k]['type'] = 'albums';
            $route_path = G\get_route_name() . '/';
            $tabs[$k]['url'] = G\get_base_url($route_path . '?' . $tabs[$k]['params']); // Note: Routing explore is adding /explore
        }
        if(!$current) {
            $tabs[0]['current'] = TRUE;
        }
       
        // List
        $list_params = CHV\Listing::getParams(); // Use CHV magic params
        $list = new CHV\Listing;
        $list->setType('albums');
        $list->setOffset($list_params['offset']);
        $list->setLimit($list_params['limit']); // how many results?
        $list->setItemsPerPage($list_params['items_per_page']); // must
        $list->setSortType($list_params['sort'][0]); // date | size | views | likes
        $list->setSortOrder($list_params['sort'][1]); // asc | desc
        $list->setRequester(CHV\Login::getUser());
        $list->setWhere('WHERE album_image_count > 4');
        $list->output_tpl = 'albums';
        $list->exec();
       
        $handler::setVar('pre_doctitle', _s('Albums'));
        $handler::setVar('tabs', $tabs);
        $handler::setVar('list', $list);
       
        if($logged_user['is_admin']) {
            $handler::setVar('user_items_editor', false);
        }
       
        $handler->template = 'explore';
       
    } catch(Exception $e) {
        G\exception_to_error($e);
    }
};
 
i think u meant route.explore.php because route.album.php have different code lines......it brings some changes in homepage but it says there is nothing to show here when i already uploaded 2 albums and both are public

I sent u my ftp account details so u can look in to it thanks
 
Is the same listing API, that's what matters. I just sent you a complete route.albums.php file, that will generate /albums. I'm sorry but I don't do custom work, you have all you need right there.
 
Please understand the following: The system does what is listed here and what you can see here. You are asking to get something that the system doesn't do by default, that being said... I just gave you the codes that can help you to achieve what you need, actually that code generates an albums route that anyone can use.

Sadly I can't go to your server and do everything for you because of the simple reason that I don't do free customization work. I spend my time adding things for everybody, not for one single person. I've said before that albums in explore will be added soon so you either wait or you code your own version of it.

Hope you can understand.
 
Sorry, the code I gave shows albums with 4 or more images (looks prettier).

PHP:
$list->setWhere('WHERE album_image_count > 4');

I commented that line and now it lists all albums, hope it helps.
 
Last edited:
I used Rodolfo's code to list albums... works fine.
Then I tried to list users using the same code but changed the type to 'users'. Works and shows all the users also but...

the users are not filtered ('WHERE user_image_count > 0') and not sorted as they should be. Filter and sorting will only apply once I click on the reload broser button

Any ideas what's the issue?
 
PHP:
<?php

/* --------------------------------------------------------------------

  Chevereto
  http://chevereto.com/

  @author    Rodolfo Berrios A. <http://rodolfoberrios.com/>
            <inbox@rodolfoberrios.com>

  Copyright (C) Rodolfo Berrios A. All rights reserved.
 
  BY USING THIS SOFTWARE YOU DECLARE TO ACCEPT THE CHEVERETO EULA
  http://chevereto.com/license

  --------------------------------------------------------------------- */

$route = function($handler) {
    try {
     
        $logged_user = CHV\Login::getUser();
     
        if(!CHV\getSetting('website_explore_page') && !$logged_user['is_admin']) {
            return $handler->issue404();
        }
     
        if($handler->isRequestLevel(2)) return $handler->issue404(); // Allow only 3 levels
     
        // Build the tabs
        $tabs = [
                    [
                        'list'        => true,
                        'tools'        => false,
                        'label'        => _s('Top Users'),
                        'id'        => 'list-top-users',
                        'params'    => 'list=users&sort=image_count_desc&page=1',
                        'current'    => $_REQUEST['sort'] == 'image_count_desc' or !$_REQUEST['sort'] ? true : false,
                    ],
                    [
                        'list'        => true,
                        'tools'        => false,
                        'label'        => _s('Most recent'),
                        'id'        => 'list-most-recent',
                        'params'    => 'list=users&sort=date_desc&page=1',
                        'current'    => $_REQUEST['sort'] == 'date_desc',
                    ],
                    [
                        'list'        => true,
                        'tools'        => false,
                        'label'        => _s('Oldest'),
                        'id'        => 'list-most-oldest',
                        'params'    => 'list=users&sort=date_asc&page=1',
                        'current'    => $_REQUEST['sort'] == 'date_asc',
                    ]
        ];

        $current = FALSE;
        foreach($tabs as $k => $v) {
            if($v['current']) {
                $current = TRUE;
            }
            $tabs[$k]['type'] = 'users';
            $route_path = G\get_route_name() . '/';
            $tabs[$k]['url'] = G\get_base_url($route_path . '?' . $tabs[$k]['params']); // Note: Routing explore is adding /explore
        }
        if(!$current) {
            $tabs[0]['current'] = TRUE;
        }
     
        // List
        $list_params = CHV\Listing::getParams(); // Use CHV magic params
        $list = new CHV\Listing;
        $list->setType('users');
        $list->setWhere('WHERE user_image_count > 0');
        $list->setOffset($list_params['offset']);
        $list->setLimit($list_params['limit']); // how many results?
        $list->setItemsPerPage($list_params['items_per_page']); // must
        $list->setSortType($list_params['sort'][0]); // date | size | views | likes
        $list->setSortOrder($list_params['sort'][1]); // asc | desc
        $list->setRequester(CHV\Login::getUser());
        $list->output_tpl = 'users';
        $list->exec();
     
        $handler::setVar('pre_doctitle', _s('Chicks'));
        $handler::setVar('tabs', $tabs);
        $handler::setVar('list', $list);
     
        if($logged_user['is_admin']) {
            $handler::setVar('user_items_editor', false);
        }
     
        $handler->template = 'explore';
     
    } catch(Exception $e) {
        G\exception_to_error($e);
    }
};
 
When you hack a listing you also need to hack route.json.php
 
No idea what to do. ๐Ÿ™ You did it with the albums, why it's working there?

Works for me. This is $list output with its query:

upload_2017-5-20_13-11-34.png

It is listing for user_image_count > 0. Your hack works only with classic pagination, like I said for endless scrolling you need to also hack route.json.php, just look for the listing case and add your clause.

Modifications are not included in support, I can only point you to the right direction not code it for you. Code it for you has a quote but at this time I'm not taking requests at all I'm too busy adding new features to the system.

Having said that, v3.9.0 will include album and users listings out of the box, no editing needed.

Cheers,
Rodolfo.
 
Back
Top