Advertisement:

Author Topic: Custom fields for user registration form  (Read 3018 times)

mohad

  • Newbie
  • *
  • Posts: 4
Custom fields for user registration form
« on: June 11, 2015, 03:17:29 pm »
Hi guys, I found a reference to a plugin that seems to be exactly what I am looking for:

http://kblog.psskhal.com/osclass-plugin-for-adding-custom-fields-in-registration-form-and-user-account/

However there is no download link anywhere. I contacted the author without any response.

So do you know of an alternative or perhaps someone was able to download the plugin previously and can point me to a download location please?

Thank you!

SmaRTeY

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2518
Re: Custom fields for user registration form
« Reply #1 on: June 11, 2015, 07:49:58 pm »
Please always look for plugins and themes in Market first, this is what you want I assume:
http://market.osclass.org/plugins/miscellaneous/required-fields_30

itcafeonline

  • Full Member
  • ***
  • Posts: 245
Re: Custom fields for user registration form
« Reply #2 on: June 11, 2015, 10:10:20 pm »
No, Its extra custom fields beyond whats already there in OSclass default.

SmaRTeY

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2518
Re: Custom fields for user registration form
« Reply #3 on: June 11, 2015, 11:37:52 pm »
 ::) I stand corrected :)

monah

  • Full Member
  • ***
  • Posts: 223
Re: Custom fields for user registration form
« Reply #4 on: June 16, 2015, 10:55:34 pm »
I found a plug-in developer , and he kindly provided ...

monah

  • Full Member
  • ***
  • Posts: 223
Re: Custom fields for user registration form
« Reply #5 on: June 17, 2015, 10:55:01 am »
tell me how to get the value psskhal_field_value in the right place , for example, the list of companies ?
Code: [Select]
<?php
  $locales   
__get('locales') ;
?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="<?php echo str_replace('_''-'osc_current_user_locale()); ?>">
<head>
  <?php osc_current_web_theme_path('head.php') ; ?>
  <meta name="robots" content="noindex, nofollow" />
  <meta name="googlebot" content="noindex, nofollow" />
</head>
<body>
  <?php osc_current_web_theme_path('header.php') ; ?>
    <?php osc_render_file(); ?>

<?php $user User::newInstance()->listAll(); ?>
<?php if (osc_total_users()>0) { ?>
<table background="#E71B1F"  class="comp_block" align="center" width="80%" cellspacing="0" cellpadding="6" style="solid grey; border-collapse:separate;
              border-spacing:2px 20px;">

<?php foreach ($user as $u) { ?>
<?php  if($u["b_company"]==1) {?>
<tr style="margin-bottom:5px;">
      <?php View::newInstance()->_exportVariableToView('user'$user_keep); ?>
   
   
    <th width="160px"> <?php 
$user_id $u['pk_i_id'];
    
$conn getConnection();
    
$result=$conn->osc_dbFetchResult("SELECT user_id, pic_ext FROM %st_profile_picture WHERE user_id = '%d' "DB_TABLE_PREFIX$user_id);
 $maxwidth NULL;
     
$what NULL;
    
$maxheight NULL;
    if(
$maxwidth == '') { $maxwidth '120'; }
     
      

    if(
$result>0//if picture exists
    
{
$upload_path osc_plugins_path().'profile_picture/images/';

        list(
$width$height$type$attr)= getimagesize($upload_path.'profile'.$user_id.$result['pic_ext']); 

// Calculate display heigh/width based on max size specified
$ratio $width/$height;
$height $maxwidth/$ratio;

        if(
$maxheight <> '') { $height $maxheight$maxwidth 'auto'; }
$modtime filemtime($upload_path.'profile'.$user_id.$result['pic_ext']); //ensures browser cache is refreshed if newer version of picture exists
// This is the picture HTML code displayed on page
echo '<img id="profile_picture_img" src="'.osc_base_url() . 'oc-content/plugins/profile_picture/images/profile'.$user_id.$result['pic_ext'].'?'.$modtime.'" width="'.$maxwidth.'" height="'.$height.'">'// display picture
    
}
    else{
        if(
$maxheight <> '') { $height $maxheight$maxwidth 'auto'; }
echo '<img id="profile_picture_img" src="'.osc_base_url() . 'oc-content/plugins/profile_picture/no-user.png" width="'.$maxwidth.'" height="'.$height.'">';
    }
 
?>

 
 </th>
  <th>  <div class="comp_style"><div class="name-ico1"></div><a href="<?php echo osc_base_url(true).'?page=user&action=pub_profile&id='.$u['pk_i_id']; ?>" ><?php echo $u['s_name']; ?></a></div><br />
  <div class="mob-ico1"></div><?php echo $u['s_phone_land'] ;?>  <?php echo $u['s_phone_mobile'] ;?><br />
        <div class="icon-item-loc"></div><?php echo $u['s_city'] ;?>, <?php echo $u['s_address'] ;?> <br />
  <div class="reg-ico1"></div><div class="left"><?php _e('Registered''tatiana'); ?> <?php echo osc_format_date($u['dt_reg_date']) ;?> </div><br />
         </th>
</tr>
<?php ?><?php ?>
</table><?php ?>

  <?php osc_current_web_theme_path('footer.php') ; ?>
</body>
</html>

SmaRTeY

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2518
Re: Custom fields for user registration form
« Reply #6 on: June 17, 2015, 09:04:37 pm »
Nice catch monah!  8)

I found a plug-in developer , and he kindly provided ...

monah

  • Full Member
  • ***
  • Posts: 223
Re: Custom fields for user registration form
« Reply #7 on: June 17, 2015, 09:16:13 pm »
it remains to find how to display the data in other places

SmaRTeY

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2518
Re: Custom fields for user registration form
« Reply #8 on: June 17, 2015, 09:50:09 pm »
No helpfile included?  ::)

monah

  • Full Member
  • ***
  • Posts: 223
Re: Custom fields for user registration form
« Reply #9 on: June 18, 2015, 12:04:24 am »
I have not found (
 :-[

Resta

  • Sr. Member
  • ****
  • Posts: 350
Re: Custom fields for user registration form
« Reply #10 on: January 24, 2018, 06:43:48 am »
Hi Monah,

I was wondering if you found out how to show value of a custom field on item page or any other page - I want to show it on the user dashboard page? Can you help me or Smartey or someone else? Thanks!

pixelpadre

  • Jr. Member
  • **
  • Posts: 76
Re: Custom fields for user registration form
« Reply #11 on: December 25, 2018, 05:01:13 pm »
OK, no documentation available for the plugin.  But I discovered that if you go to the plugin directory, there are two files you must edit.
  • footer.php
  • form.php

You will need to uncomment the lines that you want to use.

Also, pay attention to footer.  The ID values must match the ID values in Form file.  Right now they don't.  Not a difficult task if you have a tiny bit of programming experience.