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

Reply
 
Thread Tools Display Modes
  #1  
Old 06-18-2011, 04:23 AM
Wonksta Wonksta is offline
 
Join Date: Apr 2009
Posts: 325
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Force first Letter to be Capitilized in userfields?

Hi there,

Wondering if there is anyway to make it so that when a user inputs their Location the first letter is captilized?
E.g.

Location: Sydney instead of sydney or SYDNEY
Reply With Quote
  #2  
Old 06-18-2011, 08:41 AM
Sarteck's Avatar
Sarteck Sarteck is offline
 
Join Date: Mar 2008
Posts: 304
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm not COMPLETELY sure, since I don't do vB3 anymore, and so I can't test.... But you could try this on the profile_updateprofile hook:

PHP Code:
$my_location_field 'field2'/// NOTE -- Edit this if yours is different.
$location_data_entered $vbulletin->GPC['userfield'][$my_location_field];
$new_location ucwords($location_data_entered);
$vbulletin->GPC['userfield'][$my_location_field] = $new_location;
$userdata->set_userfields($vbulletin->GPC['userfield']); 
That will also take into consideration spaces. For example, if I put "SOMEWHERE IN HELL" as my location, it would change it to "Somewhere In Hell". Of course, "In" should not be capitalized grammatically, heh.




I've not tested this (I don't have vB3, and though it should (in theory) also work on vB4, I'm just too lazy to try it out. XP
Reply With Quote
  #3  
Old 06-18-2011, 08:53 AM
Wonksta Wonksta is offline
 
Join Date: Apr 2009
Posts: 325
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks mate I went to go try it but I cannot find 'profile_updateprofile' under Manage Plugs -> Plug Manager

/n00b
Reply With Quote
  #4  
Old 06-18-2011, 09:01 AM
Sarteck's Avatar
Sarteck Sarteck is offline
 
Join Date: Mar 2008
Posts: 304
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Serious? I thought it would be there... It's on line 1,885 of the vB 3.8.7 profile.php page, as ($hook = vBulletinHook::fetch_hook('profile_updateprofile') ) ? eval($hook) : false;



Sorry I couldn't have been more help.



(Just to be sure we're on the same page, you are choosing to "Add New Plugin" and choosing the profile_updateprofile from the drop-down menu, ya?)
Reply With Quote
  #5  
Old 06-18-2011, 09:09 AM
Wonksta Wonksta is offline
 
Join Date: Apr 2009
Posts: 325
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ahh no we were not on the same page, thanks mate I will try this shortly I must head out now.

Thanks so much!
Reply With Quote
  #6  
Old 06-18-2011, 09:14 AM
Sarteck's Avatar
Sarteck Sarteck is offline
 
Join Date: Mar 2008
Posts: 304
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Don't thank me until it actually works. XD

Also not that it will not change whatever you have in there already, if it does work--this will only work when someone enters new data.

(If it works at all.)
Reply With Quote
  #7  
Old 06-18-2011, 01:11 PM
Wonksta Wonksta is offline
 
Join Date: Apr 2009
Posts: 325
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Tried it now and it doesn't seem to work, bummer!

When the plugin is activated it wont let the user proceed to save the data because it says something else in another field is invalid even though fieldid is correct in the hook it messes with my other custom fields (drop down).

Ahh well!
Reply With Quote
  #8  
Old 06-18-2011, 01:28 PM
Sarteck's Avatar
Sarteck Sarteck is offline
 
Join Date: Mar 2008
Posts: 304
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

There's probably just something wrong with my coding. Hopefully someone else looking at this will be able to point it out, but I just don't know right now. If I'm bored later on, I'll give it a try on my own forum.

EDIT: Even though I'm vB4, it'll probably work the same. That section of the code seems to be the same for both 3.8.7 and 4.1.4.
Reply With Quote
  #9  
Old 06-18-2011, 01:29 PM
Wonksta Wonksta is offline
 
Join Date: Apr 2009
Posts: 325
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Sarteck View Post
There's probably just something wrong with my coding. Hopefully someone else looking at this will be able to point it out, but I just don't know right now. If I'm bored later on, I'll give it a try on my own forum.
You're a good man Starteck, thanks again for your effort.
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 07:34 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.07823 seconds
  • Memory Usage 2,240KB
  • 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_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)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