Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: , by Mutt Mutt is offline
Developer Last Online: Mar 2013 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 07-02-2001 Last Update: Never Installs: 29
 
No support by the author.

Hey there

I'm still trying to learn all of this and damn this is cool ****. Anyway, I installed the gender hack and was going to use it to install another profile select box. Then I saw the very cool CP tool for adding a field to the profile. It currently only allows you to add a input box. I decieded to modify it so I could add my select box from there. It wasn't very hard and the hack is pretty short.


Here it is in a nutshell
I added a textarea field to the add/edit profile field
if you want the new field to be a dropdown, you enter the dropdown values. each line represents a new option tag.

Ex. you want a new field called "sex" that is a drop down with
the choices male,female, and other.

Make the new field as usual.
Set Field Length. (1 would be a standard dropdown)
Set Maximum Input (I'd leave it at 250)
In the Select Box Items text area type

Male
Female
Other

each on it's own line.


UPDATED for v224 with vbHacker
Click thru for the updated version

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #92  
Old 02-24-2003, 09:00 PM
Nomb's Avatar
Nomb Nomb is offline
 
Join Date: Nov 2002
Location: Phoenix, AZ
Posts: 85
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have this hack installed and it's working great!! I have the code for the admin cp but not in front of me right now. I?ll post a new text file with the corrections.

EDIT Erwin helped me solve my form issues, unrealted to this hack.
Reply With Quote
  #93  
Old 02-27-2003, 06:12 PM
Nomb's Avatar
Nomb Nomb is offline
 
Join Date: Nov 2002
Location: Phoenix, AZ
Posts: 85
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I got my form problems worked out thanks to Erwin in the php forum.

Anyway, if you want your newly created fields to show up in the admin cp correctly, aka, dropdowns and radios actually come up that way instead of plain old text boxes I've got the code.

See my attachment below. I updated Mutt's second revision to the hack. The one that stores everything in the database, the way it should be done. The new text file shows how to alter your admin/user.php file to reflect your new fields.

Also, I made the small addition that mayja pointed out so the fields are saved. It was a minor query error.

I think you can call it final now, no more bugs. Course, I'm working on adding checkboxes. :banana:

BTW, all this is working for me on 2.2.8
Reply With Quote
  #94  
Old 02-28-2003, 06:41 AM
Nomb's Avatar
Nomb Nomb is offline
 
Join Date: Nov 2002
Location: Phoenix, AZ
Posts: 85
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I found one more small bug that wasn't displaying the type dropdown correctly when editting a field in the admin cp. It's fixed and the attachment in the above post has been updated.

Doing these checkboxes isn't easy! I'm close though.

I wonder if they're including this in vB3. Hope so!
Reply With Quote
  #95  
Old 02-28-2003, 06:29 PM
boutwell's Avatar
boutwell boutwell is offline
 
Join Date: Oct 2001
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmmm....I just (re)installed this on version 2.3.0 and everythign is working fine except for none of the cutom fields are showing up in the user's control panel where they edit their profiles. They are showing up on the registration pages and in the admin CP...anyone know what may be the problem?

Would that be an error in member.php or a template of some sort?
Reply With Quote
  #96  
Old 02-28-2003, 11:14 PM
TheComputerGuy's Avatar
TheComputerGuy TheComputerGuy is offline
 
Join Date: Oct 2001
Location: TX
Posts: 580
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Look in the "modifyprofile" edit "$customfields" with $customfield I believe...not tested yet...
Reply With Quote
  #97  
Old 03-03-2003, 01:01 AM
Nomb's Avatar
Nomb Nomb is offline
 
Join Date: Nov 2002
Location: Phoenix, AZ
Posts: 85
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by boutwell
Hmmm....I just (re)installed this on version 2.3.0 and everythign is working fine except for none of the cutom fields are showing up in the user's control panel where they edit their profiles. They are showing up on the registration pages and in the admin CP...anyone know what may be the problem?

Would that be an error in member.php or a template of some sort?
That would be an error in member.php, not sure what though.

This could all be part of a small change they made in 2.3.0, not sure because I'm using 2.2.8. Post what you edited and then also post the query that updates the mysql with the custom fields.
Reply With Quote
  #98  
Old 03-17-2003, 08:49 PM
007's Avatar
007 007 is offline
 
Join Date: Jan 2003
Location: United States
Posts: 872
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hey Nomb did you get the checkboxes code working yet?
Reply With Quote
  #99  
Old 03-24-2003, 04:24 PM
danglick danglick is offline
 
Join Date: Mar 2003
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The user.php code has a couple of errors. In both the 'add user' and the 'edit user' code, the fields are pre-filled with the values of the administrator's profile fields, rather than the user's (or blank in the case of a new record).

Nomb, I'm sure you can figure out how to fix it; but if you'd like me to send you the corrected code I'm using on my site, let me know.
Reply With Quote
  #100  
Old 03-25-2003, 02:18 AM
DigitalDesktops DigitalDesktops is offline
 
Join Date: Mar 2003
Location: Scotland, UK
Posts: 161
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i'm still having problems with this. The custom field options won't show up in the User CP. I'm using 2.3.0. The Only thing that was different in the readme was this:

User.php

In my User.php(Line 295) :

PHP Code:
  maketableheader("Custom Profile Fields");
  
$userfield=$DB_site->query_first("SELECT * FROM userfield WHERE userid=$userid");

  
$profilefields=$DB_site->query("SELECT profilefieldid,title FROM profilefield");
  while (
$profilefield=$DB_site->fetch_array($profilefields)) {
    
$varname="field$profilefield[profilefieldid]";
    
makeinputcode($profilefield[title],"field".$profilefield[profilefieldid],$userfield[$varname]);
  }

  
doformfooter("Save Changes");

}

