• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
  • 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

Status
Not open for further replies.

Luke F

Well-known member
#1
(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:



(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.
 

Attachments

Brogan

XenForo moderator
Staff member
#2
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?
 

ddmmh

Well-known member
#6
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?
 

James

Well-known member
#7
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!
 

robdog

Well-known member
#12
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?
 

robdog

Well-known member
#14
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.
 

Miko

Well-known member
#16
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.

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!
 

Weiyan

Well-known member
#19
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.
 

EQnoble

Well-known member
#20
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
 
Status
Not open for further replies.