Hi can you help me putting albums on homepage instead of images.....i can see its loading explore.php but there is no setting to change routing from image to album Thanks
http://mazakmasti.net/
http://mazakmasti.net/
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:
Support response
Support checklist
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 clearCheck route dashboard, there is an album list there that you can copy elsewhere.
<?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);
}
};
it is not generating /albums......check website its still loading imagesIs 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.
I already got 2 albums uploaded and followed the procedure for adding extra route but looks like not working....you can make documentation bit more easy with few examplesYou don't have albums yet. http://mazakmasti.net/albums
<?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);
}
};
No idea what to do. ๐ You did it with the albums, why it's working there?