MyBB Community Forums

Full Version: Add PM link in a hover card
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
What link can I use to send a PM to a specific member when viewing their hover card?  I think it should be like this:
/private.php?action=send&uid
But I can't get the proper ending to direct it to the member who's card you are viewing??
/private.php?action=send&uid=UIDHERE
(2023-09-04, 01:45 PM)Taylor M Wrote: [ -> ]
/private.php?action=send&uid=UIDHERE

This didn't work...I need it to detect what user needs to be PM'd and populate the field in the PM form.  It's not picking up who it is to be sent to from the hover card...
If it did not work I am assuming you just copy and pasted that directly instead of setting UIDHERE with the UID variable the plugin uses?

I'm assuming you're using this plugin: https://community.mybb.com/mods.php?acti...w&pid=1441

I have never used it before so I'm not sure what variable it actually uses but you could try the following for the variable in the template:
/private.php?action=send&uid={$user['uid']}
(2023-09-05, 12:16 PM)Taylor M Wrote: [ -> ]If it did not work I am assuming you just copy and pasted that directly instead of setting UIDHERE with the UID variable the plugin uses?

I'm assuming you're using this plugin: https://community.mybb.com/mods.php?acti...w&pid=1441

I have never used it before so I'm not sure what variable it actually uses but you could try the following for the variable in the template:
/private.php?action=send&uid={$user['uid']}

I'm using Shades Hover Cards but it looks the same...here is the code in context for the hover card template:

<div>
	<img class="avatar" src="{avatar}" />
	<div class="username">
		{username}
	</div>
	<div>
		<b>Last Active:</b> {lastactive}<br />
		<b>Post Count: </b>{postnum} <b>|  Threads Started:</b> {threadnum}<br />
		<b>Joined:</b> {regdate}<b> |  Reputation:</b> {reputation}<br />
		<b>Location:</b> {fid1}
	</div>
	<br /><a href="private.php?action=send&uid={$user['uid']}{$memprofile['uid']}" class="profile_button2"><i class="far fa-paper-plane"></i>  Private Message</a>
</div>
It just wont pull the user's ID from the card for some reason.

[attachment=46294]
absolute shot in the dark, but looking at the template you posted, try uid={uid}

just a try without knowing the plugin
(2023-09-05, 01:27 PM)bv64 Wrote: [ -> ]absolute shot in the dark, but looking at the template you posted, try uid={uid}

just a try without knowing the plugin

Thanks for the reply but it didn't work either!  LOL, I am stumped!
what a pity
You've got two different UID variables side by side. So if either or both are working this is going to double the UID. Or both of these variables don't work and that's why it's not working.
<a href="private.php?action=send&uid={$user['uid']}{$memprofile['uid']}" class="profile_button2">

Try replacing that with:
<a href="private.php?action=send&uid={$uid}" class="profile_button2">

I'm assuming that {$uid} is the proper variable. I downloaded the plugin by Shade and scanned the code and found that the username is formatted into the URL with {$uid}.
[attachment=46295]
I got it!  I had to use {uid} so the plugin knew where to put it in the template...so the template looks like this:

<div>
	<img class="avatar" src="{avatar}" />
	<div class="username">
		{username}
	</div>
	<div>
		<b>Last Active:</b> {lastactive}<br />
		<b>Post Count: </b>{postnum} <b>|  Threads Started:</b> {threadnum}<br />
		<b>Joined:</b> {regdate}<b> |  Reputation:</b> {reputation}<br />
		<b>Location:</b> {fid1}
	</div>
	<br /><a href="private.php?action=send&uid={uid}" class="profile_button2"><i class="far fa-paper-plane"></i>  Private Message</a>
</div>

Be sure to select/multi-select UID in the plugin settings for it to work!
Pages: 1 2