Current location: Hot Scripts Forums » Programming Languages » PHP » Layout Issue


Layout Issue

Reply
  #1 (permalink)  
Old 02-25-10, 10:07 AM
EmlynK EmlynK is offline
New Member
 
Join Date: Jan 2010
Location: Coventry, England
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Layout Issue

Hi all. Hope everyone is good.

I didn't know where to post this. Thing is, my script is mainly PHP, but there is an HTML side to it. "/

I've got a layout issue, which I've no idea how to solve. I'm not very good when it comes to the design/layout of things...ie: the HTML.

The layout I've got I downloaded (legally, I might add) from a brilliant website. I then incorporated a bit of PHP in it to apply it to mine and my brother's online game.

An image of the problem is attached to this post. Basically, the text above and below the template need to be inside the template, where Layout Name, Type etc is.

Below is my header code:
PHP Code:

<?php

class headers {
function 
startheaders() {
$key substr($key basename($_SERVER['PHP_SELF']), 0strpos($key"."));
$page = isset($table[$key]) ? $table[$key] : " ";
global 
$ir$set;
print <<<EOF
<html>
<head>
<title>Desert Storm V1.0 - Layout (c) senkouryu.net</title>
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>
<style type = 'text/css' />
<!--
body {background-color:#D4C9A8;}
table, td {font-family:Verdana, Tahoma; font-size:10px; color:#382704;}
a {color:#6E5D2D;}
a:hover {color:#99875B;}
.navhead {display:block; font-weight:bold; text-align:center; color:ccc; border:1px solid #111; background:url(Images/banner.gif);}
-->
</style>
</head>
<body bgcolor='#D4C9A8' leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'>
<br>
<center>
<table background='Images/overall_bg.gif' id='Table_01' width='638' border='0' cellpadding='0' cellspacing='0'>
EOF;
}


function 
userdata($ir,$lv,$fm,$cm,$dosessh=1)
{
global 
$db,$c,$userid$set;
$IP $_SERVER['REMOTE_ADDR'];
$db->query("UPDATE users SET laston=unix_timestamp(),lastip='$IP' WHERE userid=$userid");
if(!
$ir['email'])
{
global 
$domain;
die (
'<body>Your Account May Be Broken. Please Contact Your E-Mail Stating Your Username And User ID.');
exit;
}
if(
$dosessh && ($_SESSION['attacking'] || $ir['attacking']))
{
print 
"You Lost All Your EXP For Running From A Fight Like A Coward.";
$db->query("UPDATE users SET exp=0,attacking=0 WHERE userid=$userid");
$_SESSION['attacking']=0;
}
$enperc=(int) ($ir['energy']/$ir['maxenergy']*100);
$wiperc=(int) ($ir['will']/$ir['maxwill']*100);
$experc=(int) ( $ir['exp']/$ir['exp_needed']*100);
$brperc=(int) ($ir['brave']/$ir['maxbrave']*100);
$hpperc=(int) ($ir['hp']/$ir['maxhp']*100);
$enopp=100-$enperc;
$wiopp=100-$wiperc;
$exopp=100-$experc;
$bropp=100-$brperc;
$hpopp=100-$hpperc;
$d='';
$_GET['ID'] = abs(@intval($_GET['ID']));
$_GET['viewforum'] = abs(@intval($_GET['viewforum']));
$_GET['viewtopic'] = abs(@intval($_GET['viewtopic']));
$stmr='';
$u=$ir['username'];
if(
$ir['user_level'] > 1) { $stmr="<img src='staffimage here' alt='Staff Member' title='Staff Member' />"; };
if(
$ir['donatordays']) { $u "<font color=red>{$ir['username']}</font>';$d='<img src='donator.gif' alt='Donator: {$ir['donatordays']} Days Left' title='Donator: {$ir['donatordays']} Days Left' />"; }

 
$gn=''
global 
$staffpage;
if(
$ir['fedjail'])
{
$q=$db->query("SELECT * FROM fedjail WHERE fed_userid=$userid");
$r=$db->fetch_row($q);
die(
"<b><hr /><font color=red size=+1>You Have Been Dragged Off To {$set['game_name']} Federal Prision For {$r['fed_days']} Day(s).<hr /><br />
Reason: 
{$r['fed_reason']}</font></b></body></html>");
}
print <<<OUT
    <tr>
        <td colspan='5'>
            <img src='Images/index_01.gif' width='638' height='17' alt=''></td>
    </tr>
    <tr>
        <td colspan='5'>
            <img src='Images/banner.gif' width='638' height='125' alt=''></td>
    </tr>
    <tr>
        <td colspan='5'>
            <img src='Images/index_03.gif' width='638' height='35' alt=''></td>
    </tr>
    <tr>
        <td colspan='4'>
            <img src='Images/index_04.gif' width='613' height='1' alt=''></td>
        <td rowspan='2'>
            <img src='Images/index_05.gif' width='25' height='90' alt=''></td>
    </tr>
    <tr>
        <td>
            <img src='Images/index_06.gif' width='7' height='89' alt=''></td>
        <td>
            <img src='Images/index_07.gif' width='127' height='89' alt=''></td>
        <td>
            <img src='Images/index_08.gif' width='36' height='89' alt=''></td>
        <td>
            <img src='Images/index_09.gif' width='443' height='89' alt=''></td>
    </tr>
    <tr>
        <td valign='top'>
            <img src='Images/index_10.gif' width='7' height='23' alt=''></td>
        <td valign='top' background='Images/nav.gif' style='background-repeat:no-repeat;' width='127' height='23'>
OUT;
}

function 
menuarea() {
    include 
"mainmenu.php";
    global 
$ir$c;
print 
"<div class='navhead'>Nav Bar</div>
            </td>
        <td valign='top'>
            <img src='Images/index_12.gif' width='36' height='23' alt=''></td>
        <td valign='top' background='Images/nav.gif' style='background-repeat:no-repeat;' width='127' height='23'>"
;
}

function 
smenuarea() {
    include 
"smenu.php";
    global 
$ir$c;
    print 
"<div class='navhead'>Staff Bar</div>
    </td>
        <td valign='top' background='Images/content.gif' style='background-repeat:no-repeat;' width='443' height='23'>"
;
}

function 
maincontent() {
    global 
$ir$c$db;
    
      print 
"<div class='navhead'>Layout Info</div>
      <!-- Content Starts Here! -->
        <b>Layout Name:</b> Desert Storm V1<br>
        <b>Type:</b> Tables, Div<br>
        <b>Iframes:</b> NO<br>
        <b>Download Requirements:</b><br>
         - No requirments needed.<br>
        <b>Features:</b><br>- A Desert theme<br>
        <b>Description:</b><br>
         This simple layout is practice for me, a practice with color combinations that I haven\'t use, like this, a yellow-brownish-sand-like, for a desert theme :)
         <div class='navhead'>Copyright & Final Comments</div>
         This layout is copyrighted by SenkouRyu, don\'t edit the copyright info anywhere!<br>
         Be sure to check <a href='http://www.senkouryu.net'>http:\//www.senkouryu.net</a> for more layouts like this or even better ones!
         <!-- Content End -->
            
        </td>
        <td valign='top'>
            <img src='Images/index_14.gif' width='25' height='23' alt=''></td>
    </tr>
    <tr>
        <td colspan='3'>
            <img src='Images/index_17.gif' width='170' height='32' alt=''></td>
        <td>
            <img src='Images/index_18.gif' width='443' height='32' alt=''></td>
        <td>
            <img src='Images/index_19.gif' width='25' height='32' alt=''></td>
    </tr>
    <tr>
        <td>
            <img src='Images/index_20.gif' width='7' height='14' alt=''></td>
        <td>
            <img src='Images/index_21.gif' width='127' height='14' alt=''></td>
        <td>
            <img src='Images/index_22.gif' width='36' height='14' alt=''></td>
        <td>
            <img src='Images/index_23.gif' width='443' height='14' alt=''></td>
        <td>
            <img src='Images/index_24.gif' width='25' height='14' alt=''></td>
    </tr>"
;
}

function 
endpage() {
global 
$db;
print <<<OUT1
</table>
</center>
</body>
</html>
OUT1;
}
}
?>
If anyone could please help me, I would be ever so grateful.

Thank you,
Emlyn
Attached Images
File Type: jpg layoutGC.jpg (34.5 KB, 155 views)
Reply With Quote
  #2 (permalink)  
Old 02-28-10, 01:01 AM
job0107's Avatar
job0107 job0107 is offline
Community Liaison
 
Join Date: Dec 2006
Location: Tacoma, Washington USA
Posts: 3,454
Thanks: 0
Thanked 140 Times in 137 Posts
The biggest problem you are having is you are creating white space.
You need to close up your <td>'s.
You have most if not all of them on two lines.
Put your <td>'s on one line.

Bad example:
HTML Code:
<td>
<img></td>
Good example:
HTML Code:
<td><img></td>
In internet explorer, the bad example will create white space.
__________________
Jerry Broughton

Last edited by job0107; 02-28-10 at 01:03 AM.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
4 corner liquid box issue sample... ArtphotoasiA HTML/XHTML/XML 0 12-10-09 10:40 AM
table layout vs css layout harish CSS 8 04-21-09 07:59 PM
PHPBB/INVISION SKINS to match your site layout from $20! wwesn General Advertisements 1 11-15-07 05:51 AM
Issue Tracking and Task management SlackeR Script Requests 8 10-05-05 04:29 PM
I Need Control Panel Layout Patiek Job Offers & Assistance 1 01-24-05 02:32 PM


All times are GMT -5. The time now is 08:11 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.