• 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.
Im really hoping someone can help as im really stuck!

Ive uploaded all the files and renamed the example index page to schedule.php

When I goto schedule.php all it shows is "Hello World" - No header or footer.

Ive tried editing the setting "$kotomi_indexFile = "./DCR";"
However the page then comes back as:

Warning: require(/home/mydover/public_html/DCR/./DCR/library/Dark/Kotomi/KotomiHeader.php) [function.require]: failed to open stream: No such file or directory in /home/mydover/public_html/DCR/schedule.php on line 7

Fatal error: require() [function.require]: Failed opening required '/home/mydover/public_html/DCR/./DCR/library/Dark/Kotomi/KotomiHeader.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/mydover/public_html/DCR/schedule.php on line 7

Any help really appreciated
 
return it to normal (before all changes).
oper you shedule.php file and find:

PHP:
$kotomi_container = false;

replace it with

PHP:
$kotomi_container = true;
 
Here's the code I used with this addon to check to see if the visitor is logged in:

PHP:
XenForo_Session::startPublicSession();
$visitor = XenForo_Visitor::getInstance();
$user_id = $visitor->getUserId();
if ($user_id != null) {
    echo "user";
} else {
    echo "guest";
}
 
I can't get this to work, what am I doing wrong?

With $kotomi_container set to false I get a completely blank page.

With it set to true I get what looks like a forum page with the right header and footer, my forum title, and no content (ie. everything that was in the echo statement is ignored).
 
Fixed. Bit embarrassing this, but for the benefit of any other complete newbies with this sort of stuff, don't forget to actually install the plugin by uploading the .xml file via the ACP in addition to uploading all the other files. That step isn't explicitly mentioned in the OP which is why I didn't do it to start with !!
 
I wanted to say thanks to the OP for this, now I have it working :)

It has actually proved to be a lot easier than I thought to basically stuff anything into a XenForo-like page.

Currently, I cut and paste some custom PHP that creates this member map on my vB forum, into the php page for this plugin, and amazingly, it all works. So I have a XenForo page in which sits my vB forum membermap. All I need now is to wait for XF 1.1 so I can import the custom user fields (two of which have the long and lat) and point my PHP to the XenForo database (making the relevant changes to the database queries) and it should be a seemless transition. That's the theory anyway, for the moment I am chuffed just to see any working custom PHP on a XenForo page!
 
Can anyone share their experiance getting this script to work for a script that is installed in a different sub directory than Xenforo?

I have XF installed in
<root>/forum/

and the script I'm trying to intergrate installed in
<root>/blah/

In my case the file I'm adding the code to is something called common.php because the script I'm trying to intergrate this with is actualy made of lots of different PHP files but as far as I can see any of them a user can access all call this common.php file with a recquire PHP command.

so I have
common.php
somefile1.php
somefile2.php
somefile3.php
somefile4.php
and various more subdirectories in here that make this script work.

so I edited common.php with the post from the orignal code.

PHP:
$startTime = microtime(true);
$kotomi_indexFile = "../forum";
$kotomi_container = true;
$fileDir = dirname(__FILE__)."/{$kotomi_indexFile}";
require "{$fileDir}/library/Dark/Kotomi/KotomiHeader.php";

<all the common.php code is here>

require "{$fileDir}/library/Dark/Kotomi/KotomiFooter.php";

Knowing ../ makes you go up a directory in a require statement.
but I guess that wont work here because it's being put in a variable, and not directly used in a require statement. I don't how else to do it.
But I get PHP warnings that it fails to find the file, because it keeps looking in the /blah folder for them, when they are in the /forum folder.

I even tried adding some chdir PHP above the code then chdiring it back to the current directory at the end, but of course that means it just can't find the next .php file needed by XP to use it's framework.
I dont really know enough PHP to fix it myself.
 
I even tried adding some chdir PHP above the code then chdiring it back to the current directory at the end, but of course that means it just can't find the next .php file needed by XP to use it's framework.
I dont really know enough PHP to fix it myself.
This is actually what I used for the dynamic theme for wordpress, try this:

PHP:
$startTime=microtime(true);
$kotomi_container =true;
$fileDir = ABSPATH . "../forum";
require($fileDir . '/library/Dark/Kotomi/KotomiHeader.php');
Hope that helps.
 
Cheers for the pointer.

Still gets me the following error tho.

Code:
Warning: require(ABSPATH../forum/library/Dark/Kotomi/KotomiHeader.php) [function.require]: failed to open stream: No such file or directory in /home/<USERNAME REMOVED>/public_html/DY/dkp/common.php on line 19

Warning: require(ABSPATH../forum/library/Dark/Kotomi/KotomiHeader.php) [function.require]: failed to open stream: No such file or directory in /home/<USERNAME REMOVED>/public_html/DY/dkp/common.php on line 19

Fatal error: require() [function.require]: Failed opening required 'ABSPATH../forum/library/Dark/Kotomi/KotomiHeader.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/<USERNAME REMOVED>/public_html/DY/dkp/common.php on line 19
 
as a follwing up I got rid error by actualy putting in the full path to the file i.e
PHP:
$fileDir = "home/username/public_html/DY/forum";

But I guess the script I'm trying to intergrate is too complex for this, it now loads a page with the xenforo head and footer, no styling at all. ( $kotomi_container is already set to true) and a blank body. I guess common.php is not the place to put it for this script.
 
Looked at this 3rd party scripts code, found what looked a bit like vbulletins fetsh template function, and tried puttin this above and below that, but it has no effect at all. Also tried just puttin it at the top and bottom of one of the .php files accessable to users then visiting that in the browser, but still does nothing. I think i'll just give up and make a page in Xf and use an ugly iframe to show it.
 
Is there any way to integrate some external script with Xenforo by Kotomi?
I mean, merged authorization, commentaries, etc
Thats not what it's intended purpose is. It just allows you to use XenForo 'stuff' inside the 3rd party script. It does not change the behavious of that 3rd party script it's self. So if that script has it's own login system, it will retain it.

Depending on the script, you may be able to achieve bridged users simply by replacing all the checks for what user is logged in by equilivent ones in XF, but it might be a lot of work, depending on the script.
 
Thanks for making and sharing this great addon!

I literally spent hours trying to get the MVC/route/view/template system of XF working with our custom app and ended up giving up after making very little progress.

With this I was able to integrate my application into the XF style very quickly. Thanks again.
 
For what we needed it worked rather well, We were only after a gallery with no user uploads.
I have since moved on from that install but from memory I did make some simple css and code edits which changed the colour scheme to suit the forums theme and removed the plogger header and footer as well as centering the gallery categories and images.
 
How would I remove the breadcrumbs from the page completely without effecting them on my main forum index, or any other part of the forum for that matter.

Nevermind, I found it. Conditional statement that hid the breadcrumb if the kotomi template is in use.
 
Status
Not open for further replies.
Top Bottom