RB Agency Interactive registration snippet

This snippet will add a login, registration, profile link.  Great for your website header.  Thanks to Kerry for the idea.

<?php
global $wpdb;
global $current_user;
get_currentuserinfo();
if (is_user_logged_in()) {
	/* Check if the user is regsitered *****************************************/
	$sql = "SELECT ProfileGallery FROM ". table_agency_profile ." WHERE ProfileUserLinked =  ". $current_user->ID ."";
	$results = mysql_query($sql);
	$count = mysql_num_rows($results);
	if ($count > 0) {
	  while ($data = mysql_fetch_array($results)) {
		echo "<a href=\"". rb_agency_PROFILEDIR . $data["ProfileGallery"] ."/\" title=\"View Your Profile\" target=\"_blank\">View Profile</a>\n";
	  } // is there record?
	} else {
		echo "You are not registered.  <a href=\"/profile-member/\">Setup your profile</a>\n";
	}
} else {
	echo "You are not logged in.  <a href=\"/profile-login/\">Log In</a>\n";
}
?>
This entry was posted in RB Agency. Bookmark the permalink.