Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 07-20-2007, 11:14 PM
Dark_Sirius Dark_Sirius is offline
 
Join Date: Aug 2006
Posts: 47
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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!
Reply With Quote
  #2  
Old 07-20-2007, 11:17 PM
HMBeaty's Avatar
HMBeaty HMBeaty is offline
 
Join Date: Sep 2005
Posts: 4,141
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Do you mean you want to give them the option to choose between the postbit and postbit_legacy?
Reply With Quote
  #3  
Old 07-20-2007, 11:29 PM
Dark_Sirius Dark_Sirius is offline
 
Join Date: Aug 2006
Posts: 47
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Redlinemotorsports View Post
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.
Attached Images
File Type: jpg forumview.jpg (71.5 KB, 0 views)
Reply With Quote
  #4  
Old 07-20-2007, 11:40 PM
King Kovifor's Avatar
King Kovifor King Kovifor is offline
 
Join Date: Nov 2004
Location: PA
Posts: 3,872
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

HTML Code:
<if condition="$post['field70'] == 1"> </if>
Reply With Quote
  #5  
Old 07-20-2007, 11:45 PM
Dark_Sirius Dark_Sirius is offline
 
Join Date: Aug 2006
Posts: 47
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by King Kovifor View Post
$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?
Reply With Quote
  #6  
Old 07-21-2007, 02:14 AM
Kirk Y's Avatar
Kirk Y Kirk Y is offline
 
Join Date: Apr 2005
Location: Tallahassee, Florida
Posts: 2,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That's correct.
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:23 AM.


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.04033 seconds
  • Memory Usage 2,229KB
  • Queries Executed 14 (?)
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
  • (2)bbcode_html
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (1)postbit_attachment
  • (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
  • postbit_attachment
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete