Trouble with user location in profil
#1
Hello there,

I've a small bug in ABP User Map: when going on an user (viewing the user map) profil, I see "unknown location" but in online.php I well see "watching User Map".

Here is how I do my WOL:
$plugins->add_hook('fetch_wol_activity_end', 'abp_umap_wol');
$plugins->add_hook('build_friendly_wol_location_end', 'abp_umap_build_wol');
function abp_umap_wol(&$user_activity) {
    global $user, $mybb;
    if (my_strpos($user['location'], 'abp_umap') !== false) {
        $user_activity['activity'] = 'Usermap';
    }
	return $user_activity;
}
function abp_umap_build_wol(&$plugin_array) {
    global $lang;
    if ($plugin_array['user_activity']['activity'] == 'Usermap') {
        $lang->load(CN_ABPUMAP);
        $plugin_array['location_name'] = $lang->sprintf($lang->abp_umap_wol, 'misc.php?action=abp_umap');
    }
	return $plugin_array;
}
Did I miss something to have it working on member profil ?
Tchat en français
Do not ask me help through PM or Discord

Reply
#2
Ok, error found. I was using $user['location'] but the real name is $user_activity['activity'].
Sometimes typing to quick Big Grin
Tchat en français
Do not ask me help through PM or Discord

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)