[ Reposted for anybody who might be using vBa Links ]
Peggy,
When we talk I'll go into more detail (because I don't want to turn this thread into a vBa Links support thread) but for a quick solution try this...
Modify your "adv_links_linkbit" and "adv_links_showlink" templates...
- In adv_links_showlink look for...
Code:
<td><a href="showlink.php?$session[sessionurl]l=$link[linkid]&linkurl=$link[linkurl]" target="_blank"<if condition="$show['nofollow']"> rel="nofollow"</if>>$link[linkurl_display]</a></td>
... and replace it with:
Code:
<td><a href="<if condition="$show['search_engine']">$link[linkurl]<else />showlink.php?$session[sessionurl]l=$link[linkid]&linkurl=$link[linkurl]</if>" target="_blank"<if condition="$show['nofollow']"> rel="nofollow"</if>>$link[linkurl_display]</a></td>
- In adv_links_linkbit look for...
Code:
<td align="$stylevar[left]" class="vbmenu_option falseclass"><a href="showlink.php?$session[sessionurl]l=$link[linkid]" target="_blank"<if condition="$show['nofollow']"> rel="nofollow"</if>>$vbphrase[view_site]</a></td>
... and replace it with:
Code:
<td align="$stylevar[left]" class="vbmenu_option falseclass"><a href="<if condition="$show['search_engine']">$link[linkurl]<else />showlink.php?$session[sessionurl]l=$link[linkid]</if>" target="_blank"<if condition="$show['nofollow']"> rel="nofollow"</if>>$vbphrase[view_site]</a></td>
The summary of what that change will do is that Google, Yahoo, and MSN will see the direct link and everybody else (including all other spiders) will see the usual redirect method.
If you really want all spiders to be affected then change $show['search_engine'] to $show['spider'] instead. Be warned that will impact performance on your site since it will have to parse the spiders.xml file everytime on the page load so it's not recommended (and, besides, the 'big 3' are Google, Yahoo, and MSN anyway. It'd be nice if Alexa was also included but that's another conversation.).
If you're worried about "Wait, will Google not like this since their bot will see something different then a human?" then change $show['search_engine'] to !$bbuserinfo['userid'] (note the exclamation point in front) and that way all non-registered guests (including humans) will see the direct method while registered visitors will see the redirect method. That actually wouldn't be so bad since that way the 'views' count would only be counted for people who are logged in to vBulletin.
When making your changes be careful since "showlink.php" is used in several different templates and several times in each of the templates mentioned above.
For those curious about vBa Links....
The method that vBa Links is using to launch the remote URL is that it passes a value to "showlink.php" first (eg: showlink.php?l={linkID}) which in turn increments the DB for the 'views' count and then it uses the vBulletin function 'print_standard_redirect' to actually redirect to the passed in URL.
Coding wise it's nice & neat trimmed code but as this conversation shows it also then doesn't allow PR from being passed to the remote site, instead "showlink.php" would be the receiver.
Bookmarks