// ###################### Start do update ####################### 
In customfileds.txt posted by Nomb it says to replace this code:
PHP Code:
  maketableheader("Custom Profile Fields");
  
$profilefields=$DB_site->query("SELECT profilefieldid,title FROM profilefield");
  while (
$profilefield=$DB_site->fetch_array($profilefields)) {
    
makeinputcode($profilefield[title],"field".$profilefield[profilefieldid]);
  } 
with this code
PHP Code:
    // new options
    
    
maketableheader("Custom Profile Fields");
    
$profilefields=$DB_site->query("SELECT *
                                    FROM profilefield
                                    WHERE editable = 1
                                    ORDER BY displayorder"
);
    while (
$profilefield=$DB_site->fetch_array($profilefields)) {
      
$profilefieldname="field$profilefield[profilefieldid]";
      if (
$bgcolor=="#13486D") {
        
$bgcolor="#1C5780";
      } else {
        
$bgcolor="#13486D";
      }
      
// new options
      
$TheField="";
      
$optionlines explode(','$profilefield[options]);
      
$option_bit=$optionlines[0];
      if (
$profilefield[type]==1) {
          
// radio
          
while ($option_bit) {
              
$option_bit=trim($option_bit);
              if (
$option_bit == $bbuserinfo[$profilefieldname]) { $LocOn "checked"; } else { $LocOn ""; }
              
$TheField .= "<input type=\"radio\" name=\"$profilefieldname\" value=\"$option_bit\" $LocOn$option_bit ";
              
$option_bit=next($optionlines);
          }
      } elseif (
$profilefield[type]==2) {
          
// select
          
$TheField "<select size=\"$profilefield[size]\" name=\"$profilefieldname\">";
          while (
$option_bit) {
              
$option_bit=trim($option_bit);
              if (
$option_bit == $bbuserinfo[$profilefieldname]) { $LocOn "selected"; } else { $LocOn ""; }
              
$TheField .= "<option value=\"$option_bit\" $LocOn>$option_bit</option>";
              
$option_bit=next($optionlines);
          }
          
$TheField .= "</select>";
      } elseif (
$profilefield[type]==3) {
          
// textarea
          
$bbuserinfo[$profilefieldname]=htmlspecialchars($bbuserinfo[$profilefieldname] );
          
$TheField "<textarea name=\"$profilefieldname\" rows=\"6\" cols=\"40\" wrap=\"physical\">$bbuserinfo[$profilefieldname]</textarea>";
      } else {
          
$TheField="<input type=\"text\" class=\"bginput\" name=\"$profilefieldname\" value=\"$bbuserinfo[$profilefieldname]\" size=\"$profilefield[size]\" maxlength=\"$profilefield[maxlength]\">";
       }
    
makelabelcode($profilefield[title],$TheField);
    }
    
    
// new options 
Can anyone help me with this?
Reply With Quote
  #101  
Old 04-08-2003, 12:24 PM
TMM TMM is offline
 
Join Date: Mar 2003
Posts: 38
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Looks very interesting

Has anyone tried Nomb's latest in 2.2.9? Danglick, maybe you could post the corrected code here...?

Also, could this be made to work with Firefly's lite registration hack?

Thanks,

TMM
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 10:25 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.05656 seconds
  • Memory Usage 2,351KB
  • Queries Executed 25 (?)
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
  • (3)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete