Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
  #1  
Old 06-01-2006, 02:40 AM
dudeness3 dudeness3 is offline
 
Join Date: May 2006
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Quick Question

I have a Pokemon forum and I want to put a dropdown list in "Edit Profile" listing 386 names, when a user chooses a name, the sprite of that chosen name appears in their postbit, representing what their favorite pokemon is.
can this be done?
Reply With Quote
  #2  
Old 06-01-2006, 03:51 AM
Lea Verou Lea Verou is offline
 
Join Date: Jul 2005
Location: Greece
Posts: 1,856
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes it can.
Reply With Quote
  #3  
Old 06-01-2006, 04:04 AM
dudeness3 dudeness3 is offline
 
Join Date: May 2006
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thats great, at least i know it can be done, thank you
Reply With Quote
  #4  
Old 06-01-2006, 04:06 AM
checkmail checkmail is offline
 
Join Date: Aug 2005
Posts: 27
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Atleast he didn't lie that it was quick
Reply With Quote
  #5  
Old 06-01-2006, 04:13 AM
antialiasis's Avatar
antialiasis antialiasis is offline
 
Join Date: Jan 2006
Location: Iceland
Posts: 346
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes, it can be done. (Admittedly, I highly don't recommend putting the sprite in the postbit - too many images in the postbit can be distracting and annoying. But each to his own.)

First, if you really want to go through with the sprites thing, you'll have to get all the Pok?mon sprites with their names as their filenames somehow. You can look around yourself (or, better yet, you may have them already or know a place where you can get them), but if you don't have them and can't find any, you can just ask me to zip them for you. Just upload them in a special folder called sprites or something under images at the forums.

Now go to Admin CP -> User Profile Fields -> Add New User Profile Field

As Profile Field Type, choose "Single-selection Menu"

Apply these settings (modify at will, of course):

Title: Favorite Pok?mon
Description: Pick your favorite Pok?mon.
Set Default: None
Display Order: (leave it as it is)
Field Required: (whichever you want)
Field Editable by User: Yes
Private Field: No (unless you don't want it shown in people's profile)
Field Searchable on Members List: (whichever you want)
Show on Members List: (whichever you want)
(leave all the "Optional Input" stuff like it is)
Display Page: Edit Profile

Now, for the options, you would normally have to type out the names of all 386, but as it happens that I'm also a Pok?mon fan and have too much time on my hands, I have a Pok?mon list generator on my website. Just enter %[name]% into the field, press the Submit button, copy everything in the textarea, and paste it into the options field.

Now press Save at the bottom of the user profile field manager. It should bring you back to the list of user profile fields. Find the field you just added, remember the "name" (which will be something in the direction of field123), and go to the Style Manager under Styles and Templates on your Admin CP menu. From there, select each of your styles in order, go to Edit Templates, and edit either postbit or postbit_legacy (located under "Postbit templates"), depending on which you are using.

Now, just find the appropriate place in the code, and add this:

Code:
<if condition="$post['field123']"><img src="images/sprites/$post[field123].gif" alt="$post[field123]" /></if>
Of course, if your sprites have some other extension than .gif, such as .png, change the extension in the code accordingly, and replace field123 in all three places with the field name of your favorite Pok?mon field.

And if you did all this correctly, it should show up for all users who have specified a favorite Pok?mon.
Reply With Quote
  #6  
Old 06-01-2006, 04:19 AM
Lea Verou Lea Verou is offline
 
Join Date: Jul 2005
Location: Greece
Posts: 1,856
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

He can disable avatars and put that image instead. So he wont have many images.
In fact I think it's a great idea for a pokemon forum.

Quote:
Originally Posted by antialiasis
Now, just find the appropriate place in the code, and add this:

Code:
<if condition="$vbulletin->userinfo['field123']"><img src="images/sprites/$bbuserinfo[field123].gif" alt="$bbuserinfo[field123]" /></if>
I don't think that would work. AFAIK it would be:

Code:
<if condition="$post['field123']"><img src="images/sprites/$post[field123].gif" alt="$post[field123]" /></if>
Remember, we are talking about the postbit.
Reply With Quote
  #7  
Old 06-01-2006, 02:21 PM
antialiasis's Avatar
antialiasis antialiasis is offline
 
Join Date: Jan 2006
Location: Iceland
Posts: 346
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yeah, slip-up. Sorry. Should be what Michelle said.

Shows me not to attempt to write tutorials at five in the morning...
Reply With Quote
  #8  
Old 06-06-2006, 02:09 AM
dudeness3 dudeness3 is offline
 
Join Date: May 2006
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

wow thanks, thats perfect, and btw, I had all the sprites uploaded anyway, but thanks so much, and I'm glad I found a pokefan
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 05:20 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.04768 seconds
  • Memory Usage 2,226KB
  • 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
  • (3)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)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