Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 08-27-2008, 11:08 AM
dannykilla's Avatar
dannykilla dannykilla is offline
 
Join Date: Jun 2007
Location: Manchester, UK
Posts: 151
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default **SOLVED** HTML code help please!

Hi,

I am trying to re-position my login box, so it is part of my header image, pretty much like how vb.org have done it.
Now I have managed to move the login box but getting its position correct is proving to be a pain and I was wondering if anyone would be so kind as to help me out?

Here is the code I am using in my header template (please be kind, if completely wrong, I am a n00b)

Code:
<div align="center">

<table height="300" background="http://www.My-Page.co.uk/My-Image.png" width="970">
<tbody>
<tr>
<td nowrap="nowrap" valign="bottom">
<if condition="$show['member']">
 <div class="smallfont">
  <strong><phrase 1="$bbuserinfo[musername]" 2="member.php?$session[sessionurl]u=$bbuserinfo[userid]">$vbphrase[welcome_x_link_y]</phrase></strong><br />
  <phrase 1="$pmbox[lastvisitdate]" 2="$pmbox[lastvisittime]">$vbphrase[last_visited_x_at_y]</phrase>
  <if condition="$show['notifications'] AND $show['popups']">
   <div><span id="notifications"><a href="usercp.php$session[sessionurl_q]">$vbphrase[your_notifications]:</a> <strong>$notifications_total</strong></span></div>
   <script type="text/javascript"> vBmenu.register("notifications"); </script>
  <else /><if condition="$show['pmstats']">
   <div><phrase 1="$vbphrase[unread_x_nav_compiled]" 2="$vbphrase[total_x_nav_compiled]" 3="$session[sessionurl_q]">$vbphrase[private_messages_nav]</phrase></div>
  </if></if>
  <if condition="$show['pmwarning']"><div><strong><phrase 1="$vbphrase[pmpercent_nav_compiled]">$vbphrase[your_pm_box_is_x_full]</phrase></strong></div></if>
 </div>
 </td>
<else />
<td nowrap="nowrap" valign="bottom">
  <!-- login form -->

  <form action="login.php?do=login" method="post" onsubmit="md5hash(vb_login_password, vb_login_md5password, vb_login_md5password_utf, $show[nopasswordempty])">
  <script type="text/javascript" src="clientscript/vbulletin_md5.js?v=$vboptions[simpleversion]"></script>
  <table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0">
  <tr>
   <td class="smallfont" style="white-space: nowrap;"><label for="navbar_username">$vbphrase[username]</label></td>
   <td><input type="text" class="bginput" style="font-size: 11px" name="vb_login_username" id="navbar_username" size="10" accesskey="u" tabindex="101" value="$vbphrase[username]" onfocus="if (this.value == '$vbphrase[username]') this.value = '';" /></td>
   <td class="smallfont" nowrap="nowrap"><label for="cb_cookieuser_navbar"><input type="checkbox" name="cookieuser" value="1" tabindex="103" id="cb_cookieuser_navbar" accesskey="c" />$vbphrase[remember_me]</label></td>
  </tr>
  <tr>
   <td class="smallfont"><label for="navbar_password">$vbphrase[password]</label></td>
   <td><input type="password" class="bginput" style="font-size: 11px" name="vb_login_password" id="navbar_password" size="10" tabindex="102" /></td>
   <td><input type="submit" class="button" value="$vbphrase[log_in]" tabindex="104" title="$vbphrase[enter_username_to_login_or_register]" accesskey="s" /></td>
  </tr>
</table>
  <input type="hidden" name="s" value="$session[sessionhash]" />
  <input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" />
  <input type="hidden" name="do" value="login" />
  <input type="hidden" name="vb_login_md5password" />
  <input type="hidden" name="vb_login_md5password_utf" />
  </form>
  <!-- / login form -->
 </td>
</if>
</tr>
</table>

</div>
Basically when I use Firefox (before I login) the position is correct, but once logged in, I would like it to be slightly higher up.

So if anyone can help us out that would be awesome!

Thanks
Danny
Reply With Quote
  #2  
Old 08-28-2008, 03:58 AM
MoT3rror MoT3rror is offline
 
Join Date: Mar 2007
Posts: 423
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Find
Code:
<if condition="$show['member']">
 <div class="smallfont">
Replace
Code:
<if condition="$show['member']">
 <div class="smallfont" style="margin-top: -5px">
Use is_browser function if you want to do it just for one browser.
Reply With Quote
  #3  
Old 08-28-2008, 09:50 AM
Opserty Opserty is offline
 
