I am trying to display a field in our users table on the users profile. The field is "rating" we want the 2-3 digit number to appear next to the gravatar. We have a "Rating" table in our mysql db. I want to display this number on our user profile page. JUST BELOW THE GRAVATAR. here is the code in app/views/user/view.ctp
<div class="nhplft">
<h1 class="nhptitle"><img src="/images/nph_userprofile.png" border="0" alt="User Profile" /></h1>
<?php $session->flash(); ?>
<div class="user_img">
<img src="http://gravatar.com/avatar/<?= md5(strtolower($user["User"]["email"])); ?>?d=identicon&s=100" border="0" alt="My Avatar! UID:<?=$user["User"]["id"] ?>" />
<?php if($logged_in && $logged_in_user["User"]["id"] == $user["User"]["id"]) { ?>
<a href="http://en.gravatar.com/">Change Image</a>
<?php } ?>
</div>
<div class="user_data">
<div class="user_data_title">
<? if($user["User"]["first_name"]==""){ echo $user["User"]["email"]; } else { ?>
<?= $user["User"]["first_name"]; ?> <?= $user["User"]["last_name"]; } ?></div>
<div class="user_nav">
<?= $html->link("Home",'/items'); ?>
<?php if(!$logged_in) { } else { ?> |
<?= $html->link('Add',array('controller' => 'items','action'=>'add')); ?> |
<? } ?>
<?= $html->link('Search',array('controller'=>'items','action'=>'index')); ?>
<?php if(!$logged_in) { } else { ?> |
<?= $html->link("Logout",'/users/logout'); } ?>
</div>
i tried this - assuming its the code thats controlling the username display it should be the same for rating_id?
<div class="user_data">
<div class="user_data_title">
<? if($user["User"]["first_name"]==""){ echo $user["User"]["email"]; } else { ?>
<?= $user["User"]["first_name"]; ?> <?= $user["User"]["last_name"]; } ?></div>
<div class="user_nav">
<? if($user["User"]["first_name"]==""){ echo $user["User"]["rating_id"]; } else { ?>
<?= $user["User"]["first_name"]; ?> <?= $user["User"]["rating_id"]; } ?></div>