My ads are not showing up on PHPBB

Discussion in 'Co-op Advertising Network' started by jim, Dec 12, 2004.

  1. #1
    Can anyone tell me what I'm doing wrong?
    From page_tail:

    	'ADMIN_LINK' => $admin_link)
    );
    
    include ($phpbb_root_path . 'ad_network.php');
    $template->assign_vars(array('AD_NETWORK' => $ad_network[0]));
    $template->assign_vars(array('AD_NETWORK' => $ad_network2[0]));
    $template->assign_vars(array('AD_NETWORK' => $ad_network3[0]));
    $template->assign_vars(array('AD_NETWORK' => $ad_network4[0]));
    $template->assign_vars(array('AD_NETWORK' => $ad_network5[0]));
    
    $template->pparse('overall_footer');
    Code (markup):
    From overall_footer:

    <p align="center"><basefont size="1">{AD_NETWORK}{AD_NETWORK2}{AD_NETWORK3}{AD_NETWORK4}{AD_NETWORK5}</p>
    </body>
    Code (markup):
    I did the other things too...
     
    jim, Dec 12, 2004 IP
  2. ferret77

    ferret77 Heretic

    Messages:
    5,276
    Likes Received:
    230
    Best Answers:
    0
    Trophy Points:
    0
    #2
    add it to page_tail.php right before the exit;
     
    ferret77, Dec 12, 2004 IP
  3. jim

    jim Well-Known Member

    Messages:
    816
    Likes Received:
    53
    Best Answers:
    0
    Trophy Points:
    153
    #3
    Thanks for the suggestion Ferrret. I know have this but it still doesn't work:

    <?php
    /***************************************************************************
     *                              page_tail.php
     *                            -------------------
     *   begin                : Saturday, Feb 13, 2001
     *   copyright            : (C) 2001 The phpBB Group
     *   email                : support@phpbb.com
     *
     *   $Id: page_tail.php,v 1.27.2.2 2002/11/26 11:42:12 psotfx Exp $
     *
     *
     ***************************************************************************/
    
    /***************************************************************************
     *
     *   This program is free software; you can redistribute it and/or modify
     *   it under the terms of the GNU General Public License as published by
     *   the Free Software Foundation; either version 2 of the License, or
     *   (at your option) any later version.
     *
     ***************************************************************************/
    
    if ( !defined('IN_PHPBB') )
    {
    	die('Hacking attempt');
    }
    
    //
    // Show the overall footer.
    //
    $admin_link = ( $userdata['user_level'] == ADMIN ) ? '<a href="admin/index.' . $phpEx . '?sid=' . $userdata['session_id'] . '">' . $lang['Admin_panel'] . '</a><br /><br />' : '';
    
    $template->set_filenames(array(
    	'overall_footer' => ( empty($gen_simple_header) ) ? 'overall_footer.tpl' : 'simple_footer.tpl')
    );
    
    $template->assign_vars(array(
    	'PHPBB_VERSION' => '2' . $board_config['version'],
    	'TRANSLATION_INFO' => ( isset($lang['TRANSLATION_INFO']) ) ? $lang['TRANSLATION_INFO'] : '', 
    	'ADMIN_LINK' => $admin_link)
    );
    
    include ($phpbb_root_path . 'ad_network.php');
    $template->assign_vars(array('AD_NETWORK' => $ad_network[0]));
    $template->assign_vars(array('AD_NETWORK' => $ad_network2[0]));
    $template->assign_vars(array('AD_NETWORK' => $ad_network3[0]));
    $template->assign_vars(array('AD_NETWORK' => $ad_network4[0]));
    $template->assign_vars(array('AD_NETWORK' => $ad_network5[0]));
    
    $template->pparse('overall_footer');
    
    //
    // Close our DB connection.
    //
    $db->sql_close();
    
    //
    // Compress buffered output if required and send to browser
    //
    if ( $do_gzip_compress )
    {
    	//
    	// Borrowed from php.net!
    	//
    	$gzip_contents = ob_get_contents();
    	ob_end_clean();
    
    	$gzip_size = strlen($gzip_contents);
    	$gzip_crc = crc32($gzip_contents);
    
    	$gzip_contents = gzcompress($gzip_contents, 9);
    	$gzip_contents = substr($gzip_contents, 0, strlen($gzip_contents) - 4);
    
    	echo "\x1f\x8b\x08\x00\x00\x00\x00\x00";
    	echo $gzip_contents;
    	echo pack('V', $gzip_crc);
    	echo pack('V', $gzip_size);
    }
    include ($phpbb_root_path . 'ad_network.php');
    $template->assign_vars(array('AD_NETWORK' => $ad_network[0]));
    $template->assign_vars(array('AD_NETWORK' => $ad_network2[0]));
    $template->assign_vars(array('AD_NETWORK' => $ad_network3[0]));
    $template->assign_vars(array('AD_NETWORK' => $ad_network4[0]));
    $template->assign_vars(array('AD_NETWORK' => $ad_network5[0]));
    exit;
    
    ?>
    Code (markup):
     
    jim, Dec 13, 2004 IP
  4. thebassman

    thebassman Asleep at the Keyboard

    Messages:
    1,105
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    140
    #4
    make the adnetwork section look like this:

    include ($phpbb_root_path . 'ad_network.php');
    $template->assign_vars(array('AD_NETWORK1' => $ad_network[0]));
    unset ($ad_network);
    include ($phpbb_root_path . 'ad_network.php');
    $template->assign_vars(array('AD_NETWORK2' => $ad_network[0]));
    unset ($ad_network);
    include ($phpbb_root_path . 'ad_network.php');
    $template->assign_vars(array('AD_NETWORK3' => $ad_network[0]));
    unset ($ad_network);
    include ($phpbb_root_path . 'ad_network.php');
    $template->assign_vars(array('AD_NETWORK4' => $ad_network[0]));
    unset ($ad_network);
    include ($phpbb_root_path . 'ad_network.php');
    $template->assign_vars(array('AD_NETWORK5' => $ad_network[0]));
    unset ($ad_network);
    Code (markup):
    and you should bo good to go.
     
    thebassman, Dec 13, 2004 IP
  5. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #5
    Actually, it should look like this:

    include ($phpbb_root_path . 'ad_network.php');
    $template->assign_vars(array('AD_NETWORK' => $ad_network[0]));
    $template->assign_vars(array('AD_NETWORK2' => $ad_network[1]));
    $template->assign_vars(array('AD_NETWORK3' => $ad_network[2]));
    $template->assign_vars(array('AD_NETWORK4' => $ad_network[3]));
    $template->assign_vars(array('AD_NETWORK5' => $ad_network[4]));
    PHP:
     
    digitalpoint, Dec 13, 2004 IP
  6. thebassman

    thebassman Asleep at the Keyboard

    Messages:
    1,105
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    140
    #6
    Why does mine look different?
     
    thebassman, Dec 13, 2004 IP
  7. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #7
    I dunno... the way I posted though would be less resource intensive and cleaner on your end though.
     
    digitalpoint, Dec 13, 2004 IP
  8. thebassman

    thebassman Asleep at the Keyboard

    Messages:
    1,105
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    140
    #8
    Hmm... I think we changed mine a while back for whatever reason... don't want to frig with it. :p
     
    thebassman, Dec 13, 2004 IP
  9. jim

    jim Well-Known Member

    Messages:
    816
    Likes Received:
    53
    Best Answers:
    0
    Trophy Points:
    153
    #9
    I now ahve this, which only shows one ad instead of 5. Does anyone know why I only get one ad? Maybe my footer?
    <?php
    /***************************************************************************
     *                              page_tail.php
     *                            -------------------
     *   begin                : Saturday, Feb 13, 2001
     *   copyright            : (C) 2001 The phpBB Group
     *   email                : support@phpbb.com
     *
     *   $Id: page_tail.php,v 1.27.2.2 2002/11/26 11:42:12 psotfx Exp $
     *
     *
     ***************************************************************************/
    
    /***************************************************************************
     *
     *   This program is free software; you can redistribute it and/or modify
     *   it under the terms of the GNU General Public License as published by
     *   the Free Software Foundation; either version 2 of the License, or
     *   (at your option) any later version.
     *
     ***************************************************************************/
    
    if ( !defined('IN_PHPBB') )
    {
    	die('Hacking attempt');
    }
    
    //
    // Show the overall footer.
    //
    $admin_link = ( $userdata['user_level'] == ADMIN ) ? '<a href="admin/index.' . $phpEx . '?sid=' . $userdata['session_id'] . '">' . $lang['Admin_panel'] . '</a><br /><br />' : '';
    
    $template->set_filenames(array(
    	'overall_footer' => ( empty($gen_simple_header) ) ? 'overall_footer.tpl' : 'simple_footer.tpl')
    );
    
    $template->assign_vars(array(
    	'PHPBB_VERSION' => '2' . $board_config['version'],
    	'TRANSLATION_INFO' => ( isset($lang['TRANSLATION_INFO']) ) ? $lang['TRANSLATION_INFO'] : '', 
    	'ADMIN_LINK' => $admin_link)
    );
    
    include ($phpbb_root_path . 'ad_network.php'); 
    $template->assign_vars(array('AD_NETWORK' => $ad_network[0])); 
    $template->assign_vars(array('AD_NETWORK' => $ad_network[1])); 
    $template->assign_vars(array('AD_NETWORK' => $ad_network[2])); 
    $template->assign_vars(array('AD_NETWORK' => $ad_network[3])); 
    $template->assign_vars(array('AD_NETWORK' => $ad_network[4])); 
    
    $template->pparse('overall_footer');
    
    //
    // Close our DB connection.
    //
    $db->sql_close();
    
    //
    // Compress buffered output if required and send to browser
    //
    if ( $do_gzip_compress )
    {
    	//
    	// Borrowed from php.net!
    	//
    	$gzip_contents = ob_get_contents();
    	ob_end_clean();
    
    	$gzip_size = strlen($gzip_contents);
    	$gzip_crc = crc32($gzip_contents);
    
    	$gzip_contents = gzcompress($gzip_contents, 9);
    	$gzip_contents = substr($gzip_contents, 0, strlen($gzip_contents) - 4);
    
    	echo "\x1f\x8b\x08\x00\x00\x00\x00\x00";
    	echo $gzip_contents;
    	echo pack('V', $gzip_crc);
    	echo pack('V', $gzip_size);
    }
    
    exit;
    
    ?>
    Code (markup):
     
    jim, Dec 13, 2004 IP
  10. thebassman

    thebassman Asleep at the Keyboard

    Messages:
    1,105
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    140
    #10
    Yeah, what do you have in your overall_footer.tpl file?
     
    thebassman, Dec 13, 2004 IP
  11. jim

    jim Well-Known Member

    Messages:
    816
    Likes Received:
    53
    Best Answers:
    0
    Trophy Points:
    153
    #11
    Same as before:
    <p align="center"><basefont size="1">{AD_NETWORK}{AD_NETWORK2}{AD_NETWORK3}{AD_NETWORK4}{AD_NETWORK5}</p>
    </body
    Code (markup):
     
    jim, Dec 14, 2004 IP
  12. thebassman

    thebassman Asleep at the Keyboard

    Messages:
    1,105
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    140
    #12
    What's the URL?
     
    thebassman, Dec 14, 2004 IP
  13. Arnica

    Arnica Peon

    Messages:
    320
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #13
    Jim it looks like you've only 'filled' {AD_NETWORK}

    Taken from your previous post.
     
    Arnica, Dec 14, 2004 IP
  14. jim

    jim Well-Known Member

    Messages:
    816
    Likes Received:
    53
    Best Answers:
    0
    Trophy Points:
    153
    #14
    Thanks Arnica! You win the prize.
     
    jim, Dec 14, 2004 IP
  15. General Grant

    General Grant Well-Known Member

    Messages:
    318
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    160
    #15
    In my includes/page_tail I have the following just above the exit:
    
    include ($phpbb_root_path . 'ad_network.php'); 
    $template->assign_vars(array('AD_NETWORK' => $ad_network[0])); 
    $template->assign_vars(array('AD_NETWORK2' => $ad_network[1])); 
    $template->assign_vars(array('AD_NETWORK3' => $ad_network[2])); 
    $template->assign_vars(array('AD_NETWORK4' => $ad_network[3])); 
    $template->assign_vars(array('AD_NETWORK5' => $ad_network[4]));
    Code (markup):
    In my overall_footer, I have the following:
    <p align="center">{AD_NETWORK}{AD_NETWORK2}{AD_NETWORK3}{AD_NETWORK4}{AD_NETWORK5}</p> 
    
    Code (markup):
    But the ads are not showing. What am I doing wrong?


    The forum is at http://civil-war-auctions.clickhereforit.com/forum/
     
    General Grant, Jan 12, 2005 IP
  16. dcristo

    dcristo Illustrious Member

    Messages:
    19,776
    Likes Received:
    1,200
    Best Answers:
    7
    Trophy Points:
    470
    Articles:
    7
    #16
    I figured thats how it should be. You may want to edit your setup instructions slightly, either that or I just cant follow em properly. It took me a good while to figure out to change the additional ads to $ad_network[1], $ad_network[2] etc In the instructions it only states to change the 'AD_NETWORK' part of the code for additional ads. If you only do this it shows the exact same ad.
     
    dcristo, Jan 12, 2005 IP
  17. dcristo

    dcristo Illustrious Member

    Messages:
    19,776
    Likes Received:
    1,200
    Best Answers:
    7
    Trophy Points:
    470
    Articles:
    7
    #17
    dcristo, Jan 12, 2005 IP