MyBB Community Forums

Full Version: Integrating Advanced Sidebox with Thankyou/Like plugin to create a User Info box!!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I am trying to create a user info box. Which will show the user's profile pic,user title, post count and like count in the sidebar of Advanced Sidbox
I have been trying it in my localhost.

<tr>
<td class="trow1">{$mybb->user['username']}</td>
</tr>
<tr>
<td class="trow1">{$mybb->user['postnum']}</td>
</tr>
<tr>
<td class="trow1">{$mybb->user['usertitle']}</td>
</tr>


I have inserted this code. It works but I need to 'Post count' then post number not just post number. And also how to insert number of 'likes' in it. I did inserted this code but it didn't worked.

</tr>
<tr>
<td class="trow1">{$mybb->user[%%TYL_NUMTHANKEDLIKED%%}</td>
</tr>


Since I have no knowledge of coding so I am facing the problems.
Anyone?
Nobody!!! Guys seriously??
I don't know enough about TYL plugin to help, perhaps @Eldenroot can help with that.

As to the other thing, use this code:
<tr>
	<td class="trow1">{$mybb->user['username']}</td>
</tr>
<tr>
	<td class="trow1">Post Count: {$mybb->user['postnum']}</td>
</tr>
<tr>
	<td class="trow1">{$mybb->user['usertitle']}</td>
</tr>
(2019-10-09, 05:31 PM)Wildcard Wrote: [ -> ]I don't know enough about TYL plugin to help, perhaps @Eldenroot can help with that.

As to the other thing, use this code:
<tr>
 <td class="trow1">{$mybb->user['username']}</td>
</tr>
<tr>
 <td class="trow1">Post Count: {$mybb->user['postnum']}</td>
</tr>
<tr>
 <td class="trow1">{$mybb->user['usertitle']}</td>
</tr>

Thanks for the reply. Okay what should be the code if I want to input the user's profile pic? You know at the top profile pic, then username, then post count and title, in the box.

And also if I can align the 'Post count' word to the left end of the box and the 'postnum' to the right end of the box. Then it will be visually fantastic??!!
(2019-10-10, 03:36 AM)vk_knight Wrote: [ -> ]And also if I can align the 'Post count' word to the left end of the box and the 'postnum' to the right end of the box. Then it will be visually fantastic??!!

You can do something like this:
		<tr>
			<td class="trow1">
				<div class="trow1">{$mybb->user['username']}</div>
				<div style="display: inline-block; width: 50%;" class="trow2">Post Count:</div><div style="display: inline-block; width: 50%;" class="trow1">{$mybb->user['postnum']}</div>
				<div class="trow1">{$mybb->user['usertitle']}</div>
			</td>
		</tr>
(2019-10-10, 11:10 AM)Wildcard Wrote: [ -> ]You can do something like this:
<tr>
<td class="trow1">
<div class="trow1">{$mybb->user['username']}</div>
<div style="display: inline-block; width: 50%;" class="trow2">Post Count:</div><div style="display: inline-block; width: 50%;" class="trow1">{$mybb->user['postnum']}</div>
<div class="trow1">{$mybb->user['usertitle']}</div>
</td>
</tr>
```

Okay so I added the code and it looks like this. https://ibb.co/WgdkCMW Its in the right side saying 'User Info'.

Is it possible to add the user's profile pic on top of this somehow?
(2019-10-10, 12:37 PM)vk_knight Wrote: [ -> ]Is it possible to add the user's profile pic on top of this somehow?

Yes and no.

If the user does not have an avatar, then you need to show the default avatar. As it stands, there is no way to make that distinction inside the custom box.

You can simply use {$mybb->user['avatar']} to get the URL, but if it is blank, nothing will show.

To solve that, you could create a very simple plugin to check the current user's avatar and store the default avatar in its place, if no avatar has been chosen for the current user, but again, you'd need some PHP knowledge.
Quote:<tr>
<td class="trow1">{$mybb->user['avatar']}</td>
</tr>
<tr>
<td class="trow1">
<div style="display: inline-block; width: 50%;" class="trow2">Username:</div><div style="display: inline-block; width: 50%;" class="trow1">{$mybb->user['username']}</div>
<div style="display: inline-block; width: 50%;" class="trow2">Post Count:</div><div style="display: inline-block; width: 50%;" class="trow1">{$mybb->user['postnum']}</div>
<div style="display: inline-block; width: 50%;" class="trow2">Title:</div><div style="display: inline-block; width: 50%;" class="trow1">{$mybb->user['usertitle']}</div>
</td>
</tr>

Okay, so I added this but the avatar isn't showing. Avatar is present for this profile. Check this https://ibb.co/CtSdgxM

So, I checked my forum member's avatar code its saying 'author_avatar' instead of just 'avatar'.

Now, also the avatar isn't showing but the naked link has also disappeared as it appeared previously.
(2019-10-10, 01:46 PM)vk_knight Wrote: [ -> ]Okay, so I added this but the avatar isn't showing. Avatar is present for this profile. Check this https://ibb.co/CtSdgxM

I apologize, I should have been more clear:
<img src="{$mybb->user['avatar']}" alt="avatar" />
Pages: 1 2