1
BroHam
Change link of username in comments?
  • 2007/6/25 1:23

  • BroHam

  • Just popping in

  • Posts: 100

  • Since: 2007/3/31


I am using SMF as my forum, and one of the few kinks left to iron out is the comments in all the modules. The poster's user name and uid are embedded in the layout of list of comments, right? I want the link of the users to point to the smf profile instead. What file(s) do I need to modify?

To elaborate, if you click on a username that made a comment, you get a url like: www. exampleURL.com/userinfo.php?uid=9
I want the link to point to the smf profile with a link like: www. exampleURL.com/modules/smf/index.php?action=profile;u=9

Thanks for any help. I'm sure this is easy for many of you.
I don't know.

2
stefan88
Re: Change link of username in comments?
  • 2007/6/25 7:48

  • stefan88

  • Community Support Member

  • Posts: 1085

  • Since: 2004/9/20


Hi,

not completly shure about this, but I think the file you need is /modules/system/blocks/system_blocks.php.

There find:

$poster =& $member_handler->getUser($comments[$i]->getVar('com_uid'));
            if (
is_object($poster)) {
                
$com['poster'] = '<a href="'.XOOPS_URL.'/userinfo.php?uid='.$comments[$i]->getVar('com_uid').'">'.$poster->getVar('uname').'</a>';
            } else {
                
$com['poster'] = $GLOBALS['xoopsConfig']['anonymous'];
            }


and the part you should edit:

$com['poster'] = '<a href="'.XOOPS_URL.'/userinfo.php?uid='.$comments[$i]->getVar('com_uid').'">'.$poster->getVar('uname').'</a>';


Make shure you do a backup of the file before editing!

..

3
BroHam
Re: Change link of username in comments?
  • 2007/6/25 14:45

  • BroHam

  • Just popping in

  • Posts: 100

  • Since: 2007/3/31


Thanks for the reply. I'll play with that file and see what I can do.

Quote:
Make shure you do a backup of the file before editing!

But, of course...
I don't know.

4
BroHam
Re: Change link of username in comments?
  • 2007/6/25 15:55

  • BroHam

  • Just popping in

  • Posts: 100

  • Since: 2007/3/31


I'm afraid that file did not change anything in the comments. I'll keep looking.
I don't know.

5
BroHam
SOLVED - Re: Change link of username in comments?
  • 2007/6/25 16:27

  • BroHam

  • Just popping in

  • Posts: 100

  • Since: 2007/3/31


It looks like I got it.
In class/commentrenderer.php, on line 340, I replaced:
$poster['uname'] = '<a href="'.XOOPS_URL.'[b]/userinfo.php?uid=[/b]'.$poster['id'].'">'.$com_poster->getVar('uname').'</a>';


With this:
$poster['uname'] = '<a href="'.XOOPS_URL.'[b]/modules/smf/index.php?action=profile;u=[/b]'.$poster['id'].'">'.$com_poster->getVar('uname').'</a>';


Seems to work exactly how I want.
I don't know.

Login

Who's Online

61 user(s) are online (43 user(s) are browsing Support Forums)


Members: 0


Guests: 61


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Oct 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits