When I add photos to a group, I see that the group photos get saved in a directory called "domain.com/images/grouphotos/1/9/file.jpg"
I want to be able to create my our widget that looks for these JPG files. But I need to be able to write some code to be able to find the JPG files. So If I'm on the group page, how can I find out what the directory path is to the JPG files of the group that I'm viewing.
I'm guessing it has something to do with the "1" & "9" directories.
Let me know, Thank you,
Robert
Ho Robert,
To get the avatar group you can use our group API, here is the sample code
<?php
$group = JTable::getInstance('Group', 'CTable');
$group->load($GROUPID);
?>
<img src="<?php echo $group->getAvatar('avatar') . '?_=' . time()?>">
Hi Robert,
it should be fine, that API code will generate valid path of group avatar URL
thank you!
Hi Robert,
that code is to show the image with html code, you should have php and html knowladge to apply it, so you will undertsand ;)
Hi Robert,
The path is inside this folder JOOMLA_ROOT/images/grouphotos/ is that information do you need?
If not please explain more, what do you need what do you want to do, maybe I can give you better pointer :)
thank you!
Hi Robert,
Yes that is different, depend the userID
here is the format
normal user photos
JOOMLA_ROOT/images/photos/USERID/ALBUMID
group photos
JOOMLA_ROOT/images/groupphotos/GROUPID/ALBUMID
event photos
JOOMLA_ROOT/images/eventphotos/EVENTID/ALBUMID
HI Robert,
I am sorry, I still dont understand it, what do you want guest to do?
thank you
Hi,
For profile you can check this API
documentation.jomsocial.com/wiki/JomSocial_User_Object
, to get the image patch you can use this function
$cuser->getAvatar();