PDA

View Full Version : Attachment download counter


Black Tiger
12-30-2008, 11:25 PM
I have looked but not found it yet, but see it on several forums out there.

I would like to have a counter which counts attachments.

The build in does it like this:
Filename (12,3 KB, 120 views)

Ik would like it like this example 1:
Filename (12,3 KB, downloaded 120 times)

or even more beatiful (like I've seen some places) example 2:
Filename (12,3 KB)
This file has been downloaded 120 times.

Ofcourse I could change the "views" to "downloads" in the languages and phrases section, but normal posts al also "viewed" so I'm afraid I will change the wrong "views" phrase.

Furthermore the second example I would like the most.
Can anyone tell me how to do this please?

Black Tiger
01-02-2009, 11:53 PM
Anybody?

numberguy
11-05-2010, 05:45 PM
Anybody?

+1

I would like to know as well!

LifesGreatestGift
11-26-2010, 02:44 AM
<a href="https://vborg.vbsupport.ru/showthread.php?t=254241" target="_blank">https://vborg.vbsupport.ru/showthread.php?t=254241</a>

Black Tiger
11-27-2010, 09:46 PM
Thank you, but that's for 4.x and I need one for vb 3.8.x.

LifesGreatestGift
11-27-2010, 09:55 PM
Post the code to postbit_attachment and ill change it for you.

vbenhancer
11-27-2010, 10:42 PM
need my ...

https://vborg.vbsupport.ru/showthread.php?t=230716

Black Tiger
11-29-2010, 01:29 PM
@TheWindows7Site: Great, but I would rather like a "look for this and change that" or "look for this and replace that" kind of code, so I can see what I'm doing and save it for future use.
I'm not in a hurry, so I'm already happy if you want to do that for me.
Here is my postbit_attachment:

<tr>
<td><img class="inlineimg" src="$stylevar[imgdir_attach]/$attachment[attachmentextension].gif" alt="<phrase 1="$attachment[attachmentextension]">$vbphrase[file_type_x]</phrase>" width="16" height="16" border="0" style="vertical-align:baseline" /></td>
<td><a href="attachment.php?$session[sessionurl]attachmentid=$attachment[attachmentid]&amp;d=$attachment[dateline]"<if condition="$show['newwindow']"> target="_blank"</if>>$attachment[filename]</a> ($attachment[filesize]<if condition="$show['views']">, <phrase 1="$attachment[counter]">$vbphrase[x_views]</phrase></if>)</td>
</tr>

I presume I have to change this part somehow:
($attachment[filesize]<if condition="$show['views']">, <phrase 1="$attachment[counter]">$vbphrase[x_views]</phrase></if>)</td>
</tr>

I only don't know what to replace this by to get the "This file has been downloaded x times".
Thanks!