How do I set this up? Am I doing it the right way?

Hi

I'm trying to create a site where basically there are 3 levels of membership-

free users
basic business users
advanced business users

My site helps dog owners find walker/sitters for their dog.

Basic business users pay a membership fee to be able to list their business in the dog services directory for a year.

Advanced business users pay a little more to have everything basic business users have, plus the ability to reply to job requests, which I am trying to display using the plugin wp job manager (but am still waiting for some advice on another thread about getting that set up correctly).

Basically, am I doing this right? Is 'membership' the way to go with this? I can't see any other way to stop users from replying to job requests (and I want them to have to pay a fee to be able to do this). Using membership for all levels seems to make things less complicated I would think? But is there an easier way?

On another note, just how exactly do I allow advanced business users to reply to job requests? I can't see this in the access levels menu anywhere. I'd like all users (including strangers, free members, basic business users and advanced) to be able to view the jobs (with a 'more' tag restricting some content to keep people interested. But the only people who should be able to actually reply to the job requests are advanced business users. Hope that makes sense!

As it stands, I can't find any options at all for the job manager plugin on the access levels menu. Am I missing something really obvious?

Thanks all for your time! (and if anyone can take a look at my latest question at https://premium.wpmudev.org/forums/topic/ok-have-just-sat-and-watched-all-the-tutorial-vids that would really help me to move along with getting this working this week).

  • PC

    Hello there Sally,

    Greetings and thanks for posting on the forums.

    I see that my colleague @Jack Kitterhing is working on the other thread and he would be on it as soon as he is back in office

    For what you want to achieve, I personally feel that it would need some custom work if you want to integrate it with Membership plugin.

    Membership plugin can restrict different content based on URL's, categories etc however what you are looking to do would go in template of the wp jobs plugin you are using.

    Basic business users pay a membership fee to be able to list their business in the dog services directory for a year.

    Easy as a piece of cake. Just restrict the ability of a non paid member to visit the add business page.

    Advanced business users pay a little more to have everything basic business users have, plus the ability to reply to job requests, which I am trying to display using the plugin wp job manager

    For this, you will need to protect the code using some custom code inside the wp job manager plugin.

    For example plugin has a button to "Reply to job" and the code is

    code for the reply button

    Then you will need to but that inside the membership plugin code inside the template so that if a person is on advanced level, he would see that button.

    Something like : https://premium.wpmudev.org/forums/topic/how-to-hide-parts-of-a-template-from-non-members should be the way to go ahead.

    Can you kindly check that out once ?

    Cheers, PC

  • Sally

    Hi PC

    Sorry for the delay in replying to this.

    I have to say, I'm totally stumped by this, I must have read this post and the post you linked to over 50 times now and I still can't fathom where to begin with this.

    What code am I supposed to be putting where exactly? Please could you explain in stupid person terms

    Additionally, with regards to the first thing you said about restricting the ability of a non paid member to visit the add a business page, I don't seem to have a add a business page, and I can't for the life of me find the shortcode to create one... my add a business page appears to work within the buddypress profile platform, so I need to protect both this and a new page I obviously need to create if I can just find out what the shortcode is for the add a business form.

    Are you able to help at all please?

    Thank you

    Sally

  • CS_Team

    Hi Sally,

    If I understand the other post properly, what Jack is saying is the membership allows you to hide parts of posts or pages by using shortcodes to that users subscription level.

    By adding this above
    <?php echo do_shortcode('[level-1]'); ?>

    and this below
    <?php echo do_shortcode('[/level-1]'); ?>

    PC above says if you can find the code in your template which makes the 'reply to ad' button and put these two statements above and below you will show them only to members of that status. Documented on page 42-43 of the pdf manual

    If you have 3 membership statuses advanced will of course probably be 3 instead of 1 ie. [level-3] [/level-3]

  • Sally

    Thank you for your help

    It's all slowly beginning to make a bit more sense!

    However, having just taken another look at wp jobs manager I'm really not all that happy with the way it displays and shows confidential user info to people, so I've asked on another thread if anyone has any suggestions of a better plugin to use before I do this.

    But once I have that worked out, I'll be sure to come back to this thread and crack on with getting those codes where they need to be!

    Thanks ever so much for explaining it all to me! It's been a great help!

  • Sally

    Hi everyone

    Am now back to this, as I can't seem to find an alternative suitable plugin at this time.

    So I've managed to create the file in the child theme, with some help from the plugin creator, and establish which file to change, but having just tried the code above it didn't work, so I then tried this

    <?php if ( $apply = get_the_job_application_method() ) :
    wp_enqueue_script( 'wp-job-manager-job-application' );
    ?>
    <div class="application">
    [level-advanced-business-users] <input class="application_button" type="button" value="<?php _e( 'Contact this owner', 'wp-job-manager' ); ?>" /> [level-advanced-business-users]

    <div class="application_details">
    <?php
    switch ( $apply->type ) {
    case 'email' :

    echo '<p>' . sprintf( __( 'To contact this owner email your details to %1$s', 'wp-job-manager' ), $apply->email, '?subject=' . rawurlencode( $apply->subject ) ) . '</p>';

    echo '<p>' . __( 'Apply using webmail: ', 'wp-job-manager' );

    echo 'email . '&su=' . urlencode( $apply->subject ) .'" target="_blank" class="job_application_email">Gmail / ';

    echo 'email . '&subject=' . urlencode( $apply->subject ) .'" target="_blank" class="job_application_email">AOL / ';

    echo 'email . '&subject=' . urlencode( $apply->subject ) .'" target="_blank" class="job_application_email">Yahoo / ';

    echo 'email . '&subject=' . urlencode( $apply->subject ) .'" target="_blank" class="job_application_email">Outlook';

    echo '</p>';

    break;
    case 'url' :
    echo '<p>' . sprintf( __( 'To apply for this job please visit the following URL: %1$s →', 'wp-job-manager' ), $apply->url ) . '</p>';
    break;
    }
    ?>
    </div>
    </div>
    <?php endif; ?>

    and it's had no effect.

    Can anyone tell me what I'm doing wrong please?

    I have 4 levels, but only want one (advanced business users) to display this button. In its place I'd like a bit of bold text saying 'You must upgrade to Advanced business membership to view the owners details'.

    Can anyone advise?

    Thank you!

    Sally

  • CS_Team

    Hi Sally,

    I'm new to a lot of this as well but using this to work out how the php else statement is set up http://www.w3schools.com/php/php_if_else.asp

    and using the instructions on the other post.

    Try this, but be sure to back up what you have first as I said I'm new to this too.

    <?php if ( $apply = get_the_job_application_method() ) :
    wp_enqueue_script( 'wp-job-manager-job-application' );
    ?>
    <div class="application">
    
    <?php
    if(current_user_level(4))
    {
    echo "<input class="application_button" type="button" value="<?php _e( 'Contact this owner', 'wp-job-manager' ); ?>" />";
    }
    else
    {
    echo "You must upgrade to Advanced business membership to view the owners details";
    }
    ?>
    
    <div class="application_details">
    <?php
    switch ( $apply->type ) {
    case 'email' :
    
    echo '<p>' . sprintf( __( 'To contact this owner email your details to %1$s', 'wp-job-manager' ), $apply->email, '?subject=' . rawurlencode( $apply->subject ) ) . '</p>';
    
    echo '<p>' . __( 'Apply using webmail: ', 'wp-job-manager' );
    
    echo 'email . '&su=' . urlencode( $apply->subject ) .'" target="_blank" class="job_application_email">Gmail / ';
    
    echo 'email . '&subject=' . urlencode( $apply->subject ) .'" target="_blank" class="job_application_email">AOL / ';
    
    echo 'email . '&subject=' . urlencode( $apply->subject ) .'" target="_blank" class="job_application_email">Yahoo / ';
    
    echo 'email . '&subject=' . urlencode( $apply->subject ) .'" target="_blank" class="job_application_email">Outlook';
    
    echo '</p>';
    
    break;
    case 'url' :
    echo '<p>' . sprintf( __( 'To apply for this job please visit the following URL: %1$s ?', 'wp-job-manager' ), $apply->url ) . '</p>';
    break;
    }
    ?>
    </div>
    </div>
    <?php endif; ?>

    Let me know if it works.

  • CS_Team

    Hi Sally,

    I think I've put " when I should have put '

    Try this one

    <?php if ( $apply = get_the_job_application_method() ) :
    wp_enqueue_script( 'wp-job-manager-job-application' );
    ?>
    <div class="application">
    
    <?php
    if(current_user_level(4))
    {
    echo '<input class="application_button" type="button" value="<?php _e( 'Contact this owner', 'wp-job-manager' ); ?>" />';
    }
    else
    {
    echo 'You must upgrade to Advanced business membership to view the owners details';
    }
    ?>
    
    <div class="application_details">
    <?php
    switch ( $apply->type ) {
    case 'email' :
    
    echo '<p>' . sprintf( __( 'To contact this owner email your details to %1$s', 'wp-job-manager' ), $apply->email, '?subject=' . rawurlencode( $apply->subject ) ) . '</p>';
    
    echo '<p>' . __( 'Apply using webmail: ', 'wp-job-manager' );
    
    echo 'email . '&su=' . urlencode( $apply->subject ) .'" target="_blank" class="job_application_email">Gmail / ';
    
    echo 'email . '&subject=' . urlencode( $apply->subject ) .'" target="_blank" class="job_application_email">AOL / ';
    
    echo 'email . '&subject=' . urlencode( $apply->subject ) .'" target="_blank" class="job_application_email">Yahoo / ';
    
    echo 'email . '&subject=' . urlencode( $apply->subject ) .'" target="_blank" class="job_application_email">Outlook';
    
    echo '</p>';
    
    break;
    case 'url' :
    echo '<p>' . sprintf( __( 'To apply for this job please visit the following URL: %1$s ?', 'wp-job-manager' ), $apply->url ) . '</p>';
    break;
    }
    ?>
    </div>
    </div>
    <?php endif; ?>
  • Sally

    Hi

    I've tried that, but still seem to be getting black text.

    One thing I've noticed, it's level 3 I want to show this to, just not the others (the code there is saying level 4), but the only shortcodes I can find relating to this are [level-advanced-business-users] and
    [not-level-advanced-business-users]

    Should I be using these here? Also, shouldn't some code go both above and below the button code? This stuff completely stumps me!

    Thanks

    Sally

  • CS_Team

    Hi Sally,

    I obviously am doing something wrong on line 9. I have found it's always something simple but it's trying to spot it.

    I put the ID as 4 as I am using the method nearer the bottom of the other post.
    These [level-advanced-business-users] are shortcodes, easy to use inside pages and posts but on the other topic the user had issues when putting them inside a template file, so I thought maybe the method further down would work although they never replied to say if it did.

    I have edited the code above, do you want to try again, if it doesn't work maybe the professionals may be able to help you.

  • CS_Team

    Sorry Sally it won't let me edit the last post once someone has replied, here is my latest attempt:

    This one uses the second method on the other post:

    <?php if ( $apply = get_the_job_application_method() ) :
    wp_enqueue_script( 'wp-job-manager-job-application' );
    ?>
    <div class="application">
    
    <?php
    if (current_user_level(3))
    {
    echo "<input class="application_button" type="button" value="<?php _e( 'Contact this owner', 'wp-job-manager' ); ?>" />";
    }
    else
    {
    echo "You must upgrade to Advanced business membership to view the owners details";
    }
    ?>
    
    <div class="application_details">
    <?php
    switch ( $apply->type ) {
    case 'email' :
    
    echo '<p>' . sprintf( __( 'To contact this owner email your details to %1$s', 'wp-job-manager' ), $apply->email, '?subject=' . rawurlencode( $apply->subject ) ) . '</p>';
    
    echo '<p>' . __( 'Apply using webmail: ', 'wp-job-manager' );
    
    echo 'email . '&su=' . urlencode( $apply->subject ) .'" target="_blank" class="job_application_email">Gmail / ';
    
    echo 'email . '&subject=' . urlencode( $apply->subject ) .'" target="_blank" class="job_application_email">AOL / ';
    
    echo 'email . '&subject=' . urlencode( $apply->subject ) .'" target="_blank" class="job_application_email">Yahoo / ';
    
    echo 'email . '&subject=' . urlencode( $apply->subject ) .'" target="_blank" class="job_application_email">Outlook';
    
    echo '</p>';
    
    break;
    case 'url' :
    echo '<p>' . sprintf( __( 'To apply for this job please visit the following URL: %1$s ?', 'wp-job-manager' ), $apply->url ) . '</p>';
    break;
    }
    ?>
    </div>
    </div>
    <?php endif; ?>

    This one uses the shortcode method:

    <?php if ( $apply = get_the_job_application_method() ) :
    wp_enqueue_script( 'wp-job-manager-job-application' );
    ?>
    <div class="application">
    <?php echo do_shortcode('[level-advanced-business-users]'); ?> <input class="application_button" type="button" value="<?php _e( 'Contact this owner', 'wp-job-manager' ); ?>" /> <?php echo do_shortcode('[/level-advanced-business-users]'); ?>
    
    <div class="application_details">
    <?php
    switch ( $apply->type ) {
    case 'email' :
    
    echo '<p>' . sprintf( __( 'To contact this owner email your details to %1$s', 'wp-job-manager' ), $apply->email, '?subject=' . rawurlencode( $apply->subject ) ) . '</p>';
    
    echo '<p>' . __( 'Apply using webmail: ', 'wp-job-manager' );
    
    echo 'email . '&su=' . urlencode( $apply->subject ) .'" target="_blank" class="job_application_email">Gmail / ';
    
    echo 'email . '&subject=' . urlencode( $apply->subject ) .'" target="_blank" class="job_application_email">AOL / ';
    
    echo 'email . '&subject=' . urlencode( $apply->subject ) .'" target="_blank" class="job_application_email">Yahoo / ';
    
    echo 'email . '&subject=' . urlencode( $apply->subject ) .'" target="_blank" class="job_application_email">Outlook';
    
    echo '</p>';
    
    break;
    case 'url' :
    echo '<p>' . sprintf( __( 'To apply for this job please visit the following URL: %1$s ?', 'wp-job-manager' ), $apply->url ) . '</p>';
    break;
    }
    ?>
    </div>
    </div>
    <?php endif; ?>
  • PC

    Hey there Sally,

    Thanks for posting back. Sorry for the delay over the weekend as I had a few things to take care of.

    Thanks for the backup @CS_Team (Points coming)

    Sally, can you kindly send me a copy of your plugin so that I can break and test that on my lab site and see if I can put the thing together ?

    email it to contact [at] wpmudev [dot] org

    Subject : Attn: PC

    Cheers, PC

  • CS_Team

    Hi both,

    Sally in the shortcode method I pasted above you said you had an error on line 16.

    It looks like they have ended lines 16,19,21 & 23 with a ' when it should be a "

    PC does that look like it may work?

    <?php if ( $apply = get_the_job_application_method() ) :
    wp_enqueue_script( 'wp-job-manager-job-application' );
    ?>
    <div class="application">
    <?php echo do_shortcode('[level-advanced-business-users]'); ?> <input class="application_button" type="button" value="<?php _e( 'Contact this owner', 'wp-job-manager' ); ?>" /> <?php echo do_shortcode('[/level-advanced-business-users]'); ?>
    
    <div class="application_details">
    <?php
    switch ( $apply->type ) {
    case 'email' :
    
    echo '<p>' . sprintf( __( 'To contact this owner email your details to %1$s', 'wp-job-manager' ), $apply->email, '?subject=' . rawurlencode( $apply->subject ) ) . '</p>';
    
    echo '<p>' . __( 'Apply using webmail: ', 'wp-job-manager' );
    
    echo 'email . '&su=' . urlencode( $apply->subject ) .'" target="_blank" class="job_application_email">Gmail / ";
    
    echo 'email . '&subject=' . urlencode( $apply->subject ) .'" target="_blank" class="job_application_email">AOL / ";
    
    echo 'email . '&subject=' . urlencode( $apply->subject ) .'" target="_blank" class="job_application_email">Yahoo / ";
    
    echo 'email . '&subject=' . urlencode( $apply->subject ) .'" target="_blank" class="job_application_email">Outlook";
    
    echo '</p>';
    
    break;
    case 'url' :
    echo '<p>' . sprintf( __( 'To apply for this job please visit the following URL: %1$s ?', 'wp-job-manager' ), $apply->url ) . '</p>';
    break;
    }
    ?>
    </div>
    </div>
    <?php endif; ?>
  • CS_Team

    Hi Sally,

    You can see this is one of those situations I would just keep trial and error if it was my site.

    You can try this one if you like, I just don't want to waste your time if you'd like me to stop trying and wait for PC just let me know.

    <?php if ( $apply = get_the_job_application_method() ) :
    wp_enqueue_script( 'wp-job-manager-job-application' );
    ?>
    <div class="application">
    <?php echo do_shortcode('[level-advanced-business-users]'); ?> <input class="application_button" type="button" value="<?php _e( 'Contact this owner', 'wp-job-manager' ); ?>" /> <?php echo do_shortcode('[/level-advanced-business-users]'); ?>
    
    <div class="application_details">
    <?php
    switch ( $apply->type ) {
    case 'email' :
    
    echo '<p>' . sprintf( __( 'To contact this owner email your details to %1$s', 'wp-job-manager' ), $apply->email, '?subject=' . rawurlencode( $apply->subject ) ) . '</p>';
    
    echo '<p>' . __( 'Apply using webmail: ', 'wp-job-manager' );
    
    echo 'email . '&su=' . urlencode( $apply->subject ) .'' target="_blank" class="job_application_email">Gmail / ';
    
    echo 'email . '&subject=' . urlencode( $apply->subject ) .'' target="_blank" class="job_application_email">AOL / ';
    
    echo 'email . '&subject=' . urlencode( $apply->subject ) .'' target="_blank" class="job_application_email">Yahoo / ';
    
    echo 'email . '&subject=' . urlencode( $apply->subject ) .'' target="_blank" class="job_application_email">Outlook';
    
    echo '</p>';
    
    break;
    case 'url' :
    echo '<p>' . sprintf( __( 'To apply for this job please visit the following URL: %1$s ?', 'wp-job-manager' ), $apply->url ) . '</p>';
    break;
    }
    ?>
    </div>
    </div>
    <?php endif; ?>
  • Sally

    Hi @CS_Team

    Hey, completely the opposite - I don't want to be wasting your time! I'm extremely grateful for all the help you're trying to give me and fully appreciate every attempt!

    Having said that, the latest code results in this;

    Parse error: syntax error, unexpected '=', expecting ',' or ';' in /home/rrokngem/public_html/******.co.uk/wp-content/themes/bp-fun-child/job_manager/job-application.php on line 16

    I spoke to Jack last night in live chat, who said that the code you gave me really should work, so he said to see what @PC says. I just hope @PC hasn't forgotten!

    I do also have an issue in my functions.php in my child theme according to @Jack Kitterhing which is causing a problem elsewhere - I wonder whether this could also be causing this not to work?

    Jack says he's going to take a look at my functions.php today so hopefully at some point we will get to the bottom of this!

    Thanks again for all your fantastic help!

    Sally

  • CS_Team

    Thanks Sally,

    Happy to help, I would like to think one day I could build my points up to a free membership but everyone is so fast to reply to threads and as I am still new to it to I don't want to go helping users and pointing them in the wrong direction.

    The error says it wasn't expecting an = sign, I'm not sure if this is the first one next to su or the one next to target. Is there a chance you copied the original code wrong in your post as I am surprised line 16 isn't subject= like the ones below as this would follow the pattern instead of su=

    Try this one where I have changed su to subject.

    Regards

    Kenn

    <?php if ( $apply = get_the_job_application_method() ) :
    wp_enqueue_script( 'wp-job-manager-job-application' );
    ?>
    <div class="application">
    <?php echo do_shortcode('[level-advanced-business-users]'); ?> <input class="application_button" type="button" value="<?php _e( 'Contact this owner', 'wp-job-manager' ); ?>" /> <?php echo do_shortcode('[/level-advanced-business-users]'); ?>
    
    <div class="application_details">
    <?php
    switch ( $apply->type ) {
    case 'email' :
    
    echo '<p>' . sprintf( __( 'To contact this owner email your details to %1$s', 'wp-job-manager' ), $apply->email, '?subject=' . rawurlencode( $apply->subject ) ) . '</p>';
    
    echo '<p>' . __( 'Apply using webmail: ', 'wp-job-manager' );
    
    echo 'email . '&subject=' . urlencode( $apply->subject ) .'"target="_blank" class="job_application_email">Gmail / ";
    
    echo 'email . '&subject=' . urlencode( $apply->subject ) .'"target="_blank" class="job_application_email">AOL / ";
    
    echo 'email . '&subject=' . urlencode( $apply->subject ) .'"target="_blank" class="job_application_email">Yahoo / ";
    
    echo 'email . '&subject=' . urlencode( $apply->subject ) .'"target="_blank" class="job_application_email">Outlook";
    
    echo '</p>';
    
    break;
    case 'url' :
    echo '<p>' . sprintf( __( 'To apply for this job please visit the following URL: %1$s ?', 'wp-job-manager' ), $apply->url ) . '</p>';
    break;
    }
    ?>
    </div>
    </div>
    <?php endif; ?>
  • Sally

    Hi Kenn

    Here is a copy of the original copied just now from my original job-application.php in the original plugin folder;

    <?php if ( $apply = get_the_job_application_method() ) :
    wp_enqueue_script( 'wp-job-manager-job-application' );
    ?>
    <div class="application">
    <input class="application_button" type="button" value="<?php _e( 'Apply for job', 'wp-job-manager' ); ?>" />

    <div class="application_details">
    <?php
    switch ( $apply->type ) {
    case 'email' :

    echo '<p>' . sprintf( __( 'To apply for this job email your details to %1$s', 'wp-job-manager' ), $apply->email, '?subject=' . rawurlencode( $apply->subject ) ) . '</p>';

    echo '<p>' . __( 'Apply using webmail: ', 'wp-job-manager' );

    echo 'email . '&su=' . urlencode( $apply->subject ) .'" target="_blank" class="job_application_email">Gmail / ';

    echo 'email . '&subject=' . urlencode( $apply->subject ) .'" target="_blank" class="job_application_email">AOL / ';

    echo 'email . '&subject=' . urlencode( $apply->subject ) .'" target="_blank" class="job_application_email">Yahoo / ';

    echo 'email . '&subject=' . urlencode( $apply->subject ) .'" target="_blank" class="job_application_email">Outlook';

    echo '</p>';

    break;
    case 'url' :
    echo '<p>' . sprintf( __( 'To apply for this job please visit the following URL: %1$s ?', 'wp-job-manager' ), $apply->url ) . '</p>';
    break;
    }
    ?>
    </div>
    </div>
    <?php endif; ?>

    Sorry, I'm not sure how you do it in that white block?

    I've just tried the latest code you gave me and got

    Parse error: syntax error, unexpected '=', expecting ',' or ';' in /home/rrokngem/public_html/******.co.uk/wp-content/themes/bp-fun-child/job_manager/job-application.php on line 16

    I was hoping to ask in the live chat whether @PC was around or whether they could shed some light on this themselves, but no one turned up for live chat Would have been ideal as it was a plugins and code session, but no live chat I can ask in now until later, and at the time I have to collect the kids up from school! Aggh!

    Sorry, taking up so much of your time with this

  • CS_Team

    Hi Sally,

    Can you restore the original code so I can see how the button is supposed to appear?

    I'm pretty sure that the original code is wrong and that su should be subject. Once I can see the button I can look at the code and see if helps diagnose where I'm going wrong.

    To paste code in a white block use the code button above the box when typing a reply.
    Press it once at the beginning of the code and once at the end and it will put it in the white box.

  • Sally

    Sorry, have just learnt how to insert code properly into this post (perhaps it got damaged somehow by not posting the original in the white box?) So here is the original code without any modifications and in a white box

    <?php if ( $apply = get_the_job_application_method() ) :
    	wp_enqueue_script( 'wp-job-manager-job-application' );
    	?>
    	<div class="application">
    		<input class="application_button" type="button" value="<?php _e( 'Apply for job', 'wp-job-manager' ); ?>" />
    
    		<div class="application_details">
    			<?php
    				switch ( $apply->type ) {
    					case 'email' :
    
    						echo '<p>' . sprintf( __( 'To apply for this job <strong>email your details to</strong> <a class="job_application_email" href="mailto:%1$s%2$s">%1$s</a>', 'wp-job-manager' ), $apply->email, '?subject=' . rawurlencode( $apply->subject ) ) . '</p>';
    
    						echo '<p>' . __( 'Apply using webmail: ', 'wp-job-manager' );
    
    						echo '<a href="' . 'https://mail.google.com/mail/?view=cm&fs=1&to=' . $apply->email . '&su=' . urlencode( $apply->subject ) .'" target="_blank" class="job_application_email">Gmail</a> / ';
    
    						echo '<a href="' . 'http://webmail.aol.com/Mail/ComposeMessage.aspx?to=' . $apply->email . '&subject=' . urlencode( $apply->subject ) .'" target="_blank" class="job_application_email">AOL</a> / ';
    
    						echo '<a href="' . 'http://compose.mail.yahoo.com/?to=' . $apply->email . '&subject=' . urlencode( $apply->subject ) .'" target="_blank" class="job_application_email">Yahoo</a> / ';
    
    						echo '<a href="' . 'http://mail.live.com/mail/EditMessageLight.aspx?n=&to=' . $apply->email . '&subject=' . urlencode( $apply->subject ) .'" target="_blank" class="job_application_email">Outlook</a>';
    
    						echo '</p>';
    
    					break;
    					case 'url' :
    						echo '<p>' . sprintf( __( 'To apply for this job please visit the following URL: <a href="%1$s">%1$s &rarr;</a>', 'wp-job-manager' ), $apply->url ) . '</p>';
    					break;
    				}
    			?>
    		</div>
    	</div>
    <?php endif; ?>
  • CS_Team

    Hi Sally,

    I know it's a good feature to automatically open gmail, aol, yahoo or outlook,

    But you could remove those lines if you wanted and the mailto: command would still work on the email address and open the default email client on the users computer?

    <?php if ( $apply = get_the_job_application_method() ) :
    wp_enqueue_script( 'wp-job-manager-job-application' );
    ?>
    <div class="application">
    <?php echo do_shortcode('[level-advanced-business-users]'); ?> <input class="application_button" type="button" value="<?php _e( 'Contact this owner', 'wp-job-manager' ); ?>" /> <?php echo do_shortcode('[/level-advanced-business-users]'); ?>
    
    <div class="application_details">
    <?php
    switch ( $apply->type ) {
    case 'email' :
    
    echo '<p>' . sprintf( __( 'To contact this owner email your details to %1$s', 'wp-job-manager' ), $apply->email, '?subject=' . rawurlencode( $apply->subject ) ) . '</p>';
    
    echo '</p>';
    
    break;
    case 'url' :
    echo '<p>' . sprintf( __( 'To apply for this job please visit the following URL: %1$s ?', 'wp-job-manager' ), $apply->url ) . '</p>';
    break;
    }
    ?>
    </div>
    </div>
    <?php endif; ?>
  • Sally

    That's fine, I don't mind if the Yahoo/Outlook links go at all

    Ideally, I would have liked a contact form which would go to the poster rather than the posters email address being displayed at all, but beggers can't be choosers at the moment I suppose. At least the only people who are going to see this email address are advanced users who've paid a subscription fee to do so, so hopefully that will protect the email address enough for the time being.

    One day, I'd like to be able to afford to pay someone to make me a better solution where posters requesting dog services can post a pic of their dog too

  • CS_Team

    Try this one, I think this may work now we have all the original code.

    <?php if ( $apply = get_the_job_application_method() ) :
    	wp_enqueue_script( 'wp-job-manager-job-application' );
    	?>
    	<div class="application">
    		<?php echo do_shortcode('[level-advanced-business-users]'); ?><input class="application_button" type="button" value="<?php _e( 'Apply for job', 'wp-job-manager' ); ?>" /><?php echo do_shortcode('[/level-advanced-business-users]'); ?>
    
    		<div class="application_details">
    			<?php
    				switch ( $apply->type ) {
    					case 'email' :
    
    						echo '<p>' . sprintf( __( 'To apply for this job <strong>email your details to</strong> <a class="job_application_email" href="mailto:%1$s%2$s">%1$s</a>', 'wp-job-manager' ), $apply->email, '?subject=' . rawurlencode( $apply->subject ) ) . '</p>';
    
    						echo '<p>' . __( 'Apply using webmail: ', 'wp-job-manager' );
    
    						echo '<a href="' . 'https://mail.google.com/mail/?view=cm&fs=1&to=' . $apply->email . '&su=' . urlencode( $apply->subject ) .'" target="_blank" class="job_application_email">Gmail</a> / ';
    
    						echo '<a href="' . 'http://webmail.aol.com/Mail/ComposeMessage.aspx?to=' . $apply->email . '&subject=' . urlencode( $apply->subject ) .'" target="_blank" class="job_application_email">AOL</a> / ';
    
    						echo '<a href="' . 'http://compose.mail.yahoo.com/?to=' . $apply->email . '&subject=' . urlencode( $apply->subject ) .'" target="_blank" class="job_application_email">Yahoo</a> / ';
    
    						echo '<a href="' . 'http://mail.live.com/mail/EditMessageLight.aspx?n=&to=' . $apply->email . '&subject=' . urlencode( $apply->subject ) .'" target="_blank" class="job_application_email">Outlook</a>';
    
    						echo '</p>';
    
    					break;
    					case 'url' :
    						echo '<p>' . sprintf( __( 'To apply for this job please visit the following URL: <a href="%1$s">%1$s &rarr;</a>', 'wp-job-manager' ), $apply->url ) . '</p>';
    					break;
    				}
    			?>
    		</div>
    	</div>
    <?php endif; ?>
  • CS_Team

    This is the problem the other user described in the other post.

    If we go back to the second method on the other post that may work now we have the full code. Try this one. It's not displaying quite right in my text editor but worth a try.

    <?php if ( $apply = get_the_job_application_method() ) :
    	wp_enqueue_script( 'wp-job-manager-job-application' );
    	?>
    	<div class="application">
    
    <?php
    if(current_user_level(4))
    {
    echo "<input class="application_button" type="button" value="<?php _e( 'Contact this owner', 'wp-job-manager' ); ?>" />";
    }
    else
    {
    echo "You must upgrade to Advanced business membership to view the owners details";
    }
    ?>
    
    		<div class="application_details">
    			<?php
    				switch ( $apply->type ) {
    					case 'email' :
    
    						echo '<p>' . sprintf( __( 'To apply for this job <strong>email your details to</strong> <a class="job_application_email" href="mailto:%1$s%2$s">%1$s</a>', 'wp-job-manager' ), $apply->email, '?subject=' . rawurlencode( $apply->subject ) ) . '</p>';
    
    						echo '<p>' . __( 'Apply using webmail: ', 'wp-job-manager' );
    
    						echo '<a href="' . 'https://mail.google.com/mail/?view=cm&fs=1&to=' . $apply->email . '&su=' . urlencode( $apply->subject ) .'" target="_blank" class="job_application_email">Gmail</a> / ';
    
    						echo '<a href="' . 'http://webmail.aol.com/Mail/ComposeMessage.aspx?to=' . $apply->email . '&subject=' . urlencode( $apply->subject ) .'" target="_blank" class="job_application_email">AOL</a> / ';
    
    						echo '<a href="' . 'http://compose.mail.yahoo.com/?to=' . $apply->email . '&subject=' . urlencode( $apply->subject ) .'" target="_blank" class="job_application_email">Yahoo</a> / ';
    
    						echo '<a href="' . 'http://mail.live.com/mail/EditMessageLight.aspx?n=&to=' . $apply->email . '&subject=' . urlencode( $apply->subject ) .'" target="_blank" class="job_application_email">Outlook</a>';
    
    						echo '</p>';
    
    					break;
    					case 'url' :
    						echo '<p>' . sprintf( __( 'To apply for this job please visit the following URL: <a href="%1$s">%1$s &rarr;</a>', 'wp-job-manager' ), $apply->url ) . '</p>';
    					break;
    				}
    			?>
    		</div>
    	</div>
    <?php endif; ?>
  • CS_Team

    This part on line 9 just calls the text for the button <?php _e( 'Contact this owner', 'wp-job-manager' ); ?> Apply for job

    I have typed that in instead to hopefully avoid my error.

    Let me know.

    Regards

    Kenn

    <?php if ( $apply = get_the_job_application_method() ) :
    	wp_enqueue_script( 'wp-job-manager-job-application' );
    	?>
    	<div class="application">
    
    <?php
    if(current_user_level(4))
    {
    echo "<input class="application_button" type="button" value="Apply for job" />";
    }
    else
    {
    echo "You must upgrade to Advanced business membership to view the owners details";
    }
    ?>
    
    		<div class="application_details">
    			<?php
    				switch ( $apply->type ) {
    					case 'email' :
    
    						echo '<p>' . sprintf( __( 'To apply for this job <strong>email your details to</strong> <a class="job_application_email" href="mailto:%1$s%2$s">%1$s</a>', 'wp-job-manager' ), $apply->email, '?subject=' . rawurlencode( $apply->subject ) ) . '</p>';
    
    						echo '<p>' . __( 'Apply using webmail: ', 'wp-job-manager' );
    
    						echo '<a href="' . 'https://mail.google.com/mail/?view=cm&fs=1&to=' . $apply->email . '&su=' . urlencode( $apply->subject ) .'" target="_blank" class="job_application_email">Gmail</a> / ';
    
    						echo '<a href="' . 'http://webmail.aol.com/Mail/ComposeMessage.aspx?to=' . $apply->email . '&subject=' . urlencode( $apply->subject ) .'" target="_blank" class="job_application_email">AOL</a> / ';
    
    						echo '<a href="' . 'http://compose.mail.yahoo.com/?to=' . $apply->email . '&subject=' . urlencode( $apply->subject ) .'" target="_blank" class="job_application_email">Yahoo</a> / ';
    
    						echo '<a href="' . 'http://mail.live.com/mail/EditMessageLight.aspx?n=&to=' . $apply->email . '&subject=' . urlencode( $apply->subject ) .'" target="_blank" class="job_application_email">Outlook</a>';
    
    						echo '</p>';
    
    					break;
    					case 'url' :
    						echo '<p>' . sprintf( __( 'To apply for this job please visit the following URL: <a href="%1$s">%1$s &rarr;</a>', 'wp-job-manager' ), $apply->url ) . '</p>';
    					break;
    				}
    			?>
    		</div>
    	</div>
    <?php endif; ?>
  • CS_Team

    Reading another post it could be because I used double instead of single quotes.
    http://stackoverflow.com/questions/7940593/php-error-syntax-error-unexpected-t-string-expecting-or

    <?php if ( $apply = get_the_job_application_method() ) :
    	wp_enqueue_script( 'wp-job-manager-job-application' );
    	?>
    	<div class="application">
    
    <?php
    if(current_user_on_level(3))
    {
    echo '<input class="application_button" type="button" value="Apply for job" />';
    }
    else
    {
    echo 'You must upgrade to Advanced business membership to view the owners details';
    }
    ?>
    
    		<div class="application_details">
    			<?php
    				switch ( $apply->type ) {
    					case 'email' :
    
    						echo '<p>' . sprintf( __( 'To apply for this job <strong>email your details to</strong> <a class="job_application_email" href="mailto:%1$s%2$s">%1$s</a>', 'wp-job-manager' ), $apply->email, '?subject=' . rawurlencode( $apply->subject ) ) . '</p>';
    
    						echo '<p>' . __( 'Apply using webmail: ', 'wp-job-manager' );
    
    						echo '<a href="' . 'https://mail.google.com/mail/?view=cm&fs=1&to=' . $apply->email . '&su=' . urlencode( $apply->subject ) .'" target="_blank" class="job_application_email">Gmail</a> / ';
    
    						echo '<a href="' . 'http://webmail.aol.com/Mail/ComposeMessage.aspx?to=' . $apply->email . '&subject=' . urlencode( $apply->subject ) .'" target="_blank" class="job_application_email">AOL</a> / ';
    
    						echo '<a href="' . 'http://compose.mail.yahoo.com/?to=' . $apply->email . '&subject=' . urlencode( $apply->subject ) .'" target="_blank" class="job_application_email">Yahoo</a> / ';
    
    						echo '<a href="' . 'http://mail.live.com/mail/EditMessageLight.aspx?n=&to=' . $apply->email . '&subject=' . urlencode( $apply->subject ) .'" target="_blank" class="job_application_email">Outlook</a>';
    
    						echo '</p>';
    
    					break;
    					case 'url' :
    						echo '<p>' . sprintf( __( 'To apply for this job please visit the following URL: <a href="%1$s">%1$s &rarr;</a>', 'wp-job-manager' ), $apply->url ) . '</p>';
    					break;
    				}
    			?>
    		</div>
    	</div>
    <?php endif; ?>
  • Sally

    OMG Kenn, I think you've done it!!

    Thank you!!!!!

    Hurray!!

    A couple more things (if you don't mind me asking!)

    Do you reckon you know how to create a bit of space between the end of the posters text and the button (or the alternative text). It's displaying a little bit squashed up towards the main body of text at the moment if you can see what I mean?

    Also, to make this text bold and to make it show a link to upgrade to advanced membership, should I do the following to the original replacement text?

    <b>You must upgrade to Advanced business membership to view the owners details<b>

    Don't want to mess up anything you've done by doing it wrong at this stage!

    Thank you again!!

    Will send you some points for helping!!

  • CS_Team

    I was checking your example page and could see it change so was hoping it was working for you.

    You don't want <b> you want <strong> and don't forget you need to add the / when closing a section of code so </strong> at the end. If you inspect a bold part of your site in Firebug or if in chrome inspect element you will see the pattern.

    For a link you can get the code from an existing link on your site and just edit it. Or as your using wordpress create the link/text in a post to look how you want and then go to the text view and copy the code where you want it to appear in your template.

    To get the result you want change line 13 between the ' marks to:

    <p><strong>You must <a href="paste your link here">upgrade to Advanced business membership</a> to view the owners details</strong>

    Glad it works for you. Maybe worth emailing @PC to let him know he doesn't need to test it now?

    Regards

    Kenn