vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   change attachment link (https://vborg.vbsupport.ru/showthread.php?t=252461)

Hornstar 10-25-2010 05:56 AM

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?

Hornstar 10-26-2010 08:49 PM

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?

Lynne 10-27-2010 04:17 AM

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.

Hornstar 10-27-2010 10:48 AM

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

Lynne 10-27-2010 01:54 PM

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.

Hornstar 10-27-2010 08:44 PM

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?


All times are GMT. The time now is 05:07 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.01091 seconds
  • Memory Usage 1,745KB
  • 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
  • (4)bbcode_php_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
  • (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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete