Jump to content

Adding "about me" Box in public profile


truemo9

Recommended Posts

Please allow our users here time to answer you back. If in an emergency, a bump a couple days alter may be in order, but minutes later is not going to get you anywhere real fast. All the users here have a life outside of the website here and freely give their time and effort when they are on. Patience is a virtue. Wait and see!

Waiting over.......

You can add any extra pages you want to do. It is real easy. Simply go in the admin panel and click on the link called Pages. You can use the html editor to add code if your page is more than simple text. If you wish to add ANY php or special links like we use in core_nav, create your page and simply save it. Then open that page in Dreamweaver or editor of your choice and edit it otherwise special urls and php will not stay in the added pages. The path to the added pages is public_html/core/pages

Presto! Enjoy your newly added page.

  • Like 3
Link to comment
Share on other sites

Ray,

I think what he means is have a short text form added in the profile_main.tpl so that each member (not admin) can add a short summary about themselves and that will show up in the pilot_public_profile.tpl so everyone can view info on each member. I think it would be a great add-on if someone would like to tackle this task.

Link to comment
Share on other sites

Ray,

I think what he means is have a short text form added in the profile_main.tpl so that each member (not admin) can add a short summary about themselves and that will show up in the pilot_public_profile.tpl so everyone can view info on each member. I think it would be a great add-on if someone would like to tackle this task.

I got ya. That is a quick easy one to do. I can not do it tonight though. I will try it in the morning. I got a whopping 1 hour sleep last night. I'm tired and heading to bed now.

Link to comment
Share on other sites

Guest lorathon

Just add a field to the pilot table. Call it aboutme. then just write the code to save/edit and display the data.

I would modify the core/modules/profile file.

to display would be $pilotinfo->aboutme or $userinfo->aboutme or Auth::$userinfo->aboutme. You get the picture :D

Link to comment
Share on other sites

Just add a field to the pilot table. Call it aboutme. then just write the code to save/edit and display the data.

I would modify the core/modules/profile file.

to display would be $pilotinfo->aboutme or $userinfo->aboutme or Auth::$userinfo->aboutme. You get the picture :D

We need to come up with a way to do this so that no core files are edited at all. I know this way is the best way, but I hate getting my files over written in updates. I suppose we could write up a module for it, but that much work for a simple about me field is almost overkill I'm guessing. Now maybe if we added a little to it like simple profile comments or something like that...... It would sweeten the deal up some.

Link to comment
Share on other sites

Isn't there a way to actually place it in the Edit Profile page so they will be able to update it at any time? I was fiddling with it last night, but couldn't get it to show. I added a custom profile field in the admin center but couldn't figure out how to have it work correctly since I've never tried the custom profile before.

Link to comment
Share on other sites

  • Moderators

woulnd it be so easy yes it is

just add a custom field in the admin section and just name it "about me"

then check the boxes show in profile and show at registration and thats it laugh.gif

i think most off us alted so manny that we lose the grip on the things already in there

Link to comment
Share on other sites

Hey I have this in it's entirety. I can not get the about me to populate the database though. If someone can toss a query at me that I can try, I will give it a go. I hate to give out the code and it not work. If I can't get it to work, I'll scrap it. :D Nahh probably not, but I would love to show you all a working product.

profile.JPG

editprofile.JPG

Link to comment
Share on other sites

Hi Guys. I have had a VERY bad couple days and not been on the PC. I do plan on having this fixed today. I was actually able to query the db on submit. However, it is not updating with what I type in the box. So at least it is connecting. Maybe something with the value or what ever I am trying to do.

Oh well back to the drawing board. :D

Link to comment
Share on other sites

  • Moderators

Ray,

I am just having a look at this and if you add a custom field then you can edit this and have it displayed already by the code.

