Kotomi - Generic script bridge

Kotomi - Generic script bridge 0.0.1

No permission to download
I unfortunately cannot manage to get the addon working... Maybe someone can help me out. I tried the two example codes going with the addon, the one included in the download file gives me this result:
http://inferiorsrpg.com/example-index.php
while the one delivered with the description of this addon gives this result:
http://inferiorsrpg.com/example_index2.php

They only differ in this line though:
$kotomi_container = true/false;
Believe, it is the place, where the skin and so on is included. At least this is my explanation, why the one without skin shows at least its content while the other one spits out an error. I tried out to move the file to different paths already and to fix those, but as soon as everything seemed "correct" again, the error reappeared. Any ideas?
 
Looks like "Nodes as Tabs" is the bad guy here interfering. As soon as I deactivate the addon, everything works as it should again. Any way to make those two compatible?
 
Code:
Zend_Exception: No entry is registered for key 'fc' - /home/inferior/public_html/library/XenForo/Application.php:917
Code:
#0 /home/inferior/public_html/library/XenForo/Application.php(1302): XenForo_Application::get('fc')
#1 /home/inferior/public_html/library/NodesAsTabs/Listen.php(145): XenForo_Application::getFc()
#2 [internal function]: NodesAsTabs_Listen::includeCSS('PAGE_CONTAINER', Array, Object(XenForo_Template_Public))
#3 /home/inferior/public_html/library/XenForo/CodeEvent.php(73): call_user_func_array(Array, Array)
#4 /home/inferior/public_html/library/XenForo/Template/Abstract.php(82): XenForo_CodeEvent::fire('template_create', Array, 'PAGE_CONTAINER')
#5 /home/inferior/public_html/library/XenForo/Dependencies/Public.php(244): XenForo_Template_Abstract->__construct('PAGE_CONTAINER', Array)
#6 /home/inferior/public_html/library/XenForo/ViewRenderer/Abstract.php(263): XenForo_Dependencies_Public->createTemplateObject('PAGE_CONTAINER', Array)
#7 /home/inferior/public_html/library/XenForo/ViewRenderer/HtmlPublic.php(115): XenForo_ViewRenderer_Abstract->createTemplateObject('PAGE_CONTAINER', Array)
#8 /home/inferior/public_html/library/XenForo/FrontController.php(604): XenForo_ViewRenderer_HtmlPublic->renderContainer(Object(XenForo_Template_Public), Array)
#9 /home/inferior/public_html/library/Dark/Kotomi/FrontController.php(48): XenForo_FrontController->renderView(Object(XenForo_ControllerResponse_View), Object(XenForo_ViewRenderer_HtmlPublic), Array)
#10 /home/inferior/public_html/library/Dark/Kotomi/KotomiFooter.php(2): Dark_Kotomi_FrontController->runKotomi('?<html>?<head>?...')
#11 /home/inferior/public_html/example_index2.php(21): require('/home/inferior/...')
#12 {main}
Code:
array(3) {
  ["url"] => string(42) "http://inferiorsrpg.com/example_index2.php"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}

This one is spit out every time the page is called.
 
Code:
Zend_Exception: No entry is registered for key 'fc' - /home/inferior/public_html/library/XenForo/Application.php:917
Code:
#0 /home/inferior/public_html/library/XenForo/Application.php(1302): XenForo_Application::get('fc')
#1 /home/inferior/public_html/library/NodesAsTabs/Listen.php(145): XenForo_Application::getFc()
#2 [internal function]: NodesAsTabs_Listen::includeCSS('PAGE_CONTAINER', Array, Object(XenForo_Template_Public))
#3 /home/inferior/public_html/library/XenForo/CodeEvent.php(73): call_user_func_array(Array, Array)
#4 /home/inferior/public_html/library/XenForo/Template/Abstract.php(82): XenForo_CodeEvent::fire('template_create', Array, 'PAGE_CONTAINER')
#5 /home/inferior/public_html/library/XenForo/Dependencies/Public.php(244): XenForo_Template_Abstract->__construct('PAGE_CONTAINER', Array)
#6 /home/inferior/public_html/library/XenForo/ViewRenderer/Abstract.php(263): XenForo_Dependencies_Public->createTemplateObject('PAGE_CONTAINER', Array)
#7 /home/inferior/public_html/library/XenForo/ViewRenderer/HtmlPublic.php(115): XenForo_ViewRenderer_Abstract->createTemplateObject('PAGE_CONTAINER', Array)
#8 /home/inferior/public_html/library/XenForo/FrontController.php(604): XenForo_ViewRenderer_HtmlPublic->renderContainer(Object(XenForo_Template_Public), Array)
#9 /home/inferior/public_html/library/Dark/Kotomi/FrontController.php(48): XenForo_FrontController->renderView(Object(XenForo_ControllerResponse_View), Object(XenForo_ViewRenderer_HtmlPublic), Array)
#10 /home/inferior/public_html/library/Dark/Kotomi/KotomiFooter.php(2): Dark_Kotomi_FrontController->runKotomi('?<html>?<head>?...')
#11 /home/inferior/public_html/example_index2.php(21): require('/home/inferior/...')
#12 {main}
Code:
array(3) {
  ["url"] => string(42) "http://inferiorsrpg.com/example_index2.php"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}

