Hello all,
Just getting into drupal from postnuke and I must say from what I have seen so far, its quite amazing.
I am currently building my own user_profile.tpl.php file and I have come accrosss a few issues.
First one is that I am trying to make the profile display a date field (birthday). There is a snippet code that I tried to use however, I get an unexpected ':' error and I don't really know how to fix it. I can make the error go away, but then it will just display a blank page. Here is the code below:
$date_key = 'profile_expiry_date'; //change the name to the profile date field you are using.
<?php if ((user_access('administer users') || $GLOBALS['user']->uid == $user->uid): ?>
<div class="warning">
<?php $keyMonth = $user->$date_key{month}; ?>
<?php $keyDay = $user->$date_key{day}; ?>
<?php $keyYear = $user->$date_key{year}; ?>
<?php $month = date(F); $mon = date(n); $day = date(j); $year = date(Y); ?>
<?php $hours_left = (mktime(0,0,0,$keyMonth,$keyDay,$keyYear) - time())/3600; ?>
<?php $daysLeft = ceil($hours_left/24); ?>
<?php $z = (string)$daysLeft; ?>
<?php if ($z > 1): ?>
<P>There are <?php print $z ;?> days left until your membership expires with this site</p>
</div>
<?php endif; ?>
Then my other problem is that I am trying to edit the Display Freeform list code to display as an inline list instead of bullet point as well as use commas as seperators. I have been able to take it as far as making it an inline list but as far as the commas, I have either been able to put them in and have them display after the last word (i.e. sports, movies, cooking,) or else they do not show at all. How would I go about editing this snippet to make it the way I am looking for:
$fieldname = 'profile_keywords';
if($user->$fieldname != ""):