Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 04-01-2009, 08:39 AM
Powlo Powlo is offline
 
Join Date: Feb 2008
Location: Sunderland UK
Posts: 155
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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?
Reply With Quote
  #2  
Old 04-02-2009, 04:25 AM
Mr-Moo Mr-Moo is offline
 
Join Date: Sep 2007
Location: Chicago, IL.
Posts: 130
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 04-02-2009, 02:34 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #4  
Old 04-02-2009, 02:53 PM
nexialys
Guest
 
Posts: n/a
Default

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...
Reply With Quote
  #5  
Old 04-02-2009, 03:16 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I totally forgot about that. Thanks, nexia.
Reply With Quote
  #6  
Old 04-03-2009, 11:52 AM
Powlo Powlo is offline
 
Join Date: Feb 2008
Location: Sunderland UK
Posts: 155
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #7  
Old 04-06-2009, 03:02 AM
Mr-Moo Mr-Moo is offline
 
Join Date: Sep 2007
Location: Chicago, IL.
Posts: 130
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:01 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.04024 seconds
  • Memory Usage 2,215KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (6)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete