Hello
1) login as active user with tons of albums
2) navigate to main stream
3) upload photo(s) with share box
4) chose album in dropdown list. Try to find default "stream photos" album.
Hi,
Please always give us private information(backend, ftp or cpanel) or site information.. so we can help the issue faster without search again on your old topics.. let me know once you done ;)
thank you
Hi. I added private info, but supposed it's no need for this case. :)
For example I have 1000+ albums and want to upload photo with main stream share box to default album (Фото ленты). But I have to scroll dropdown list and find default album in 1000+ list. It kinda difficult. It would be great if default album will be on the top of list or pre chosed :)
Thanks.
sometimes the issue can't be replicated on our end, so thats why the client site information is needed :)
Actually the stream photos album always show on the first.. because the ordering by album id , it can be your stream album has been deleted and created new one.. which is the id is bigger than another album ids
Hi. Thanks for explanation :) Yes, on clear site it works perfect (default stream album always on top). May be I really deleted default album on my life site and recreated it, like you said.
I just edited DB, folder etc and made default album lower ID "15". And it didn't helped: in sharebox default album "Основной альбом") was first on top only after I uploaded photos to it. Like sorting by "latest updated album" (not ID).
Day later I created "latest album" and uploaded photos to it.
Now, when I try to upload photo with share box, "default album" is not on top (it under "latest album").
Result:
Hi,
please also make sure the "created" date is set lower than the another albumid, look on table #__community_photos_albums.
thank you!
Hi. Yes, "created" date was'n set lower than the another albumid.
Steps:
1) I changed "created" and checked that ID and "created" is lower than the another albumid.
please you look this file components/com_community/modules/photos.php, look on this function getAlbumPhotoCount() echo the query there
echo $query
Hi. I can find lots of string "getAlbumPhotoCount" in file, but don't know what is needed. So I also attached it. Can you pldease look at it?
$result = $this->getAlbumPhotoCount($where, $limit, $limitstart);
public function getAlbumPhotoCount($where = '', $limit = NULL, $limitstart = NULL, $orderBy = '') ...
$result = ($pagination) ? $this->getAlbumPhotoCount($extraSQL, $limit, $limitstart,$order ) : $this->getAlbumPhotoCount($extraSQL, null, null, $order);
}elseif($sort == 'featured_only'){
$result = $this->getAlbumPhotoCount($extraSQL, NULL, NULL, ' ORDER BY '.$db->quoteName('name').' ASC');
}elseif($sort == 'name'){
$result = ($pagination) ? $this->getAlbumPhotoCount($extraSQL, $limit, $limitstart, ' ORDER BY '.$db->quoteName('name').' ASC') : $this->getAlbumPhotoCount($extraSQL, NULL, NULL, ' ORDER BY '.$db->quoteName('name').' ASC');
}elseif($sort == 'hit') {
$result = ($pagination) ? $this->getAlbumPhotoCount($extraSQL, $limit, $limitstart, ' ORDER BY '.$db->quoteName('hits').' DESC') : $this->getAlbumPhotoCount($extraSQL, null, null, ' ORDER BY '.$db->quoteName('hits').' DESC');
}else{
$result = ($pagination) ? $this->getAlbumPhotoCount($extraSQL, $limit, $limitstart) : $this->getAlbumPhotoCount($extraSQL);
}
$result = ($limit === '' || $limitstart === '') ? $this->getAlbumPhotoCount($extraSQL) : $this->getAlbumPhotoCount($extraSQL, $limit, $limitstart);
$result = ($limit === '' || $limitstart === '') ? $this->getAlbumPhotoCount($extraSQL) : $this->getAlbumPhotoCount($extraSQL, $limit, $limitstart);
etc.
Thanks.
on that function you can find this code, please search it
if($orderBy == ''){
$orderBy =' ORDER BY a.'.$db->quoteName('created').' DESC';
}
Hi. It should looks like that:...? [just add "echo $query;"?]
I checked, but nothing changed :(if($orderBy == ''){
$orderBy =' ORDER BY a.'.$db->quoteName('created').' DESC';
echo $query;
}
please put the echo $query; before this code on that function
$db->setQuery($query);
Sorry, but I can't find the right place to put code. Should I paste "echo $query;" to there:
echo $query;
$db->setQuery($query);
try {
$total = $db->loadResult();
} catch (Exception $e) {
JFactory::getApplication()->enqueueMessage($e->getMessage(), 'error');
}
return $total;
}
public function getAlbumPhotoCount($where = '', $limit = NULL, $limitstart = NULL, $orderBy = '') {
$db = $this->getDBO();
if($orderBy == ''){
$orderBy =' ORDER BY a.'.$db->quoteName('created').' DESC';
}
SELECT COUNT(*) FROM `#__community_photos_albums` AS a WHERE a.type != '' AND a.creator='62' AND a.groupid='0' AND a.eventid= '0' AND a.type NOT LIKE 'profile.avatar' AND a.type NOT LIKE 'profile.Cover' AND a.type NOT LIKE 'profile.gif'
Hi,
I checked by myself, the order by is based on "created" date, please you check again the created system album is lower than another album
SELECT a. *, COUNT (DISTINCT (b.id)) AS count, MAX (b.created) AS lastupdated, c.thumbnail as thumbnail, c.storage AS storage, c.id as photoid FROM `#__ community_photos_albums` AS a LEFT JOIN `#__ community_photos` AS b ON a.id = b.albumid LEFT JOIN` #__ community_photos` AS c ON a.photoid = c.id WHERE a.type! = '' AND a.creator = '62 'AND a .groupid = '0' AND a.eventid = '0' AND a.type NOT LIKE 'profile.avatar' AND a.type NOT LIKE 'profile.Cover' AND a.type NOT LIKE 'profile.gif' GROUP BY a .id ORDER BY a.`created` DESC