XF 2 [PAID] Need to integrate Xenforo's header & footer with custom php pages

bzcomputers

Well-known member
I am moving over from vBulletin 4 and have hundreds of custom pages that run from a handful of php templates that reside outside of the forum directory structure. I was previously able to integrate the header and footer styling in vBulletin 4 with the templates using some simple php code similar to below...

Code:
// ######################### Require vBulletin Back-End ############################
// if your page is outside of your normal vb forums directory, change directories by uncommenting the next line
chdir ('../../forum');
require_once('./global.php');

Being completely new to Xenforo and its' code I an looking to pay to get this done in a timely manner.

I see there was a previous add-on made for Xenforo 1 to do this:
Kotomi - Generic script bridge 0.0.1 but nothing currently for Xenforo 2.

I do not want to go about the page node/route filters since this appears to limit the directory structure to subdirectories of the forum itself.

The best thing for me is to have some custom php code to include on my current templates that can easily be changed if needed to work with future Xenforo releases.

If interested, contact me with your time frame and cost. Thanks.
 
You can do that with page nodes. Go to ACP > Forums > Nodes, create a new node and select "Page". It'll allow you to define title, url snippet, and the active navigation section (you may want to add a new navigation point in the navigation manager - ACP > Setup > Public Navigation). You may also want to hide it from the node list.

Once all that's done, you can define a static callback in the PHP callback field, that's responsible for handling your template parameters, that then get pushed to the "Template HTML" field, so if you have any variable content, put that into a static method as you define in that field and it'll be forwarded to the content. Fill your template as needed, and you're done. If you don't want the page container div, you can remove it by ticking "Advanced mode".
 
You can do that with page nodes. Go to ACP > Forums > Nodes, create a new node and select "Page". It'll allow you to define title, url snippet, and the active navigation section (you may want to add a new navigation point in the navigation manager - ACP > Setup > Public Navigation). You may also want to hide it from the node list.

Once all that's done, you can define a static callback in the PHP callback field, that's responsible for handling your template parameters, that then get pushed to the "Template HTML" field, so if you have any variable content, put that into a static method as you define in that field and it'll be forwarded to the content. Fill your template as needed, and you're done. If you don't want the page container div, you can remove it by ticking "Advanced mode".

I think he also wants to make it outside Xenforo directory, so neither page node nor route filter will work. But we can achieve it by .htaccess.
 
Also, we have this product that (though it works with WordPress) uses a similar implementation of Kotami there in that we can grab header/footer/wrapper around custom pages. May be worth glancing at if you need it https://xenforo.com/community/resou...dge-for-bringing-wordpress-into-xenforo.6551/

I was actually planning to use your product to integrate Wordpress as a front-end to Xenforo. I did first try to integrate the custom pages with a Wordpress wrapper (header/footer) but I could never figure out how to fix the conflicting css issues with my own css and the Wordpress style.css. Wordpress always seemed to override my page's css no matter what order I tried to load them in.

I was using this code:

PHP:
<?php
// if your page is outside the Wordpress directory, you should change directories by uncommenting the next line
//chdir ('../wordpress-directory');
require_once('./wp-config.php');
  $wp->init();
  $wp->parse_request();
  $wp->query_posts();
  $wp->register_globals();
  $wp->send_headers();

// then placing these where needed
get_header();
get_footer();
?>

It did exactly what I wanted but could never get the css to look right. I just couldn't figure out how to block the Wordpress style.css from overriding my page css.

How would this work with xpress? Would I see similar css conflict issues?
 
I was actually planning to use your product to integrate Wordpress as a front-end to Xenforo. I did first try to integrate the custom pages with a Wordpress wrapper (header/footer) but I could never figure out how to fix the conflicting css issues with my own css and the Wordpress style.css. Wordpress always seemed to override my page's css no matter what order I tried to load them in.

I was using this code:

PHP:
<?php
// if your page is outside the Wordpress directory, you should change directories by uncommenting the next line
//chdir ('../wordpress-directory');
require_once('./wp-config.php');
  $wp->init();
  $wp->parse_request();
  $wp->query_posts();
  $wp->register_globals();
  $wp->send_headers();

// then placing these where needed
get_header();
get_footer();
?>

It did exactly what I wanted but could never get the css to look right. I just couldn't figure out how to block the Wordpress style.css from overriding my page css.

How would this work with xpress? Would I see similar css conflict issues?
I wonder if simply loading that css later in the page would work. If you want to make a ticket at our site and link to it that might help me figure that one out. :)
 
I'm going to take this thread because my needs are similar.

I haven't quite understood it yet, @Mike Creuzer. Does XPress offer a "single page" like Kotomi for xf1.5, which you can be used with or without header, inside and outside of Xenforo? Besides real content pages, which one can build super with Xenforo Pages or XPress, I need exactly what Kotomi offers:
(a) I use it to load the Kotomi-page without header and any content as 1x1 pixel iframe in other (mostly completely Xenforo-external) applications during page calls to keep the Xenforo session up and running in these applications as well.
(b) and e.g. as simple PHP result pages (e.g. confirmation pages for a newsletter subscription)

I can't imagine that ThemeHouse does not offer a similar addon or couldn't release a "Kotomi" addon quickly. :)
 
I'm going to take this thread because my needs are similar.

I haven't quite understood it yet, @Mike Creuzer. Does XPress offer a "single page" like Kotomi for xf1.5, which you can be used with or without header, inside and outside of Xenforo? Besides real content pages, which one can build super with Xenforo Pages or XPress, I need exactly what Kotomi offers:
(a) I use it to load the Kotomi-page without header and any content as 1x1 pixel iframe in other (mostly completely Xenforo-external) applications during page calls to keep the Xenforo session up and running in these applications as well.
(b) and e.g. as simple PHP result pages (e.g. confirmation pages for a newsletter subscription)

I can't imagine that ThemeHouse does not offer a similar addon or couldn't release a "Kotomi" addon quickly. :)
Sure I mean it might require some custom development, but you could render a custom add-on inside of WordPress that uses its own template and have complete and full control over how it works. I think you could do that in XenForo too though, just depends on overall goals.

a) I think this can be done. To do this I would make a template or add-on in WordPress, have it load a custom template, and that template has no get_header() sidebar, footer, etc.
b) Same idea as above, but you can choose whatever template you want. Header/footer synced or not.
 
I am moving over from vBulletin 4 and have hundreds of custom pages that run from a handful of php templates that reside outside of the forum directory structure. I was previously able to integrate the header and footer styling in vBulletin 4 with the templates using some simple php code similar to below...

Code:
// ######################### Require vBulletin Back-End ############################
// if your page is outside of your normal vb forums directory, change directories by uncommenting the next line
chdir ('../../forum');
require_once('./global.php');

Being completely new to Xenforo and its' code I an looking to pay to get this done in a timely manner.

I see there was a previous add-on made for Xenforo 1 to do this:
Kotomi - Generic script bridge 0.0.1 but nothing currently for Xenforo 2.

I do not want to go about the page node/route filters since this appears to limit the directory structure to subdirectories of the forum itself.

The best thing for me is to have some custom php code to include on my current templates that can easily be changed if needed to work with future Xenforo releases.

If interested, contact me with your time frame and cost. Thanks.

Bumping this back up. Still looking for a clean solution. Looking to add a XenForo Page Wrapper around some custom php pages that will reside outside of the Xenforo directory structure but on the same domain. The page needs to be able to integrate the XenForo header, navigation, notices and footer. As with the original Katomi bridge these two points are important:

1) a variable to direct to Xenforo's index file to allow for pages outside of XenForo directory structure: "$kotomi_indexFile should be updated to the relative directory where XenForo's index.php can be found."
2) the custom page container to reduce the possibility of css conflicts: "$kotomi_container can be set to false for a raw integration (still passes through XenForo's framework etc, just without any XenForo HTML/CSS/templates being applied)."

If you are interested send me a time frame and quote.

I know of at least a handful of others have inquired about this exact add-on need so additional sales are a likely possibility.
 
I would like to thank @vbresults for responding and building me a complete solution for my custom page add-on needs. It was done quickly and at the price quoted for the project. They went above and beyond to produce exactly what I needed. I will definitely be going back to them if I need any additional custom XenForo work done.

I had used them in the past for some vBulletin 4 projects over the years and I'm glad to see they are developing for XenForo too.
 
I'm also looking for something like this & happy to pay for it.

Unfortunately vbresults doesn't accept DMs and bzcomputers hasn't responded to me so asking in the option if anyone is interested in doing a similar job as vbresults did
 
I'm also looking for something like this & happy to pay for it.

Unfortunately vbresults doesn't accept DMs and bzcomputers hasn't responded to me so asking in the option if anyone is interested in doing a similar job as vbresults did
Very interesting on this job please start pm.


Thanks
 
@Dibbles
I'm also looking for something like this & happy to pay for it.

Unfortunately vbresults doesn't accept DMs and bzcomputers hasn't responded to me so asking in the option if anyone is interested in doing a similar job as vbresults did
We are quite interested to get this job done for you. Kindly initiate the PM for further discussions.
 
Yes, becoming a real epidemic here.

People need to be vigilant when selecting addon developers, and use long term recognised users like yourself.
Yeah, ForumSolution wanted $700 to do the addon, but hasn't provided any previous works or anything.
 
Yeah, ForumSolution wanted $700 to do the addon, but hasn't provided any previous works or anything.

That’s ridiculous. Yeah I wouldn’t hire a developer without having been established here and some free/paid addons released to the community so the work can be investigated to see the code quality.
 
You can make a standalone page by 'starting' XF.

bringing in the templates is not something i'm sure about, but the general concept is the same as wp...

bring in the includes and start the XF app, something like:

Code:
<?php

require "src/config.php";
$dir = "/home/yoursite/public_html";
require($dir . '/src/XF.php');

XF::start($dir);
$app = XF::setupApp('XF\Pub\App');
$app->start();

//more php here
?>
<html> markup here</html>

I probably wouldn't do it this way, opting for a full templated solution instead, but it should work for a basic page or something outside the XF dir.
 
You can make a standalone page by 'starting' XF.

bringing in the templates is not something i'm sure about, but the general concept is the same as wp...

bring in the includes and start the XF app, something like:

Code:
<?php

require "src/config.php";
$dir = "/home/yoursite/public_html";
require($dir . '/src/XF.php');

XF::start($dir);
$app = XF::setupApp('XF\Pub\App');
$app->start();

//more php here
?>
<html> markup here</html>

I probably wouldn't do it this way, opting for a full templated solution instead, but it should work for a basic page or something outside the XF dir.
While this works, it doesn't include any of the theme (ie navbar, footer etc) which ideally is what I'm after.
 
Top Bottom