Certainly! You can use the native jQuery that comes with vBulletin instead of loading it from Google's CDN. Here's how you can modify the client-side script to use vBulletin's native jQuery and integrate a CAPTCHA after a certain number of refreshes:
Code:
<script type="text/javascript">
// Assuming vBulletin's jQuery is already loaded and available as jQuery or $j instead of $
var refreshCount = localStorage.getItem('refreshCount') || 0;
$j(document).ready(function () {
refreshCount++;
localStorage.setItem('refreshCount', refreshCount);
if (refreshCount > 5) { // Change 5 to the number of refreshes you want to allow before triggering CAPTCHA
$j.ajax({
url: 'captcha_trigger.php', // Adjust the URL to the location of your server-side script
type: 'POST',
data: { triggerCaptcha: true },
success: function(response) {
if (response === 'show_captcha') {
// Redirect to a page or pop up a modal to show the CAPTCHA challenge
window.location.href = 'show_captcha.php'; // Adjust the URL to the location of your CAPTCHA page
}
}
});
}
});
</script>
For the server-side PHP scripts, you can use the same code provided in the previous reply, but make sure the paths match the actual locations of the scripts in your vBulletin directory. Remember to place the client-side script in a template that's included on every page, such as the footer or header template. This way, it will track the refresh count consistently across the site.
Also, ensure that your server-side scripts are secure and validate the session correctly to prevent any security issues. It's important to test this thoroughly to make sure it doesn't interfere with the normal user experience for those who are not spamming the refresh button.
Let me know if that works out

.