Hi,
I share a lot of (legal) files on my board. But the bandwidth load is very heavy. Therefor i want my visitors to click a banner first before they get access to a file stated in a thread (one file, or downloadpage per thread).
I was thinking about a custom bbcode.
This is the javascript i want to use:
Code:
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function adClick(ad, site) {
window.open(ad);
window.location = site;
}
// End -->
</script>
And in HTML the code would be like this...
Code:
<a href="javascript:adClick('http://www.sponsor.com', 'files.htm');">
Click here to visit our sponsor and go to the files</a>
The sponsor part is clear, it is mandatory, but the files.htm vary per thread... so i wanted to wrap the code around the files.htm (the name 'files.htm' is an example, it will change in name in every thread).
I hope you can help me with it...
--------------- Added [DATE]1224228025[/DATE] at [TIME]1224228025[/TIME] ---------------
Got it, but now i want it for certain usergroups, so eg only for registered members...
--------------- Added [DATE]1224233751[/DATE] at [TIME]1224233751[/TIME] ---------------
I simply placed the javascript in the SHOWTHREAD template and then added a custom BBCODE where {param} is the destination for where the files are...
Is it possible to create a usergroup called eg "mustclick" and then add the following code to the replacementcode in BBCODE (where usergroupid 10 stands for the mustclick group)?
Code:
<if ($vbulletin->userinfo[?usergroupid?] == ?10?)>
<a href=?javascript:adClick(?http://www.sponsor.com?, ?{param}?);?>
<img src=?http://wherethebanner.is? border=?0? /></a>
<else>
<a href=?tothefiles.com?>To the files</a>
</if>