Author Topic: Adding profile fields  (Read 13100 times)

0 Members and 1 Guest are viewing this topic.

Offline widgit1981

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
Adding profile fields
« on: February 06, 2003, 11:15:40 AM »
Hi all

I know how to add fields when a user uploads but when I try to add fields for edit profile I get this error:

DB Error: Bad SQL Query: SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits, i.image_photographer, i.image_grey, i.user_camera, c.cat_name, u.user_name FROM galleryimages i, gallerycategories c LEFT JOIN galleryusers u ON (u.user_id = i.user_id) WHERE i.image_active = 1 AND c.cat_id = i.cat_id AND i.cat_id IN (0, 50, 58, 77, 40, 25, 17, 74, 66, 2, 55, 18, 75, 26, 41, 78, 11, 69, 51, 19, 31, 81, 79, 76, 52, 20, 59, 27, 42, 80, 60, 43, 29, 53, 70, 44, 32, 22, 54, 12, 63, 30, 47, 23, 13, 56, 72, 24, 33, 46, 14, 57, 71, 35, 15, 48, 61, 36, 3, 45, 73, 37, 9, 49, 38, 16, 65, 28, 64, 39) ORDER BY i.image_date DESC LIMIT 6
Unknown column 'i.user_camera' in 'field list'

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /***/includes/db_mysql.php on line 116


What is going on ?

Thanks

Steve

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
Adding profile fields
« Reply #1 on: February 06, 2003, 05:35:46 PM »
first u'll need manualy add new fields into database, then:
http://4homepages.de/forum/viewtopic.php?t=3079
same u can do for profile.
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 widgit1981

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
Adding profile fields
« Reply #2 on: February 06, 2003, 05:42:38 PM »
Do I put it in the images or member category

I tried both and they give the same error

Thanks

Steve

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
Adding profile fields
« Reply #3 on: February 06, 2003, 05:46:19 PM »
what do u mean put?
tryed what?

in the database insert new field into 4image_users
then enter the name of new field as in that thread.
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 widgit1981

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
Adding profile fields
« Reply #4 on: February 06, 2003, 05:49:57 PM »
Ok I created a new field in users.

The thread u linked to says this:

first see the code in global.php after this line:
Code:
if (defined("GET_CACHES")) {

Add the new field to the sql query. All category data will be saved to the $cat_cache array. From this you can register the value to the template engine.

For example in categories.php

Add after
Code:
"cat_hits" => $cat_cache[$cat_id]['cat_hits'],

this
Code:
"cat_age" => $cat_cache[$cat_id]['cat_age'],

Now you can use {cat_age} in the categories.html template.




What does this all mean especilly :

Add the new field to the sql query. All category data will be saved to the $cat_cache array. From this you can register the value to the template engine.

Thanks

Steve

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
Adding profile fields
« Reply #5 on: February 06, 2003, 06:07:06 PM »
ok, after u inserted new field and edited includes/db_field_definitions.php
u'll need find out what variable uses to store user info (in each script like categories.php, home.php, details.php so on it might be little different.)
so, as in that example  
$cat_cache[$cat_id]['field_name'] has category's information from field field_name
so, for example in details.php $user_info['field_name'] has current user information. $user_info['user_name'] - will pull user 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 widgit1981

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
Adding profile fields
« Reply #6 on: February 06, 2003, 06:26:42 PM »
Ok

I tried that and got this error:

['image_entrance'], "text", 1); $additional_image_fields['image_address'] = array($lang['image_address'], "textarea", 1); $additional_image_fields['image_tel'] = array($lang['image_tel'], "text", 1); $additional_image_fields['image_map'] = array($lang['image_map'], "text", 1); ?>

Thanks

Steve

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
Adding profile fields
« Reply #7 on: February 06, 2003, 06:38:16 PM »
is this the error message or peace of code?
if it's code, I dont see <?php

P.S. please, when u write your post, use [ code ] ... [ /code ] if u want show some code, or [ quote ] ... [ /quote ] if want show error message or quote something.
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 widgit1981

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
Adding profile fields
« Reply #8 on: February 06, 2003, 07:25:17 PM »
Here is the code

Code: [Select]
['image_entrance'], "text", 1); $additional_image_fields['image_address'] = array($lang['image_address'], "textarea", 1); $additional_image_fields['image_tel'] = array($lang['image_tel'], "text", 1); $additional_image_fields['image_map'] = array($lang['image_map'], "text", 1); ?> ?>>
Warning: Cannot add header information - headers already sent by (output started at /web/highrez/public_html/includes/db_field_definitions.php:34) in /web/highrez/public_html/includes/sessions.php on line 85

Warning: Cannot add header information - headers already sent by (output started at /web/highrez/public_html/includes/db_field_definitions.php:34) in /web/highrez/public_html/includes/sessions.php on line 85

Warning: Cannot add header information - headers already sent by (output started at /web/highrez/public_html/includes/db_field_definitions.php:34) in /web/highrez/public_html/includes/sessions.php on line 85

Warning: Cannot add header information - headers already sent by (output started at /web/highrez/public_html/includes/db_field_definitions.php:34) in /web/highrez/public_html/includes/sessions.php on line 85


Steve

Offline Chris

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.487
  • Did u ever stop to think and then forget to start?
    • View Profile
Adding profile fields
« Reply #9 on: February 06, 2003, 07:26:24 PM »

Offline widgit1981

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
Adding profile fields
« Reply #10 on: February 06, 2003, 07:28:26 PM »
This has now brought my whole site down I cant get it working

Offline widgit1981

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
Adding profile fields
« Reply #11 on: February 06, 2003, 07:29:58 PM »
Ok I have now got everything back to normal with my backups thew !

What went wrong do you know ?

Offline Chris

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.487
  • Did u ever stop to think and then forget to start?
    • View Profile
Adding profile fields
« Reply #12 on: February 06, 2003, 07:30:10 PM »
It just occurred to me that you shouldn't see any code as part of the error message that is displayed in the browser:
Code: [Select]
['image_entrance'], "text", 1); $additional_image_fields['image_address'] = array($lang['image_address'], "textarea", 1); $additional_image_fields['image_tel'] = array($lang['image_tel'], "text", 1); $additional_image_fields['image_map'] = array($lang['image_map'], "text", 1); ?> ?>>
Check the syntax of your code.  Maybe you're missing a \ or " or ;  Certainly "?> ?>>" doesn't look right.

Offline Chris

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.487
  • Did u ever stop to think and then forget to start?
    • View Profile
Adding profile fields
« Reply #13 on: February 06, 2003, 07:32:05 PM »
Quote from: Chris
It just occurred to me that you shouldn't see any code as part of the error message that is displayed in the browser:
Code: [Select]
['image_entrance'], "text", 1); $additional_image_fields['image_address'] = array($lang['image_address'], "textarea", 1); $additional_image_fields['image_tel'] = array($lang['image_tel'], "text", 1); $additional_image_fields['image_map'] = array($lang['image_map'], "text", 1); ?> ?>>
Check the syntax of your code.  Maybe you're missing a \ or " or ;  Certainly "?> ?>>" doesn't look right.

Actually, if the code above is what appears in your includes/db_field_definitions.php then delete the trailing
Code: [Select]
?>> at the bottom of that file.  Note that this includes the SPACE between the "?>" and the "?>>"

Offline widgit1981

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
Adding profile fields
« Reply #14 on: February 06, 2003, 08:36:24 PM »
Thanks

I will have to go through the steps again. Not know though maybe later 2nite. I will let u know how it goes

Steve