2014-09-27, 07:26 PM
2014-09-28, 06:25 AM
This sidebox should be default in your GenX template. But this is the default code
<html>
<head>
<title>{$mybb->settings['bbname']}</title>
{$headerinclude}
</head>
<body>
{$header}
<table width="100%" cellspacing="0" cellpadding="{$theme['tablespace']}" border="0" align="center">
<tr><td valign="top" width="200">
{$welcome}
{$pms}
{$search}
{$stats}
{$whosonline}
</td>
<td> </td>
<td valign="top">
{$announcements}
{$latestthreads}
</td>
</tr>
</table>
{$footer}
</body>
</html>
2014-09-28, 09:11 AM
2014-09-28, 10:52 AM
@adi19: I know you from MyBB Romania.
Anyway, for avatar (in portal), you need a plugin! I think you can try to write a basic one by yourself. The rest can be made with some modifications of your templates.
For example, if you will paste in "portal.php" page - immediately after (line 57):
And... if you modify this template:
AdminCP->Templates->Templates&Style->Templates->YOUR TEMPLATE->portal->portal_welcome_membertext
similar with:
Or you can ask for a real plugin in Plugin Requests section. Good luck!
Anyway, for avatar (in portal), you need a plugin! I think you can try to write a basic one by yourself. The rest can be made with some modifications of your templates.
For example, if you will paste in "portal.php" page - immediately after (line 57):
$plugins->run_hooks("portal_start");
the following code:// If the user is known, get avatar
if($mybb->user['uid'] != 0)
{
// set a maximum width (in px)
$avatar_width = 50;
$user_avatar = $mybb->settings['useravatar'];
$query = $db->simple_select("users", "avatar AS user_avatar", "uid = ".(int)$mybb->user['uid']."");
$result = $db->fetch_field($query, "user_avatar");
if(!empty($result))
{
$user_avatar = htmlspecialchars_uni($result);
}
unset($result);
$user_avatar_width = (int)$avatar_width."px";
$useravatar = "<img src=\"".$user_avatar."\" alt=\"\" width=\"".$user_avatar_width."\"\" />";
}
then you will be able to display the avatar wherever you want in portal page, using {$uservatar}.And... if you modify this template:
AdminCP->Templates->Templates&Style->Templates->YOUR TEMPLATE->portal->portal_welcome_membertext
similar with:
{$useravatar}<span class="smalltext"><em>{$lang->member_welcome_lastvisit}</em> {$lastvisit}<br />
{$lang->since_then}<br />
<strong>»</strong> {$lang->new_announcements}<br />
<strong>»</strong> {$lang->new_threads}<br />
<strong>»</strong> {$lang->new_posts}<br /><br />
<a href="{$mybb->settings['bburl']}/search.php?action=getnew">{$lang->view_new}</a><br /><a href="{$mybb->settings['bburl']}/search.php?action=getdaily">{$lang->view_todays}</a>
</span>
you will get something like in this image:Or you can ask for a real plugin in Plugin Requests section. Good luck!
2014-09-28, 11:19 AM
You don't need a query for getting the current user's avatar. It's saved in the $mybb->user array. This would be the most optimised way to display it: http://community.mybb.com/thread-159826-...pid1104543 that also supports ACP settings like dimensions or default avatar.
2014-09-28, 12:05 PM
How is the box supposed to look like for guests? If it wasn't for them, you could simply bash a few templates together from the "portal"-group :p
You will definitely need a plugin that applies different content depending on who's viewing the page.
You will definitely need a plugin that applies different content depending on who's viewing the page.
2014-09-28, 01:36 PM
I found myself solving!!