vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Download counter attachments (https://vborg.vbsupport.ru/showthread.php?t=282172)

michaelbang 04-28-2012 02:02 PM

Download counter attachments
 
Hi,

I'm looking for a mod that can show how many times a given attachment has been downloaded. E.g. next to the link in a post:

movie-from-my-holiday.mpg (downloaded: 135 times)

Is that possible?

Thanks

//Michael

BirdOPrey5 04-28-2012 04:30 PM

That should be visible by default- it's called "views" but it's there.

Look at the attachment in this first post: https://www.vbulletin.com/forum/show...rum-04-23-2012

I see it is currently at "403 views."

michaelbang 04-30-2012 08:32 AM

It's excactly what I want! But that's not visible in my forum. Is it something that I have to "turn on"?

--------------- Added [DATE]1335779546[/DATE] at [TIME]1335779546[/TIME] ---------------

Maybe something is wrong/missing in the postbit-attachment template?

BirdOPrey5 04-30-2012 09:53 AM

Post a copy of your postbit attachment template here- they are small... Put it inside [CODE] bbcode so it's easy to read.

Or, here is the default code for postbit_attachment:

Code:

<li>
        <img class="inlineimg" src="{vb:stylevar imgdir_attach}/{vb:raw attachment.attachmentextension}.gif" alt="{vb:rawphrase file_type_x, {vb:raw attachment.attachmentextension}}" />
        <a href="attachment.php?{vb:raw session.sessionurl}attachmentid={vb:raw attachment.attachmentid}&amp;d={vb:raw attachment.dateline}"<vb:if condition="$show['newwindow']"> target="_blank"</vb:if>>{vb:raw attachment.filename}</a>
({vb:raw attachment.filesize}<vb:if condition="$show['views']">, {vb:rawphrase x_views, {vb:raw attachment.counter}}</vb:if>)
</li>

The code in red controls the showing of views... I don't see anywhere to disable the showing of views and it is always enabled by default. But it is in a condition so I don't know.

michaelbang 04-30-2012 10:08 AM

Seeing anything wrong?

Code:

<li>
        <img class="inlineimg" src="{vb:stylevar imgdir_attach}/{vb:raw attachment.attachmentextension}.gif" alt="{vb:rawphrase file_type_x, {vb:raw attachment.attachmentextension}}" />
        <a href="attachment.php?{vb:raw session.sessionurl}attachmentid={vb:raw attachment.attachmentid}&amp;d={vb:raw attachment.dateline}"<vb:if condition="$show['newwindow']"> target="_blank"</vb:if>>{vb:raw attachment.filename}</a>
({vb:raw attachment.filesize}<vb:if condition="$show['views']">, {vb:rawphrase x_views, {vb:raw attachment.counter}}</vb:if>)
</li>


BirdOPrey5 04-30-2012 11:10 AM

No... I don't know why the showing of views would be disabled- I didn't see any options that control this...

In the code change:

Code:

<vb:if condition="$show['views']">
to

Code:

<vb:if condition="1">
and that should force the views to show.

There is an option in Admin CP -> Settings -> Options -> Attachment Options that lets you decide if views are updated immediately or the default once per hour to reduce load on the server.

michaelbang 04-30-2012 11:31 AM

I tried to change the code. Did nothing.

Do you mean "Message Attachment Options" in "Settings/Options"? I cant find the option you mention here.

Thanks for the support!

BirdOPrey5 04-30-2012 02:02 PM

Setting <vb:if condition="1"> made no change? Are you sure you made it to the correct style?

Can I get a link to a post on your forum with an attachment in it?

The setting I was talking about is actually under "Server Settings and Optimization Options" - sorry.

michaelbang 04-30-2012 02:17 PM

I changed the postbit_attachment template in Postbit Templates.

Code:

<li>
        <img class="inlineimg" src="{vb:stylevar imgdir_attach}/{vb:raw attachment.attachmentextension}.gif" alt="{vb:rawphrase file_type_x, {vb:raw attachment.attachmentextension}}" />
        <a href="attachment.php?{vb:raw session.sessionurl}attachmentid={vb:raw attachment.attachmentid}&amp;d={vb:raw attachment.dateline}"<vb:if condition="$show['newwindow']"> target="_blank"</vb:if>>{vb:raw attachment.filename}</a>
({vb:raw attachment.filesize}<vb:if condition="1">, {vb:rawphrase x_views, {vb:raw attachment.counter}}</vb:if>)
</li>

I'll PM you a link to my forum and a post with an attachment.

BirdOPrey5 04-30-2012 03:03 PM

The link you sent me- the issue is those are "inline attachments" so they show up differently.

It actually tells you the views if you mouse-over the link.

To get the real counter like they have on the link I sent you to vBulletin.com you need to edit the post and remove the attachments from being inline (just delete them from the editor box) and they will show up as real attached files with the view counter.


All times are GMT. The time now is 07:05 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00964 seconds
  • Memory Usage 1,739KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete