Results 1 to 9 of 9

Thread: Register in order to email an advertiser - solved!

  1. #1
    Thread Starter
    Amateur
    Not a Verified Customer
    pkmonockus's Avatar
    Join Date
    Jun 2009
    Location
    NZ
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Register in order to email an advertiser - solved!

    Does Classipress have the ability to force users to register/login to see or use the email contact box?

    Any of this possible? Thanks.

  2. #2
    Member
    Not a Verified Customer
    secretstache's Avatar
    Join Date
    Mar 2009
    Posts
    65
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Register in order to email an advertiser?

    this is not an option built into the theme, but I believe you can offer that option if you are comfortable working with the template files.

    find the code that controls the email form in single.php and modify the code with this:

    <?php if (is_user_logged_in()){ ?>

    // Insert Email Form Here

    }
    else {
    echo "Sorry, you must be logged in to contact the Seller by email.";
    };
    ?>

  3. #3
    Thread Starter
    Amateur
    Not a Verified Customer
    pkmonockus's Avatar
    Join Date
    Jun 2009
    Location
    NZ
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Register in order to email an advertiser?

    Fantastic - took me a while to figure it out but worked a treat! Thank you very much!!
    Only had to tweak a few bits.

    Here's the modified code and placement:

    <?php if (is_user_logged_in()){ ?>

    <form... ***form code here****
    </form>

    <?php } else {
    echo "Sorry, you must be logged in to contact the Seller by email.";
    };
    ?>

    Thanks again.

  4. #4
    Member
    Not a Verified Customer
    redsoxmaniac's Avatar
    Join Date
    Apr 2009
    Posts
    63
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Register in order to email an advertiser - solved!

    THank YOu! This is what I've been looking for for months. In single.php Where do I put this? Do I cut the form code out, or do I copy and paste? I think I will put this php around the form code I guess.

  5. #5
    Thread Starter
    Amateur
    Not a Verified Customer
    pkmonockus's Avatar
    Join Date
    Jun 2009
    Location
    NZ
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Register in order to email an advertiser - solved!

    No need to remove any existing code. Add the additional code straight before the form tag starts and straight after the form tag ends as illustrated above.

  6. #6
    pepsi's Avatar
    Join Date
    Mar 2009
    Location
    New Zealand
    Posts
    14,883
    Thanks
    91
    Thanked 804 Times in 718 Posts

    Re: Register in order to email an advertiser - solved!

    Ah got it, working now Thanks so much for sharing this!!

  7. #7
    Member success's Avatar
    Join Date
    Apr 2009
    Location
    Singapore
    Posts
    68
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Register in order to email an advertiser - solved!

    Simple but very useful. Why don't we make this an option in Classipress control panel?

  8. #8
    Founder dcowgill's Avatar
    Join Date
    Mar 2009
    Location
    San Francisco, CA
    Posts
    1,939
    Thanks
    66
    Thanked 135 Times in 99 Posts

    Re: Register in order to email an advertiser - solved!

    This feature will be available in 3.0.

  9. #9
    Rookie
    Not a Verified Customer
    WCFScouk's Avatar
    Join Date
    Dec 2009
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Register in order to email an advertiser - solved!

    This is a bit of an old thread, but thought I would add something else to it, at least until 3.0 is released...
    As you only want to display this to logged users, then it is good to give those who are not yet members or logged in the ability to click a button and either Login or Register right from that box.

    So here is what I added to the code to display a Login and Register button right below the "Sorry, you must be logged in to contact the Seller by email":

    In single.php:
    Code:
    <?php } else {
    echo "Sorry, you must be logged in to contact the Seller by email.
    
    LoginRegister</p>";
    };
    ?>
    To style it, add this to your chosen template style, in my case blue.css:
    Code:
    a.report{background:#fff;border:1px solid #bbbbbb;float:left;font-size:14px;margin:0 2px 10px 2px;padding:5px;width:105px;}
    You may wish to specify the the selector more accurately, but for me this works in my design.
    You should then see this on your website when not logged in:

Thread Information

Users Browsing this Thread

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