In product-psi_whodownloaded.xml at approx line 206 find and delete:
PHP Code:
if (isset($vbulletin->templatecache['modifyattachmentsbit']))
{
$find_string = compile_template('<phrase 1="$post[counter]">$vbphrase[x_downloads]</phrase>');
$add_string = compile_template('<if condition="$post[\'counter\'] > 0"> - <a href="#" onclick="whodownloaded($post[attachmentid]); return false;">$vbphrase[psiwd_who_downloaded]</a></if>');
$vbulletin->templatecache['modifyattachmentsbit'] = str_replace($find_string, $find_string . $add_string, $vbulletin->templatecache['headinclude']);
}
Save and upload through the Add/Import Products with Allow Overwrite set to yes
Then to have the link appear in the attachments list, in vb admin go to Style Manager -> Your Style Options -> Modify User Option Templates ->
postbit_attachment
Find :
PHP Code:
<phrase 1="$attachment[counter]">$vbphrase[x_views2]</phrase>
After, add :
PHP Code:
<if condition="is_member_of($bbuserinfo, 6)"><if condition="$attachment['counter'] > 0"> - <a href="#" onclick="whodownloaded($attachment[attachmentid]); return false;">$vbphrase[psiwd_who_downloaded]</a></if></if>
You have to specify the usergroup you want to authorize to see the link appear.
Change 6 by any usergroup. If you want to add more than one group, add a comma after each ID.
Example : <if condition="is_member_of($bbuserinfo, 1, 2, 3, 4, 5, 6)
Close this template and open the template :
modifyattachmentsbit
Find :
PHP Code:
<div class="smallfont">$post[size], <phrase 1="$post[counter]">$vbphrase[x_downloads]</phrase>
After, add :
PHP Code:
<if condition="$post['counter'] > 0"> - <a href="#" onclick="whodownloaded($post[attachmentid]); return false;">$vbphrase[psiwd_who_downloaded]</a></if>
Go to Usergroup manager -> Your usergroup -> Set
Can View Who Downloaded permission on "
NO", then go again in your usergroup but, this time, set to "
YES"