News:

Wondering if this will always be free?  See why free is better.

Main Menu

VigLink

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

Previous topic - Next topic

lurkalot

Link insertion has stopped working on one of my sites for some reason.  It was working perfectly up until two days ago.  Tried un-installing and re-installing, still not working. Checked my settings over at Viglink and it's all set correctly. 

Links are getting affiliated, but like I said the link insertion has stopped.  Running SMF 2.0.4  Any ideas why this might have happened?

I also have it running on two other SMF 2.0.4 sites without problems.

johnpaul2k2

The package you are trying to download or install is either corrupt or not compatible with this version of SMF.



what is the way forward???

lurkalot

Quote from: johnpaul2k2 on May 10, 2013, 12:57:55 PM
The package you are trying to download or install is either corrupt or not compatible with this version of SMF.



what is the way forward???

Assuming you're using SMF 2.0.4 then emulate to 2.0.2 and it should install.  http://wiki.simplemachines.org/smf/How_can_I_install_a_mod_that_doesn%27t_work_in_my_SMF_version

Arantor

Quote from: johnpaul2k2 on May 10, 2013, 12:57:55 PM
The package you are trying to download or install is either corrupt or not compatible with this version of SMF.



what is the way forward???

Not shouting in a huge font would also be a fantastic way forward.

Mick.

He's been here long enuff. I would imagine what to do when he sees that message.

johnpaul2k2

thanks for the suggestion ;)

SORRY ABOUT THAT

i have done everything, please when am i expected to start seeing adverts

lurkalot

Does this Viglink mod still work as expected?  I realise it will install ok, but the Viglink insert seems to have stopped working on my sites, and wondered if recent changes to the Viglink API code require this mod to be updated.


Tony Reid

Hi Lurkalot,

I'd forgotten that I had written this mod.

With a quick look at the mod code, and what appears to be new javascript, the mod needs to be changed.

To manually update your code :

edit : ./Themes/default/index.template.php
find
</body>

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

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

echo '


I have not tested this at all - please make sure you backup any files!

You will need to remove the old code which looks something like 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>';
                  }

echo '



Hope that helps. Let me know if it works, and i'll update the mod with the new code.



Tony Reid

lurkalot

Quote from: Tony Reid on August 13, 2016, 08:53:01 AM

Hope that helps. Let me know if it works, and i'll update the mod with the new code.

Thanks.  I've updated the code as you posted above, just got to see if it starts working. So far it isn't but that could be my shoddy editing.  :-[  It's here if you want to check the source code for me. ;)  Both default and the custom theme I'm using have the edit.

lurkalot

Tony, gave it a good test, but for me it's still not working.  Tried it in both default and custom theme but the Viglink insert still doesn't produce any links.

Tony Reid

Can you provide a link to the forum in question please :)
Tony Reid

lurkalot

Quote from: Tony Reid on August 13, 2016, 12:36:20 PM
Can you provide a link to the forum in question please :)

Sorry forgot to add the link in the post above.  This is the one using your code edit, http://guitaristguild.com/

Tony Reid

You have an additional bracket...... I edited it out immediately after posting, but you must have been quick off the mark.

Remove the Bracket on this line...
    s.src = ('//cdn.viglink.com/api\vglnk.js';
Tony Reid

lurkalot

Quote from: Tony Reid on August 13, 2016, 03:57:48 PM
You have an additional bracket...... I edited it out immediately after posting, but you must have been quick off the mark.

Remove the Bracket on this line...
    s.src = ('//cdn.viglink.com/api\vglnk.js';

Thanks Tony.  Removed the bracket, let's see if it works now. ;)

Tony Reid

Failed to load resource: the server responded with a status of 403 (Forbidden) http://cdn.viglink.com/api%0Bglnk.js

this...
s.src = '//cdn.viglink.com/api\vglnk.js';

Should be : 
s.src = '//cdn.viglink.com/api/vglnk.js';

Sorry for all the edits, but that should sort you out fine :)

Tony Reid

lurkalot

Quote from: Tony Reid on August 13, 2016, 05:08:24 PM

Sorry for all the edits, but that should sort you out fine :)


Thank you, seems to be working now.  I will keep an eye on it for a few days, it should be inserting more links than it is atm, but that's not down to your mod.  Look forward to your version update.  8)

mj.

I just signed up with Viglinks and installed this mod.  Was a bit of a wild ride getting the code edits here correct, but I think I have it now, when I view source on my site it **LOOKS** right.  Can't really tell if it's working, the validation at Viglinks certainly doesn't think so.  If anyone more knowledgeable than I could take a quick peek I'd appreciate it. http://spaceciggysforum.com/

Tony Reid

Appears to be working. Check back in a day or so.

You have the mod on your board index, this is not necessary - it really only needs to be on the pages that display posts.

Separate issue though :
Failed to load resource: the server responded with a status of 404 (Not Found) http://spaceciggysforum.com/Themes/enterprise_smf20final/images/theme/main_block.png
http://spaceciggysforum.com/Themes/enterprise_smf20final/scripts/theme.js?fin20
Tony Reid

Tony Reid

*Updated the mod for 2.0.13 compatibility.

Please uninstall the previous mod before installing this one.
Tony Reid

mj.

Thanks Tony!  And thanks for the heads up on those errors, I'd meant to fix them for a while.  That poor theme is basically abandoned, it was never really updated properly for 2.something, I think that may be why the mod code is getting executed on the message index.  I've been applying duct tape and baling wire to the theme for some time now, but I really lack the php coding skills and theme knowledge to fix it correctly before the sun burns out...

Advertisement: