1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

Kotomi - Generic script bridge

Discussion in 'Add-on Releases [Archive]' started by Luke F, Mar 14, 2011.

Thread Status:
Not open for further replies.
  1. Luke F

    Luke F Well-Known Member

    (Made this ages ago and forgot to release it... :p)


    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.
     

    Attached Files:

  2. Brogan

    Brogan XenForo Moderator Staff Member

    So if I'm reading this right, I could use this to create a www.mydomain.com/home.php page using all the XenForo css, login, perms, etc?
     
  3. Luke F

    Luke F Well-Known Member

    Pretty much yeah :)
     
    EQnoble and Brogan like this.
  4. Brogan

    Brogan XenForo Moderator Staff Member

    Can I say w00t! ?

    :LOL:
     
    EQnoble and Peggy like this.
  5. Wuebit

    Wuebit Well-Known Member

    lol not heard that one in some time. :LOL:
     
  6. ddmmh

    ddmmh Well-Known Member

    This sounds really cool. Id love to be able to integrate a very basic shop into my XF community.

    Although Im not a developer but I think I get the idea.

    I tried this on my local webserver, no errors but just a blank page. Does this work on windows?
     
  7. James

    James Well-Known Member

    Just out of curiosity, wouldn't it have been more readable to use a heredoc instead of the echo?
    PHP:
    echo <<<HTML
    <html>
    <head>
    <title>kotomi test</title>
    </head>
    <body>
    Hello world!
    </body>
    </html>
    HTML;
    Anyway, great release!
     
  8. robdog

    robdog Well-Known Member

    Good stuff right here. Going to be testing this out for my new site this weekend. Thanks for releasing.
     
  9. Digital Doctor

    Digital Doctor Well-Known Member

    Would this be a good way to embed a gallery script ?
    With all the people looking for galleries ..... it could be helpful.
     
  10. Miko

    Miko Well-Known Member

    This is great! Thank you.
    Did you find a easy or not so easy way to add a custom breadcrumb and navigation to this script that you could share?

    Cheers,
    -Miko
     
  11. Wuebit

    Wuebit Well-Known Member

    Wish me look dark <3 using this to build a manga viewer (if that's ok with you that is)
     
  12. robdog

    robdog Well-Known Member

    Finally started testing this out. Ran into a slight problem. I installed my forum to the /community/ directory and since all URLs are relative, they all break if I apply this mod to a file outside the community directory.

    Anyone have success with this out side the forum directory?
     
  13. robdog

    robdog Well-Known Member

    Anyone figure out how to customize the breadcrumb? or add a right rail?
     
  14. robdog

    robdog Well-Known Member

    Well figured out how to get a base sidebar on the external pages now just need to figure out how to initialize the who is online block and the forum stats block and add it to the sidebar.
     
  15. EQnoble

    EQnoble Well-Known Member

    speechless!
    AWESOME
    need to sleep
    will play with this tomorrow :)

    You are awesome.

    THANK YOU
     
  16. Miko

    Miko Well-Known Member


    Reading some of your posts on other threads.... Looks like you have made some good progress.... Hope you are going to share the love and some of your finding :D

    Please & Thank you!
     
  17. robdog

    robdog Well-Known Member

    I will put together a post on what I did to create external pages. Not really good at putting together plugin packages though, but I will give it a shot. :)
     
  18. robdog

    robdog Well-Known Member

  19. Weiyan

    Weiyan Well-Known Member

    Cool! Hot summer is coming, this add-0n is cool enough.

    So anyone with little php knowledge can write a front page like this forum.
     
  20. EQnoble

    EQnoble Well-Known Member

    So in 30 seconds or so I get this...
    hgdfhdh.png
    So many awesome possibilities open up for me with this...you have made this so friggin simple I can almost not believe it. WOW
     
    Luke F likes this.
Thread Status:
Not open for further replies.

Share This Page