FlyerTalk Forums - View Single Post - Can't click "like" on some threads
View Single Post
Old Jul 31, 2024 | 1:30 am
  #16  
s3m
100k
20 Countries Visited
100 Nights
All eyes on you!
 
Join Date: Apr 2024
Posts: 233
I believe I've found the bug: the like code relies on jQuery being available via a variable named $ which is not always the case because some of the third-party scripts ran on the website are overwriting it. There's 2 possible fixes depending on what level of access the admins like IBJoel have:

a. Ensure that jQuery is available via the variable $ by adding additional Javascript to the page via Google Tag Manager which assigns `var $ = jQuery`
b. Modify the file vbseo/resources/scripts/vbseo_ui.js: replace `$("#main-content")` with `jQuery("#main-content")`

Until the issue is fixed by the administrators, individual users can fix it on each page load by running the following code in their browser console:

var $ = jQuery
vbseoui = new vBSEO_UI();
vbseoui.page_init(Array('postbody', 'blogbit', 'content', 'postcontainer', 'vbseo_like_postbit'), Array("php",1));

And that can be made even easier by adding it as a bookmark, so each time you need to enable likes on a page, you can just click the bookmark, e.g:

javascript:var $ = jQuery; vbseoui = new vBSEO_UI(); vbseoui.page_init(Array('postbody', 'blogbit', 'content', 'postcontainer', 'vbseo_like_postbit'), Array("php",1));



Enjoy!

(Apologies to anyone who got notifications of me liking and unliking their posts while I was testing this.)

Last edited by s3m; Jul 31, 2024 at 11:45 am Reason: Added spacing to prevent code being broken up
s3m is offline