TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 196,004
  • Total Topics: 21,330
  • Online today: 468
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 91
  • Total: 91

Users Box

Started by madagascar, June 03, 2007, 05:17:16 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

madagascar

Help me guys,

Want to maximise the vacant area at the right side of the avatar of my users box. Have to put in there the PM, show unread, show replies and show on posts.

Please help me guys on how to divide the top area of my users box.

Many thanks
:)

IchBin

You'll need to open the TPortalBlocks.template.php file and edit the userbox section to achieve what you need.

madagascar

#2
Quote from: IchBinâ„¢ on June 03, 2007, 05:30:34 AM
You'll need to open the TPortalBlocks.template.php file and edit the userbox section to achieve what you need.

Im new in php programming, can you help me how to do it? My problem is how to devide the area for the image on the left and text on the right.

Many thanks

madagascar


madagascar


madagascar

This is my TPortalBlocks.template Code - Userbox portion:

// Tportal userbox
function TPortal_userbox()
{
   global $context, $settings, $options, $scripturl, $txt, $modSettings;

   $bullet = '<img src="'.$settings['images_url'].'/TPdivider.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
   $bullet2 = '<img src="'.$settings['images_url'].'/TPdivider2.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
   $bullet3 = '<img src="'.$settings['images_url'].'/TPdivider3.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
   $bullet4 = '<img src="'.$settings['images_url'].'/tpgoto.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
   $bullet5 = '<img src="'.$settings['images_url'].'/tpmodule2.gif" alt="" border="0" style="margin:0 2px 0 0;" />';

   echo'
   <div class="smalltext">';

   if (!empty($context['user']['avatar']) && isset($context['TPortal']['userbox']['avatar']))
      echo $context['user']['avatar']['image'] . '
';

   // If the user is logged in, display stuff like their name, new messages, etc.
   if ($context['user']['is_logged']){
      echo '<span class="normaltext">', $txt['hello_member'], ' ', $context['user']['name'], '</span>';

      // Only tell them about their messages if they can read their messages!
      if ($context['allow_pm']){
         echo '
'.$bullet.'<a href="', $scripturl, '?action=pm">' .$txt['tp-pm'].' ', $context['user']['messages'], '</a>';
         if($context['user']['unread_messages']>0)
            echo '
'.$bullet.'<a style="font-weight: bold; " href="', $scripturl, '?action=pm">' .$txt['tp-pm2'].' ',$context['user']['unread_messages'] , '</a>';
      }
      // Are there any members waiting for approval?
      if (!empty($context['unapproved_members']))
         echo '
'.$bullet.'<a href="', $scripturl, '?action=viewmembers;sa=browse;type=approve">'.$txt['tp_unapproved_members'].' '. $context['unapproved_members']  . '</a>';

      if(isset($context['TPortal']['userbox']['unread'])){
         echo '
'.$bullet.'<a href="', $scripturl, '?action=unread">' .$txt['tp-unread'].'</a>
            
'.$bullet.'<a href="', $scripturl, '?action=unreadreplies">'.$txt['tp-replies'].'</a>
            
'.$bullet.'<a href="', $scripturl, '?action=profile;u='.$context['user']['id'].';sa=showPosts">'.$txt['tp-showownposts'].'</a>';
      }

      // Is the forum in maintenance mode?
      if ($context['in_maintenance'] && $context['user']['is_admin'])
         echo '
' .$bullet.$txt['tp_maintenace']. '';
      // Show the total time logged in?
      if (!empty($context['user']['total_time_logged_in']) && isset($context['TPortal']['userbox']['logged'])){
         echo '
'.$bullet.$txt['tp-loggedintime'] . ' ';
         echo $context['user']['total_time_logged_in']['days'] . $txt['tp-acronymdays'];
         echo $context['user']['total_time_logged_in']['hours'] . $txt['tp-acronymhours'];
         echo $context['user']['total_time_logged_in']['minutes'] .$txt['tp-acronymminutes'];
      }
      if(isset($context['TPortal']['userbox']['time'])){
         echo '
'.$bullet. $context['current_time'];
      }
   }
   // Otherwise they're a guest - so politely ask them to register or login.
   else{
      echo '
   ', $txt['welcome_guest'], '

   ', $context['current_time'], '

   <form action="', $scripturl, '?action=login2" method="post" >
      <input type="text" name="user" size="10" /> <input type="password" name="passwrd" size="10" />
        <select name="cookielength">
         <option value="60">', $txt['smf53'], '</option>
         <option value="1440">', $txt['smf47'], '</option>
         <option value="10080">', $txt['smf48'], '</option>
         <option value="302400">', $txt['smf49'], '</option>
         <option value="-1" selected="selected">', $txt['smf50'], '</option>
      </select>
        <input type="submit" value="', $txt[34], '" />

        ', $txt['smf52'], '
   </form>';
   }
   echo '</div>';
}


IchBin

You'll have to redesign the whole thing pretty much. Right now, things are just sitting in a single <div>. You'll have to figure it out by adding more divs, or do it with tables. I don't have the time to do it. And as you've noticed, nobody else has replied, which means they don't know how or don't have the time as well.

This website is proudly hosted on Crocweb Cloud Website Hosting.