Jquery social share script

Hello everyone,

Trying to add this to my vbulletin site in footer. (note I’m not a pro coder so please bear with me).

http://plugins.in1.com/share/demo

I’m not sure what I’m doing wrong here.

I’ve added this in the headinclude template

<script type="text/javascript">
	$('#mydiv').share({
        networks: ['facebook','googleplus','twitter','tumblr','email','stumbleupon','digg']
    });
</script>


<script type="text/javascript" src="clientscript/jquery.share.js"></script>
<link rel="stylesheet" type="text/css" href="clientscript/jquery.share.css" />

The paths are correct.

I added this in footer template

<div id="mydiv"></div>

Doesn’t show up at all. Any ideas?

I even added the whole thing in footer template only, tried that variation and even tried putting the css/js lines prior to the <script> code section, still doesn’t show up.


[RIGHT]
[/RIGHT]

The code you posted looks fine.

Could you post a link to a page where I can see this not working, as there may well be something else at work.

Thanks. You can view the site at
http://www.talkjesus.com/forum.php

The code is entirely in the footer template, but it still doesn’t appear in the footer anywhere.

Hi there,

Currently you have the following starting in line 3050 of your page:

<script type="text/javascript">
  $('#mydiv').share({
    networks: ['facebook','googleplus','twitter','tumblr','email','stumbleupon','digg']
  });
</script>

<script type="text/javascript" src="clientscript/jquery.share.js"></script>
<link rel="stylesheet" type="text/css" href="clientscript/jquery.share.css" />

<div id="mydiv"></div>

It looks like you’re trying to call the .share() function on your <div> element, before either the <div> exists in the page or the JavaScript which implements the .share() function has been included.

Try changing the above to this:

<div id="mydiv"></div>

<script type="text/javascript" src="clientscript/jquery.share.js"></script>
<link rel="stylesheet" type="text/css" href="clientscript/jquery.share.css" />

<script type="text/javascript">
  $('#mydiv').share({
    networks: ['facebook','googleplus','twitter','tumblr','email','stumbleupon','digg']
  });
</script>

Does that make a difference?

Thanks. Unfortunately that didn’t fix it.

I tried that in footer, header and headerinclude templates (not at the same time, but individually). None displayed the plugin.

Weird. It works just great for me when I make these changes locally.

Can you change the code as I mention above, then let me know so that I can take another look.

I’m sorry but what do you mean change the code? That’s what I did before and my follow up reply was in regards to those changes.

Hi there,

When I had a look at the source code of your page, I could find no reference to the string:

‘<div id=“mydiv”>’

or the string:

‘networks: [’

It seems that the code you originally posted has now been removed from the page.

I was just hoping you could put it back in, alter it as I originally mentioned, then let me know.

Oh sorry, yes I re-added it in order you suggested. It’s there in footer template so will show up in source code

Good, good.
And now you can see the social media icons at the bottom of the page.
:slight_smile:

P.S. Don’t forget to refresh the page and clear your cache if necessary.

Thanks. Very strange Chrome wasn’t clearing right. Works now.

Appreciate your assistance

No problem.
I like the design of your site BTW.

I see why Chrome was showing. I saw it in IE, but not Chrome and here’s why. Once I’m logged in, the script does not show. This is now pretty odd. I don’t know if it’s a conflict with VB’s built in Facebook login/connect script. Any help on this appreciated.

PS: I moved it to the showthread template, if your not logged in it’ll display floating right of thread title:
http://www.talkjesus.com/bible-study-hall/45132-scriptural-balance.html

Once logged in, it disappears.

Can you shoot me some login credentials so I can have a look?

PM’d you, thanks

Hi,

The problem is that when you are logged in, jQuery is suddenly not defined, that is to say, you no longer reference the jQuery code in your page.
When you are not logged in, it is included in the hgead section of your document on line 94:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>

However, when you log in, this line vanishes from the source code.

Could it be possible that you have two different templates for “logged in” and “not logged in”?

Turning in now (it’s late here).
If you have any more questions, I’ll pick this up tomorrow.

None that I know of. That Google code was there by default in the template itself.

Thanks for the help. I’ll wait for tomorrow.

Good morning,

Now the icons are gone, whether I’m logged in or not.
I’m guessing you changed something?

Sorry I just re-added it in the footer template.


<div id="mydiv" style="float:left"></div>


<script type="text/javascript" src="clientscript/jquery.share.js"></script>
<link rel="stylesheet" type="text/css" href="clientscript/jquery.share.css" />


<script type="text/javascript">
  $('#mydiv').share({
    networks: ['facebook','googleplus','twitter','tumblr','email','stumbleupon','digg']
  });
</script>