This one is spit out every time the page is called.

Kotomi uses its own front controller. That's why. This is really a problem with the Kotomi script not being updated for XenForo 1.2.

Try editing this file:

library/Dark/Kotomi/FrontController.php

Add this to the top:

Rich (BB code):
<?php
class Dark_Kotomi_FrontController extends XenForo_FrontController
{
	public function runKotomi($html)
	{
		XenForo_Application::set('fc', $this);

		global $kotomi_indexFile, $kotomi_container;
		
		ob_start();

		$this->setup();
		$this->_request->setBasePath(XenForo_Link::convertUriToAbsoluteUri("{$kotomi_indexFile}"));
		$this->setRequestPaths();
		$showDebugOutput = $this->showDebugOutput();

That should fix the immediate error.
 
@Jake Bunce Thanks Jake.. Will give this a go shortly and report back.. This has been a very frustrating time for me for personal projects and also a clients project.. If this works now i will Fly to wherever you are and give you the sloppiest kiss you ever had :P LMAO.. sorry but i am soo hoping this works this will prevent me having to do so much extra work.. Fingers Crossed !!

Darren
 
Still having Massive issues with this and only when using this outside of the XF installation dir.. When Kotomi is used in the root dir and XF installed in a sub-dir it's having a hard time trying to render the XF wrapper.. Any assistance on this would be of great help.. but as ive noticed unless your actually using this script or realize the potential then i guess i can not expect people to bend over backwards to help me..

But should someone be able to fix this for me i can / will send you a small donation.

Regards, Darren
 
Yes, here is my MediaWiki skin built using Kotomi generating an alert:
kotomialert.png
Is you MediaWiki theme available for download?

Many thanks.
 
Am I able to limit a page to certain groups and if so, could anyone give me an example on how to do so?
This script is not needed now with the latest version of XF.. shoot me a PM if you need a hand with it.. You can use the XF pages and Route features to do exactly what this script was intended to do prior to the custom routes feature.
 
I've used this with another Zend-platform app (aMember), and while I managed to get the XF header and footer wrapped around the page, all links now point use the page itself as a starting point.

I.e.

The forums are in the root folder.
The aMember app resides in /shop

My header now has "forums" pointing to "/shop/forums/"

Anything I clould possibly do to address that?

Thanks!
 
I got it to work guys! It's awesome, going to donate some money to the creator soon as I'm paid. I will also do a documentation for beginners like me who want to use this script with their installation on the site when it's up and running this summer. :D

Any chance of sharing what you did to solve the issue?
 
  • Like
Reactions: LPH
Hi!

We recently got in position of managing one website, and updated xenforo version and most of the addons that we had previously(they were 2+ yrs old mostly).
Now, the problem is that previous owner was using kotomi(link to the addon) to create custom php pages(which would trigger SQL database to read/write the related info), but now, that doesn't work anymore.
Well, it doesn't parse the css/template for it, just the html+php.

Example of the mentioned problem: LINK

Here's the php for the mentioned page:
PHP:
<?php

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

XenForo_Session::startPublicSession();
$visitor = XenForo_Visitor::getInstance();
$user_id = $visitor->getUserId();
$name = $visitor['username'];

?>
<html>
<head>
<title>Nodes</title>
</head>
<body>
<BR>
<CENTER>
<A HREF="https://twitter.com/DukeJoy">News</A><BR><BR>
<A HREF="http://www.buxville.net/xf/nodes/userjobs.php">Vacations</A><BR><BR>
<A HREF="http://www.buxville.net/queue/">Queue</A><BR><BR>
<A HREF="http://www.buxville.net/map/" target="_blank">Map</A><BR><BR>
<A HREF="http://www.buxville.net/xf/nodes/towns/townlist.php">Towns</A><BR><BR>
<A HREF="http://www.buxville.net/xf/nodes/questlist.php">Examaze Quests</A><BR><BR>
<A HREF="http://www.buxville.net/xf/nodes/npcmanager.php">NPC Manager</A><BR><BR>
<A HREF="http://www.buxville.net/xf/nodes/buxlotmanager.php">Bux Lot Manager</A><BR><BR>
<A HREF="http://www.buxville.net/xf/nodes/ether.php">Ether Ranking</A><BR><BR>
<A HREF="http://www.buxville.net/misc/petitionlog.txt">Ticket Log</A><BR><BR>
<A HREF="http://www.buxville.net/xf/nodes/moneylog.php">Money Log</A><BR><BR>
<A HREF="http://www.buxville.net/xf/nodes/signshopsales.php">Sign Shop Log</A><BR><BR>
<A HREF="http://www.buxville.net/misc/mailboxlog.txt">Mail Box Log</A><BR><BR>
</CENTER>
</body>
</html>
<?php
require "{$fileDir}/library/Dark/Kotomi/KotomiFooter.php";
?>


As you can see, as advised in kotomi addon thread even, this was set to true to actually include templates etc, but it still doesn't work. :/
Code:
$kotomi_container = true;



I think we spent about 3-4 days on this issue now(still new to xenforo really, and coding itself), so, we're a bit out of options and are banging our heads against the wall with this problem.

Does anyone maybe know how to solve this? Everything works, but yea, css/template doesn't exist on those pages. There's no console errors in ACP nor anything else. :/

Any kind of help is appreciated! Thanks in advance! :)
 
Hi!

We recently got in position of managing one website, and updated xenforo version and most of the addons that we had previously(they were 2+ yrs old mostly).
Now, the problem is that previous owner was using kotomi(link to the addon) to create custom php pages(which would trigger SQL database to read/write the related info), but now, that doesn't work anymore.
Well, it doesn't parse the css/template for it, just the html+php.

Example of the mentioned problem: LINK

Here's the php for the mentioned page:
PHP:
<?php

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

XenForo_Session::startPublicSession();
$visitor = XenForo_Visitor::getInstance();
$user_id = $visitor->getUserId();
$name = $visitor['username'];

?>
<html>
<head>
<title>Nodes</title>
</head>
<body>
<BR>
<CENTER>
<A HREF="https://twitter.com/DukeJoy">News</A><BR><BR>
<A HREF="http://www.buxville.net/xf/nodes/userjobs.php">Vacations</A><BR><BR>
<A HREF="http://www.buxville.net/queue/">Queue</A><BR><BR>
<A HREF="http://www.buxville.net/map/" target="_blank">Map</A><BR><BR>
<A HREF="http://www.buxville.net/xf/nodes/towns/townlist.php">Towns</A><BR><BR>
<A HREF="http://www.buxville.net/xf/nodes/questlist.php">Examaze Quests</A><BR><BR>
<A HREF="http://www.buxville.net/xf/nodes/npcmanager.php">NPC Manager</A><BR><BR>
<A HREF="http://www.buxville.net/xf/nodes/buxlotmanager.php">Bux Lot Manager</A><BR><BR>
<A HREF="http://www.buxville.net/xf/nodes/ether.php">Ether Ranking</A><BR><BR>
<A HREF="http://www.buxville.net/misc/petitionlog.txt">Ticket Log</A><BR><BR>
<A HREF="http://www.buxville.net/xf/nodes/moneylog.php">Money Log</A><BR><BR>
<A HREF="http://www.buxville.net/xf/nodes/signshopsales.php">Sign Shop Log</A><BR><BR>
<A HREF="http://www.buxville.net/misc/mailboxlog.txt">Mail Box Log</A><BR><BR>
</CENTER>
</body>
</html>
<?php
require "{$fileDir}/library/Dark/Kotomi/KotomiFooter.php";
?>


As you can see, as advised in kotomi addon thread even, this was set to true to actually include templates etc, but it still doesn't work. :/
Code:
$kotomi_container = true;



I think we spent about 3-4 days on this issue now(still new to xenforo really, and coding itself), so, we're a bit out of options and are banging our heads against the wall with this problem.

Does anyone maybe know how to solve this? Everything works, but yea, css/template doesn't exist on those pages. There's no console errors in ACP nor anything else. :/

Any kind of help is appreciated! Thanks in advance! :)
I'm not sure why you are using the following:
Code:
XenForo_Session::startPublicSession();
$visitor = XenForo_Visitor::getInstance();
$user_id = $visitor->getUserId();
$name = $visitor['username'];
You aren't even utilizing their username on the page.

Once removed, it works completely fine: http://www.mcbrawl.com/test.php
Code:
<?php
$startTime = microtime(true);
$kotomi_indexFile = "./";
$kotomi_container = true;
$fileDir = dirname(__FILE__)."/{$kotomi_indexFile}";
require "{$fileDir}/library/Dark/Kotomi/KotomiHeader.php";

?>

<html>
<head>
<title>Nodes</title>
</head>
<body>
<BR>
<CENTER>
<A HREF="https://twitter.com/DukeJoy">News</A><BR><BR>
<A HREF="http://www.buxville.net/xf/nodes/userjobs.php">Vacations</A><BR><BR>
<A HREF="http://www.buxville.net/queue/">Queue</A><BR><BR>
<A HREF="http://www.buxville.net/map/" target="_blank">Map</A><BR><BR>
<A HREF="http://www.buxville.net/xf/nodes/towns/townlist.php">Towns</A><BR><BR>
<A HREF="http://www.buxville.net/xf/nodes/questlist.php">Examaze Quests</A><BR><BR>
<A HREF="http://www.buxville.net/xf/nodes/npcmanager.php">NPC Manager</A><BR><BR>
<A HREF="http://www.buxville.net/xf/nodes/buxlotmanager.php">Bux Lot Manager</A><BR><BR>
<A HREF="http://www.buxville.net/xf/nodes/ether.php">Ether Ranking</A><BR><BR>
<A HREF="http://www.buxville.net/misc/petitionlog.txt">Ticket Log</A><BR><BR>
<A HREF="http://www.buxville.net/xf/nodes/moneylog.php">Money Log</A><BR><BR>
<A HREF="http://www.buxville.net/xf/nodes/signshopsales.php">Sign Shop Log</A><BR><BR>
<A HREF="http://www.buxville.net/misc/mailboxlog.txt">Mail Box Log</A><BR><BR>
</CENTER>
</body>
</html>
<?php
require "{$fileDir}/library/Dark/Kotomi/KotomiFooter.php";

You should really get to redoing that html, the <center> and <br> elements are really depreciated.
 
Sorry, but even just copying/pasting your code as an example, it still doesn't parse template/css, even with suggested changes. It's pretty much the same, just plain html/php. :/
Does it maybe have something to do with path where kotomi index file should be? Cause atm, whenever I do
Code:
$kotomi_indexFile = "./";
it's pretty much blank page, and it only works with
Code:
$kotomi_indexFile = "../";
Sorry, I know, silly question, but as I said, beginner here.

And as it goes for html/old php code, it's leftover from old owners code, will be recreated, well, once this problem is fixed. :(
 
:) This issue isn't really a Kotomi specific issue, it's because you're using it outside of the XF installation directory, XenForo uses relative links, as you're a directory down from where XenForo is installed the HTML Kotomi is getting from XenForo is linking to CSS and JS in your custom directory, which aren't there.

<link rel="css.php?css=xenforo,form,public&amp;style=8&amp;dir=LTR&amp;d=1418512633" /> etc.

There are a few ways around this (symlinks, redirects, static copies in the custom directory) but none really work properly, the best option would be to put your custom PHP in the XenForo root.
 
Hah! That actually did the trick. :D
Although, is it possible to get around this by using Routes? Was reading something about it, just need to figure out how to do that now, as there's quite the number of php pages that previous owner left us.
However, once more, thank you Falken. :)
 
No because due to the script not working when say like this:

mysite.com <-- This is where Kotomi is broken / breaking now
mysite.com/forum/ <-- XF installed here with addons

mysite.com/forum/custom-page-using-kotomi/ <-- This still works fine.

So as it's not causing issues, it's just not working there are no errors / issues being noted by XF.

Darren

I have solved this issue by following follow procedure

  1. Edit file config.php and add below two lines:

    $config ['externalDataUrl'] = 'http://mysite.com/forum/data';
    $config ['javaScriptUrl'] = 'http://mysite.com/forum/js';
  2. Go to the Admin Control Panel in Xenforo.

    AdminCP/Appearance/Styles/YourSkin/Style Property Groups/General/Settings/Path to Images http://mysite.com/forum/styles/default
  3. copy deferred.php and css.php from forum root to directory where new php file is located
  4. edit both deferred.php and css.php and change default $fileDir TO $fileDir = dirname(__FILE__).'/forum';
Now everything working well for me.
Enjoy :)
 
Top Bottom