News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

[Help] Add code in index.template

Started by Rodrigo_Gustin, April 07, 2019, 12:12:17 PM

Previous topic - Next topic

Rodrigo_Gustin

How to add this code in my index.template without error.
This code is for users' accounts to have the profile image of the forum equal to the game.

function template_body_above()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;

$usuario = $context['user']['name'];

$query = mysql_query("SELECT * FROM usuarios WHERE Username = '".$usuario."'");
while($row = mysql_fetch_assoc($query))
{
$ropa = $row['Skin'];
}

echo '
<div id="bodybg">';
echo !empty($settings['forum_width']) ? '
<div id="wrapper">' : '', '
  <div id="header">
<div id="head-l">
<div id="head-r">
  <div id="userarea" class="smalltext">';
if ($context['user']['is_logged']){

echo '
<div id="my-avatar" class="clearfix">


<img src="./avatars/skin/'.$ropa.'.png" />

</div>';

$quitargion=str_replace("_"," ",$context['user']['name']);

echo '
  <div class="logged-usuario">';
echo '
<br><br><center>', strtoupper($quitargion), '</center>
<br>&nbsp;<a href="', $scripturl, '?action=unread">&raquo;&nbsp;', $txt['unread_since_visit'], '</a>
<br>&nbsp;<a href="', $scripturl, '?action=unreadreplies">&raquo;&nbsp;', $txt['show_unread_replies'], '</a>
</div>';
}

GigaWatt

Are you asking for a default user profile image?
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

Advertisement: