Gah! its ugly... help!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Gappa
Forum Contributor
Posts: 119
Joined: Fri May 23, 2003 10:02 am

Gah! its ugly... help!

Post by Gappa »

Ok . gah having troubles here, with layout... its just not looking right and its repeating stuff, and I have no idea why!? Some one help please...

site looking like: http://www.hostultra.com/~Gappa/index.php

Code: Select all

<?php 
define('IN_PHPBB', true); 
/** 
   TODO: set $phpbb_root_path 
*/ 
$phpbb_root_path = 'phpBB2/'; 

include($phpbb_root_path . 'extension.inc'); 
include($phpbb_root_path . 'common.'.$phpEx); 
include($phpbb_root_path . 'includes/bbcode.'.$phpEx); 

$forumId = 6; 
$user_ip = '127.0.0.1'; 
/** calling init_userprefs will instantiate $template */ 
$userdata = session_pagestart($user_ip, $forumId); 
init_userprefs($userdata); 

/** 
   might be you have to change this depending on your config-data 
   if you see the smilie image filenames instead of the images... 
*/ 
$board_config['smilies_path'] = $phpbb_root_path . $board_config['smilies_path']; 


$query = 'SELECT topic_title, topic_id, FROM_UNIXTIME(topic_time,"%W the %D %M @ %r") AS Topic_Date, post_text, bbcode_uid, username 

FROM phpbb_topics RIGHT JOIN phpbb_posts_text ON topic_first_post_id=post_id JOIN phpbb_users WHERE forum_id='.$forumId.' AND 

topic_poster=user_id ORDER BY topic_time DESC'; 
$result = $db->sql_query($query); 

?> 
<?php    
while($row = $db->sql_fetchrow($result)) 
{ 
   // this field is in <prefix_>posts, I'm skipping it for now and enable all smilies 
   $row['enable_smilies'] = true; 
   // enable_bbcode (always true) and enable_html (always false) are ignored as well 

   $row['post_text'] = preg_replace('#(<)([\/]?.*?)(>)#is', "<\\2>", $row['post_text']);    
   if ( isset($row['bbcode_uid']) && $row['bbcode_uid'] != '' ) 
      $row['post_text'] = ( $board_config['allow_bbcode'] ) ? bbencode_second_pass($row['post_text'], $row['bbcode_uid']) : 

preg_replace('/\:[0-9a-z\:]+\]/si', ']', $row['post_text']); 
   if ($row['enable_smilies']) 
      $row['post_text'] = smilies_pass($row['post_text']); 
?>
<html> 
   <head> 
      <style tye="text/css"> 
body {
background-color: #666666; 
}
      </style> 
   <title>Reminisce.tk :: Home of the Wrangler</title>
</head>

<body topmargin="0" leftmargin="0" bgcolor="#C0C0C0">

  <center>

  <table border="0" width="782" height="250" cellspacing="0" cellpadding="0">
    <tr>
      <td width="1" height="200" bgcolor="#000000"></td>
      <td width="780" height="200"><OBJECT codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="780" HEIGHT="250" id="header" ALIGN=""><PARAM NAME=movie VALUE="header.swf"><PARAM NAME=quality VALUE=high><PARAM NAME= bgcolor VALUE=#FFFFFF><EMBED src="header.swf" quality=high bgcolor=#FFFFFF  WIDTH="780" HEIGHT="250" NAME="header" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT></td>
      <td width="1" height="200" bgcolor="#000000"></td>
    </tr>
  </table>
<table border="0" width="782" cellspacing="0" cellpadding="0">
    <tr>
      <td width="1" rowspan="2" bgcolor="#000000"><img src="pixel.gif" border=0></td>
      <td width="500" rowspan="2" bgcolor="#FFFFFF"> 
<b><FONT FACE="Arial" SIZE="-1" COLOR="#FDDB3F"> 
         <?php echo $row['topic_title']; ?> 
      </FONT> 
   </b> 
   <br /> 
   <FONT FACE="Arial" SIZE="-2" COLOR="#999999"> 
      posted by: <b><?php echo $row['username']; ?></b> 
      on:   <?php echo $row['Topic_Date']; ?> 
   </FONT> 
   <br /><hr /><br /> 
   <FONT FACE="Arial" SIZE="-1" COLOR="#FFFFFF"><?php echo nl2br($row['post_text']); ?></FONT> 
   <br /><br /> 
   <FONT FACE="Arial" SIZE="-2"> 
      <a href="http://www.hostultra.com/~Gappa/phpBB2/viewtopic.php?t=<?php echo $row['topic_id']; ?> " target=_blank> 
         <b><FONT COLOR="#FDDB3F">Read comments</FONT></b> 
      </a> 
   </FONT> 
   <br /><br /><br /> 
<?php 
} 
?>
</td>
      <td width="300" height="400" background="right2.gif"></td>
      <td width="1" height="400" bgcolor="#000000"></td>
    </tr>
    <tr>
      <td width="300" bgcolor="#FFFFFF"></td>
      <td width="1" bgcolor="#000000"></td>
    </tr>
  </table>

  </center>

   </body> 
</html>
Last edited by Gappa on Wed Jul 02, 2003 8:18 am, edited 1 time in total.
qartis
Forum Contributor
Posts: 271
Joined: Sat Dec 14, 2002 4:43 pm
Location: BC, Canada
Contact:

Post by qartis »

EDIT: Oop, nevermind..
Last edited by qartis on Wed Jul 02, 2003 8:46 am, edited 1 time in total.
Gappa
Forum Contributor
Posts: 119
Joined: Fri May 23, 2003 10:02 am

Post by Gappa »

Eh sorry, left out a "t" in my link.. fixed it now...
Tubbietoeter
Forum Contributor
Posts: 149
Joined: Fri Mar 14, 2003 2:41 am
Location: Germany

Post by Tubbietoeter »

this is because you have the whole sourcecode to display within this loop: while($row = $db->sql_fetchrow($result))
(except the foot of the site)
Gappa
Forum Contributor
Posts: 119
Joined: Fri May 23, 2003 10:02 am

Post by Gappa »

ok its a lil better but the stuff on the right is still repeating when I dont want it to....

Code: Select all

<?php 
define('IN_PHPBB', true); 
/** 
   TODO: set $phpbb_root_path 
*/ 
$phpbb_root_path = 'phpBB2/'; 

include($phpbb_root_path . 'extension.inc'); 
include($phpbb_root_path . 'common.'.$phpEx); 
include($phpbb_root_path . 'includes/bbcode.'.$phpEx); 

$forumId = 6; 
$user_ip = '127.0.0.1'; 
/** calling init_userprefs will instantiate $template */ 
$userdata = session_pagestart($user_ip, $forumId); 
init_userprefs($userdata); 

/** 
   might be you have to change this depending on your config-data 
   if you see the smilie image filenames instead of the images... 
*/ 
$board_config['smilies_path'] = $phpbb_root_path . $board_config['smilies_path']; 


$query = 'SELECT topic_title, topic_id, FROM_UNIXTIME(topic_time,"%W the %D %M @ %r") AS Topic_Date, post_text, bbcode_uid, username 

FROM phpbb_topics RIGHT JOIN phpbb_posts_text ON topic_first_post_id=post_id JOIN phpbb_users WHERE forum_id='.$forumId.' AND 

topic_poster=user_id ORDER BY topic_time DESC'; 
$result = $db->sql_query($query); 

?> 
<html> 
   <head> 
      <style tye="text/css"> 
body {
background-color: #666666; 
}
      </style> 
   <title>Reminisce.tk :: Home of the Wrangler</title>
</head>

<body topmargin="0" leftmargin="0" bgcolor="#C0C0C0">

  <center>

  <table border="0" width="782" height="250" cellspacing="0" cellpadding="0">
    <tr>
      <td width="1" height="200" bgcolor="#000000"></td>
      <td width="780" height="200"><OBJECT codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="780" HEIGHT="250" id="header" ALIGN=""><PARAM NAME=movie VALUE="header.swf"><PARAM NAME=quality VALUE=high><PARAM NAME= bgcolor VALUE=#FFFFFF><EMBED src="header.swf" quality=high bgcolor=#FFFFFF  WIDTH="780" HEIGHT="250" NAME="header" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT></td>
      <td width="1" height="200" bgcolor="#000000"></td>
    </tr>
  </table>
<table border="0" width="782" cellspacing="0" cellpadding="0">
    <tr>
      <td width="1" rowspan="2" bgcolor="#000000"><img src="pixel.gif" border=0></td>
      <td width="500" rowspan="2" bgcolor="#FFFFFF"><?php    
