Vanilla 1.1.4 is a product of Lussumo. More Information: Documentation, Community Support.
Help keep Vanilla free:// 2. BUILD PAGE CONTROLS
// Add the custom HTML to the body
class BodyContent
{
function BodyContent(&$Context)
{
$this->Context = &$Context;
}
function Render()
{
$html = "<table>etc</table>";
echo($html);
}
}
$BodyContent = $Context->ObjectFactory->NewContextObject($Context, 'BodyContent');
// 3. ADD CONTROLS TO THE PAGE
$Page->AddRenderControl($Head, $Configuration["CONTROL_POSITION_HEAD"]);
$Page->AddRenderControl($Menu, $Configuration["CONTROL_POSITION_MENU"]);
$Page->AddRenderControl($Panel, $Configuration["CONTROL_POSITION_PANEL"]);
$Page->AddRenderControl($NoticeCollector, $Configuration['CONTROL_POSITION_NOTICES']);
$Page->AddRenderControl($BodyContent, $Configuration["CONTROL_POSITION_BODY_ITEM"]);
$Page->AddRenderControl($Foot, $Configuration["CONTROL_POSITION_FOOT"]);
$Page->AddRenderControl($PageEnd, $Configuration["CONTROL_POSITION_PAGE_END"]);
class BodyContent
{
function BodyContent(&$Context)
{
$this->Context = &$Context;
}
function Render()
{
$html = "<table>etc</table>";
echo($html);
}
}
$BodyContent = $Context->ObjectFactory->NewContextObject($Context, 'BodyContent');
$Head->AddString("<script>...</script>");$Head->AddScript("http://url/to/the/script");
...
$Configuration['GoogleAnalyticsAccountNumber'] = 'xxxx-x';
//add an array of pages to not analyse
if ( !in_array($Context->SelfUrl, array('settings.php')) ) {
$Head->AddScript("http://www.google-analytics.com/urchin.js");
$Head->AddString("
_uacct=\"UA-".$Configuration['GoogleAnalyticsAccountNumber']."\";
urchinTracker();
");
}
<?php
/*
Extension Name: Google Analytics
Extension Url: http://lussumo.com/community/discussion/3507/
Description: Adds google analytics code to your vanilla forum pages.
Version: 1.0
Author: ercatli
Author Url: http://lussumo.com/community/account/1973/
*/
//replace this with your google analytics account number, of course
$Configuration['GoogleAnalyticsAccountNumber'] = 'xxxx-x';
//add an array of pages to not analyse
if ( !in_array($Context->SelfUrl, array('settings.php')) )
{
$Head->AddScript("http://www.google-analytics.com/urchin.js");
$Head->AddString("<script type=\"text/javascript\">;
_uacct=\"UA-".$Configuration['GoogleAnalyticsAccountNumber']."\";
urchinTracker();
</script>");
}
?>Fatal error: Call to a member function on a non-object in /home/console/public_html/engineersvoice/extensions/GoogleAnalytics/default.php on line 17$Head->AddScript("http://www.google-analytics.com/urchin.js");

1 to 45 of 45