Recent Topics

1 Jun 14, 2009 23:55    

My b2evolution Version: 3.2.0 Beta

In every version of b2, since it was in shorts, I've used the following code in .index.main.php, to place a Google Ad between the first and second post...
It stopped working with the new version.
I've tried it in index.main.php and in _item_block.inc.php with no luck.
Any suggestions welcomed

<?php
      if ( empty( $shown_advert) || ! $shown_advert )
    {
?>
<p class="money">
<script type="text/javascript"><!-- 
google_ad_client = "pub-##%$&##*$**#";
//After First Post
google_ad_slot = "##%$&##*$**#";
google_ad_width = 468;
google_ad_height = 60;
--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
<?php
      $shown_advert = 1;
    }
}// ---------------------------------- END OF POSTS ------------------------------------ ?>

2 Jun 20, 2009 03:34

Solved... in index.main.php

<?php
		// --------------------------------- 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 "}"

			
			// ---------------------- ITEM BLOCK INCLUDED HERE ------------------------
			skin_include( '_item_block.inc.php', array(
					'content_mode' => 'auto',		// 'auto' will auto select depending on $disp-detail
					'image_size'	 =>	'fit-400x320',
				) );
			// ----------------------------END ITEM BLOCK  ---------------------------- ?>
			<?php
			  if ( empty( $shown_advert) || ! $shown_advert )
			{
			?>
			<p class="money">
			<script type="text/javascript"><!-- 
			google_ad_client = "pub-##%$&##*$**#";
			//After First Post
			google_ad_slot = "##%$&##*$**#";
			google_ad_width = 468;
			google_ad_height = 60;
			--></script>
			<script type="text/javascript"
			src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
			</p>
			<?php
			  $shown_advert = 1;
			}
		} // ---------------------------------- END OF POSTS ------------------------------------
	?>

3 Jun 20, 2009 07:45

An even better method, I think, is to display an ad block after every 3-4 posts

$i = 0;
while( $Item = & mainlist_get_item() )
{
    if( $i == 2 || $i == 5 )
    {
        // display ad
    }
    
    .........

$i++
}


Form is loading...