AH! okay... that explains it. I was wondering what was going on... Again, porting 2 Mods to 3 won't work (for obvious reasons demonstrated so nicely above. ) I know you can write up the code from scratch, just use theirs as a template of ideas. -- That's basically what I did with yours to achieve what I posted above in the example. -- but don't use their coding techniques... you can bet that 90% of it is going to be using incorrect methods.
Okay, I've finally got it working perfectly in "viewprofile". But I'm having trouble with "viewtopic". See, I'm supposed to call this "functions_karma.php" file:
// Posts are stored in the $rowset array while $attach_list, $user_cache // and the global bbcode_bitfield are built while ($row = $db->sql_fetchrow($result)) {
(taken straight from viewtopic.php)
Now, unfortunately, calling the "grab_karma_rank" function anywhere after the "{" makes the karma be the karma of one of the posters (don't know which one), but it repeats that karma on the whole topic. See for yourselves.
Now, how do I fix that? What variable should I use? Also, I've tried using the following, but it doesn't work either:
Doesn't solve it, at least, not where I put it, but HoL has given me another suggestion:
basically, look in viewtopic at the way it's pulling and displaying the custom profile fields, you'll want to call it about the same way, it's using classes, so you would need something like: include_once($phpbb_root_path . 'includes/functions_karma.' . $phpEx); $karma = new karma_rank(); $karma_level_cache = $karma->grab_karma_rank($target['karma'], $target['user_type']); Though that is a very rudimentary example, I'm hoping it will steer you in the right direction.
Remember, it's using cache for the viewtopic, so see how you can utilize that, and include a functions file that would do that it instead of modifying any of the core code.
Hi guys, I've been trying to get this to work for viewtopic, but I just can't figure out how to make it work like (custom) profile fields. Once again, the best I can get is either the last person who posted, or the topic starter.
Edit: I'm in despair: Parse error: syntax error, unexpected '{' in /home.8/a/r/p/arpia/www/phpBB3/includes/functions_karma_p.php on line 3