• 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

Most Viewed

You only need to override the language string. Create an "en.po" file in app/content/languages/overrides with the following contents:

Code:
msgid "Most viewed"
msgstr "Popular"
 

Attachments

  • en.zip
    182 bytes · Views: 6
Ah :D Thanks so much :D

And for the other question? :)
Possible to make a page with only the "popular" images?
 
Like /popular? You will need to clone route.explore.php and name it route.popular.php and then trim all the extra listing stuff from that file.
 
This is the code that should be left, when taking away the others right?

Code:
            [

                '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',

            ],

        ];

--
And add the same code in explorer in a new page e.g popular.php?
 
I can't get the "most viewd" to only show on the page...

this is code: https://norpx.no/popular ->> If i remove the most oldest, i only get up the most recent images, and not the most viewd.
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('Cant get this removed'),
                'id'        => 'list-most-oldest',
                'params'    => 'list=images&sort=date_asc&page=1',
                'current'    => $_REQUEST['sort'] == 'date_asc',
            ],
            [
                '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',
            ],
        ];
        if(CHV\getSetting('enable_likes')) {
            $tabs[] = [
                'list'        => TRUE,
                'tools'        => TRUE,
                'label'        => _s('this is not something i cant remove'),
                'id'        => 'list-most-liked',
                'params'    => 'list=images&sort=likes_desc&page=1',
                'current'    => $_REQUEST['sort'] == 'likes_desc',
            ];
        }
        $current = FALSE;
        foreach($tabs as $k => $v) {
            if($v['current']) {
                $current = TRUE;
            }
            $tabs[$k]['type'] = 'images';
            $route_path = CHV\getSetting('homepage_style') == 'route_explore' ? NULL : (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('images');
        $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->exec();
      
        $handler::setVar('pre_doctitle', _s('Explore'));
        $handler::setVar('meta_keywords', NULL);
        $handler::setVar('category', NULL);
        $handler::setVar('tabs', $tabs);
        $handler::setVar('list', $list);
      
        if($logged_user['is_admin']) {
            $handler::setVar('user_items_editor', false);
        }
      
    } catch(Exception $e) {
        G\exception_to_error($e);
    }
};
 
Last edited:
pfft, i cant get this to work... I tried so many times now.. :(:oops:
I only get the "last uploaded images", and NOT the most viewed.. o_O
 
Try forcing the listing params:

PHP:
        $list->setSortType('views'); // date | size | views | likes
        $list->setSortOrder('desc'); // asc | desc

Please note that modifications are on your own and is not part of the package.

Cheers,
Rodolfo.
 
That worked :)

Alright then.. May i ask what is "included" in my license?

Updates + Tech support. Everything else is on my goodwill, which sometimes is a very scarce commodity.

Glad to help.
 
Last edited:
Back
Top