PDA

View Full Version : Adding a user option -- setting up conditional code


Dark_Sirius
07-20-2007, 11:14 PM
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, 11: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, 11:29 PM
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, 11:40 PM
$post['field70'] is already added / filled. You want to do something like this:

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

Dark_Sirius
07-20-2007, 11:45 PM
$post['field70'] is already added / filled. You want to do something like this:

<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, 02:14 AM
That's correct.