1
Hi there.
Here is a hack that I use for Weblinks and ported to xoopspartners. The first part of this hack is to add a javascript into the theme.html files of your theme. This will allow using this script in any other modules than xoopspartner.
First edit your /themes/yourThemeDir/theme.html, find the line with "" and add this code before that line:
<script language="javascript">
function snx_hardlink(link, redirect) {
link.href='<{$xoops_url}>' + redirect;
return true;
}
script>
go to the /modules/xoopspartners/ folder and edit index.php. At line 76, replace
with this code
Now edit templates/blocks/xoopspartners_block_site.html.
At line 38, replace:
<a href="<{$xoops_url}>/modules/xoopspartners/vpartner.php?id=<{$partner.id}>" target="_blank">
with this code:
<a href="<{$partner.url}>" onMouseDown="snx_hardlink(this, '/modules/xoopspartners/vpartner.php?id=<{$partner.id}>')" target="_blank">
What's happened ?
We replace each redirection URL of Xoopspartners with the real hardlink of the partner and add a javascript call when a mouse button is pressed (even before it is released). In normal situation, the partner's URL is called when the left mouse button is pressed AND THEN released. Here the javascript is called just before it is released to change the hardlink URL into an redirection URL.
The javascript function should be called like this:
<a href="[A HARD LINK URL]" onMouseDown="snx_hardlink(this, '/path/to/redir_script.php?id=[partnerID]')">[TEXT]a>