MyBB Community Forums

Full Version: [TUTORIAL]Integrate Twitter Logins with MyBB
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14
Admin CP >> Configuration >> Custom Profile Fields
-.-

yeah but more fields

example


Put Your Forum Username:
Select your flag
Select your Sex
(2010-02-27, 08:19 PM)Walkman 5.0 Wrote: [ -> ]how add custom profile fields to the Twitter login ??

Hm?

Is that a question about the profile fields part of the tutorial or do you want certain fields set during Twitter registration?
mmm i need add member_register_requiredfields to this form
(2010-02-27, 09:01 PM)Walkman 5.0 Wrote: [ -> ]mmm i need add member_register_requiredfields to this form

I will look into this later but doesn't adding more fields during the Twitter registration remove the point of using it in place of normal registration?
Confused

give me an error

Array ( [0] => No has introducido una opción para el campo "Sexo". Por favor, rellénalo o selecciona un valor para este campo. [1] => No has introducido una opción para el campo "Localizacion". Por favor, rellénalo o selecciona un valor para este campo. )

translated

Array ( [0] => You did not enter an option for the field "Sex". Please, fill it or select a value for this field. [1] => You did not enter an option for the field "Location". Please, fill it or select a value for this field.
If you change those fields to not be required(as they shouldn't be by default) you won't error.
but i need this fields as required Confused
If you look at callback.php you will find the following code:
$db->query("UPDATE mybb_userfields SET fid13='".$twtoken."' WHERE ufid=$scrid");
	$db->query("UPDATE mybb_userfields SET fid14='$twsecret' WHERE ufid=$scrid");
		$db->query("UPDATE mybb_userfields SET fid15='1' WHERE ufid=$scrid");

You can use this as an example on how to set any profile field during registration. You can set Location for example, which for me is ID 1 like this:
$db->query("UPDATE mybb_userfields SET fid1='Somewhere' WHERE ufid=$scrid");

If you wanted the user to be able to edit the field instead of it having a default value, you could add another field to the form in the username selection template, then replace "Somewhere" with $_POST['location'] or something similar(of course you should do security checks instead of just the post variable, but that's the general idea.
thanks afrothunder for these tutorials that I have long wanted to have on my forum, but I also have the same problem as walkman ...

thank you very much!
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14