<h3>Edit Profile</h3>
<form action="<?php echo url('/profile');?>" method="post" enctype="multipart/form-data">
<dl>
  <dt>Name</dt>
  <dd><?php echo $userinfo->firstname . ' ' . $userinfo->lastname;?></dd>

  <dt>Airline</dt>
  <dd><?php echo $userinfo->code?>
     <p>To request a change, contact your admin</p>
  </dd>

  <dt>Email Address</dt>
  <dd><input type="text" name="email" value="<?php echo $userinfo->email;?>" />
     <?php
        if(isset($email_error) && $email_error == true)
           echo '<p class="error">Please enter your email address</p>';
     ?>
  </dd>

  <dt>Location</dt>
  <dd><select name="location">
     <?php
     foreach($countries as $countryCode=>$countryName)
     {
        if($userinfo->location == $countryCode)
           $sel = 'selected="selected"';
        else  
           $sel = '';

        echo '<option value="'.$countryCode.'" '.$sel.'>'.$countryName.'</option>';
     }
     ?>
     </select>
     <?php
        if(isset($location_error) &&  $location_error == true)
           echo '<p class="error">Please enter your location</p>';
     ?>
  </dd>

  <dt>Signature Background</dt>
  <dd><select name="bgimage">
     <?php
     foreach($bgimages as $image)
     {
        if($userinfo->bgimage == $image)
           $sel = 'selected="selected"';
        else  
           $sel = '';

        echo '<option value="'.$image.'" '.$sel.'>'.$image.'</option>';
     }
     ?>
     </select>
  </dd>

  <?php
  if($customfields)
  {
     foreach($customfields as $field)
     {
        echo '<dt>'.$field->title.'</dt>
             <dd>';

       if($field->type == 'dropdown')
        {
           $field_values = SettingsData::GetField($field->fieldid);          
           $values = explode(',', $field_values->value);


           echo "<select name=\"{$field->fieldname}\">";

           if(is_array($values))
           {                 
              foreach($values as $val)
              {
                 $val = trim($val);

                 if($val == $field->value)
                    $sel = " selected ";
                 else
                    $sel = '';

                 echo "<option value=\"{$val}\" {$sel}>{$val}</option>";
              }
           }

           echo '</select>';
        }
        elseif($field->type == 'textarea')
        {
           echo '<textarea class="customfield_textarea"></textarea>';
        }
        else
        {
           echo '<input type="text" name="'.$field->fieldname.'" value="'.$field->value.'" />';
        }

        echo '</dd>';
     }
  }
  ?>

  <dt>Avatar:</dt>
  <dd><input type="hidden" name="MAX_FILE_SIZE" value="<?php echo Config::Get('AVATAR_FILE_SIZE');?>" />
     <input type="file" name="avatar" size="40"> 
     <p>Your image will be resized to <?php echo Config::Get('AVATAR_MAX_HEIGHT').'x'.Config::Get('AVATAR_MAX_WIDTH');?>px</p>
  </dd>
  <dt>Current Avatar:</dt>
  <dd><?php   
        if(!file_exists(SITE_ROOT.AVATAR_PATH.'/'.$pilotcode.'.png'))
        {
           echo 'None selected';
        }
        else
        {
     ?>
        <img src="<?php   echo SITE_URL.AVATAR_PATH.'/'.$pilotcode.'.png';?>" /></dd>
     <?php
     }
     ?>
  <dt></dt>
  <dd><input type="hidden" name="action" value="saveprofile" />
     <input type="submit" name="submit" value="Save Changes" /></dd>
</dl>
</form>

  • Like 1
Link to comment
Share on other sites

I'll have to take a peak at that mark. That is much longer and drawn out then mine, but probably the best way to do it.

I really am having issues working with this whole codeon module style to be honest. Funny how I can code a php website from scratch and make it run flawless, but I have so much trouble here. :D

Dealing with a couple issues here at home with one of the young'uns right now. As soon as I can here in a bit, I will dive in to this.

Thanks Mark!

Link to comment
Share on other sites

Hey Mark, I got thinking about it some. If we make it a field in registration as the code suggests as a custom field, then the person will never be able to update their about me ever again. Thus the need to be able to update the database from the edit profile page.

