News:

Join the Facebook Fan Page.

Main Menu

VigLink

Started by lurkalot, December 12, 2010, 06:05:08 PM

Previous topic - Next topic

mxcape21

yes I just saved it again, can you just give me a code snippet with "xxxxxx" for key and I will manually replace it in the index.template.php.

Oh sorry i forgot to say i was using SMF 2.0 RC5
The only thing I can presume, since I know I'm not crazy (certifiably at least), is that everybody else is until they prove otherwise! 8)
http://techraffle.com/forum/index.php

Tony Reid

Well right at the bottom of your index.template.php you need to change this....

<script type="text/javascript">
        var vglnk = { api_url: '//api.viglink.com/api',key: '' };

  (function(d, t) {
    var s = d.createElement(t);
    s.type = 'text/javascript'; s.async = true;
    s.src = ('https:' == document.location.protocol ? vglnk.api_url :
             '//cdn.viglink.com/api') + '/vglnk.js';
    var r = d.getElementsByTagName(t)[0]; r.parentNode.insertBefore(s, r);
  }(document, 'script'));
</script></body></html>


to this - replacing xxxxxxxxxxxxxxxxxx with your api key...


<script type="text/javascript">
        var vglnk = { api_url: '//api.viglink.com/api',key: 'xxxxxxxxxxxxxxxxxx' };

  (function(d, t) {
    var s = d.createElement(t);
    s.type = 'text/javascript'; s.async = true;
    s.src = ('https:' == document.location.protocol ? vglnk.api_url :
             '//cdn.viglink.com/api') + '/vglnk.js';
    var r = d.getElementsByTagName(t)[0]; r.parentNode.insertBefore(s, r);
  }(document, 'script'));
</script></body></html>
Tony Reid

mxcape21

Ok that's not at the bottom of my index.template.php

I see this but its a long way from the bottom


(function(d, t) {
    var s = d.createElement(t);
    s.type = \'text/javascript\'; s.async = true;
    s.src = (\'https:\' == document.location.protocol ? vglnk.api_url :
             \'//cdn.viglink.com/api\') + \'/vglnk.js\';
    var r = d.getElementsByTagName(t)[0]; r.parentNode.insertBefore(s, r);
  }(document, \'script\'));
</script>';
                  }
The only thing I can presume, since I know I'm not crazy (certifiably at least), is that everybody else is until they prove otherwise! 8)
http://techraffle.com/forum/index.php

Tony Reid

Above that you should have something like...

var vglnk = { api_url: '//api.viglink.com/api',key: '' };

Change it to (replacing the xxx with your API):

var vglnk = { api_url: '//api.viglink.com/api',key: 'xxxxxxxxxxxxxxxxxx' };
Tony Reid

mxcape21

Now I get this error -->


Parse error: syntax error, unexpected '(', expecting ',' or ';' in .../Themes/darkmodern_203/index.template.php on line 407

398: echo !empty($settings['forum_width']) ? '
399: </div>' : '', '
400: ';
401: global $modSettings;
402: if(!empty($modSettings['vigLinkCode']))
403:                                         {
404:         echo '<script type="text/javascript">
405:         var vglnk = { api_url: '//api.viglink.com/api',key: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxx' };
406:

407:   (function(d, t) {

408:     var s = d.createElement(t);
409:     s.type = 'text/javascript\'; s.async = true;
410:     s.src = (\'https:\' == document.location.protocol ? vglnk.api_url :
411:              \'//cdn.viglink.com/api\') + \'/vglnk.js\';

The only thing I can presume, since I know I'm not crazy (certifiably at least), is that everybody else is until they prove otherwise! 8)
http://techraffle.com/forum/index.php

Tony Reid

Attache your index.template.php file here and I'll take a look
Tony Reid

Tony Reid

Sorry - I am half asleep - you need to change this...

global $modSettings;
if(!empty($modSettings['vigLinkCode']))
                                        {
        echo '<script type="text/javascript">
        var vglnk = { api_url: \'//api.viglink.com/api\',key: \''.$modSettings['vigLinkCode'].'\' };

  (function(d, t) {
    var s = d.createElement(t);
    s.type = \'text/javascript\'; s.async = true;
    s.src = (\'https:\' == document.location.protocol ? vglnk.api_url :
             \'//cdn.viglink.com/api\') + \'/vglnk.js\';
    var r = d.getElementsByTagName(t)[0]; r.parentNode.insertBefore(s, r);
  }(document, \'script\'));
</script>';


to this....

global $modSettings;
if(!empty($modSettings['vigLinkCode']))
                                        {
        echo '<script type="text/javascript">
        var vglnk = { api_url: \'//api.viglink.com/api\',key: \'xxxxxxxxxxxxxxxxxx\' };

  (function(d, t) {
    var s = d.createElement(t);
    s.type = \'text/javascript\'; s.async = true;
    s.src = (\'https:\' == document.location.protocol ? vglnk.api_url :
             \'//cdn.viglink.com/api\') + \'/vglnk.js\';
    var r = d.getElementsByTagName(t)[0]; r.parentNode.insertBefore(s, r);
  }(document, \'script\'));
</script>';
Tony Reid

mxcape21

Ok here it is......thanks  :)

The only thing I can presume, since I know I'm not crazy (certifiably at least), is that everybody else is until they prove otherwise! 8)
http://techraffle.com/forum/index.php

Tony Reid

Whats your API key? its not private - so it doesn't matter if you post it here.
Tony Reid

mxcape21

Do I leave the "\" at the end of the key?

88b8065c5fcc0df0d5ad104ca9f1331e

still fails the VIGLINK website test..
The only thing I can presume, since I know I'm not crazy (certifiably at least), is that everybody else is until they prove otherwise! 8)
http://techraffle.com/forum/index.php

Tony Reid

This should do it....
Tony Reid

mxcape21

It still fails the test...
The only thing I can presume, since I know I'm not crazy (certifiably at least), is that everybody else is until they prove otherwise! 8)
http://techraffle.com/forum/index.php

Tony Reid

I see you've uploaded it - and the code is in place.

I ran the test, and it failed - however this is down to an issue with the way viglink is checking - perhaps due to spacing etc.

Leave the code in for a few days and you will see it working - the busier your site is with shopping links etc, and the more links people click on - the more you will see viglink recording the activity.
Tony Reid

mxcape21

Ok thanks a lot.  :)
The only thing I can presume, since I know I'm not crazy (certifiably at least), is that everybody else is until they prove otherwise! 8)
http://techraffle.com/forum/index.php

Babyfacemagee

Hi,  The viglink mod doesn't seem to be working with my new 2.0.1 forum install.  After I upload the file into the packages directory if I try to install it doesn't give me the option to install and only lists [list files] and [delete].  No install or uninstall options.   Funny thing is it worked in my 2.0 forum.   

The website is www.kindlefireforums.com

Any ideas?[/list]

Tony Reid

So this is a fresh 2.0.1 install - not an upgrade of your 2.0 forum?
Tony Reid

Babyfacemagee

yes, brand new install of 2.0.1.   

Tony Reid

I've uploaded a new version that should run fine on 2.0.1

Tony Reid

Babyfacemagee

New version is doing the same thing.  Once the package is downloaded or placed in the packages folder I only get the select files and delete options.   No install option.  By the way I have your viglink mod on 5 of my other forums but they are all either 2.0 rc4 or rc5.   It's only when I've tried to install on 2.0.1 forums that it isn't working for me and i'm getting the missing install option.

Tony Reid

How did you upload the package? via the package manager or FTP? also, can you check the file permissions.
Tony Reid

Advertisement: