1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Kotomi - Generic script bridge 0.0.1

Developer sample for basic script embedding

  1. Luke F
    This is mainly intended for developer use. It lets you embed a non-XenForo/non-MVC script (just about any PHP script should work) into the XenForo page and use XenForo functions such as permissions while still accessing the script from a standard URL (the XenForo route system is pretty much disregarded).

    So using this addon you can do a very basic integration of pretty much anything into XenForo - be it a blog, gallery, store, standalone script, etc. Probably even vBulletin if you wanted :p


    This example shows the header (top block of code) and footer (bottom line) you need to add to your existing script:

    PHP:
    <?php
     
    $startTime 
    microtime(true);
    $kotomi_indexFile "./";
    $kotomi_container true;
    $fileDir dirname(__FILE__)."/{$kotomi_indexFile}";
    require 
    "{$fileDir}/library/Dark/Kotomi/KotomiHeader.php";
     
     
    echo 
    "
    <html>
    <head>
    <title>kotomi test</title>
    </head>
    <body>
    Hello world!
    </body>
    </html>"
    ;
     
     
    require 
    "{$fileDir}/library/Dark/Kotomi/KotomiFooter.php";
    $kotomi_indexFile should be updated to the relative directory where XenForo's index.php can be found.
    $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).


    The example gives the following output:

    [​IMG]

    (Notice how the URL is a real PHP script without routes being involved at all; it could be in a completely different directory if you wanted.)

    Navigation/breadcrumbs unfortunately need to be added and configured manually.
    Also removing the title text from within the page itself is as simple as editing the dark_kotomi template to your liking.

Recent Reviews

  1. Takprojadm
    Takprojadm
    5/5,
    Version: 0.0.1
    This is a must for sites with custom external pages that you wish to integrate into a forum. The only way it would be better is to have forms to fill out within the options area.
  2. Xyon
    Xyon
    5/5,
    Version: 0.0.1
    Most worthwhile addon I think I've downloaded so far. Let me take my site to the next level. 10/10 would download again twice. Lets me make all the pages!
  3. 0xym0r0n
    0xym0r0n
    5/5,
    Version: 0.0.1
    Makes things a lot easier for me <3
  4. ip0dhacker
    ip0dhacker
    5/5,
    Version: 0.0.1
    Love it :D
  5. NDM
    NDM
    5/5,
    Version: 0.0.1
    Great add-on. Very useful since I can now include everything I need to :)
  6. Darq
    Darq
    5/5,
    Version: 0.0.1
    This was excellent for getting a new page onto my site, with limited time (and the lack of Xenforo modding knowledge) to do so.
  7. EQnoble
    EQnoble
    5/5,
    Version: 0.0.1
    If you have a need to quickly paste in some php code to make a page, this addon is for you. For those who can't code but have a working script or snippet they want to add, using this would be called 'the easy way'.
  8. 5/5,
    Version: 0.0.1
    amazing plugin for thos who can't make addons
  9. Ingenious
    Ingenious
    5/5,
    Version: 0.0.1
    Very good way of creating a forum-branded page on which you can do anything, including using the INCLUDE command in PHP to include your own script.