News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Profiles on who's online list

Started by asmith, May 04, 2014, 12:32:00 AM

Previous topic - Next topic

asmith

Hello,

SMF 2.0.7
Who.php, line 352:

Quote
         // Viewing/editing a profile.
         if ($actions['action'] == 'profile')
         {
            // Whose?  Their own?
            if (empty($actions['u']))
               $actions['u'] = $url[1];

            $data[$k] = $txt['who_hidden'];
            $profile_ids[(int) $actions['u']][$k] = $actions['action'] == 'profile' ? $txt['who_viewprofile'] : $txt['who_profile'];
         }

The first if statement we have $actions['action'] == 'profile', but then again on the last line of the block we have shorthand of the same condition.

I had to review all SMF codes and I went back to SMF 2.0 RC1, same thing there too. So went back even more to my old SMF archive and looked up 1.1.6 and the if statement there has an extra condition:


// Viewing/editing a profile.
if ($actions['action'] == 'profile' || $actions['action'] == 'profile2')


That is because in SMF 1, profile2() was in charge of saving profile data. But there's no profile2 on SMF 2 because of its more advanced profile system.

Anyway, the correct line must be probably something like this:

Quote// Viewing/editing a profile.
         if ($actions['action'] == 'profile')
         {
            // Whose?  Their own?
            if (empty($actions['u']))
               $actions['u'] = $url[1];

            $data[$k] = $txt['who_hidden'];
            $profile_ids[(int) $actions['u']][$k] = !isset($actions['save']) ? $txt['who_viewprofile'] : $txt['who_profile'];
         }

Advertisement: