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

Could you please post the conditional code and template name? I need it as well.
 
Yes, you use a conditional statement with the dark kotomi template, like this:

Find this in the PAGE_CONTAINER template:

PHP:
<xen:hook name="page_container_breadcrumb_top">
<div class="breadBoxTop">
<xen:if is="{$topctrl}"><div class="topCtrl">{xen:raw $topctrl}</div></xen:if>
<xen:include template="breadcrumb"><xen:set var="$microdata">1</xen:set></xen:include>
</div>
</xen:hook>

Then add the conditional statements around the PHP:

PHP:
<xen:if is="{$contentTemplate} != 'dark_kotomi'">
      <xen:hook name="page_container_breadcrumb_top">
      <div class="breadBoxTop">
      <xen:if is="{$topctrl}"><div class="topCtrl">{xen:raw $topctrl}</div></xen:if>
      <xen:include template="breadcrumb"><xen:set var="$microdata">1</xen:set></xen:include>
      </div>
      </xen:hook>
</xen:if>

Do the same thing for the bottom breadcrumb, find:
PHP:
      <xen:hook name="page_container_breadcrumb_bottom">
      <div class="breadBoxBottom"><xen:include template="breadcrumb" /></div>
      </xen:hook>

And add the conditional statement:

PHP:
<xen:if is="{$contentTemplate} != 'dark_kotomi'">
      <xen:hook name="page_container_breadcrumb_bottom">
      <div class="breadBoxBottom"><xen:include template="breadcrumb" /></div>
      </xen:hook>
</xen:if>
Glad I could actually help someone else for once.
 
You should be able to access the database by creating it, like so:
PHP:
$db = XenForo_Application::get('db');
$db->query($someQuery); // etc

Thanks mate as helpful as ever :D

Any idea where I can find a list of the database functions I can use?
 
Thanks mate as helpful as ever :D

Any idea where I can find a list of the database functions I can use?
I think you can find some functions in XenForo_Db (library/XenForo/Db.php) and Zend_Db_Adapter_Abstract (library/Zend/Db/Adapter/Abstract.php)
 
There are conflicts between this add-on and the TaigaChat addon if global hook in TaigaChat is enabled.

An exception occurred: Uninitialized string offset: 0 in \library\Dark\TaigaChat\EventListener\FrontControllerPreView.php on line 11
  1. XenForo_Application::handlePhpError() in /library/Dark/TaigaChat/EventListener/FrontControllerPreView.php at line 11
  2. Dark_TaigaChat_EventListener_FrontControllerPreView::listen()
  3. call_user_func_array() in /library/XenForo/CodeEvent.php at line 54
  4. XenForo_CodeEvent::fire() in/library/Dark/Kotomi/FrontController.php at line 46
  5. Dark_Kotomi_FrontController->runKotomi() in/library/Dark/Kotomi/KotomiFooter.php at line 2
  6. require() in /index.php at line 19
 
I'm trying to get the username of the person that is logged in and have not been successful. I've tried this code to debug:

Code:
$visitor = XenForo_Visitor::getInstance();
$user_id = $visitor->getUserId();
if ($user_id != null) {
    echo "user";
} else {
    echo "guest";
}

And it always displays "guest" (user_id of "0") even though I am logged in and the wrapper shows all the logged in elements. Am I doing something wrong?
 
If you just need the username just recall $visitor['username'], something like that. Inside $visitor there are all info of the user.
I guess you can do it with the other method $username = $visitor->getUsername();
But i don't know the right one :(
If the first one didn't work just use print_r($visitor) to know which one is the correct one.
 
Hey guys, I'm having an issue using the script bridge with the template system of another script, aMember.
When I finally got all the include stuff to line up right aMember throws the following error message:
Registry is already initialized
with the following errors:
Code:
Exception Zend_Exception
Zend_Registry::setClassName [ /home/content/p/p/o/ppowers/html/forum/library/XenForo/Application.php : 244 ]
XenForo_Application::initialize [ /home/content/p/p/o/ppowers/html/forum/library/Dark/Kotomi/KotomiHeader.php : 5 ]
include_once [ /home/content/p/p/o/ppowers/html/header.php : 6 ]
include_once [ library/Am/View.php : 419 ]
Am_View->printLayoutHead [ application/default/themes/sample/layout.phtml : 8 ]
include [ library/Am/View.php : 352 ]
Am_View->_run [ library/Zend/View/Abstract.php : 888 ]
Zend_View_Abstract->render [ library/Am/View.php : 326 ]
Am_View->display [ application/default/controllers/IndexController.php : 7 ]
IndexController->indexAction [ library/Am/Controller.php : 139 ]
Am_Controller->_runAction [ library/Am/Controller.php : 116 ]
Am_Controller->dispatch [ library/Zend/Controller/Dispatcher/Standard.php : 295 ]
Zend_Controller_Dispatcher_Standard->dispatch [ library/Zend/Controller/Front.php : 954 ]
Zend_Controller_Front->dispatch [ library/Am/App.php : 1372 ]
Am_App->run [ index.php : 41 ]

I know the bridge itself is working, I can reference the header and footer files from an index.php file in my root directory without an issue. You can see a few key files above, the first few lines are XenForo and the Kotomi system doing it's work, "header.php" contains the kotomi header script files, like I said before I used this method with an index.php file and it worked flawlessly.

The follwing line, referencing "layout.phtml" is the template file aMember calls for the template information, everything that follows that is an aMember file reference. I feel like I'm in over my head here, anybody willing to lend me a hand?
 
Status
Not open for further replies.
Top Bottom