RSGallery2 Support Forums
Welcome, Guest. Please login or register.

Login with username, password and session length
  Home    Forum    Help    Search    Login    Register  
*
News : November 22, 2008, 02:26:56 pm
+  RSGallery2 Support Forums
|-+  Developers corner
| |-+  Developer Lobby
| | |-+  User Comments link to CB profiles [code included]
Advanced search
  « previous next »
Pages 1
Author
Topic: User Comments link to CB profiles [code included]  (Read 7490 times)
« on: May 09, 2008, 08:55:05 am »
grVulture Offline
Newbie
*
Posts: 4

View Profile Email

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:
foreach ($comments as $comment) {
$catid = galleryUtils::getCatIdFromFileId($comment['item_id']);
etc...

add the following between these two lines:
Code:
/* 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:
<td colspan="2" class="title"><span class="posttitle"><?php echo galleryUtils::genericGetUsername$comment['user_id'] );?></span></td>   

to this:
Code:
<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!
Logged
 
Reply #1
« on: May 10, 2008, 07:41:41 am »
grVulture Offline
Newbie
*
Posts: 4

View Profile Email

I got the avatars displaying on the comments. Eaaaasy!  Grin

anyway, if u're interested, reply...
Logged
 
Reply #2
« on: May 10, 2008, 09:03:39 am »
grVulture Offline
Newbie
*
Posts: 4

View Profile Email

...and link to gallery where the image belongs. and link to image owner...

all working
Logged
 
Reply #3
« on: June 19, 2008, 11:20:08 am »
xplay Offline
Newbie
*
Posts: 1

View Profile

...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 !!!!  Roll Eyes
Logged
 
Reply #4
« on: August 18, 2008, 02:40:27 pm »
Tomek Offline
Newbie
*
Posts: 2

View Profile Email

Quote
and link to image owner...

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

Kind Regards Tomek
Logged
 
Reply #5
« on: September 10, 2008, 08:09:49 am »
Markus Offline
Newbie
*
Posts: 14

View Profile Email

I get "Call to undefined function sefRelToAbs()"?
Logged
 
Reply #6
« on: September 10, 2008, 08:18:02 am »
Markus Offline
Newbie
*
Posts: 14

View Profile Email

forgot... in J1.5 you must use JRoute::_ Smiley
Logged
 
Reply #7
« on: September 10, 2008, 08:57:04 am »
Markus Offline
Newbie
*
Posts: 14

View Profile Email

...and link to gallery where the image belongs. and link to image owner...

all working

Perhaps you are willing to share your hack?? Smiley
Logged
 
Reply #8
« on: September 22, 2008, 11:56:50 am »
MediaMisfit Offline
Newbie
*
Posts: 1

View Profile Email

This is EXACTLY what I need to tie my site together.  If there is any additional code I'd love to see it.
Logged
 
Print  Pages 1
« previous next »
Jump to: