XF 1.2 Creating external Page using XenForo Elements

Lukas W.

Well-known member
Hey Folks,

I'm currently working on my XenForo-Board on some new features for my users. One is going to be an external page displaying some bunch of random stuff, maybe even more than one page of this kind. The Problem: Standard XenForo pages do not allow you to use php-code. There is of course the possibility to use those callbacks but I have neither any idea how to use them nor if they would even be able to do, what I plan to.

So what do I like to have?
Some people maybe know the free forum software SMF. SMF allows you to access its system by including a single file on your server, called the SSI.php into your php-document. After that you got access to all features like current user session, threads, etc. For the documentation see here.

So in SMF I was able to set up a php document by including this file, then start a simple php-querry and get the SMF header automatically included in my document, including the style of the page, all scripts in the header, etc. Then I could do my content and close with a php-inclusion of the footer.

So this is what such a code would look like:
PHP:
<?php
require_once('/path/to/SSI.php');
$context['page_title_html_safe'] = 'Page title goes here';

template_html_above();
  template_body_above();
 
echo '
  <hr />
  This would be the content sections of the page
  <hr />
  ';
 
  template_body_below();
  template_html_below();
   
?>

This is what I want for XenForo now. Is it possible?

Greetings & thanks in advance.
 
This is exactly what I wanted. Thanks a lot!!

Edit: It is unfortunately not working together with the Nodes as Tabs Addon v.1.2.0...
 
Last edited:
Top Bottom