Customizing SMF > SMF Coding Discussion

Using Information from the Profile, elsewhere...

(1/1)

ninth:
Hi,

Well first off; great board! I love it, so many things you can customize.

Now, what I want to do is take a users 'Post Count' , 'Position' and 'Karma' (which is displayed in someone's profile) and put it in my index template.

Now I got the 'Post Count' to work, by changing my Load.php:


--- Code: ---// Set up the contextual user array.
$context['user'] = array(
'id' => &$ID_MEMBER,
'is_logged' => !$user_info['is_guest'],
'is_guest' => &$user_info['is_guest'],
'is_admin' => &$user_info['is_admin'],
'is_mod' => false,
'username' => &$user_info['username'],
'name' => $user_info['is_guest'] ? $txt[28] : $user_info['name'],
'language' => &$user_info['language'],
'email' => &$user_info['email'],
'posts' => &$user_info['posts']
};
--- End code ---

As you can see, I made $user_info['post'] global. If this is the only way I can do it, fine. But I wanted to see if I can do it the same way my profile template does it, with $context['member']['posts'].

The other two items ("Position" and "Karma") I just can't seem to find where it's coming from, or what to change.

Anyway, here's hoping I don't sound to beginnerish! :)

[Unknown]:
Actually, the function that loads most of the post/profile data is loadMemberData.  Problem is, this is a bit much to load on every page view for the user....

-[Unknown]

Navigation

[0] Message Index

Go to full version