Notice

The forum is in read only mode.

Support Forum

Welcome! Support Forums have been reactivated
Welcome the Technical Support section. Help us in assisting you by providing us with a concise and descriptive elaboration of your issues. Be specific and if possible, provide us with a step-by-step instruction in replicating your problem.

Make default album pre'chosed when user upload photos to the stream

6 years 8 months ago
Licenses:
JomSocial Active

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.



Result: user has tons of album, so it's difficult to scroll down and impossible to find default album.

I would like to suggest:
Always display "default album" at the top of this dropdown list. Or may be make it "pre chosed" if impossible move to the top?
Thanks.


Sorry for my English
Attachments:
6 years 8 months ago
  • Dimas's Avatar
  • Dimas
  • Visitor
  • Thank you received: 0
Licenses:

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

6 years 8 months ago
Licenses:
JomSocial Active

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.


Sorry for my English
6 years 8 months ago
  • Dimas's Avatar
  • Dimas
  • Visitor
  • Thank you received: 0
Licenses:

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

6 years 8 months ago
Licenses:
JomSocial Active

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:



And seems "default album" is going to move lower (if I will not use it). And in top always will be latest updated album.

Can you please help with it?
User I'd: 62, album I'd: 15.

Thanks.


Sorry for my English
Attachments:
6 years 8 months ago
  • Dimas's Avatar
  • Dimas
  • Visitor
  • Thank you received: 0
Licenses:

Hi,

please also make sure the "created" date is set lower than the another albumid, look on table #__community_photos_albums.

thank you!

6 years 8 months ago
Licenses:
JomSocial Active

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.



2) I uploaded photo to "default stream album".
3) I created "new custom created album" at gallery section and uploaded few photos to it.
4) I'm going to upload photo with animal (hyena) to "default stream album", but...
Result 1 :( : "default stream album" is lower than "new custom created album". Looks like latest updated album ("new custom created album") is on top.


5) Anyway, I uploaded photo with animal (hyena) to "default stream album".
6) Refreshed Main Stream page.
7) I'm going to upload photo with human face to "default stream album".
Result 2: "default stream album" is on top. May be because it latest updated album (with animal photo)?


I don't know what is happening on life site :(

P.S: On "Test clear site #1" user first uploaded photos to default stream album. And everything works OK. Default stream photos is always on top:



P.P.S: On other "Test clear site #2" (for example) user first uploaded photos to custom created album. And there is nothing to do because "ID1" is allready exist and I have no idea how to edit DB to make ID lower. Based on this case I suggest to find the way to display "Stream album" on top independently of ID and created date.


Thanks for help.


Sorry for my English
6 years 8 months ago
  • Dimas's Avatar
  • Dimas
  • Visitor
  • Thank you received: 0
Licenses:

please you look this file components/com_community/modules/photos.php, look on this function getAlbumPhotoCount() echo the query there

echo $query

what do you get ? by default it should show query with order by "created"

6 years 8 months ago
Licenses:
JomSocial Active

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.


Sorry for my English

This message has an attachment file.
Please log in or register to see it.

6 years 8 months ago
  • Dimas's Avatar
  • Dimas
  • Visitor
  • Thank you received: 0
Licenses:

on that function you can find this code, please search it

if($orderBy == ''){
            $orderBy =' ORDER BY a.'.$db->quoteName('created').' DESC';
        }

and put echo the query on that function..

6 years 8 months ago
Licenses:
JomSocial Active

Hi. It should looks like that:...? [just add "echo $query;"?]

if($orderBy == ''){
$orderBy =' ORDER BY a.'.$db->quoteName('created').' DESC';
echo $query;
}

I checked, but nothing changed :(
Latest updated albums still on top (upper than default album).


Sorry for my English
6 years 8 months ago
  • Dimas's Avatar
  • Dimas
  • Visitor
  • Thank you received: 0
Licenses:

please put the echo $query; before this code on that function

$db->setQuery($query);

6 years 8 months ago
Licenses:
JomSocial Active

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';
}



after vefore sharebox display this code:

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'


Thanks.


Sorry for my English
6 years 8 months ago
  • Dimas's Avatar
  • Dimas
  • Visitor
  • Thank you received: 0
Licenses:

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

Moderators: Piotr Garasiński
Powered by Kunena Forum

Join 180,000 websites creating Amazing communities

JomSocial is the most complete, easy-to-use addon that turns Joomla CMS into a
full -fledged, social networking site

TRY NOW BUY NOW