Jump to content
Sign in to follow this  
Guest Kenn

Contact Form only for logged in users

Recommended Posts

Guest Kenn

Good evening,

 

I would like to restrict the contact form so that only registered/logged in users can contact the sellers, this also helps prevent them suffering from spam. I'm pretty sure the amendment has to go into:

\Components\com_jomestate\views\homepage\tmpl\_detailed.tpl.php

 

around line 258 below {*CONTACT*}

 

Would you be able to offer any assistance?

Share this post


Link to post
Share on other sites
Guest Kenn

My understanding is this would be the usual code

<?php

$user = JFactory::getUser();

$status = $user->guest;

 

if($status == 1){

//do user logged out stuff

}

else

{

//do user logged in stuff

}

?>

 

but I can't figure out how to amend it as you wrap all your if statements etc in {'s and with {/if} to close

 

Hope you can help me amend the above.

Share this post


Link to post
Share on other sites
Guest Kenn

Figured it out if anyone else needs this

 

 

{$user = JFactory::getUser()}

{$status = $user->guest}

 

{if $status==guest}

 

Add content for logged in user

 

{else}

 

Add content for non logged in user

 

{/if}

Share this post


Link to post
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.   Paste as plain text instead

  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...
Sign in to follow this  

×
×
  • Create New...