treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Including my header on phpBB

  • Hey guys.

    Ok, so i'm not really sure whether or not i'm out of line for posting this, but if i am i apologize in advance.

    I am currently developing af danish news site about Android (located at www.ndroid.dk), and for that site i wanted to include a forum. I am not happy with the current available Wordpress forum's, and since our site is non-profit, i went to gold old phpBB - as i have a lot of time before.

    My phpBB installation is located at www.ndroid.dk/forum/

    What i really wanted to do, was integrate our phpBB forum somewhat into the site, and it was searching the web about that, that i stumbled upon this site and your video tutorial on how to do just that (video #48). I have pretty good understanding of how HTML and CSS works, but i would call myself an extreme novice when it comes to PHP.

    I of course ran into several problems with the integration on my header, and i think its mainly due to the fact that our current Wordpress theme, is quite advanced and calls a lot of PHP in the header - which somehow doesn't get called when they are suddenly called from the /forum/ directory (i might be 100% off though).

    My header.php looks like this, and i tried copying everything from after the "body" tag, as you explained in the tut, to my overall_header file


    <!DOCTYPE html>
    <html <?php language_attributes(); ?>>
    <head>

    <meta http-equiv="content-type" content="text/html; charset=utf-8" />

    <title><?php wp_title('', true, 'left'); ?></title>

    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" />
    <link rel="stylesheet" href="<?php bloginfo('template_directory'); ?>/js/colorbox/colorbox.css" type="text/css" />

    <?php if(get_option('pyre_feedburner')): ?>
    <link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php echo get_option('pyre_feedburner'); ?>" />
    <?php endif; ?>

    <?php if(get_option('pyre_favicon')): ?>
    <link rel="shortcut icon" href="<?php echo get_option('pyre_favicon'); ?>" />
    <?php endif; ?>

    <?php wp_enqueue_script('jquery'); ?>
    <?php wp_enqueue_script('jCarouselLite', get_bloginfo('template_directory'). '/js/jcarousellite_1.0.1.pack.js'); ?>
    <?php wp_enqueue_script('nivo', get_bloginfo('template_directory'). '/js/jquery.nivo.slider.pack.js'); ?>
    <?php wp_enqueue_script('jquery.colorbox', get_bloginfo('template_directory'). '/js/colorbox/jquery.colorbox-min.js'); ?>
    <?php wp_enqueue_script('AvenueTheme', get_bloginfo('template_directory'). '/js/scripts.js'); ?>
    <?php
    wp_localize_script('AvenueTheme', 'AvenueVars', array(
    'ajaxUrl' => admin_url('admin-ajax.php'),
    ));
    ?>
    <?php if(is_singular()) { wp_enqueue_script('comment-reply'); } ?>
    <?php wp_head(); ?>

    <script type='text/javascript'>
    jQuery(window).load(function() {
    // Implementation of Nivo Slider
    jQuery('#slider').nivoSlider({
    effect: '<?php echo get_option('pyre_slider_effect'); ?>',
    pauseTime: '<?php echo get_option('pyre_slider_speed'); ?>',
    controlNavThumbs: true,
    controlNavThumbsFromRel: true,
    directionNav: false,
    directionNavHide: false,
    captionOpacity: false
    });

    jQuery('.nivo-control').each(function() {
    jQuery('<div class="overlay">').appendTo(this);
    });
    });
    </script>

    <style type='text/css'>
    body { background:#<?php echo get_option('pyre_bg_color'); ?> url('<?php bloginfo('template_url'); ?>/images/patterns/<?php echo get_option('pyre_pattern'); ?>.png') repeat; }
    .arrows { color:#<?php echo get_option('pyre_link_color'); ?>; }
    .block-arrows, .block-arrows a { color:#<?php echo get_option('pyre_link_color'); ?>; }
    .meta-arrow { font-size:16px; color:#<?php echo get_option('pyre_link_color'); ?>; }
    .tweets a, .textwidget a { color:#<?php echo get_option('pyre_link_color'); ?>; }
    </style>

    </head>

    <body <?php body_class($class); ?>>
    <a name='top'></a>

    <!-- BEGIN WRAPPER -->
    <div id="wrapper">

    <!-- BEGIN HEADER-TOP -->
    <?php wp_nav_menu(array('theme_location' => 'topNav', 'depth' => 3, 'fallback_cb' => false, 'menu_class' => 'topNav')); ?>
    <!-- END HEADER-TOP -->

    <!-- BEGIN WRAPPER-CONTENT -->
    <div id="wrapper-content">

    <!-- BEGIN HEADER -->
    <div id="header">

    <!-- BEGIN HEADER-MIDDLE -->
    <div id="header-middle">
    <?php if(get_option('pyre_header_banner')): ?>
    <div id="header-banner">
    <?php echo get_option('pyre_header_banner'); ?>
    </div>
    <?php endif; ?>
    <div id="logo">
    <?php
    if(get_option('pyre_logo')) {
    $logo = get_option('pyre_logo');
    } else {
    if(get_option('pyre_skins')) {
    $color = explode('_', get_option('pyre_skins'));
    $logo = get_bloginfo('template_directory') . '/css/skins/images/' . $color[1] . '_logo.png';
    } else {
    $logo = get_bloginfo('template_directory') . '/images/logo4.png';
    }
    }
    ?>
    <a href='<?php bloginfo('wpurl'); ?>'><img src="<?php echo $logo; ?>" alt="<?php bloginfo('name'); ?>" /></a>
    </div>
    </div>
    <!-- END HEADER-MIDDLE -->
    <!-- BEGIN WRAPPER-NAVIGATION -->
    <div id="wrapper-navigation">

    <div id="navigation">
    <?php wp_nav_menu(array('theme_location' => 'mainNav', 'depth' => 3)); ?>
    </div>

    </div>
    <!-- END WRAPPER-NAVIGATION -->

    </div>
    <!-- END HEADER -->



    I also added the tag to the overall_footer file. I also added the relative link to my style.css file to my overall_header.

    The result was a 100% mess, where the phpBB itself lost all styling, and none of my own header appeared. After the page got cached, it showed only a blank page, and i had to delete the cache files to show the mess once more, before it showed blank page again when the new cache was made.

    I apologize for bad english, as this isn't my native tongue.

    - Rasmus