Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 03-01-2007, 01:56 PM
PayBas PayBas is offline
 
Join Date: Jun 2006
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default [Advice Needed] User avatar depending on profile field input?

Hello, I am seeking to create the following functionality for my forum.

I want the avatars of users to be displayed depending on what information they have selected from the custom user profilefields I have created.

Basically, there are 4 Single-Selection Menus that each have about 10 options. I want different combinations to result if different avatars.

There are about 350 different combinations (and avatars). Luckily there is some systematic avatar image naming but thats about it.

For example:
Field 1: option 4
Field 2: option 1
Field 3: option 8
Field 4: option 5

Should result in:
images/avatars_4/1-8-5.gif



Now my question... what would be the most efficient way to code this?

Obviously coding this through vBulletin <if> statements in the postbit template would do the trick, but would be a total pain in the *** to code, plus I don't think it is efficient at all.
But what would be the best way? I was thinking of using javascript to handle this and to make it through variables (avatars_w/x-y-z.gif) but I'm not sure if this will work.

Any advice would be appreciated.

Although a more basic question would be if this whole feature is best handled serverside or clientside... I'm pretty bad at writing php and plugins for serverside implementation but im learning java as we speak.



Update: beginning to wonder if a method through javascript is even possible...
Code:
<if condition="$post['field5'] & 1"><img src="/images/icon/race/1-0.gif" border="0"></if>
<if condition="$post['field5'] & 2"> <img src="/images/icon/race/1-1.gif" border="0"></if>
<if condition="$post['field5'] & 4"><img src="/images/icon/race/2-0.gif" border="0"></if>
<if condition="$post['field5'] & 8"><img src="/images/icon/race/2-1.gif" border="0"></if>
<if condition="$post['field5'] & 16"><img src="/images/icon/race/3-0.gif" border="0"></if>
<if condition="$post['field5'] & 32"><img src="/images/icon/race/3-1.gif" border="0"></if>
Haven't got a clue how to convert the $post['field5'] & 32 to a meaningfull clientside script, how would this be linked in the first place? It would have to read the output of the generated code... perhaps making a plugin was the better choice after all.
Reply With Quote
  #2  
Old 03-05-2007, 07:45 AM
PayBas PayBas is offline
 
Join Date: Jun 2006
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

nobody got a clue?
Reply With Quote
Reply


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 08:24 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.03795 seconds
  • Memory Usage 2,164KB
  • Queries Executed 11 (?)
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
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (2)post_thanks_box
  • (2)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit_info
  • (2)postbit
  • (2)postbit_onlinestatus
  • (2)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_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