vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Adding attach download link to Threadbit (https://vborg.vbsupport.ru/showthread.php?t=210036)

Powlo 04-01-2009 07:39 AM

Adding attach download link to Threadbit
 
I'm customisizing my threadbit and i want a download button for the attachment contained within the thread but im having difficulty getting the url correct.

Ive been using this ..

Code:

<a href="attachment.php?$session[sessionurl]attachmentid=$attachment[attachmentid]&d=$attachment[dateline]">
but that doesnt work.

Any ideas where im going wrong?

Mr-Moo 04-02-2009 03:25 AM

You are trying to reference a thread from the threadbit. To my knowledge you must first reference a specific thread before calling any of its information.

Let me see what I can find out for you.

Well mate, I can get everything to work except the display of the 'attachmentid'. If someone can chime in on how to display the attachmentid then this will work just fine. You need to modify your code to look like:

PHP Code:

<a href="attachment.php?$session[sessionurl]attachmentid=$attachment[attachmentid]&amp;d=$thread[dateline]">TESTING</a

Some key things to keep in mind:
-What happens when there are multiple attachments?
-In your original code, you did not have the HTML correct to even display anything, you only posted a link.
-In the future, please remember, when you are calling thread information you must refer to them with "$thread".

Hope I was able to help :)

// Edit //
I don't have the time to modify that, however that will display on every thread, regardless if there is an attachment. That must be modified to an IF statement to display/hide if there is/isn't an attachment. If I have time I will code and post.

Lynne 04-02-2009 01:34 PM

I am pretty sure you will have to write a plugin to grab the attachmentid. And, as brought up, you will have to determine *which* attachmentid you are going to grab if there are multiple attachments.

nexialys 04-02-2009 01:53 PM

in the threadbit list, you always see the attachment icon when there is attachments in that thread... click on it, and you have a popup with the full list of all the attachments... click them and if you have permission, you will be able to download them too...

Lynne 04-02-2009 02:16 PM

I totally forgot about that. Thanks, nexia.

Powlo 04-03-2009 10:52 AM

Thankyou all for your replies, im still no further forward but i will have a play and see what i get.

There will always be an attachment in the forums i am using this in, these forums use a different template to the others.

Thanks again

Mr-Moo 04-06-2009 02:02 AM

Before you begin tinkering with anything you may want to ask yourself the questions some of us presented. In specific how you will go about handling multiple attachments.

Question - Why is it you don't want the window to pop-up? Any specific reasoning behind that?


All times are GMT. The time now is 02:12 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.01764 seconds
  • Memory Usage 1,722KB
  • 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
  • (1)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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