Author Topic: I need help with new user field  (Read 12238 times)

0 Members and 1 Guest are viewing this topic.

Offline bag53

  • Jr. Member
  • **
  • Posts: 62
    • View Profile
I need help with new user field
« on: February 13, 2003, 07:52:13 AM »
I am trying to add a "Real Name" field to the users that will only be displayed in the admin Control Panel. My 4images site is a private membership (friends and family only), and I would like to know who people are when they join. I have already set up activation by admin only.

I have read db_field_definitions.php and have already created the user_realname column in the 4images_users table.

Where am I supposed to put this line:

Code: [Select]
$user_realname['user_realname'] = array($lang['user_realname'], "text", 1);

In db_field_definitions.php?

Which file is all the new user activation information stored in the database?
register.php?

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
I need help with new user field
« Reply #1 on: February 13, 2003, 08:02:36 AM »
U must do it this way:
Code: [Select]
$additional_user_fields['user_realname'] = array($lang['user_realname'], "text", 1);

then u'll need add new user_realname field in 4images_users table.
and after that, u'll need edit register_form.html, member_profile.html, member_editprofile.html and so on so, your members can enter their real name.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline bag53

  • Jr. Member
  • **
  • Posts: 62
    • View Profile
I need help with new user field
« Reply #2 on: February 13, 2003, 08:12:40 AM »
Thanks. that worked.

I have one more question :

I put this into my lang/english/main.php file:

Code: [Select]
$lang['user_realname'] = "Real Name:";

But whenever I use {lang_user_realname} in an html template file I get nothing.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
I need help with new user field
« Reply #3 on: February 13, 2003, 08:18:31 AM »
that's right, u'll need register {user_realname} in "main" .php files.
Just search for:
Code: [Select]
$site_template->register_vars(array(
then u'll see bunch of
Code: [Select]
"something" => $whatever,
"sometingelse" => $somethingelse,

just add this line there:
Code: [Select]
"user_realname" => $lang['user_realname'],
make sure, that if u entered as last line in the array, there is no comma at the end of your line, and line above yours must have comma.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline bag53

  • Jr. Member
  • **
  • Posts: 62
    • View Profile
I need help with new user field
« Reply #4 on: February 13, 2003, 08:27:33 AM »
Works now. Thanks!

Offline Zyga

  • Jr. Member
  • **
  • Posts: 87
    • View Profile
Re: I need help with new user field
« Reply #5 on: January 20, 2006, 07:41:59 PM »
i trying create something like field "few words from user"

Code: [Select]
$additional_user_fields['user_about'] = array($lang['user_about'], "text", 0);
what should i add and where to cut off from text things like img src or other (all tags) ?

and i need something like wordwrap to disable long descriptions like "Oooooooooooo........."

Offline TheOracle

  • Hero Member
  • *****
  • Posts: 875
    • View Profile
Re: I need help with new user field
« Reply #6 on: January 20, 2006, 08:02:41 PM »
i trying create something like field "few words from user"

Code: [Select]
$additional_user_fields['user_about'] = array($lang['user_about'], "text", 0);
what should i add and where to cut off from text things like img src or other (all tags) ?

and i need something like wordwrap to disable long descriptions like "Oooooooooooo........."

There are two ways you could do it.

1.

Quote

$site_template->register_vars(array(
"something" => "<img src=\"".get_gallery_image("something.gif")."\">"
));


Note: something.gif is being loaded automatically from your templates/<your_template>/images folder by using the get_gallery_image function (no matter which template folder you load by default from your configuration page under ACP). However, you'd just need to assure that your image's filename is being uploaded on all your personalized template to avoid questionnings from your users. ;)

2. In your HTML template, after following the example above, you could simply add the <img src into the same file and use the tag like this if you wanted too :

Quote

<img src="{something}">


but, then, no. 1 above would become simply like this :

Quote

$site_template->register_vars(array(
"something" => get_gallery_image("something.gif")
));


;)

Offline Zyga

  • Jr. Member
  • **
  • Posts: 87
    • View Profile
Re: I need help with new user field
« Reply #7 on: January 20, 2006, 09:41:32 PM »
hmmmmmm cool options but i mean something differnet (sorry for my english :? )

when user add (by control panel) some text as his description in profile and in this text is something like links to images or realy long strings of characters
it looks not to good so i want wrap words and dont show images (maybe links too other sites should be disabled but in this mement its not necessary)

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: I need help with new user field
« Reply #8 on: January 21, 2006, 04:41:49 AM »
i trying create something like field "few words from user"

Code: [Select]
$additional_user_fields['user_about'] = array($lang['user_about'], "text", 0);
what should i add and where to cut off from text things like img src or other (all tags) ?

and i need something like wordwrap to disable long descriptions like "Oooooooooooo........."
The question is, where do you want to display it?

@TheOracle:
Are you a robot who only see some keywords that trigger responce command, no metter what the post is about? You act like one! Unbelivable, google undestarnds people better then you do...
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline TheOracle

  • Hero Member
  • *****
  • Posts: 875
    • View Profile
Re: I need help with new user field
« Reply #9 on: January 21, 2006, 04:48:01 AM »
Quote

Are you a robot who only see some keywords that trigger responce command, no metter what the post is about? You act like one! Unbelivable, google undestarnds people better then you do...


If, from your perspective of course, you think I don't understand people - then, at least, I know how to write english more than you do (including the fact it's not even my first language).

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: I need help with new user field
« Reply #10 on: January 21, 2006, 05:00:38 AM »
then, at least, I know how to write english more than you do (including the fact it's not even my first language).
heh, good argument. I've told you this before, and telling you again: I know that my english is not good, I've never said its good, in fact I always say its not good enough. Besides that, its not even my second language...whatever. Please stop spam.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Zyga

  • Jr. Member
  • **
  • Posts: 87
    • View Profile
Re: I need help with new user field
« Reply #11 on: January 21, 2006, 08:54:33 AM »
i need it (display) in user profile (member_profile.html)

PS. english is not my first language too so correct me if i wrote something wrong and be cool  :)

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: I need help with new user field
« Reply #12 on: January 21, 2006, 09:31:15 AM »
You can try this:
in member.php find:
Code: [Select]
$additional_field_array[$key] = (!empty($user_row[$key])) ? format_text($user_row[$key], 1) : REPLACE_EMPTY;Insert above
Code: [Select]
        if ($key == "yourfield")
          $additional_field_array[$key] = (!empty($user_row[$key])) ? format_text($user_row[$key], 0, XXX) : REPLACE_EMPTY;
        else
Replace yourfield with the name of your field and XXX with the number of characters per line for word wrap.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Zyga

  • Jr. Member
  • **
  • Posts: 87
    • View Profile
Re: I need help with new user field
« Reply #13 on: January 21, 2006, 03:38:25 PM »
Thank You !
Its exactly what i was looking and work perfect :)