Join Date: Apr 2007
Posts: 4,103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Before you try the above post try:
Code:
<div align="center">

<table height="300" background="http://www.My-Page.co.uk/My-Image.png" width="970">
<tbody>
<tr>

<if condition="$show['member']">
<td nowrap="nowrap" valign="bottom">
 <div class="smallfont">
  <strong><phrase 1="$bbuserinfo[musername]" 2="member.php?$session[sessionurl]u=$bbuserinfo[userid]">$vbphrase[welcome_x_link_y]</phrase></strong><br />
  <phrase 1="$pmbox[lastvisitdate]" 2="$pmbox[lastvisittime]">$vbphrase[last_visited_x_at_y]</phrase>
  <if condition="$show['notifications'] AND $show['popups']">
   <div><span id="notifications"><a href="usercp.php$session[sessionurl_q]">$vbphrase[your_notifications]:</a> <strong>$notifications_total</strong></span></div>
   <script type="text/javascript"> vBmenu.register("notifications"); </script>
  <else /><if condition="$show['pmstats']">
   <div><phrase 1="$vbphrase[unread_x_nav_compiled]" 2="$vbphrase[total_x_nav_compiled]" 3="$session[sessionurl_q]">$vbphrase[private_messages_nav]</phrase></div>
  </if></if>
  <if condition="$show['pmwarning']"><div><strong><phrase 1="$vbphrase[pmpercent_nav_compiled]">$vbphrase[your_pm_box_is_x_full]</phrase></strong></div></if>
 </div>
 </td>
<else />
<td nowrap="nowrap" valign="bottom">
  <!-- login form -->

  <form action="login.php?do=login" method="post" onsubmit="md5hash(vb_login_password, vb_login_md5password, vb_login_md5password_utf, $show[nopasswordempty])">
  <script type="text/javascript" src="clientscript/vbulletin_md5.js?v=$vboptions[simpleversion]"></script>
  <table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0">
  <tr>
   <td class="smallfont" style="white-space: nowrap;"><label for="navbar_username">$vbphrase[username]</label></td>
   <td><input type="text" class="bginput" style="font-size: 11px" name="vb_login_username" id="navbar_username" size="10" accesskey="u" tabindex="101" value="$vbphrase[username]" onfocus="if (this.value == '$vbphrase[username]') this.value = '';" /></td>
   <td class="smallfont" nowrap="nowrap"><label for="cb_cookieuser_navbar"><input type="checkbox" name="cookieuser" value="1" tabindex="103" id="cb_cookieuser_navbar" accesskey="c" />$vbphrase[remember_me]</label></td>
  </tr>
  <tr>
   <td class="smallfont"><label for="navbar_password">$vbphrase[password]</label></td>
   <td><input type="password" class="bginput" style="font-size: 11px" name="vb_login_password" id="navbar_password" size="10" tabindex="102" /></td>
   <td><input type="submit" class="button" value="$vbphrase[log_in]" tabindex="104" title="$vbphrase[enter_username_to_login_or_register]" accesskey="s" /></td>
  </tr>
</table>
  <input type="hidden" name="s" value="$session[sessionhash]" />
  <input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" />
  <input type="hidden" name="do" value="login" />
  <input type="hidden" name="vb_login_md5password" />
  <input type="hidden" name="vb_login_md5password_utf" />
  </form>
  <!-- / login form -->
 </td>
</if>
</tr>
</table>

</div>
I switched the Green & Red lines.
Reply With Quote
  #4  
Old 08-30-2008, 09:08 PM
dannykilla's Avatar
dannykilla dannykilla is offline
 
Join Date: Jun 2007
Location: Manchester, UK
Posts: 151
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks that works great!

1 thing I have now added two links (as a test) to my header and there using the forums css, can someone tell me how I can add the links own css so that the font is white, and the link hover colours are completely separate to the boards css?

Thanks
Danny

--------------- Added [DATE]1220192342[/DATE] at [TIME]1220192342[/TIME] ---------------

Here is my header code:

Code:
<div align="center">
<table height="300" width="970" background="http://www.tf2-forums.co.uk/tf2-banner.jpg">
<tr>
<td align="$stylevar[left]" valign="top"><a href="http://www.tf2-forums.co.uk"><img src="http://www.tf2-forums.co.uk/logo.png" border="0" alt="TF2-Forums.co.uk" /></a></td>
<tbody>
<if condition="$show['member']">
<!-- avatar welcome bar -->
<td class="hlinks" align="left" style="padding: 20pt 0px 0px 5px; white-space: nowrap;">	
<a href="http://www.tf2-forums.co.uk/" ><font color="#FFFFFF">Home</font></a>   |   
<a href="http://www.tf2-forums.co.uk/forums/" >Forums</a>   |	
<td align="right" height="60" width="570">
		<if condition="$bbuserinfo['userid']">
 		   <img src="$vboptions[bburl]/image.php?u=$bbuserinfo[userid]" alt="$vbphrase[avatar]"  width="50" height="50" border="0" align="center"/>
		</td>
		<else />
		<td class="alt2" align="center">
		   <img src="$vboptions[bburl]/images/avatars/noavatar.gif" alt="$vbphrase[guest] $vbphrase[avatar]" width="50" height="50" border="0">
		</if>
		</td>
<!-- / avatar welcome bar -->
<td class="headerlinks" align="left">
<div class="smallfont" style="padding: 0pt 0px 0px 5px; white-space: nowrap;>
<div class="smallfont">	
		<strong><phrase 1="$bbuserinfo[musername]" 2="member.php?$session[sessionurl]u=$bbuserinfo[userid]">$vbphrase[welcome_x_link_y]</phrase></strong><br />
		<phrase 1="$pmbox[lastvisitdate]" 2="$pmbox[lastvisittime]">$vbphrase[last_visited_x_at_y]</phrase>

		<if condition="$show['notifications'] AND $show['popups']">
			<div><span id="notifications"><a href="usercp.php$session[sessionurl_q]">$vbphrase[your_notifications]:</a> <strong>$notifications_total</strong></span></div>
			<script type="text/javascript"> vBmenu.register("notifications"); </script>
		<else /><if condition="$show['pmstats']">
			<div><phrase 1="$vbphrase[unread_x_nav_compiled]" 2="$vbphrase[total_x_nav_compiled]" 3="$session[sessionurl_q]">$vbphrase[private_messages_nav]</phrase></div>
		</if></if>

		<if condition="$show['pmwarning']"><div><strong><phrase 1="$vbphrase[pmpercent_nav_compiled]">$vbphrase[your_pm_box_is_x_full]</phrase></strong></div></if>
	</div>
	</td>
<else />
<td class="headerlinks" align="right">
<div class="smallfont" style="padding: 0pt 4px; white-space: nowrap;">
		<!-- login form -->
		<form action="login.php?do=login" method="post" onsubmit="md5hash(vb_login_password, vb_login_md5password, vb_login_md5password_utf, $show[nopasswordempty])">
		<script type="text/javascript" src="clientscript/vbulletin_md5.js?v=$vboptions[simpleversion]"></script>
		<table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0">
		<tr>
			<td class="smallfont" style="white-space: nowrap;"><label for="navbar_username">$vbphrase[username]</label></td>
			<td><input type="text" class="bginput" style="font-size: 11px" name="vb_login_username" id="navbar_username" size="10" accesskey="u" tabindex="101" value="$vbphrase[username]" onfocus="if (this.value == '$vbphrase[username]') this.value = '';" /></td>
			<td class="smallfont" nowrap="nowrap"><label for="cb_cookieuser_navbar"><input type="checkbox" name="cookieuser" value="1" tabindex="103" id="cb_cookieuser_navbar" accesskey="c" />$vbphrase[remember_me]</label></td>
		</tr>
		<tr>
			<td class="smallfont"><label for="navbar_password">$vbphrase[password]</label></td>
			<td><input type="password" class="bginput" style="font-size: 11px" name="vb_login_password" id="navbar_password" size="10" tabindex="102" /></td>
			<td><input type="submit" class="button" value="$vbphrase[log_in]" tabindex="104" title="$vbphrase[enter_username_to_login_or_register]" accesskey="s" /></td>
		</tr>
		</table>
		<input type="hidden" name="s" value="$session[sessionhash]" />
		<input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" />
		<input type="hidden" name="do" value="login" />
		<input type="hidden" name="vb_login_md5password" />
		<input type="hidden" name="vb_login_md5password_utf" />
		</form>
		<!-- / login form -->
	</td>
</if>
</tr>

</table>
</div>
can anyone point me in the right direction please!

Dan

--------------- Added [DATE]1220192724[/DATE] at [TIME]1220192724[/TIME] ---------------

Solved
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:30 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04812 seconds
  • Memory Usage 2,209KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (5)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (4)post_thanks_box
  • (4)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit_info
  • (4)postbit
  • (4)postbit_onlinestatus
  • (4)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete