vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Download button for attachments (https://vborg.vbsupport.ru/showthread.php?t=260831)

techdeals07 03-23-2011 04:11 PM

Download button for attachments
 
Looking for a way to mod attachments to show a download button that links to a posted attachment rather than the attachment file name. Basically just want to hide the filename replace with a button. Any relatively easy way to accomplish this?

techdeals07 03-25-2011 02:21 PM

Hmm, surely somebody has implemented a mod like this.....could it be possible by editing phrases maybe?

Lynne 03-25-2011 02:53 PM

Have you tried just modifying the postbit_attachment template to do this?

techdeals07 03-26-2011 03:51 AM

Quote:

Originally Posted by Lynne (Post 2177321)
Have you tried just modifying the postbit_attachment template to do this?

Ok, that makes sense. I'm no expert on this type of thing, but I'm guessing this is the bit of code from postbit_attachment I'm concerned with:

Code:

        <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>
Can somebody point me in the right direction as to how to go about editing this to get an image rather than the file name?

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

Ok, took a shot at it myself and it's pretty easy. For anybody else seeking to do the same here's what I did:.

Code:

<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>><img src="http://yourimage.png" border="0" alt="Download"></a>

Lynne 03-26-2011 02:58 PM

Yep, good job and thanks for sharing the solution. :)

DaPike 01-27-2013 03:27 PM

Hi,

how can I make the download button when I use a Hide-Hack for attachments?
The bbcode looks like [HIDE][ATTACH]Link to file[/ATTACH][/HIDE]

I only see the attach number. But instead of the number I wanna see a download button.

Can someone tell how to do this?

I'm on vB 4.1.10

Thx for help.

DaPike


All times are GMT. The time now is 10:23 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.01117 seconds
  • Memory Usage 1,720KB
  • 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
  • (2)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete