How to make a logged in and logged out php link?


I am using shortcode exec php plugin to make a menu. Patrick was kind and helped me put together a link that only showed when the user was logged in.

I now want to change this slightly and have the menu link take you to the login page if you are not logged in and if you are it take you to the correct link.

Heres what I had in mind but it doesnt work :S

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

echo ‘<a href=”‘;

echo (bp_loggedin_user_domain() . “classifieds/my-classifieds”:wink:;

echo ‘”>My Broadcasts’;


echo ‘<a href=”;;

<?php endif; ?>

I am close right?

Kind Regards