View Poll Results: How was this tutorial/mod?

Voters
27. You may not vote on this poll
  • No good, I can't use it.

    2 7.41%
  • Looks okay but I'm not going to try it.

    2 7.41%
  • Looks great, but I'm not skilled enough to try it.

    3 11.11%
  • Looks great, but I couldn't get it to work.

    2 7.41%
  • Awesome, I'm trying it on my site.

    9 33.33%
  • Perfect, I tried it on my site and had absolutely no problems at all.

    9 33.33%
Page 1 of 3 123 LastLast
Results 1 to 10 of 25

Thread: Adding Phone Number - My Way

  1. #1
    Community Partner scarstens's Avatar
    Join Date
    Apr 2010
    Location
    Cave Creek, AZ USA
    Posts
    912
    Thanks
    2
    Thanked 129 Times in 86 Posts

    Post Adding Phone Number - My Way

    I decided to just write my own mod tutorial on adding the Phone Number attribute to user profiles and displaying the phone number on the poster tab. This can be done to ad ANY type of information, but we will be using phone number as an example. After doing the tutorial, I'm not sure its a good idea to be modifying all these core files, as it will require you to preform this long tediuous task after every update... someday I'll have a better way to add custom code to this software. Until then, if you want feel free to follow this tutorial, I tested it on v3+ and results can be seen at http://mytacksales.com/.

    Step 1: Fixing the Profile Template Page to properly update our new author field to (\tpl-profile.php)

    FIND:
    Code:
    // update the custom user fields
    ADD ON NEW LINE DIRECTLY BELOW ABOVE CODE:
    Code:
    update_usermeta($user_ID, 'phone', $_POST['phone']);
    Step 2: Adding the Phone Number field, label, and description to (includes\theme-profile.php)

    FIND:
    Code:
    <table class="form-table">
    ADD ON NEW LINES DIRECTLY BELOW THE ABOVE LINE:
    Code:
    <tr>
        <th><label for="phone"><?php _e('Phone Number','cp')?></label></th>
        <td>
            <input type="text" name="phone" id="phone" value="<?php echo esc_attr(get_the_author_meta('phone', $user->ID)); ?>" class="regular-text" />
     
            <span class="description"><?php _e('We prefer the format (000) 000-0000','cp')?></span>
        </td>
    </tr>
    Step 3: Update function that saves the fields (includes\theme-profile.php)

    FIND:
    Code:
    /* Copy and paste this line for additional fields. Make sure to change 'twitter' to the field ID. */
    ADD ON NEW LINE DIRECTLY BELOW ABOVE CODE:
    Code:
    update_usermeta( $user_id, 'phone', $_POST['phone'] );
    Step 4: Adding the information to the "poster" tab (\sidebar-ad.php)

    FIND:
    Code:
    [*]<span><?php _e('Member Since:','cp');?></span> <?php echo date(get_option('date_format'), strtotime(get_the_author_meta('user_registered'))); ?>
    ADD ON NEW LINE DIRECTLY BELOW THE ABOVE CODE:
    Code:
    [*]<span><?php _e('Phone Number:','cp');?></span> <?php echo get_the_author_meta('phone'); ?>
    Step 5: Adding the information to the author page, and the user-sidebar (\sidebar-user.php)
    FIND:
    Code:
    <h3><span class="colour"><?php echo $userdata->first_name; ?><?php echo $userdata->last_name; ?></span></h3>
    ADD ON NEW LINE DIRECTLY BELOW THE ABOVE CODE:


    Step 6: Adding the information to the user-sidebar (\author.php)
    FIND:
    Code:
    <div class="author-main">
    ADD ON NEW LINE DIRECTLY BELOW THE ABOVE CODE:
    Code:
    <?php _e('Phone Number:','cp');?> <?php echo $curauth->phone; ?>
    Last edited by pepsi; August 9th, 2010 at 03:32 AM.
    ~ Seth Carstens, Sethmatics Inc.


  2. The Following 5 Users Say Thank You to scarstens For This Useful Post:

    alphadude (March 10th, 2013), bmahillet (December 29th, 2011), bruunmedia (December 4th, 2011), msyahrizan (September 30th, 2011), rubencio (August 7th, 2011)

  3. #2
    Veteran sarge's Avatar
    Join Date
    Jun 2009
    Location
    USA
    Posts
    628
    Thanks
    2
    Thanked 9 Times in 9 Posts

    Re: Adding Phone Number - My Way

    You must be an AppThemes customer and logged in to view this response. Join today!
    Always treat everyone with respect and courtesy, but trust no one.

  4. #3
    Veteran bluecafe's Avatar
    Join Date
    Apr 2010
    Location
    Berlin
    Posts
    1,563
    Thanks
    58
    Thanked 359 Times in 273 Posts

    Re: Adding Phone Number - My Way

    You must be an AppThemes customer and logged in to view this response. Join today!

  5. The Following User Says Thank You to bluecafe For This Useful Post:

    alphadude (March 10th, 2013)

  6. #4
    Member pipno's Avatar
    Join Date
    Apr 2010
    Posts
    87
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Adding Phone Number - My Way

    You must be an AppThemes customer and logged in to view this response. Join today!

  7. #5
    mcasdorph's Avatar
    Join Date
    Apr 2010
    Location
    WV, USA
    Posts
    122
    Thanks
    17
    Thanked 4 Times in 4 Posts

    Re: Adding Phone Number - My Way

    You must be an AppThemes customer and logged in to view this response. Join today!

  8. #6
    Community Partner scarstens's Avatar
    Join Date
    Apr 2010
    Location
    Cave Creek, AZ USA
    Posts
    912
    Thanks
    2
    Thanked 129 Times in 86 Posts

    Re: Adding Phone Number - My Way

    You must be an AppThemes customer and logged in to view this response. Join today!
    Last edited by pepsi; July 9th, 2010 at 06:41 AM.
    ~ Seth Carstens, Sethmatics Inc.


  9. The Following User Says Thank You to scarstens For This Useful Post:

    ybpress (November 7th, 2011)

  10. #7
    artfan1's Avatar
    Join Date
    Jun 2010
    Location
    United States
    Posts
    59
    Thanks
    4
    Thanked 3 Times in 1 Post
    You must be an AppThemes customer and logged in to view this response. Join today!

  11. #8
    dollarpermile.com's Avatar
    Join Date
    May 2010
    Posts
    112
    Thanks
    0
    Thanked 4 Times in 3 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  12. #9
    artfan1's Avatar
    Join Date
    Jun 2010
    Location
    United States
    Posts
    59
    Thanks
    4
    Thanked 3 Times in 1 Post
    You must be an AppThemes customer and logged in to view this response. Join today!

  13. #10
    Veteran demonlee's Avatar
    Join Date
    Mar 2011
    Location
    Antas, Spain
    Posts
    574
    Thanks
    6
    Thanked 51 Times in 46 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

Page 1 of 3 123 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)