4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Requests & Discussions) => Topic started by: halobender on October 13, 2005, 05:45:50 AM

Title: Problem Adding Extra Fields
Post by: halobender on October 13, 2005, 05:45:50 AM
Hi,

I have been trying to add additional fields to the user profile; I have managed to get the fields to show up in the control panel, but the information I type into them will not save. (For example, I am trying to insert a field where a user can type a small bio about themselves. I enter the text, click Save in my control panel, but the info does not show up.) There are so many things that might need adjusting, and I need help.


I HAVE... added the directory to my database:
Code: [Select]
4images_users -> user_bio  tinyint(1) notnull  default 0
I HAVE... modified my /includes/db_field_definitions.php to include this field:
Code: [Select]
if (!defined('ROOT_PATH')) {
  die("Security violation");
$additional_user_fields['user_bio'] = array($lang['user_bio'], "text", 0);

I have made sure that there are no spaces after ?>

I HAVE... modified my /templates/custom/member_edit.html file:
Code: [Select]
          <tr>
    <td class="row2"><b>{lang_bio}</b></td>
<td class="row2"><input type="text" name="user_bio"  size="30" value="{user_bio}" class="input" /></td>

</tr>

I HAVE... edited my /templates/custom/register_form.html file:
Code: [Select]
<tr>
    <td class="row1"><b>{lang_user_bio}</b></td>
<td class="row1"><input type="text" name="user_bio" size="30" class="input" value="{user_bio}" /></td>
</tr>

I HAVE... edited my /lang/english/main.php file:
Code: [Select]
//--- Users ------------------------------------------- (...) $lang['bio'] = "Bio:";
I HAVE... edited my /templates/custom/member_profile.html file:
Code: [Select]
<tr>
    <td class="row2"><b>{user_bio}</b></td>
<td class="row2">{user_bio} </td>
</tr>



It's very confusing, editing all of these files. I do not know what is going wrong, so I do not know what I need to fix. Please help. Does anyone know what I might be doing wrong? I will answer all questions asked (maybe not immediately) but I will.

Thanks so much
Title: Re: Problem Adding Extra Fields
Post by: V@no on October 13, 2005, 06:36:20 AM
1)
Quote
user_bio  tinyint(1) notnull  default 0
is a wrong type of field for this purpose
You either need VARCHAR(255) or TEXT type of the field.

2)
Code: [Select]
if (!defined('ROOT_PATH')) {
  die("Security violation");
$additional_user_fields['user_bio'] = array($lang['user_bio'], "text", 0);
I hope it doesnt look like this in your file, your new entry should be just above closing ?>
Title: Re: Problem Adding Extra Fields
Post by: halobender on October 13, 2005, 11:46:44 PM
Thanks very much! That got things working. :D


One other small thing: how do I resize an input field to make it taller (this is for the bio information a user can enter in their control panel, which can contain up to 255 characters) and make it so that the field has an option for a scrollbar (if necessary). Does that need a special TEXTAREA tag/setting in my database?
Title: Re: Problem Adding Extra Fields
Post by: V@no on October 14, 2005, 12:05:15 AM
not in the database, but in the template where you have this field (textarea)
Title: Re: Problem Adding Extra Fields
Post by: halobender on October 14, 2005, 12:19:14 AM
I've tried that, but it won't save the information I put into the field (I just know for a fact there's something wrong with this code, but I don't know how to fix it). Here is what I am typing in my member_editprofile.html file:

Code: [Select]
<td class="row2"><b>{lang_user_bio}</b></td>
<td class="row2"><TEXTAREA name="user_bio" cols="23" rows="5" value="{user_bio}" class="input" /></textarea></td>



EDIT: It won't show the bio text after I type it in the field and submit it, but when I click on my profile from the main gallery page, the information is there in my profile. Weird. My setting for this field in my database is VARCHAR(255).
Title: Re: Problem Adding Extra Fields
Post by: V@no on October 14, 2005, 12:29:54 AM
you must add {user_bio} between <textarea> and </textarea> not as value="" ;)

Code: [Select]
<TEXTAREA name="user_bio" cols="23" rows="5" class="input" />{user_bio}</textarea>
Title: Re: Problem Adding Extra Fields
Post by: Alex_Ok on January 28, 2006, 12:47:00 AM
DB Error: Bad SQL Query: INSERT INTO 4images_users (user_id, user_level, user_name, user_password, user_email, user_showemail, user_allowemails, user_invisible, user_joindate, user_activationkey, user_lastaction, user_lastvisit, user_comments, user_homepage, user_icq, user_limit, user_bio) VALUES (2147483648, 2, '56', '9f61408e3afb633e50cdf1b20de6f466', '56@mail.ru', 1, 1, 0, 1138404708, 'e3e19611643411ef5e21e808afbf55ba', 1138404708, 1138404708, 0, '', '', 5, 'tyhjh')
Duplicate entry '2147483647' for key 1

У меня такая проблема , что это может быть за двойной вход и как его исправить :?: :D Плиз... подскажите...
Title: Re: Problem Adding Extra Fields
Post by: Alex_Ok on January 30, 2006, 03:01:40 PM
Как вывести  {user_bio}{lang_user_bio} на страничке   details.html .   Если я их просто вставляю туда то они не отображаются. Подскажите пожалуйста что нужно сделать :?:
Title: Re: Problem Adding Extra Fields
Post by: Alex_Ok on January 30, 2006, 04:45:48 PM
Как вывести  {user_bio}{lang_user_bio} на страничке   details.html .   Если я их просто вставляю туда то они не отображаются. Подскажите пожалуйста что нужно сделать :?:
Ведь в профиле город появляется а почему details.html нет :?:
Title: Re: Problem Adding Extra Fields
Post by: Alex_Ok on January 30, 2006, 06:55:32 PM
V@no   Подскажите как специалист :D
Title: Re: Problem Adding Extra Fields
Post by: Alex_Ok on January 31, 2006, 01:44:39 PM
 :?: :cry:
Title: Re: Problem Adding Extra Fields
Post by: Alex_Ok on January 31, 2006, 01:46:43 PM
 :?: :cry:
Title: Re: Problem Adding Extra Fields
Post by: Alex_Ok on January 31, 2006, 04:17:12 PM
Неужели мне никто не поможет :?:
Title: Re: Problem Adding Extra Fields
Post by: TheOracle on January 31, 2006, 04:44:33 PM
Quote

Duplicate entry '2147483647' for key 1


@Alex_Ok:

The problem is that you already have this entry in your users table and cannot be added twice. If you're trying to make any corrections on that table, make sure to backup it up first, then to empty your table. Then, execute the SQL query from your mysql_default.sql file. ;)
Title: Re: Problem Adding Extra Fields
Post by: Alex_Ok on February 05, 2006, 08:07:58 AM
Как вывести  {user_bio}{lang_user_bio} на страничке   details.html .   Если я их просто вставляю туда то они не отображаются. Подскажите пожалуйста что нужно сделать
Title: Re: Problem Adding Extra Fields
Post by: Alex_Ok on February 05, 2006, 06:54:14 PM
ни кто не знает :?:
Title: Re: Problem Adding Extra Fields
Post by: Alex_Ok on February 10, 2006, 03:09:19 PM
Как вывести  {user_bio}{lang_user_bio} на страничке   details.html .   Если я их просто вставляю туда то они не отображаются. Подскажите пожалуйста что нужно сделать
Неужели никто не подскажет почему не выводятся новые данные из {user_bio}{lang_user_bio} на странице details.html
Title: Re: Problem Adding Extra Fields
Post by: Alex_Ok on February 24, 2006, 07:18:11 PM
Может я вопрос задаю не правильно :?:
Я хочу вывести данные из доп областей на страничку? но их не видно на страничке details.html. Подскажите плиз... в чём дело :?:
Хотя в member.html всё в порядке и доп области работают
Title: Re: Problem Adding Extra Fields
Post by: Alex_Ok on April 27, 2006, 03:44:29 PM
Ну кто нибудь подскажите.... Как вывести ....  :?: :?: :?:
Title: Re: Problem Adding Extra Fields
Post by: Lysander on August 08, 2006, 05:46:43 PM
Can anyone explain me this thinks in English please? I want to add extra profile fields... How can i do it? Can anyone explain me like add after this code bla bla???

Thanks a lot