Recent Topics

1 Dec 03, 2008 03:59    

My b2evolution Version: Not Entered

Hello everyone,

I haven't been able to find a similar post on this issue of mine so I'm hoping one of you lovely folks can help :)

I'm currently creating a website and want to feature the latest blog posts on the homepage. So I am using a stub and an edited template to display it how I want. The problem I am having is that at the end of the stub content an annoying '1' appears. I have no idea where it is coming from. You can see it here: http://www.pettalk.com.au/_index.php

Here is the stub content:


# You can also create new blogs over there. If you do, you may duplicate this file for the new blog.
$blog = 5;

# You could *force* a specific skin here with this setting: (otherwise, default will be used)
 $skin = 'basic';

# This setting retricts posts to those published, thus hiding drafts.
# You should not have to change this.
$show_statuses = array();

# Here you can set a limit before which posts will be ignored
# You can use a unix timestamp value or 'now' which will hide all posts in the past
$timestamp_min = '';

# Here you can set a limit after which posts will be ignored
# You can use a unix timestamp value or 'now' which will hide all posts in the future
$timestamp_max = 'now';

# Additionnaly, you can set other values (see URL params in the manual)...
# $order = 'ASC'; // This for example would display the blog in chronological order...

/**
 * That's it, now let b2evolution do the rest! :)
 * Note: if you put this file in a subdirectory, you will need to adjust the path below, for example:
 * require_once dirname(__FILE__).'/../conf/_config.php';
 */
require_once dirname(__FILE__).'/conf/_config.php';

require $inc_path.'_blog_main.inc.php';

And here is the edited template:


if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );

if( version_compare( $app_version, '2.4.1' ) < 0 )
{ // Older 2.x skins work on newer 2.x b2evo versions, but newer 2.x skins may not work on older 2.x b2evo versions.
	die( 'This skin is designed for b2evolution 2.4.1 and above. Please <a href="http://b2evolution.net/downloads/index.html">upgrade your b2evolution</a>.' );
}

// This is the main template; it may be used to display very different things.
// Do inits depending on current $disp:
skin_init( $disp );

	// ---------------------------------- START OF POSTS --------------------------------------
		// Display message if no post:
		display_if_empty();

		while( $Item = & mainlist_get_item() )
		{	// For each blog post, do everything below up to the closing curly brace "}"
		?>

		<hr />
			<div id="<?php $Item->anchor_id() ?>" >

			<?php
				$Item->locale_temp_switch(); // Temporarily switch to post locale (useful for multilingual blogs)
			?>

			<h2>
				<a href="<?php $Item->permanent_url() ?>" title="<?php echo T_('Permanent link to full entry') ?>"></a>
				<?php $Item->title(); ?>
			</h2>

						<?php
			// ------------------------------ DATE SEPARATOR ------------------------------
			$MainList->date_if_changed( array(
					'before'      => '<h3>',
					'after'       => '</h3>',
					'date_format' => '#',
				) );
			?>
            
			<blockquote>

				<?php
					$Item->categories( array(
						'before'          => '<small>'.T_('Categories').': ',
						'after'           => '</small>',
						'include_main'    => true,
						'include_other'   => true,
						'include_external'=> true,
						//'link_categories' => true,
					) );
				?>

				<?php
					// ---------------------- POST CONTENT INCLUDED HERE ----------------------
					skin_include( '_item_content.inc.php', array(
							'image_size'	=>	'fit-162x320',
						) );
					// Note: You can customize the default item feedback by copying the generic
					// /skins/_item_feedback.inc.php file into the current skin folder.
					// -------------------------- END OF POST CONTENT -------------------------
				?>

			</blockquote>
	</div>
	<? } ?>
			
	
	

	<?php
		$Hit->log();  // log the hit on this page
		//debug_info();	// output debug info if requested
	?>

Any help is greatly appreciated.

Thanks.

2 Dec 03, 2008 07:23

Welcome to the forums.

I guess you include the posted code in index.main.php or another template file, so please show us the other file also.

3 Dec 04, 2008 01:50

Thanks for the reply sam2kb. I have included the index.main.php - it is the template code?

I then call the stub file through a php include command on my homepage. Is there something I am missing?

4 Dec 08, 2008 03:08

No-one has any ideas? :(

5 Dec 08, 2008 03:49

The problem isn't in the code you posted here. The number 1 appears between the post loop (posted above) and the closing </div> starting with <div class="inside">.
So, post the source of the file where you include the above code.


Form is loading...