Trying to match a wordpress header.

phpBB3 styling support, style coding, and style graphics assistance.
Forum rules
Style coding and style related questions only.

Trying to match a wordpress header.

Postby jakc » 10 Apr 2011, 03:49

Running Wordpress v3.1.1 with a theme called boldy. Site can be seen here.
Running phpBB v3.0.8 with the standard ProSilver theme. Its a default install and sits here.

With the help of a great video, I want to try and match the header from my WP theme in my phpBB site.
i.e. I want it to visually appear seamless between phpBB and WP.
Actually, it will probably only be the top green bit and the menus and search panel that sit within it.

However, I have fallen over fairly early.

These are the steps I took:

1. Opened my header.php from my WP theme. (Source for this can be seen here)
2. Copied the folling code:
Code: Select all
<!-- BEGIN WRAPPER -->
    <div id="wrapper">
      <!-- BEGIN HEADER -->
        <div id="header">
            <div id="logo"><a href="<?php bloginfo('url'); ?>/"><img src="<?php echo get_option('boldy_logo_img'); ?>" alt="<?php echo get_option('boldy_logo_alt'); ?>" /></a></div>
            <div id="logo2"><a href="http://www.esriaustralia.com.au/esri/4619.html"><img src="<?php echo get_option('boldy_logo2_img'); ?>" alt="<?php echo get_option('boldy_logo2_alt'); ?>" /></a></div>
         <!-- BEGIN MAIN MENU -->
         <?php if ( function_exists( 'wp_nav_menu' ) ){
               wp_nav_menu( array( 'theme_location' => 'main-menu', 'container_id' => 'mainMenu', 'container_class' => 'ddsmoothmenu', 'fallback_cb'=>'primarymenu') );
            }else{
               primarymenu();
         }?>
            <!-- END MAIN MENU -->
         <!-- BEGIN TOP SEARCH -->
         <div id="topSearch">
            <form id="searchform" action="<?php bloginfo('url'); ?>/" method="get">
               <input type="submit" value="" id="searchsubmit"/>
               <input type="text" id="s" name="s" value="type your search" />
            </form>
         </div>
         <!-- END TOP SEARCH -->


3. Pasted this code into ProSilvers overall_header.html file - (source can be seen here)
Code: Select all
</head>

<body id="phpbb" class="section-{SCRIPT_NAME} {S_CONTENT_DIRECTION}">

<!-- header to match Boldy theme -->
    <div id="wrapper">
      
   <!-- BEGIN MAIN MENU -->
         <?php if ( function_exists( 'wp_nav_menu' ) ){
               wp_nav_menu( array( 'theme_location' => 'main-menu', 'container_id' => 'mainMenu', 'container_class' => 'ddsmoothmenu', 'fallback_cb'=>'primarymenu') );
            }else{
               primarymenu();
         }?>
            <!-- END MAIN MENU -->
         <!-- BEGIN TOP SEARCH -->
         <div id="topSearch">
            <form id="searchform" action="<?php bloginfo('url'); ?>/" method="get">
               <input type="submit" value="" id="searchsubmit"/>
               <input type="text" id="s" name="s" value="type your search" />
            </form>
         </div>
         <!-- END TOP SEARCH (all the above has been pasted in from Boldy themes header-->

<div id="wrap">
   <a id="top" name="top" accesskey="t"></a>
   <div id="page-header">


4. Also added a /div tag to the overall_footer, as mentioned in the video.

So, that ends up giving me the following error:

Parse error: syntax error, unexpected T_STRING in /home6/dekhofor/public_html/forum/includes/template.php(668) : eval()'d code on line 107

I assume its having issues executing the php?

Would really like some help on solving this. Im new to PHP, but keen to learn. :D
jakc
Crewman
Crewman
 
Posts: 4
Joined: 10 Apr 2011, 03:15
Gender: Male
phpBB Knowledge: 4




phpBB Academy at StarTrekGuide
Support STG
Using PayPal Donate

Re: Trying to match a wordpress header.

Postby zrox » 10 Apr 2011, 05:42

Few points...

You can't run php in phpBB template unless its enable from ACP (for security reason(more of Co-Admin Trust factor) it is recommend to have it disable).

Wordpress template function won't work in phpBB .. unless you call worpress in phpBB.

Code: Select all

    require
( '../wordpress/wp-load.php' );
 


P.S. WordPress and phpBB might have some conflicts. Please take look at wp-united mod.
php Knowledge: 2
phpBB Knowledge: 4

.... Under Rating is OK but Over Rating your knowledge is Bad.
User avatar
zrox
Lt. Jr Grade
Lt. Jr Grade
 
Posts: 104
Joined: 05 May 2008, 01:08
Location: Mumbai
Gender: Male
phpBB Knowledge: 4

Re: Trying to match a wordpress header.

Postby jakc » 11 Apr 2011, 00:25

Thanks.

Please take look at wp-united mod.

Have heard good things about the mod, and was hoping it would be the answer to all my problems.
I quote:
you can also choose to have phpBB appear inside a WordPress page!

I also heard the author was looking to make the tool more as a plugin for WP, making it easy to install and manage.

However, the main website has been down for well over 4mths, therefore even if it comes back up, my confidence in it being a futureproof option is low.

Hence, I am looking on how to bodge making my phpBB install appear the same as my WP theme.

So, I will enabled PHP from ACP.

Wordpress template function won't work in phpBB .. unless you call worpress in phpBB.

This makes sense.
You mention wp-load. Will adding this in, allow me to call the function that I assume its having problems with - wp_nav_menu?

Thanks for your patience.
jakc
Crewman
Crewman
 
Posts: 4
Joined: 10 Apr 2011, 03:15
Gender: Male
phpBB Knowledge: 4

Re: Trying to match a wordpress header.

Postby topdown » 11 Apr 2011, 01:24

Is it just the style (theme) of WP that you are after or the actual functions?
If its just the theme why not keep to HTML ans CSS and just make a new phpBB3 style using the HTML ans CSS wrapper from the WP theme.

Then no PHP is needed and the security stays in tact.
Do not PM me for Support unless I give permission in a post......PM's only help one, posts help everyone !
User avatar
topdown    
STG Styles Leader
STG Styles Leader
 
Posts: 3026
Joined: 01 Oct 2007, 22:56
Location: Handyman's harddrive
Favorite Team: STG Teams
Gender: Male
phpBB Knowledge: 9

Re: Trying to match a wordpress header.

Postby jakc » 11 Apr 2011, 02:15

Is it just the style (theme) of WP that you are after or the actual functions?

It is the header area, both the visual style of it, but also the menu items that sit on it (which are powered by php, and I think the menu is some sort of jQuery menu).

However, I do think I see what your saying.
Lets say I was happy with my menu setup choices in Wordpress.
Although these are populated via PHP, perhaps if I just 'View Source' on my site, pinch the HTML/JS and stick that in my overall_header in phpBB?
jakc
Crewman
Crewman
 
Posts: 4
Joined: 10 Apr 2011, 03:15
Gender: Male
phpBB Knowledge: 4

Re: Trying to match a wordpress header.

Postby zrox » 11 Apr 2011, 12:19

jakc wrote:You mention wp-load. Will adding this in, allow me to call the function that I assume its having problems with - wp_nav_menu?

Thanks for your patience.

Yes. then you can access all wp function.

topdown wrote:Is it just the style (theme) of WP that you are after or the actual functions?
If its just the theme why not keep to HTML ans CSS and just make a new phpBB3 style using the HTML ans CSS wrapper from the WP theme.

Then no PHP is needed and the security stays in tact.

I agree with topdown and to make it bit more dynamic. You will have to create php script/plugin within wordpress that will write the response(html output) from menu function wp_nav_menu to phpBB template file eg. wp_menu_for_phpBB.html placed in phpBB style template folder. This will allow you include wp_menu_for_phpBB.html in phpBB template. You can call the php script to update the template whenever you update navigation in WordPress.

Another easy approach would be frameset ... not sure if its okay to use.

https://launchpad.net/wp-united/trunk
http://codex.wordpress.org/Function_Ref ... p_nav_menu
php Knowledge: 2
phpBB Knowledge: 4

.... Under Rating is OK but Over Rating your knowledge is Bad.
User avatar
zrox
Lt. Jr Grade
Lt. Jr Grade
 
Posts: 104
Joined: 05 May 2008, 01:08
Location: Mumbai
Gender: Male
phpBB Knowledge: 4

Re: Trying to match a wordpress header.

Postby jakc » 12 Apr 2011, 01:44

You will have to create php script/plugin within wordpress that will write the response(html output) from menu function wp_nav_menu to phpBB template file eg. wp_menu_for_phpBB.html placed in phpBB style template folder. This will allow you include wp_menu_for_phpBB.html in phpBB template. You can call the php script to update the template whenever you update navigation in WordPress.


I would have no clue on how to start the above, and to be honest, sounds a little out of my skillset.
I was hoping to find a similar plugin to WP-United, but nothing.
jakc
Crewman
Crewman
 
Posts: 4
Joined: 10 Apr 2011, 03:15
Gender: Male
phpBB Knowledge: 4

Re: Trying to match a wordpress header.

Postby topdown » 14 Apr 2011, 22:31

If you're not worried about WP functions, just use the source code and change the paths.

[ Post made via Android] Image
Do not PM me for Support unless I give permission in a post......PM's only help one, posts help everyone !
User avatar
topdown    
STG Styles Leader
STG Styles Leader
 
Posts: 3026
Joined: 01 Oct 2007, 22:56
Location: Handyman's harddrive
Favorite Team: STG Teams
Gender: Male
phpBB Knowledge: 9

Re: Trying to match a wordpress header.

Postby kathy0023 » 03 Sep 2012, 03:08

Hi!,
It could be that your PHP code was not executed because of the extension of the file where you inserted your code is in HTML. You said you pasted your code in "overall_header.html" .HTML extension, I think does not execute PHP codes. Correct me if I'm wrong here. This could be the reason of your dilemma.

Cheers
kathy0023    
Crewman
Crewman
 
Posts: 2
Joined: 03 Sep 2012, 02:26
Location: New York, USA
Gender: Female
phpBB Knowledge: 5


Return to phpBB3 Styling Assistance

Who is online

Users browsing this forum: No registered users and 5 guests