Am I looking to far into your suggestion?

Link to comment
Share on other sites

Ray,

I am just having a look at this and if you add a custom field then you can edit this and have it displayed already by the code.

<h3>Edit Profile</h3>
<form action="<?php echo url('/profile');?>" method="post" enctype="multipart/form-data">
<dl>
  <dt>Name</dt>
  <dd><?php echo $userinfo->firstname . ' ' . $userinfo->lastname;?></dd>

  <dt>Airline</dt>
  <dd><?php echo $userinfo->code?>
     <p>To request a change, contact your admin</p>
  </dd>

  <dt>Email Address</dt>
  <dd><input type="text" name="email" value="<?php echo $userinfo->email;?>" />
     <?php
        if(isset($email_error) && $email_error == true)
           echo '<p class="error">Please enter your email address</p>';
     ?>
  </dd>

  <dt>Location</dt>
  <dd><select name="location">
     <?php
     foreach($countries as $countryCode=>$countryName)
     {
        if($userinfo->location == $countryCode)
           $sel = 'selected="selected"';
        else  
           $sel = '';

        echo '<option value="'.$countryCode.'" '.$sel.'>'.$countryName.'</option>';
     }
     ?>
     </select>
     <?php
        if(isset($location_error) &&  $location_error == true)
           echo '<p class="error">Please enter your location</p>';
     ?>
  </dd>

  <dt>Signature Background</dt>
  <dd><select name="bgimage">
     <?php
     foreach($bgimages as $image)
     {
        if($userinfo->bgimage == $image)
           $sel = 'selected="selected"';
        else  
           $sel = '';

        echo '<option value="'.$image.'" '.$sel.'>'.$image.'</option>';
     }
     ?>
     </select>
  </dd>

  <?php
  if($customfields)
  {
     foreach($customfields as $field)
     {
        echo '<dt>'.$field->title.'</dt>
             <dd>';

       if($field->type == 'dropdown')
        {
           $field_values = SettingsData::GetField($field->fieldid);          
           $values = explode(',', $field_values->value);


           echo "<select name=\"{$field->fieldname}\">";

           if(is_array($values))
           {                 
              foreach($values as $val)
              {
                 $val = trim($val);

                 if($val == $field->value)
                    $sel = " selected ";
                 else
                    $sel = '';

                 echo "<option value=\"{$val}\" {$sel}>{$val}</option>";
              }
           }

           echo '</select>';
        }
        elseif($field->type == 'textarea')
        {
           echo '<textarea class="customfield_textarea"></textarea>';
        }
        else
        {
           echo '<input type="text" name="'.$field->fieldname.'" value="'.$field->value.'" />';
        }

        echo '</dd>';
     }
  }
  ?>

  <dt>Avatar:</dt>
  <dd><input type="hidden" name="MAX_FILE_SIZE" value="<?php echo Config::Get('AVATAR_FILE_SIZE');?>" />
     <input type="file" name="avatar" size="40"> 
     <p>Your image will be resized to <?php echo Config::Get('AVATAR_MAX_HEIGHT').'x'.Config::Get('AVATAR_MAX_WIDTH');?>px</p>
  </dd>
  <dt>Current Avatar:</dt>
  <dd><?php   
        if(!file_exists(SITE_ROOT.AVATAR_PATH.'/'.$pilotcode.'.png'))
        {
           echo 'None selected';
        }
        else
        {
     ?>
        <img src="<?php   echo SITE_URL.AVATAR_PATH.'/'.$pilotcode.'.png';?>" /></dd>
     <?php
     }
     ?>
  <dt></dt>
  <dd><input type="hidden" name="action" value="saveprofile" />
     <input type="submit" name="submit" value="Save Changes" /></dd>
</dl>
</form>

Ok I gave this a go and I can not get it to show anything on the profile page. I can enter the text in the about me section of the edit profile page and I get the same results as before. Nothing is showing after I submit.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...