while($row = $db->sql_fetchrow($result)) 
{ 
   // this field is in <prefix_>posts, I'm skipping it for now and enable all smilies 
   $row['enable_smilies'] = true; 
   // enable_bbcode (always true) and enable_html (always false) are ignored as well 

   $row['post_text'] = preg_replace('#(<)([\/]?.*?)(>)#is', "<\\2>", $row['post_text']);    
   if ( isset($row['bbcode_uid']) && $row['bbcode_uid'] != '' ) 
      $row['post_text'] = ( $board_config['allow_bbcode'] ) ? bbencode_second_pass($row['post_text'], $row['bbcode_uid']) : 

preg_replace('/\:[0-9a-z\:]+\]/si', ']', $row['post_text']); 
   if ($row['enable_smilies']) 
      $row['post_text'] = smilies_pass($row['post_text']); 
?> 
<b><FONT FACE="Arial" SIZE="-1" COLOR="#FDDB3F"> 
         <?php echo $row['topic_title']; ?> 
      </FONT> 
   </b> 
   <br /> 
   <FONT FACE="Arial" SIZE="-2" COLOR="#999999"> 
      posted by: <b><?php echo $row['username']; ?></b> 
      on:   <?php echo $row['Topic_Date']; ?> 
   </FONT> 
   <br /><hr /><br /> 
   <FONT FACE="Arial" SIZE="-1" COLOR="#FFFFFF"><?php echo nl2br($row['post_text']); ?></FONT> 
   <br /><br /> 
   <FONT FACE="Arial" SIZE="-2"> 
      <a href="http://www.hostultra.com/~Gappa/phpBB2/viewtopic.php?t=<?php echo $row['topic_id']; ?> " target=_blank> 
         <b><FONT COLOR="#FDDB3F">Read comments</FONT></b> 
      </a> 
   </FONT> 
   <br /><br /><br /> 
<?php 
} 
?>
</td>
      <td width="300" height="400" background="right2.gif"></td>
      <td width="1" height="400" bgcolor="#000000"></td>
    </tr>
    <tr>
      <td width="300" bgcolor="#FFFFFF"></td>
      <td width="1" bgcolor="#000000"></td>
    </tr>
  </table>

  </center>

   </body> 
</html>
...how can i fix that? do i need to terminate the script or something?
Gappa
Forum Contributor
Posts: 119
Joined: Fri May 23, 2003 10:02 am

Post by Gappa »

hmm still no ideas, i guess this is kinda a html question? but if you look at http://www.hostultra.com/~Gappa/index.php the object on the right under the header i do not wish for it to repeat, but sadly it is :(

to be more specifc:

<td width="300" height="400" background="right2.gif"></td>

is repeating, not sure why its out side all the php tags...
Gappa
Forum Contributor
Posts: 119
Joined: Fri May 23, 2003 10:02 am

Post by Gappa »

triple post i know :( so ashamed.... buuuut, i do need some help, i cant see any way i can rearrange the code, so that the image on the right well the entire table cell actually doesnt repeat....
User avatar
cactus
Forum Regular
Posts: 343
Joined: Tue Jun 10, 2003 4:16 am
Location: UK

Post by cactus »

I am unsure of your specific issue but here's a screen-shot of your site:

Mozilla 1.3 (Linux)

http://cactusdesigns.net/grfx/forum/Scr ... c10352.png

?

Regards,
Gappa
Forum Contributor
Posts: 119
Joined: Fri May 23, 2003 10:02 am

Post by Gappa »

Whoa thats weird the flash header doesnt appear for you? But the right hand table doesnt repeat, hell im confused.... :S
User avatar
cactus
Forum Regular
Posts: 343
Joined: Tue Jun 10, 2003 4:16 am
Location: UK

Post by cactus »

I don't have the flash plugin for Moz, sorry ;)

What browsers have you tried it in ?? Are you viewing a cached version ??

Regards,
Gappa
Forum Contributor
Posts: 119
Joined: Fri May 23, 2003 10:02 am

Post by Gappa »

Using IE 6, its not a cached version... I dunno whats going on :(
User avatar
redhair
Forum Contributor
Posts: 300
Joined: Fri May 30, 2003 4:36 pm
Location: 53.23N-6.57E
Contact:

Post by redhair »

Something off topic: Your site http://www.hostultra.com/~Gappa/index.php currently has white fonts on a white background. It's not very readable ;-)
User avatar
cactus
Forum Regular
Posts: 343
Joined: Tue Jun 10, 2003 4:16 am
Location: UK

Post by cactus »

This is what I saw in IE6 today:

Ref : http://cactusdesigns.net/grfx/forum/Scr ... c10352.png

Regards,
Gappa
Forum Contributor
Posts: 119
Joined: Fri May 23, 2003 10:02 am

Post by Gappa »

Yeah, see how the object on the right, repeats itself? I dont want that to happen its a table, well a cell that keeps repeating an im not sure why.

And I will fix the white font after I get thing other thing sorted hehe :)
Tubbietoeter
Forum Contributor
Posts: 149
Joined: Fri Mar 14, 2003 2:41 am
Location: Germany

Post by Tubbietoeter »

try to shoot the code through the w3c code chck thingie, maybe you didn't close all tags or didn't close them on the right line.
this can cause quite funny errors.
Post Reply