I need help to integrate "Social Traffic Pop" jquery

leonor

Active Member
License Active
Hello, i want to add a "Social Traffic Pop" jquery to my /stats/{username} sites.

I have to add this in my <head> tag:
PHP:
<link href="social-traffic-pop.css" rel="stylesheet" type="text/css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
<script src="http://platform.twitter.com/widgets.js" type="text/javascript"></script>
<script src="jquery.stp.min.js" type="text/javascript"></script>
And this too, but i want to show this only when some is visit /stats/ Pages ... so tryed to put it my stats.html but its not working :D
Code:
<script>
 
$(document).ready(function(){     
             
    $().socialTrafficPop({
        timeout: 999,
        title: "Social Traffic Pop",
        message: 'Share my hot new Envato item <em>Social Traffic Pop</em>!',
        google_url: "http://private-server.ws",
        fb_url: "http://google.com/",
        closeable: true,
        advancedClose: true,
        google_on: true,
        twitter_on: true,
        opacity: '0.45',
        twitter_method: "tweet",
        tweet_url: 'http://private-server.ws',
        tweet_text: 'Just tried out this awesome plugin Social Traffic Pop - Its Amazing!',
        onClick: 'example-class'
    });
 
});
 
</script>
Then i tryed to get it working on all pages, but the some NOTHING :p

I have here two .js files and one .css, if you need this files i can send you a DL Link via pm.

leonor
 

cajkan

Active Member
Leonor
Basti told me that VL already uses a JQuery into Core files

so you dont need another one JQuery file into head that ( i think )

and maybe change thouse 999 to less so you dont have to wait too much time...

i had same problem adding an accordion and tabs but ive used the same jquery ( js ) file and works smooth now
 

leonor

Active Member
License Active
the 999 is how laong the user have to wait, to unlock "content".

hm i tryed many things, visiolist also use fb,twitter,google on stats page. I deletet them from this header code, but nothing.
Now i testet it without jquery, but nothing. idk wath i have to do, maybe i will find tomorrow a solution :)
 

Mark

Administrator
Staff member
try using absolute paths

<script src="jquery.stp.min.js" type="text/javascript"></script>

if your VL is installed in the root

<script src="/jquery.stp.min.js" type="text/javascript"></script>

or i fyou installed in a folder called "toplist"

<script src="/toplist/jquery.stp.min.js" type="text/javascript"></script>
 

leonor

Active Member
License Active
nope :( its not working [on my homeserver] I will try it later on my real server but no time now. I have to work :p
 

Basti

Administrator
Staff member
You can always use path like
<script src="jquery.stp.min.js" type="text/javascript"></script>
since we have a base_url tag in the header.

Asumming you use it like that, it means the js file has to be in your topsite root where .htaccess is.
Same goes for the css file

The social, as well as the jquery core file could be left out, since you have it already included.
Iam assuming there is either a path issue or youve interpreted the docs wrongly

If you put the above js in header, and the document ready code into stats.html at the bottom it should only appear on stats.

Drop me a note on skype later today, iam sure its quick to solve, leaving out that you force visitors to do something, which is evil in my opinion :)
 
Top