Recent Topics

1 May 20, 2005 04:02    

Not sure if this belongs in this particular category but ...

I'm having trouble displaying my posts the way I would like. Here's the page with them, http://www.ewanmcgregor.org/index.php . I embed the posts using a php include pointing to news/index.php because I don't like having it as a main page.

My problem is as you may be able to tell, the post from the 18th is not showing up like the 19th. It's supposed to be in those coloured tables as well but it's not showing up that way. Here's my code ...

<?php
	/**
	 * This is the main template. It displays the blog.
	 *
	 * However this file is not meant to be called directly.
	 * It is meant to be called automagically by b2evolution.
	 * To display a blog, you should call a stub file instead, for example:
	 * /blogs/index.php or /blogs/blog_b.php
	 *
	 * b2evolution - {@link http://b2evolution.net/}
	 * Released under GNU GPL License - {@link http://b2evolution.net/about/license.html}
	 * @copyright (c)2003-2004 by Francois PLANQUE - {@link http://fplanque.net/}
	 *
	 * @package evoskins
	 * @subpackage custom
	 */
if( !defined('DB_USER') ) die( 'Please, do not access this page directly.' );
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php locale_lang() ?>" lang="<?php locale_lang() ?>">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php locale_charset() ?>" />

<meta name="generator" content="b2evolution <?php echo $b2_version ?>" /> <!-- Please leave this for stats -->
</head>
<body>

<table width="390" cellpadding="2">
<tr>
<td width=390 class=tl><p align="right"><b>
<?php // ------------------------------------ START OF POSTS ----------------------------------------
	if( isset($MainList) ) while( $Item = $MainList->get_item() )
	{
		$Item->issue_date('d F, Y');
	?> • <?php $Item->title(); ?></b></td></tr>
<tr><td width=390 class=tf>
<div align="justify"><img src="img/icon_minipost.gif" width="12" height="9" border="0"> <?php the_author() ?> • 
			<?php
			$Item->issue_time();
                        		echo ' &nbsp; ';
			$Item->wordcount();
			echo ' ', T_('words'), ' &nbsp; ';
			?> 	
                        <?php $Item->content(); ?></div></td></tr></table>
<?php } // ---------------------------------- END OF POSTS ------------------------------------ ?>

I figured the problem was a closing tag somewhere but I can't figure out why it's not wanting to display every post in the manner as the first. Can any help me please!? I am supposed to open this site tonight and I don't think I'll be able to.

2 May 20, 2005 04:53

Unfortunately, there's not a quick fix for your problem, because there are several issues with your page. The biggest is that you've copied code from the top of one page, and put it into the middle of another page. As a result, you've got multiple HTML and HEAD tags, and your doctype declaration is in the middle of the page (it should be at the very top).

It would take a while to go line by line through the errors, but here is a good way to start:

Step 1: Take these two lines and put them at the very top of your page.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php locale_lang() ?>" lang="<?php locale_lang() ?>">

Step 2: Remove the following lines completely

<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php locale_charset() ?>" />

<meta name="generator" content="b2evolution <?php echo $b2_version ?>" /> <!-- Please leave this for stats -->
</head>
<body>

Step 3: Convert all the HTML tags in the other parts of your page to be all lower-case (required for step 4)

Step 4: Go to http://validator.w3.org/detailed.html and enter the URL to your page. It will validate your site and tell you where you have tags that are not closed, etc.

Sorry I couldn't provide a simpler solution, but I hope this is helpful.

3 May 20, 2005 06:50

woo! I fixed it!!! The problem was in the

<td width=390 class=tl><p align="right"><b>
<?php // ------------------------------------ START OF POSTS ----------------------------------------
	if( isset($MainList) ) while( $Item = $MainList->get_item() )
	{
		$Item->issue_date('d F, Y');
	?> • <?php $Item->title(); ?></b></td></tr>

section. I changed it to ...

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php locale_lang() ?>" lang="<?php locale_lang() ?>"> 

<?php // ------------------------------------ START OF POSTS ----------------------------------------
	if( isset($MainList) ) while( $Item = $MainList->get_item() )
	{	?>

<table width="390" cellpadding="2">
<tr>
<td width=390 class=tl><p align="right"><b>
<?php $Item->issue_date('d F, Y'); ?> • <?php $Item->title(); ?></b></td></tr>
<tr><td width=390 class=tf>
<div align="justify"><img src="img/icon_minipost.gif" width="12" height="9" border="0"> <?php the_author() ?> • 
			<?php
			$Item->issue_time();
                        		echo ' &nbsp; ';
			$Item->wordcount();
			echo ' ', T_('words'), ' &nbsp; ';
			?> 	
                        <?php $Item->content(); ?></div></td></tr></table>
<?php } // ---------------------------------- END OF POSTS ------------------------------------ ?>

AND IT WORKS! WOO! Thanks for your help, it helped steer me to the problem! :-D


Form is loading...