I have installed this module, but I would still need to know how I could implement it in the custimzed user profile page?!

Sorry to bother you...

Comments

sanduhrs’s picture

Assigned: Unassigned » sanduhrs

I assume you are referring to [1].

You may try something like:

foreach($fields['Profile visits'] as $visits) {
  print $visits['value'];
}

In template.php you may define your own themeable function, e.g.

function phptemplate_user_visit($user, $timestamp = NULL) {
  $output  = "<div class=\"profile\">\n";
  $output .= theme('user_picture', $user);
  $output .= ' <div class="name">'. theme('username', $user) ."</div>\n";
  if ($timestamp) {
    $output .= " <div class=\"visit\">". t('!time ago', array('!time' => format_interval(time() - $timestamp))) ."</div>\n";
  }
  $output .= "</div>\n";

  return $output;
}

Be shure you use the latest version from CVS [2].

vg

[1] http://drupal.org/node/35728
[2] http://cvs.drupal.org/viewcvs/drupal/contributions/modules/user_visits/?...

lienty’s picture

Status: Active » Closed (fixed)

fabulous

thank you

Lausch’s picture

(thanks for fixing the latest bug)

the user_profile.tpl.php solution there will also retunr the old bug

Invalid argument supplied for foreach() .........

have also to be updated

greets

Lausch

sanduhrs’s picture

Status: Closed (fixed) » Active

I'll have a look at it.

sanduhrs’s picture

Status: Active » Fixed

Just check, if the array is populated:

if (is_array($fields['Profile visits']  )) {
  foreach($fields['Profile visits'] as $visits) {
    print $visits['value'];
  }
}
Anonymous’s picture

Status: Fixed » Closed (fixed)