News:

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

Main Menu

login box I created is taking too much unnessecary space. Codes provided

Started by universalsameera, July 03, 2009, 12:54:50 PM

Previous topic - Next topic

universalsameera

Hello everyone,

With great difficulty I worked out the code for a login box that I can move anywhere. However there is a small problem. I have a transparent login box meaning no background but when I insert it takes up too much unessecary space below it that it doesn't even use. I think it is due to the table. How can I have this login box take less space. Thanks for anyhelp in advance  :)


// Show a vB style login for quick login? TOP OF PAGE
   if ($context['show_quick_login'])
   {
      echo '
   <table cellspacing="0" cellpadding="0" border="0" style="position:relative; left:-210px; top:-1500px;" width="95%">
      <tr><td nowrap="nowrap" align="right">
         <script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/scripts/sha1.js"></script>
         <form action="', $scripturl, '?action=login2" method="post" accept-charset="', $context['character_set'], '"', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' . $context['session_id'] . '\');"' : '', '><br />
         <span class="middletext">Welcome,<b>Guest</b>.Please <a href="">login</a> or <a href="">register.</a> </span>
         <input name="user" size="10" style="font-size: 100%;" type="text">
                  <input name="passwrd" size="10" style="font-size: 100%;" type="password">
                  <select name="cookielength">
                    <option value="60">1 Hour</option>
                    <option value="1440">1 Day</option>
                    <option value="10080">1 Week</option>
                    <option value="43200">1 Month</option>
                    <option value="-1" selected="selected">Forever</option>
                  </select>
                  <input value="Login" type="submit"><br>
                  <span class="middletext">Login with username, password and session length</span>
                  <input name="hash_passwrd" value="" type="hidden">
                </form>
      </td></tr>
   </table>';
   }

// Don't show a login box, just a break.
   else
      echo '
   <br />';



Bulakbol

Why is it that the left and top positions have negative values? Try removing the position and add 1px border to the table so you can see what causes the gap. Get rid of XHTML errors too. Where did you copy this from? :)
Quote<table cellspacing="0" cellpadding="0" border="0" style="position:relative; left:-210px; top:-1500px;" width="95%">
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

Advertisement: