• 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
(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:

l7xj.png


(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

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?
 
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?
 
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!
 
Good stuff right here. Going to be testing this out for my new site this weekend. Thanks for releasing.
 
Would this be a good way to embed a gallery script ?
With all the people looking for galleries ..... it could be helpful.
 
Navigation/breadcrumbs unfortunately need to be added and configured manually.

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
 
Wish me look dark <3 using this to build a manga viewer (if that's ok with you that is)
 
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?
 
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.
 
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!
 
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.
 
So in 30 seconds or so I get this...
hgdfhdh.webp
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.
Top Bottom