1
jeffgr
How to add PM link on any page?
  • 2007/6/6 15:13

  • jeffgr

  • Quite a regular

  • Posts: 263

  • Since: 2004/2/22


Hello,

Does anyone know how to add a link to "contact by pm (private message), on any module page that is attributed to a certain user (like, on a classified ad that they have posted?).

I know many modules have this already built in, but I want to add a "contact by pm" link on a module that does not have this....

I thought it would be as easy as adding in this smarty template code "<{$user_pmlink}>"... but that doesn't seem to be working...it is not picking up the user id.

Any thoughts on this would be most appreciated!

Thanks,

Jeff

2
iHackCode
Re: How to add PM link on any page?

here is the basic idea of what userinfo.php has set up .which is what you are wanting.

some php file..
[color=006633]//part one. create object for user.[/color]
$uid intval($_GET['uid']);
$member_handler xoops_gethandler('member'); 
$thisUser =& $member_handler->getUser($uid); [color=006633//uid is the userid of the other person (classified ad or something)[/color]


[color=006633]//part two. create pm link for that user. w/image[/color]
$xoopsTpl->assign('user_pmlink'"<a href="javascript:openWithSelfMain('".XOOPS_URL."/pmlite.php?send2=1&to_userid=".$thisUser->getVar('uid')."''pmlite'450380);"><img src="".XOOPS_URL."/images/icons/pm.gif" alt="".sprintf(_SENDPMTO,$thisUser->getVar('uname'))."" /></a>"); 
[
color=006633]//creates the link to use in the smarty variable.. "<{$user_pmlink}>".. [/color]


//if you already have something that creates the object for the person,author(classified ad poster).. part two would be what you are after... with a little bit of modification.
CBB / LatestNews / Publisher / XM-Spotlight

(ノ◕ヮ◕)ノ*:・゚✧

Login

Who's Online

165 user(s) are online (82 user(s) are browsing Support Forums)


Members: 0


Guests: 165


more...

Donat-O-Meter

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

Latest GitHub Commits