Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 11-12-2010, 07:59 AM
Chewy75 Chewy75 is offline
 
Join Date: Jun 2010
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default two <IF>???

Hi,

our users which to have an higher threadview as standard 150px.

I found this in the styles at showthreadlist:
PHP Code:
<div style="height:auto; <if condition="$show['postlistwidth']">width:$postlistwidth;</if> overflow:auto; border:2px inset; padding: 0px; text-align:$stylevar[left];" class="alt1" id="links"
there i change the standard from 150px into auto, but for some users it is to much, they more like the smaller view...
Then I made an extra profilfield with radio-buttons, so they can chose a standard of 150px, double height of 300px or auto height.
But I don?t know how to put it into the style.

I just took the above code snippet and packed it into a simple if block:
PHP Code:
<if condition="$post['field16'] & 1">
<
div style="height:150; <if condition="$show['postlistwidth']">width:$postlistwidth;</if>
overflow:auto; border:2px inset; padding: 0px;
text-align:
$stylevar[left];" class="alt1" id="links">
</if>

<if 
condition="$post['field16'] & 2">
<
div style="height:300; <if condition="$show['postlistwidth']">width:$postlistwidth;</if>
overflow:auto; border:2px inset; padding: 0px;
text-align:
$stylevar[left];" class="alt1" id="links">
</if>

<if 
condition="$post['field16'] & 4">
<
div style="height:auto; <if condition="$show['postlistwidth']">width:$postlistwidth;</if>
overflow:auto; border:2px inset; padding: 0px;
text-align:
$stylevar[left];" class="alt1" id="links">
</if> 
but this doesn?t work. I don?t know realy much about it, but is ist possible that my code isn?t working because there are to if-questions in one block?
Is any one out here who has an idea to solve my problem?

best regards

Chewy
Reply With Quote
  #2  
Old 11-12-2010, 08:44 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think maybe the problem is that with three radio buttons the possible values of field16 would be [S]1, 2, 3[/S], ...

Edit: I think that was wrong...see below.
Reply With Quote
  #3  
Old 11-12-2010, 08:52 AM
Chewy75 Chewy75 is offline
 
Join Date: Jun 2010
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi,

thanks for your reply, but the first radio button has an value of 1, the second has two, the third hast 4, the fifth has 8, 16, 32, 64 and so on
Reply With Quote
  #4  
Old 11-12-2010, 09:09 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That kind of sounds like checkboxes vs radio buttons, but maybe you're doing something I don't understand.

In either case, I think I was wrong - I think the values of a radio button field would be whatever strings are listed as the options in the profile field manger (I'm changing my mind because I went back and looked at a plugin a wrote a while back that checks the value of a custom user radio button field).

But again - maybe you're doing something different.
Reply With Quote
  #5  
Old 11-12-2010, 09:37 AM
Chewy75 Chewy75 is offline
 
Join Date: Jun 2010
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I will try to explain exactly what I want to do, perhaps I am goning a totaly wrong way...

If you select thread-view or hybrid-view in a thread, then you will see a tree-structure in top of the postings in that thread. This tree structure is normaly 150 Pixels high. What I want to do is to allow users to change this height by their own.
I found the height in template: "showthread_list" and I thought best way to solve my problem is adding a field for the users selection and adding some little code to this template, but I am not a real coder so I looked arround for the syntax and so on and thougt the code of my frist posting would be near to that what I need...
Reply With Quote
  #6  
Old 11-12-2010, 12:10 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well, it's easy enough to test what the value of field16 actually is: put this in your template:

Code:
<!-- Field16: $post[field16] -->
then view your HTML source to see what it is.

ETA: I think you are doing the right thing, I'm just thinking that if it's not working the problem may be the "if" conditions - but I could be wrong.
Reply With Quote
  #7  
Old 11-12-2010, 12:43 PM
Chewy75 Chewy75 is offline
 
Join Date: Jun 2010
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, this should be fault 1, in source it is empty: "<!-- -->"

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

ok the fault was that I was using the field from the wrong user...

<!-- $bbuserinfo[field13] --> outputs the value of the option exactly as you told earlier!
Reply With Quote
  #8  
Old 11-12-2010, 12:52 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

(nvm - posted this before I read the above)
Reply With Quote
  #9  
Old 11-12-2010, 12:54 PM
Chewy75 Chewy75 is offline
 
Join Date: Jun 2010
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I got it now in a very more simple way than I thought...

PHP Code:
<div style="height:$bbuserinfo[field16]; <if condition="$show['postlistwidth']">width:$postlistwidth;</if>overflow:auto; border:2px inset; padding: 0px; text-align:$stylevar[left];" class="alt1" id="links"
kh99 I like to thank you very very much, you kicked me into the right direction ;-)
Reply With Quote
Reply

Thread Tools
Display Modes

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 07:53 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04267 seconds
  • Memory Usage 2,248KB
  • 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
  • (3)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete