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

Reply
 
Thread Tools Display Modes
  #11  
Old 10-25-2010, 05:56 AM
Hornstar Hornstar is offline
 
Join Date: Jun 2005
Location: Australia
Posts: 2,469
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think it is newpost_attachmentbit

In that template it has:
PHP Code:
<div style="margin:2px">
    <
img class="inlineimg" src="$attach[imgpath]alt="" border="0" />
    <
a href="attachment.php?$session[sessionurl]attachmentid=$attach[attachmentid]&amp;stc=1&amp;d=$attach[dateline]target="_blank">$attach[filename]</a>
    (
$attach[filesize])
</
div
Now this is probably mega wrong as I have not done much of this before, but does this look nearly right?

PHP Code:
<if condition="is_member_of($bbuserinfo, 2)">
and
<if 
condition="$attach['attachmentid'] == 41610">
<
div style="margin:2px">
    <
img class="inlineimg" src="$attach[imgpath]alt="" border="0" />
    <
a href="http://www.site.com/link">My Link</a>
    (
$attach[filesize])
</
div>
<else />
<
div style="margin:2px">
    <
img class="inlineimg" src="$attach[imgpath]alt="" border="0" />
    <
a href="attachment.php?$session[sessionurl]attachmentid=$attach[attachmentid]&amp;stc=1&amp;d=$attach[dateline]target="_blank">$attach[filename]</a>
    (
$attach[filesize])
</
div>
</if>
</if> 
I got that to save okay But then it did not change anything on the page which had that attachment

Any ideas?

Edit: I found where it was making the changes, if I click edit thread, than I will see the changes made on that page, and they worked perfect ^^, but I need them to show on the page where attachments are shown in a thread.

I tried these templates so far:
newpost_attachmentbit
attachmentbit
newattachmentbit
postbit_attachment
None of those worked in the spot I am trying, any idea which template I should edit for that?
Reply With Quote
  #12  
Old 10-26-2010, 08:49 PM
Hornstar Hornstar is offline
 
Join Date: Jun 2005
Location: Australia
Posts: 2,469
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have it all working, except I can't find the correct template to put my code in. I tried "Add Template Name in HTML Comments" but that showed me a different part.

Any ideas of how I can find the correct template?
Reply With Quote
  #13  
Old 10-27-2010, 04:17 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The Add Template Name in HTML Comments will work if you look at the correct part of your page source. Get the attachment url and search for it in the page source and you will find it.
Reply With Quote
  #14  
Old 10-27-2010, 10:48 AM
Hornstar Hornstar is offline
 
Join Date: Jun 2005
Location: Australia
Posts: 2,469
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I took away the attachment if statement, and I re did what I did in every template again, and I found that this time it worked in the postbit_attachment template.

These are my if statements:
PHP Code:
<if condition="is_member_of($bbuserinfo, 2, 6)">
and
<if 
condition="$attach['attachmentid'] == 41668"
Now I noticed if I change my if statment to: <if condition="$attach['attachmentid'] != 41668">
Then it changes every attachment on the whole site to the code. so my problem is it picking up the actual attachmentid and seeing if it is true.

I am kind of stumped at this stage as I have even tried this if statement"
PHP Code:
<if condition="in_array($attach['attachmentid'], array(41668, 41669))"
Still with no success of it changing anything for those attachment with those IDs

Is there anything wrong with my if statements that you can see?


Also as an example.....This attachment: https://vborg.vbsupport.ru/attachmen...3&d=1263721711

The ID is: 109923 correct?

Because I have tried everything that I can possibly think of lol
Reply With Quote
  #15  
Old 10-27-2010, 01:54 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you look at the postbit_attachment template, you'll see that the variable they are using is not $attach, it is $attachment. You need to use the correct variable name.
Reply With Quote
  #16  
Old 10-27-2010, 08:44 PM
Hornstar Hornstar is offline
 
Join Date: Jun 2005
Location: Australia
Posts: 2,469
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ic now. Thanks I will give that another go when I get home (You have helped me learn heaps so far tho)
It is working, but with one minor problem.
Every attachment now has the word 'and' showing. I think it may have something to do with my 2 if statements. Do I not need the word and between them? I removed the word 'and' and they seem to still be working.

Edit:
With my if statement, it is meant to show the special link to only registered users and the normal link to everyone else. However it is working good for registered users, but it is showing nothing to everyone else.

It is like my else statement is not working. any ideas?
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 09:58 AM.


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.07965 seconds
  • Memory Usage 2,244KB
  • 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
  • (4)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)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_postinfo_query
  • fetch_postinfo
  • 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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete