PDA

View Full Version : Desperate - [pics] Cant intergrate code without breaking layout


spadez
02-09-2008, 09:46 PM
Hey guys,

Ive spent about an hour trying to get this to work, but to no avail. Its quite complicated so ill try to make it as clear as possible.

Im replacing my old login box code with a new script since im changing forum software.

This is the new script i need to intergrate:


<?php
if($user->data['is_registered'])
{
$con = mysql_connect('localhost','**********','************');
mysql_select_db("sfnexusc_dise", $con);

$avvy = "SELECT * FROM phpbb_dseusers WHERE user_id =" . $user->data['user_id'];
$result = mysql_query($avvy) or die (mysql_error());

while($row = mysql_fetch_array($result))
{
$link = $row['user_avatar'];
$width = $row['user_avatar_width'];
$height = $row['user_avatar_height'];
}

echo( "<img src='http://dse.sfnexus.com/phpBB3/download/file.php?avatar=" . $link . "' border='0' width='" . $width . "' height='" . $height . "' alt='Avatar' />
<br />Hi <a href='phpBB3/memberlist.php?mode=viewprofile&u=" . $user->data['user_id'] . "' target='_self'>" . $user->data['username'] . "</a>!<br /><br /><a href=" . $phpbb_root_path . 'ucp.php?mode=logout&redirect=../index.php' . '&sid=' . $user->data['session_id'] . ">Logout</a>");
}
else
{
echo('<form action="phpBB3/ucp.php" method="post" enctype="multipart/form-data">
<input type="text" name="username" style="border:#cccccc 1px dashed; color:#333333; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; padding:4px; font-weight:bold; width:95%;" value="Username"/>
<br />
<br />
<input type="password" name="password" style="border:#cccccc 1px dashed; color:#333333; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; padding:4px; font-weight:bold; width:95%;" value="Password"/>
<br />
<br />
<input type="hidden" name="redirect" value="../index.php" />
<input type="submit" value="login" name="login" style="border:#cccccc 1px dashed; background:#F2F2F2; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; padding:4px; font-weight:bold;" />
&nbsp;<a href="phpBB3/ucp.php?mode=register" target="_self" style="color:#FFFFFF;">Register a free account </a>
</form>');
}
echo "</table>";
?>


Below is the area that i am trying to intergrate the code (highlighted in red is the old code):


........
</script>
</div></td>
<td valign="top" style="padding:5px; margin-bottom:-5px; background-image:url(images/login.jpg); background-repeat:repeat-x;"> <h2 style="color:#FFFFFF; border:0px;">Welcome to Brunel Radio</h2>
<div style="font-size:12px;">
<form action="./../forums/ucp.php?mode=login" method="post" enctype="multipart/form-data">
<input name="username" type="text" style="border:#cccccc 1px dashed; color:#333333; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; padding:4px; font-weight:bold; width:95%;" onclick="this.value=''" value="Username"/>
<br />
<br />
<input name="password" type="password" style="border:#cccccc 1px dashed; color:#333333; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; padding:4px; font-weight:bold; width:95%;" onclick="this.value=''" value="Password" />
<br />
<br />
<input type="hidden" name="redirect" value="../site" />
<input type="submit" value="Login" name="login" style="border:#cccccc 1px dashed; background:#F2F2F2; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; padding:4px; font-weight:bold;" />

&nbsp;<a href="http://trixfm.co.uk/forums/ucp.php?mode=register" style="color:#FFFFFF;">Register a free account </a>
</form>
</div>
</td>
</tr>
<tr>
<td valign="top".........


This is that the website looks like with the old login box code (and how i want it to look):

http://img227.imageshack.us/img227/9845/oldln4.jpg

Below is what it looks like after i have put in the new login code (it breaks the columns under the login box)

http://img231.imageshack.us/img231/6971/newvb6.jpg

This is a link to the website - New (http://hiven.net/radio/index.html) Old (http://hiven.net/radio/index5.php)

If you need any more info just ask, i would really appreciate any help you can give with this.

Regards,

James

spadez
02-09-2008, 11:35 PM
Fixed, there was a table element in the php that wasnt needed.