• 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

explorer page as default (index)

BMWracing

Chevereto Member
With the older versions I was able to copy explore.php and rename it to index.php to set it as a starting page for one of my sites.

With the latest version this isn't working unfortunately. Could you please tell us how to do this, or add some kind of feature to the admin panel? I'm sure there are more users which would like to see this.

Thanks!
 
Use this one as index.php:

PHP:
<?php if(!defined('access') or !access) die('This file cannot be directly accessed.'); ?>
<?php G\Render\include_theme_header(); ?>

<?php CHV\Render\show_banner('explore_after_top'); ?>

<div class="content-width">
   
    <?php
       
        // Use CHV magic params
        $list_params = CHV\Listing::getParams();
       
        $type = 'images';
        $category = function_exists('get_category') ? $category : NULL;
       
        try {
            global $list;
            $list = new CHV\Listing;
            $list->setType($type); // images | users | 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
            $list->setSortOrder($list_params['sort'][1]); // asc | desc
            if($category) {
                $list->setCategory($category['id']);
            }
            $list->setRequester(CHV\Login::getUser());
            $list->exec();
        } catch(Exception $e) {
            G\exception_to_error($e);
        }
    ?>
   
    <div class="header header-tabs margin-bottom-10 follow-scroll">
        <h1><strong><?php echo $category ? $category['name'] : _s('Explore'); ?></strong></h1>
        <?php
            global $tabs; // Define it as a global to bind it on the included tab.php
            $tabs = array(
                0 => array(
                    'list'        => true,
                    'tools'        => true,
                    'label'        => _s('Most recent'),
                    'id'        => 'list-most-recent',
                    'params'    => 'list=images&sort=date_desc&page=1',
                    'current'    => $_REQUEST['sort'] == 'date_desc' or !$_REQUEST['sort'] ? true : false,
                ),
                1 => array(
                    'list'        => true,
                    'tools'        => true,
                    'label'        => _s('Oldest'),
                    'id'        => 'list-most-oldest',
                    'params'    => 'list=images&sort=date_asc&page=1',
                    'current'    => $_REQUEST['sort'] == 'date_asc',
                ),
                2 => array(
                    'list'        => true,
                    'tools'        => true,
                    'label'        => _s('Most viewed'),
                    'id'        => 'list-most-viewed',
                    'params'    => 'list=images&sort=views_desc&page=1',
                    'current'    => $_REQUEST['sort'] == 'views_desc',
                )
            );
           
            $current = false;
            foreach($tabs as $k => $v) {
               
                if($category) {
                    $tabs[$k]['params_hidden'] .= 'category_id=' . $category['id'];
                }
               
                if($v['current']) {
                    $current = true;
                }
                $tabs[$k]['type'] = 'images';
                $route_path = G\get_route_name();
                if($category) {
                    $route_path .= '/' . $category['url_key'];
                }
                $tabs[$k]['url'] = G\get_base_url($route_path . '/?' . $tabs[$k]['params']);
            }
           
            if(!$current) {
                $tabs[0]['current'] = true;
            }
           
        ?>
       
        <?php G\Render\include_theme_file("snippets/tabs"); ?>
       
        <?php
            if(is_admin()) {
                global $user_items_editor;
                $user_items_editor = false;
                G\Render\include_theme_file("snippets/user_items_editor");
        ?>
        <div class="header-content-right phone-float-none">
            <?php G\Render\include_theme_file("snippets/listing_tools_editor"); ?>
        </div>
        <?php
            }
        ?>
       
    </div>
   
    <div id="content-listing-tabs" class="tabbed-listing">
        <div id="tabbed-content-group">
            <?php
                G\Render\include_theme_file("snippets/listing");
            ?>
        </div>
    </div>
   
</div>

<?php G\Render\include_theme_footer(); ?>
 
It works! Thanks! Would be great if you could add this to the dashboard functionality as an option. Every update will cause this change to be lost now and I'm sure others would like to see this as an option.

Thanks!
 
If I start to make a configurable setting for anything we will end up with an endless list of settings isn't?. In your case you could do a route override with this code:

app/routes/overrides/route.index.php
PHP:
<?php
$route = function($handler) {
    $handler::mapRoute('explore');
};

That will work from 3.4.5 and above.
 
By doing this we are missing big upload button and header image/black background, good part is we get endless listings,
I request Rodolfo that configurable setting in future we need upload button, responsive header image, and endless listings.
 
By doing this we are missing big upload button and header image/black background, good part is we get endless listings,
I request Rodolfo that configurable setting in future we need upload button, responsive header image, and endless listings.

Please open a new request for that.
 
This seems to break the selection box for images as wel.

In other words I cannot select images with the checkbox for some reason? To delete or get embed tags etc.

Edit: some times it works and some times it doesn't? After refreshing/reopening for some reason I see the selection option again.. weird..

Would be great if you could add this specific feature in the dashboard. I know endless options in the dashboard is not the option, but I'm pretty sure this is a general feature many people would like.
 
Last edited:
I did and I'm also seeing the same problem on my other site WITHOUT the explorer modification (latest chevereto version)
 
Last edited:
Explorer/category listing selection works only for admin. The one that users have is on their profiles.
 
If I start to make a configurable setting for anything we will end up with an endless list of settings isn't?. In your case you could do a route override with this code:

app/routes/overrides/route.index.php
PHP:
<?php
$route = function($handler) {
    $handler::mapRoute('explore');
};

That will work from 3.4.5 and above.

I had the override you mentioned above and with version 3.5.4 worked perfect,
now that I upgraded to 3.5.6, the homepage (in this case explore) does not show any images.

Do I have to chage the code for the override?
 
Since 3.4.5 the MVC abstraction is improved which means that all those $list and $tab stuff goes directly at route level, not theme level. So for route.index.php is not enough just do a map, you need to include the actual route code.

So you can fool the thing by doing this:
PHP:
<?php
$route = function($handler) {
    $handler::mapRoute('explore');
    include G_APP_PATH_ROUTES . 'route.explore.php';
    return $route($handler);
};
 
Back
Top