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.

Finding the path to photos?

6 years 11 months ago
  • Robert's Avatar
    Topic Author
  • Robert
  • Offline
  • Fresh Boarder
  • Posts: 14
  • Thank you received: 0
Licenses:
JomSocial Active

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

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

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()?>">

You should have some PHP knowladge to do it :)

thank you!

6 years 11 months ago
  • Robert's Avatar
    Topic Author
  • Robert
  • Offline
  • Fresh Boarder
  • Posts: 14
  • Thank you received: 0
Licenses:
JomSocial Active

What about photos that have been uploaded to a group by other members.

How can I find the path to those photos/JPGs

Thanks
Robert

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

Hi Robert,

it should be fine, that API code will generate valid path of group avatar URL

thank you!

6 years 11 months ago
  • Robert's Avatar
    Topic Author
  • Robert
  • Offline
  • Fresh Boarder
  • Posts: 14
  • Thank you received: 0
Licenses:
JomSocial Active

But doesn't this line just access the avatar photo?

"<img src="<?php echo $group->getAvatar('avatar') . '?_=' . time()?>">"

Robert

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

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 ;)

6 years 11 months ago
  • Robert's Avatar
    Topic Author
  • Robert
  • Offline
  • Fresh Boarder
  • Posts: 14
  • Thank you received: 0
Licenses:
JomSocial Active

I understand the code.

But that code only shows the avatar photo.

What I want to know is, How do I find out what the path is to the photos that a user has uploaded?

Thanks
Robert

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

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!

6 years 11 months ago
  • Robert's Avatar
    Topic Author
  • Robert
  • Offline
  • Fresh Boarder
  • Posts: 14
  • Thank you received: 0
Licenses:
JomSocial Active

When your viewing a users profile page.

I want to be able to find the path to their uploaded photos so I can use the photos in my custom gallery. I assume the path would be different for each user

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

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

6 years 11 months ago
  • Robert's Avatar
    Topic Author
  • Robert
  • Offline
  • Fresh Boarder
  • Posts: 14
  • Thank you received: 0
Licenses:
JomSocial Active

Can you tell me what the actual code would be with the variable strings.

I would like to find the path if a guest in on a profile page.

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

HI Robert,

I am sorry, I still dont understand it, what do you want guest to do?

thank you

6 years 10 months ago
  • Robert's Avatar
    Topic Author
  • Robert
  • Offline
  • Fresh Boarder
  • Posts: 14
  • Thank you received: 0
Licenses:
JomSocial Active

If a guest views one of the profiles on my website. I want to be able to find the url path to the images(upload ed to the gallery) for that profile page only.

Robert

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

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();

Like I said before you should have PHP knowladge to implement it, or you will confuse or maybe dont uderstand what you should do then..

I suggest you hire 3rd party developer to apply this

thank you!

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