vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Adding a user option -- setting up conditional code (https://vborg.vbsupport.ru/showthread.php?t=152892)

Dark_Sirius 07-20-2007 10:14 PM

Adding a user option -- setting up conditional code
 
Okay. So, this is probably simple but I can't figure it out.

What I would like to do is add a new user profile option. Either a radio selection or a single check box.

The option would be a toggle between two types of visual styles on the postbit_legacy. More specfically, the information displayed under the user name (avatar, join date, posts...etc).

The option, which would default to the 'vb default look' could be changed so that, if the users selects the profile option, they would get a different visual style on the post bit. (A cleaner looking display of the info displayed on the left side of all posts).

Now, heres where I run into issues. It could be that I am not setting my conditionals up correctly, but what I tried to do was this:

In the postbit_legacy code, I would have a conditional statement similar to if <condition="$post["field70"]>

If that condition is met, it would display the updated visual style. <else /> it would display the default style.

Is this doable? Each time I have tried, the two "styles" were merged and displayed at once, completely destroying the look of the forum. Does this sound more like a logical coding error, perhaps my if statements are nested incorrectly or am I trying to tackle something more complicated?

Any advice would be awesome!

HMBeaty 07-20-2007 10:17 PM

Do you mean you want to give them the option to choose between the postbit and postbit_legacy?

Dark_Sirius 07-20-2007 10:29 PM

1 Attachment(s)
Quote:

Originally Posted by Redlinemotorsports (Post 1296978)
Do you mean you want to give them the option to choose between the postbit and postbit_legacy?

Negative. If you view the attached image, I would like users to have the option between those two views, or something similar. Vb's default style on the left (as the default option) and an updated look on the right (selectable by the user)

So, the only thing that would change with this option would be the quick stats on all the posts.

It's an odd project but when you cater to the wide array of opinions forums have, it's good to have simple options open. :D

King Kovifor 07-20-2007 10:40 PM

$post['field70'] is already added / filled. You want to do something like this:

HTML Code:

<if condition="$post['field70'] == 1"> </if>

Dark_Sirius 07-20-2007 10:45 PM

Quote:

Originally Posted by King Kovifor (Post 1296995)
$post['field70'] is already added / filled. You want to do something like this:

HTML Code:

<if condition="$post['field70'] == 1"> </if>

So, in other words, 1 would be in the selected state and 0 would be deselected?

Kirk Y 07-21-2007 01:14 AM

That's correct.


All times are GMT. The time now is 01:50 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.01413 seconds
  • Memory Usage 1,725KB
  • 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
  • (2)bbcode_html_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete