Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Try Vanilla Forums Cloud product

Ready to contribute?

Amazing! Sign our contributors' agreement and then join us on GitHub.

Vanilla 2.3 fully supports PHP 7. Get it now!
Please upgrade to 2.3 here. The 2.2 and earlier branches are no longer being updated.

Adding Javascript and Getting HelloBar to Work

Hi guys -

I just purchased hello bar solo -
And am trying to get it to work on my forum -
www.hypnosisforum.co.za

But I can not for the life of me figure out how to get it to work -
I am using the bootstrap theme - http://vanillaforums.org/addon/bootstrap-theme

this is how hello bar asks to be installed >
Step 1 -

[link type="text/css" rel="stylesheet" href="hellobar-solo/hellobar.css" /]
[script type="text/javascript" src="hellobar-solo/hellobar.js"][/script]

[/head]

Step 2

script type="text/javascript"
new HelloBar( "Enter your Hello Bar's message here", {
showWait: 1000
}, 1.0 );
script

[/body]

And finally setting up the specific bar -

No clue where to put the latter code or get any of this working well on my site -

Please Help!

Answers

  • 422422 Developer MVP

    Default.master.php or use pockets plugin.

    422 Real Estate Australia , now open Check it out

  • I tried that - in the default.master.tpl file - and when I add it before the end body tag i get a bonk error

  • Don't add javascript text in default master and you will get bonk, try to add it in themehooks

  • 422422 Developer MVP
    edited May 2012

    Not sure why that would be the case..perhaps elaborate.

    To the OP.

    download example addon in addon section. You can deploy it that way.

    http://vanillaforums.org/addon/example-plugin

    422 Real Estate Australia , now open Check it out

  • create a plugin
    
    <?php if (!defined('APPLICATION'))  exit();
    
    
    // Define the plugin:
    $PluginInfo['HelloBar'] = array(
        'Name' => 'HelloBar',
        'Description' => 'HelloBar add-on',
        'Version' => '1.0',
        'RequiredApplications' => FALSE,
        'RequiredTheme' => FALSE,
        'RequiredPlugins' => FALSE,
    
    );
    
    class HelloBarPlugin extends Gdn_Plugin {
    
    
    // change the controller to wherever you want it to appear
    public function Base_Render_Before($Sender) {
            $Sender->AddJsFile('/plugins/HelloBar/js/hellobar.js');
            $Sender->AddJsFile('/plugins/HelloBar/js/hellobar2.js');
            $Sender->AddCssFile('/plugins/HelloBar/design/hellobar.css');
    
    }
    
    
    
    
    
    }
    
    
    
    ---
    
    hellobar2.js
    
    jQuery(document).ready(function($) {
        new HelloBar( "Enter your Hello Bar's message here", {
            showWait: 1000
        }, 1.0 );
    });
    

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

Sign In or Register to comment.