I've updated to version 5.4.4 and was running a hook that would pop up a popup when downloading a file with this script
But when the script is executed the forum page gives System error that it may be due
Code:
<script>
(function(){
window.onload = function() {
$('.conversation-content-widget').on('click', '.b-post--first .b-post-attachments__item a', function(e) {
var that = this;
setTimeout(function() {
var filename = $('span:nth-child(2)', that).html() || '',
options, randomOptions,
arr;
if ((/\.zip$/i).test(filename) || (/\.pdf$/i).test(filename) || (/\.bin$/i).test(filename) || (/\.rar$/i).test(filename)) {
options = {
title: 'Danos soporte',
message: '<strong>{vb:data userInfo, user, fetchUserSettings} {vb:raw userInfo.username}</strong>,<p>Crear el FORO y mantener este sitio requiere mucho tiempo, energía y dinero. Le agradeceríamos mucho si pudiera donar unos pocos euros para ayudarnos a pagar los costos de alojamiento y dominio, para mejorar continuamente este sitio. ¡Gracias!<img src="core/images/smilies/smile.png" border="0" alt="" title="Smile" smilieid="1" class="inlineimg"><img src="https://foro4g.com/core/images/smilies/Galore/thumbs_thumbsupup.gif" border="0" alt="" title="Thumbs Thumbsupup" smilieid="377" class="inlineimg"/>',
iconType: 'question'
};
arr = [
{
buttonLabel: {
yesLabel: 'Donar ahora',
noLabel: 'Donare luego'
},
onClickYes: function() {
window.open('https://www.paypal.me/foro/');
return true;
}
},
{
buttonLabel: {
yesLabel: 'Donare luego',
noLabel: 'Donar ahora'
},
onClickNo: function() {
window.open('https://www.paypal.me/foro/');
return true;
}
}
];
randomOptions = arr[Math.floor(Math.random() * arr.length)];
$.extend(true, options, randomOptions);
window.openConfirmDialog(options);
}
}, 1000);
});
}
})();
</script>




Comment