Skip to:
Content
Pages
Categories
Search
Top
Bottom

Conforming bbPress to my website

  • I have a big main section on my website and I would like for the entire bbPress program to reside there and look and act like it does as a freestanding, or as best it can.

    I can easily do this with WordPress but this is much different. For thing, it seems that there can only be one stylesheet, so I have to copy bbPress’s stylesheet and paste it into mine and name it style.css. then rename the divs with the same names.

    This is what I want it to be:

    <My website>

    <my header></close my header>

    <my navigation></close my navigation>

    <my mainsection or column is 900px wide>

    <<< Here will go the entire bbPress program >>>

    </close my mainsection or column>

    </close My website>

    Here’s how I have the header.php:

    <<<<—- Start of header.php —->>>>

    <?php

    $_head_profile_attr = ”;

    if ( bb_is_profile() ) {

    global $self;

    if ( !$self ) {

    $_head_profile_attr = ‘ profile=”http://www.w3.org/2006/03/hcard”&#8216;;

    }

    }

    ?>

    <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.1//EN” “http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd”&gt;

    <html xmlns=”http://www.w3.org/1999/xhtml”&lt;?php bb_language_attributes( ‘1.1’ ); ?>>

    <head<?php echo $_head_profile_attr; ?>>

    <meta http-equiv=”X-UA-Compatible” content=”IE=8″ />

    <meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ />

    <title><?php bb_title() ?></title>

    <link rel=’stylesheet’ href=’style.css’ type=’text/css’ charset=’utf-8′ />

    <link rel=”stylesheet” href=”<?php bb_stylesheet_uri(); ?>” type=”text/css” />

    <?php if ( ‘rtl’ == bb_get_option( ‘text_direction’ ) ) : ?>

    <link rel=”stylesheet” href=”<?php bb_stylesheet_uri( ‘rtl’ ); ?>” type=”text/css” />

    <?php endif; ?>

    <?php bb_feed_head(); ?>

    <?php bb_head(); ?>

    </head>

    <body>

    <!–Begin top of My Website–>

    <div id=’al_wrapper’>

    <div id=’al_sub_wrapper’>

    <div id=’al_head’>

    <h1>Title</h1>

    <h4>Tag Line</h4>

    </div>

    <div id=’pagetitle’>

    <div id=’bread’>You are here: Home » This Page</div>

    </div>

    <div id=’al_both’>

    <div id=’my_right’>

    <div id=’inside_my_right’>

    <h2 class=’myright’>This Page</h2>

    <!–End top of My Website–>

    <body id=”<?php bb_location(); ?>”>

    <div id=”wrapper”>

    <div id=”header” role=”banner”>

    <h1>“><?php bb_option(‘name’); ?></h1>

    <?php if ( bb_get_option(‘description’) ) : ?><p class=”description”><?php bb_option(‘description’); ?></p><?php endif; ?>

    <?php if ( !in_array( bb_get_location(), array( ‘login-page’, ‘register-page’ ) ) ) login_form(); ?>

    <div class=”search”><?php search_form(); ?></div>

    </div>

    <div id=”main”>

    <?php if ( bb_is_profile() ) profile_menu(); ?>

    <<<<—- End of header.php —->>>>

    <<<<—- Start of footer.php —->>>>

    </div>

    </div>

    <div id=”footer” role=”contentinfo”>

    </body>

    </div>

    <?php do_action(‘bb_foot’); ?>

    <!–Beging of My Website footer–>

    </div>

    </div>

    </div><!–end both–>

    <div class=’spacer_20′></div>

    <div id=’al_footer’>

    Content copyright 2010. Mywebsite.com – All rights reserved.

    Home  · 

    Privacy Policy  · 

    Terms of Use  · 

    Contact Me

    </div>

    </div><!–end al_subwrapper–>

    </div><!–end al_wrapper–>

    <!–End My Website footer–>

    </body>

    </html>

    <<<<—- End of footer.php —->>>>

    Using this, the look of my website is OK but the bbPress is all jumbled up and not right. Any help would be appreciated.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hey ,

    The plugin works as intended for topic views. However, I’ve got trouble with forum view counts.

    I’ve copied the ‘forums_views_append’ function to the php file (renamed to ‘forums_views_appendaa’ because of some name conflict) of the plugin, and I’ve added add_filter(‘get_forums’,’forums_views_appendaa’);

    I’ve called ‘var_dump(get_object_vars($forum));’ instead of ‘echo $forum->views’ inside the views cell in forum.php, giving me output

    array(9) {

    [“forum_id”]=> string(1) “2”

    [“forum_name”]=> string(6) “Ostalo”

    [“forum_slug”]=> string(6) “ostalo”

    [“forum_desc”]=> string(37) “Sve što ne spada u ostale kategorije”

    [“forum_parent”]=> string(1) “0”

    [“forum_order”]=> string(1) “8”

    [“topics”]=> string(1) “0”

    [“posts”]=> string(1) “0”

    [“forum_is_category”]=> string(1) “1”

    }

    Clearly no ‘views’ field has been defined in the filter function.

    That function is being called properly, as it echoes if I insert an echo command. I’ve found that the $forums_views variable is empty after the SQL call, which indeed creates no ‘views’ field in $forum. However, I’m lost on what to do next. Hopefully you can help me out.

    Here’s the filter function:

    function forums_views_appendaa($forums) {

    global $bbdb; $sum_meta_value=”SUM(meta_value)”;

    $forums_views = $bbdb->get_results(” SELECT $sum_meta_value,forum_id FROM $bbdb->topicmeta LEFT JOIN $bbdb->topics ON $bbdb->topicmeta.topic_id = $bbdb->topics.topic_id WHERE $bbdb->topicmeta.meta_key=’views’ GROUP BY $bbdb->topics.forum_id”);

    print_r ($forums_views);

    foreach ($forums_views as $forum_views) {

    $forums[$forum_views->forum_id]->views=$forum_views->$sum_meta_value;

    }

    echo ‘filter executed’;

    return $forums;

    }

    Hey ,

    The plugin works as intended for topic views. However, I’ve got trouble with forum view counts.

    I’ve copied the ‘forums_views_append’ function to the php file (renamed to ‘forums_views_appendaa’ because of some name conflict) of the plugin, and I’ve added add_filter(‘get_forums’,’forums_views_appendaa’);

    I’ve called ‘var_dump(get_object_vars($forum));’ instead of ‘echo $forum->views’ inside the views cell in forum.php, giving me output

    array(9) {

    [“forum_id”]=> string(1) “2”

    [“forum_name”]=> string(6) “Ostalo”

    [“forum_slug”]=> string(6) “ostalo”

    [“forum_desc”]=> string(37) “Sve što ne spada u ostale kategorije”

    [“forum_parent”]=> string(1) “0”

    [“forum_order”]=> string(1) “8”

    [“topics”]=> string(1) “0”

    [“posts”]=> string(1) “0”

    [“forum_is_category”]=> string(1) “1”

    }

    Clearly no ‘views’ field has been defined in the filter function.

    That function is being called properly, as it echoes if I insert an echo command. I’ve found that the $forums_views variable is empty after the SQL call, which indeed creates no ‘views’ field in $forum. However, I’m lost on what to do next. Hopefully you can help me out.

    Here’s the filter function:

    function forums_views_appendaa($forums) {

    global $bbdb; $sum_meta_value=”SUM(meta_value)”;

    $forums_views = $bbdb->get_results(” SELECT $sum_meta_value,forum_id FROM $bbdb->topicmeta LEFT JOIN $bbdb->topics ON $bbdb->topicmeta.topic_id = $bbdb->topics.topic_id WHERE $bbdb->topicmeta.meta_key=’views’ GROUP BY $bbdb->topics.forum_id”);

    print_r ($forums_views);

    foreach ($forums_views as $forum_views) {

    $forums[$forum_views->forum_id]->views=$forum_views->$sum_meta_value;

    }

    echo ‘filter executed’;

    return $forums;

    }

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Skip to toolbar