collapse

* User Info

 
 
Welcome, Guest. Please login or register.
Did you miss your activation email?

* Recent Posts

Can't get RSG "Show My Galleries" to work by Dampfnudel
[February 25, 2019, 11:01:55 AM]


Change the order of uploaded images in the gallery by whazzup
[February 19, 2019, 10:37:29 PM]


Upload timeout for large galleries (500 images each) by whazzup
[February 11, 2019, 10:07:25 PM]


Greetings from Ronald Smit by whazzup
[January 06, 2019, 03:39:22 PM]


Pluign and module by whazzup
[June 08, 2018, 11:57:13 PM]


Version 4.4.1 released by whazzup
[May 31, 2018, 04:31:16 PM]


search.html.php refer to rsgsearch.css with a wrong path by whazzup
[January 13, 2018, 08:12:04 PM]


Slow Gallery with many Photos by whazzup
[September 22, 2017, 09:22:33 AM]

User Comments link to CB profiles [code included]

  • 8 replies
  • 9637 views
User Comments link to CB profiles [code included]
« on: May 09, 2008, 02:55:05 PM »
Hi all!

If u want to link the CommunityBuilder profile of a user to his/her comments on a photo, you have to edit the file rsgcomments.class.php
It's in your directory /components/com_rsgallery2/lib/rsgcomments/

I'm not sure about the line where you have to add code, cause I deleted/added/edited preceding lines of code for other things I wanted to implement...
Anyway, somewhere around line 370 you will see:
Code: [Select]
foreach ($comments as $comment) {
$catid = galleryUtils::getCatIdFromFileId($comment['item_id']);
etc...

add the following between these two lines:
Code: [Select]
/* GRVULTURE CB INTEGRATION -------------------------------------------------------------------------*/
      $grName = galleryUtils::genericGetUsername( $comment['user_id'] );
  $grHref = "index.php?option=com_comprofiler&task=userProfile&user={$comment['user_id']}";
      $grHref = sefRelToAbs($grHref);
$gruser = "<a href='{$grHref}' title='$grName'>$grName</a>";
/* --------------------------------------------------------------------------------------------------*/

Then, search for galleryUtils::genericGetUsername( $comment['user_id'] )
and replace it with $gruser

This is where normally the user's name/username appears in his/her comment box.

Mine is at the Title cell, cause I don't use titles in the comments on my site.
So my line became from this:
Code: [Select]
<td colspan="2" class="title"><span class="posttitle"><?php echo galleryUtils::genericGetUsername$comment[&#39;user_id&#39;] );?></span></td>   

to this:
Code: [Select]
<td colspan="2" class="title"><span class="posttitle"><?php echo $gruser;?></span></td>   

Now the name of the user is hyperlinked to his/her profile!
Have fun!

next I'm going to display the username of the owner of the photo and link that also to his/her profile. that's easy...
and then I will try to display thumbnails of the users' avatars next to their comments. this is gonna be tricky, so any help is mostly welcome!

Re: User Comments link to CB profiles [code included]
« Reply #1 on: May 10, 2008, 01:41:41 PM »
I got the avatars displaying on the comments. Eaaaasy!  ;D

anyway, if u're interested, reply...

Re: User Comments link to CB profiles [code included]
« Reply #2 on: May 10, 2008, 03:03:39 PM »
...and link to gallery where the image belongs. and link to image owner...

all working

Re: User Comments link to CB profiles [code included]
« Reply #3 on: June 19, 2008, 05:20:08 PM »
...and link to gallery where the image belongs. and link to image owner...

all working

Hi, great job !

please post the code......is exactly what I was looking for !!!!  ::)

Re: User Comments link to CB profiles [code included]
« Reply #4 on: August 18, 2008, 08:40:27 PM »
Quote
and link to image owner...

AWESOME! Pleeeeeeeeease provide the code for this!
Would be great! Awesome work

Kind Regards Tomek

Re: User Comments link to CB profiles [code included]
« Reply #5 on: September 10, 2008, 02:09:49 PM »
I get "Call to undefined function sefRelToAbs()"?

Re: User Comments link to CB profiles [code included]
« Reply #6 on: September 10, 2008, 02:18:02 PM »
forgot... in J1.5 you must use JRoute::_ :)

Re: User Comments link to CB profiles [code included]
« Reply #7 on: September 10, 2008, 02:57:04 PM »
...and link to gallery where the image belongs. and link to image owner...

all working

Perhaps you are willing to share your hack?? :)

Re: User Comments link to CB profiles [code included]
« Reply #8 on: September 22, 2008, 05:56:50 PM »
This is EXACTLY what I need to tie my site together.  If there is any additional code I'd love to see it.