Results 1 to 10 of 10

Thread: Auto-Fill Data into Contact Form [3 Steps]

  1. #1
    Thread Starter
    Junior Member matt's Avatar
    Join Date
    Jan 2012
    Posts
    25
    Thanks
    1
    Thanked 13 Times in 2 Posts

    Thumbs up Auto-Fill Data into Contact Form [3 Steps]

    Just giving back to the community a bit, wish the classipress devs would step it up with basic features (report a post, share, THIS POST, etc.)

    This is working with the version 3.1.8. Should work w/ future updates unless they actually incorporate it into the installation.

    Step 1:
    Open "classipress/includes/sidebar-contact.php"


    Step 2:
    Change Line 81 to:
    Code:
    <input name="from_name" id="from_name" type="text" minlength="2" value="<?php global $current_user; get_currentuserinfo(); echo $current_user->user_firstname; ?>" class="text required" />
    Change Line 92 to:
    Code:
    <input name="from_email" id="from_email" type="text" minlength="5" value="<?php global $current_user; get_currentuserinfo(); echo $current_user->user_email; ?>" readonly="readonly"  class="text required email" />

    Step 3:
    Save, enjoy.


    *BONUS* Other Options:
    You can modify what is displayed, edit the italicized "$current_user->user_CHANGEME" with:

    "user_login"
    "user_firstname"
    "user_lastname"
    "display_name"
    "ID" (registration number)

    I also prefer to add the line " readonly="readonly" " into the subject, so users cannot modify that. It would be:

    Line 104
    Code:
    <input name="subject" id="subject" type="text" minlength="2" value="<?php _e('Re:', 'appthemes') ?> <?php the_title();?>" readonly="readonly" class="text required" />

  2. The Following 12 Users Say Thank You to matt For This Useful Post:

    adityasudhakar (December 13th, 2013), andreuerj (April 6th, 2014), appouser (March 30th, 2012), barukar (March 29th, 2012), bleem (August 3rd, 2013), eaport (April 22nd, 2012), lucrothe (March 29th, 2012), matt9250 (September 2nd, 2012), serno (April 6th, 2014), sneyman (April 6th, 2012), talent (August 4th, 2013), weiching (March 30th, 2012)

  3. #2
    Veteran barukar's Avatar
    Join Date
    Sep 2010
    Location
    Brasil, São Paulo, SP
    Posts
    6,785
    Thanks
    186
    Thanked 742 Times in 623 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!
    -------------------------------------------------------------------------------------------
    Projects: ClassiNoiva - Classimóveis - vocênoenem - i50 - Clube DETRAN

  4. #3
    manishkhullar's Avatar
    Join Date
    Nov 2012
    Location
    India
    Posts
    893
    Thanks
    19
    Thanked 15 Times in 14 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  5. #4
    Veteran bleem's Avatar
    Join Date
    Feb 2012
    Posts
    1,571
    Thanks
    103
    Thanked 205 Times in 180 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  6. The Following User Says Thank You to bleem For This Useful Post:

    manishkhullar (August 4th, 2013)

  7. #5
    comproevendo's Avatar
    Join Date
    Jul 2013
    Location
    Switzerland
    Posts
    52
    Thanks
    2
    Thanked 0 Times in 0 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  8. #6
    gidantrip's Avatar
    Join Date
    Jun 2014
    Location
    Italy
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  9. #7
    Kar1nUSA's Avatar
    Join Date
    Nov 2013
    Location
    United States
    Posts
    214
    Thanks
    32
    Thanked 19 Times in 18 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  10. #8
    gidantrip's Avatar
    Join Date
    Jun 2014
    Location
    Italy
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  11. #9
    Kar1nUSA's Avatar
    Join Date
    Nov 2013
    Location
    United States
    Posts
    214
    Thanks
    32
    Thanked 19 Times in 18 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  12. #10
    gidantrip's Avatar
    Join Date
    Jun 2014
    Location
    Italy
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [TUTORIAL] Auto-fill and lock Contact form
    By doctorcilantro in forum ClassiPress General Discussion
    Replies: 32
    Last Post: October 5th, 2016, 11:32 AM
  2. Inserting Already-Present Data into the Contact Form
    By matt in forum ClassiPress General Discussion
    Replies: 1
    Last Post: March 7th, 2012, 03:00 AM
  3. save contact form data in the database
    By foundationmedia in forum ClassiPress General Discussion
    Replies: 1
    Last Post: July 20th, 2011, 07:45 AM