Advertisement:

Author Topic: [TRICK] displaying the "unknown action" in the who's online list  (Read 53023 times)

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 55,120
  • Gender: Male
    • Kindred-999 on GitHub
so, you have a bunch of mods installed and 90% of them - while they add functionality to your forum - don't add themselves into the list of valid actions in the Who's Online list.

This little trick won't fix ALL of the problems (it's a quick trick, it doesn't drill down into special actions or sub-actions) but it will, at least, display where the user actually IS in your system.

Code: (find in Sources/Who.php) [Select]
function determineActions($urls, $preferred_prefix = false)
{
  global $txt, $user_info, $modSettings, $smcFunc, $context;

Code: (add after) [Select]
global $scripturl;

Code: (find in Sources/who.php) [Select]
// Unlisted or unknown action.
else
$data[$k] = $txt['who_unknown'];

Code: (replace) [Select]
// Unlisted or unknown action.
else
$data[$k] = $txt['who_thisaction'] . '<a href="' . $scripturl . '?action=' . $actions['action'] . '">' . $actions['action'] . '</a>';

then add the following text string to modifications.YOURLANGUAGE.txt
Code: [Select]
$txt['who_thisaction'] = 'Viewing the ';
« Last Edit: June 25, 2012, 11:45:12 AM by Kindred »
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 55,120
  • Gender: Male
    • Kindred-999 on GitHub
Re: [TRICK] displaying the "unknown action" in the who's online list
« Reply #1 on: January 30, 2012, 10:24:48 PM »
note: I have been playing with the following, but it doesn't quite work....

Code: [Select]
// Unlisted or unknown action.
else {
if (isset($actions['sa'])) {
$extraaction['sa']['text'] = ' - ' . $actions['sa'];
$extraaction['sa']['url'] = ';sa=' . $actions['sa'];
} else {
$extraaction['sa']['text'] = '';
$extraaction['sa']['url'] = '';
}
if (isset($actions['area'])) {
$extraaction['area']['text'] = ' - ' . $actions['area'];
$extraaction['area']['url'] = ';area=' . $actions['area'];
} else {
$extraaction['area']['text'] = '';
$extraaction['area']['url'] = '';
}
if (isset($actions['u'])) {
$extraaction['u']['text'] = ' for User ID' . $actions['u'];
$extraaction['u']['url'] = ';u=' . $actions['u'];
} else {
$extraaction['u']['text'] = '';
$extraaction['u']['url'] = '';
}
if (isset($actions['cat'])) {
$extraaction['cat']['text'] = ' in Category' . $actions['cat'];
$extraaction['cat']['url'] = ';cat=' . $actions['cat'];
} else {
$extraaction['cat']['text'] = '';
$extraaction['cat']['url'] = '';
}

$data[$k] =  'Viewing the <a href="' . $scripturl . '?action=' . $actions['action'] . $extraaction['sa']['url'] . $extraaction['area']['url'] . $extraaction['u']['url'] . $extraaction['cat']['url'] .'">' . $actions['action'] . $extraaction['sa']['text'] . $extraaction['area']['text'] . $extraaction['u']['text'] . $extraaction['cat']['text'] . '</a>';
}

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline Matthew K.

  • SMF Super Hero
  • *******
  • Posts: 12,430
  • Gender: Male
    • matthew.kerle on Facebook
    • @matthew_kerle on Twitter
Re: [TRICK] displaying the "unknown action" in the who's online list
« Reply #2 on: January 30, 2012, 11:34:55 PM »
Very neat, Kindred...it'd be cool if eventually SMF had this implemented into the core so modifications didn't HAVE to.

Offline nza2k

  • Jr. Member
  • **
  • Posts: 235
  • Thank you SMF
    • Annuaire Voyage-Net.com
Re: [TRICK] displaying the "unknown action" in the who's online list
« Reply #3 on: January 31, 2012, 02:41:41 AM »
Thank you Kindred,

Is there any way, without killing the sever, to display real time stats instead of a list of names.

For instance :
- 5 members and 1 moderator are watching post 1
- 7 members are watching post 2
- 3 members are connecting
- 1 member is posting a new message
...

?
« Last Edit: February 02, 2012, 01:36:52 PM by nza2k »
Avis sur les voyagistes dans le forum de Voyage-Net, propulsé par SMF depuis des années :)

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 55,120
  • Gender: Male
    • Kindred-999 on GitHub
Re: [TRICK] displaying the "unknown action" in the who's online list
« Reply #4 on: January 31, 2012, 07:45:38 AM »
that would require a whole bunch more recoding...   my trick is just to replace the frustrating "unknown action"
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline nza2k

  • Jr. Member
  • **
  • Posts: 235
  • Thank you SMF
    • Annuaire Voyage-Net.com
Re: [TRICK] displaying the "unknown action" in the who's online list
« Reply #5 on: February 02, 2012, 01:37:30 PM »
No problem, I understand. Thank you for your reply
Avis sur les voyagistes dans le forum de Voyage-Net, propulsé par SMF depuis des années :)

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 55,120
  • Gender: Male
    • Kindred-999 on GitHub
Re: [TRICK] displaying the "unknown action" in the who's online list
« Reply #6 on: February 20, 2012, 01:16:40 AM »
note:  I just discovered that you also should add $scripturl to the global variables at the start of the function.
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline geek_andy

  • Semi-Newbie
  • *
  • Posts: 23
  • Gender: Male
    • @geek_andy on Twitter
Re: [TRICK] displaying the "unknown action" in the who's online list
« Reply #7 on: February 20, 2012, 08:58:37 AM »
Very neat, Kindred...it'd be cool if eventually SMF had this implemented into the core so modifications didn't HAVE to.

I completely agree.

Works great Kindred! Thanks!

Offline Chalky

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,360
  • Gender: Female
  • If in doubt, give me beer...
    • ChalkCat
Re: [TRICK] displaying the "unknown action" in the who's online list
« Reply #8 on: March 16, 2012, 02:24:16 PM »
Thank you lots for this  :D

Offline lets4410

  • Newbie
  • *
  • Posts: 1
Re: [TRICK] displaying the "unknown action" in the who's online list
« Reply #9 on: April 05, 2012, 09:43:55 AM »
just the info I needed, thanks

Offline TattooLeashed

  • Full Member
  • ***
  • Posts: 637
Re: [TRICK] displaying the "unknown action" in the who's online list
« Reply #10 on: April 05, 2012, 02:08:07 PM »
It doesn't work for me :(


Offline NanoSector

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 10,471
  • Gender: Male
  • VC321xb47@aperture:~#
    • Yoshi2889 on GitHub
Re: [TRICK] displaying the "unknown action" in the who's online list
« Reply #11 on: April 05, 2012, 02:45:15 PM »
It doesn't work for me :(


You just posted it did ???
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Offline TattooLeashed

  • Full Member
  • ***
  • Posts: 637
Re: [TRICK] displaying the "unknown action" in the who's online list
« Reply #12 on: April 05, 2012, 03:19:15 PM »
Only the word 'Portal' is seen now by the members. Guests show the proper things. Strange...

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 55,120
  • Gender: Male
    • Kindred-999 on GitHub
Re: [TRICK] displaying the "unknown action" in the who's online list
« Reply #13 on: April 05, 2012, 04:02:52 PM »
which code snippet did you use?   And did you make exactly the edit that I showed?
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline NanoSector

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 10,471
  • Gender: Male
  • VC321xb47@aperture:~#
    • Yoshi2889 on GitHub
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 55,120
  • Gender: Male
    • Kindred-999 on GitHub
Re: [TRICK] displaying the "unknown action" in the who's online list
« Reply #15 on: April 05, 2012, 04:08:43 PM »
ah yes...   I didn't even think to $txt the english string (naughty me!)

Sorry, my dutch is non existent, so I can't comment directly. lol....
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline NanoSector

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 10,471
  • Gender: Male
  • VC321xb47@aperture:~#
    • Yoshi2889 on GitHub
Re: [TRICK] displaying the "unknown action" in the who's online list
« Reply #16 on: April 05, 2012, 04:11:49 PM »
ah yes...   I didn't even think to $txt the english string (naughty me!)

Sorry, my dutch is non existent, so I can't comment directly. lol....
First code's what needs to be added in Modifications.{language}.php, second and third code is Find > Replace.
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Offline Antechinus

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 24,136
  • Master of BBC Abuse
Re: [TRICK] displaying the "unknown action" in the who's online list
« Reply #17 on: April 05, 2012, 04:17:37 PM »
Nifty. I like it. Should be default IMO.

What I would also like is a change in that silly "Nothing, or nothing you can see" message. It would make more sense to say "Ant is messing around in admin" or something like that, if it is the case, rather than getting all spooky about it.

Offline TattooLeashed

  • Full Member
  • ***
  • Posts: 637
Re: [TRICK] displaying the "unknown action" in the who's online list
« Reply #18 on: April 08, 2012, 10:22:59 AM »
I did all that Yoshi but it still doesn't work :(


This is how it looks like in who.php:


Code: [Select]
// Unlisted or unknown action.
else {
if (isset($actions['sa'])) {
$extraaction['sa']['text'] = ' - ' . $actions['sa'];
$extraaction['sa']['url'] = ';sa=' . $actions['sa'];
} else {
$extraaction['sa']['text'] = '';
$extraaction['sa']['url'] = '';
}
if (isset($actions['area'])) {
$extraaction['area']['text'] = ' - ' . $actions['area'];
$extraaction['area']['url'] = ';area=' . $actions['area'];
} else {
$extraaction['area']['text'] = '';
$extraaction['area']['url'] = '';
}
if (isset($actions['u'])) {
$extraaction['u']['text'] = ' for User ID' . $actions['u'];
$extraaction['u']['url'] = ';u=' . $actions['u'];
} else {
$extraaction['u']['text'] = '';
$extraaction['u']['url'] = '';
}
if (isset($actions['cat'])) {
$extraaction['cat']['text'] = ' in Category' . $actions['cat'];
$extraaction['cat']['url'] = ';cat=' . $actions['cat'];
} else {
$extraaction['cat']['text'] = '';
$extraaction['cat']['url'] = '';
}

$data[$k] = $txt['unknown_action_viewing'] . ' <a href="' . $scripturl . '?action=' . $actions['action'] . '">' . $actions['action'] . '</a>';
}[s][/s] 

And I put the txt line in my modifications.dutch.php file. What am i doing wrong? Starts to bug me ;)
« Last Edit: April 08, 2012, 10:32:12 AM by TattooLeashed »

Offline NanoSector

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 10,471
  • Gender: Male
  • VC321xb47@aperture:~#
    • Yoshi2889 on GitHub
Re: [TRICK] displaying the "unknown action" in the who's online list
« Reply #19 on: April 08, 2012, 10:33:35 AM »
That's the code that doesn't work ;)

Just use the code I provided, it's in the first post of this topic.
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Offline TattooLeashed

  • Full Member
  • ***
  • Posts: 637
Re: [TRICK] displaying the "unknown action" in the who's online list
« Reply #20 on: April 08, 2012, 12:16:24 PM »
That one doesn't work for me. I only see my own status, the other statusses remain portal only.

Dan    18:15:13    Bekijkt Wie is er online.
Online Lisje 18:15:10    Bekijkt portal
Online Mylvan     18:15:09    Bekijkt portal
Online Mair 18:15:08    Bekijkt portal
Online Siin 18:15:07    Bekijkt portal
Online Luppie    18:15:06    Bekijkt portal
Online Chefke 18:15:05    Bekijkt portal
Online TVT    18:15:04    Bekijkt portal
Gast     18:14:43    Bekijkt topic Paintedflesh werken.
Gast    18:14:31    Bekijkt de forumindexpagina van .

Offline NanoSector

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 10,471
  • Gender: Male
  • VC321xb47@aperture:~#
    • Yoshi2889 on GitHub
Re: [TRICK] displaying the "unknown action" in the who's online list
« Reply #21 on: April 08, 2012, 12:48:14 PM »
Guess the portal is taking over then. Sorry, I dunno what to do with annoying portals taking over the world :(
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Offline TattooLeashed

  • Full Member
  • ***
  • Posts: 637
Re: [TRICK] displaying the "unknown action" in the who's online list
« Reply #22 on: April 08, 2012, 01:23:51 PM »
I thank you anyway for all the good help! ;)

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 55,120
  • Gender: Male
    • Kindred-999 on GitHub
Re: [TRICK] displaying the "unknown action" in the who's online list
« Reply #23 on: April 08, 2012, 02:53:27 PM »
the only thing that my trick does is to replace the "doing something unknown" statement with the actual action that the user is doing.
If there is any other action defined (like "portal") it never gets to my little but of code.
I'd say it's a poorly coded action for whatever portal you are using.
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline TattooLeashed

  • Full Member
  • ***
  • Posts: 637
Re: [TRICK] displaying the "unknown action" in the who's online list
« Reply #24 on: April 08, 2012, 04:18:48 PM »
I'm using Simple Portal. Recently updated to 2.3.5. Never had any problems with it.

Offline mr.Curiosity

  • Jr. Member
  • **
  • Posts: 108
  • Gender: Male
    • tarry.bychoo on Facebook
Re: [TRICK] displaying the "unknown action" in the who's online list
« Reply #25 on: April 09, 2012, 03:08:24 AM »
Nice Work...



Zelite poptpuno besplatno reklamirati svoj server?
Posjetite  www.reklamiraj-server.netne.net
Ocekujemo Vas!

Offline Deezel

  • Jr. Member
  • **
  • Posts: 208
  • Gender: Male
  • It Is What It Is
    • Owner/Admin
Re: [TRICK] displaying the "unknown action" in the who's online list
« Reply #26 on: April 10, 2012, 04:36:59 PM »
Thanks Kindred... worked like a charm on my site!!
running
SMF 2.0.2
and
SimplePortal 2.3.5

Offline Chalky

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,360
  • Gender: Female
  • If in doubt, give me beer...
    • ChalkCat
Re: [TRICK] displaying the "unknown action" in the who's online list
« Reply #27 on: April 29, 2012, 05:21:08 PM »
What I would also like is a change in that silly "Nothing, or nothing you can see" message. It would make more sense to say "Ant is messing around in admin" or something like that, if it is the case, rather than getting all spooky about it.

Did anyone find a way of doing this yet?

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 55,120
  • Gender: Male
    • Kindred-999 on GitHub
Re: [TRICK] displaying the "unknown action" in the who's online list
« Reply #28 on: April 29, 2012, 05:39:06 PM »
Did you even read the original post?
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline NanoSector

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 10,471
  • Gender: Male
  • VC321xb47@aperture:~#
    • Yoshi2889 on GitHub
Re: [TRICK] displaying the "unknown action" in the who's online list
« Reply #29 on: April 29, 2012, 05:53:49 PM »
* Yoshi2889 mumbles something about "...first post.......same problem.......fixed......."
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Offline Chalky

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,360
  • Gender: Female
  • If in doubt, give me beer...
    • ChalkCat
Re: [TRICK] displaying the "unknown action" in the who's online list
« Reply #30 on: April 29, 2012, 06:03:09 PM »
Yes, I did!  I made the edit some time ago and I love it!  However, my regular members complain that they still see the "nothing or nothing you can see" message while I'm doing Admin stuff, which is why I quoted Antechinus' post in particular.

I would also like my members to see something a little more friendly when I'm admin'ing, however, if this was indeed fixed in the first post along with all the other actions that this edit has revealed for me so wonderfully, then I have clearly missed something, but I suspect you misunderstood me  ;)
« Last Edit: April 29, 2012, 06:44:51 PM by Sabrinova »

Offline Antechinus

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 24,136
  • Master of BBC Abuse
Re: [TRICK] displaying the "unknown action" in the who's online list
« Reply #31 on: April 29, 2012, 09:35:36 PM »
Yup, that's different to the OP. The OP only deals with the "unknown action" message, not with the other one.

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 55,120
  • Gender: Male
    • Kindred-999 on GitHub
Re: [TRICK] displaying the "unknown action" in the who's online list
« Reply #32 on: April 29, 2012, 10:41:57 PM »
Oops, sorry, sabrinova, I misread your question (that's the problem, reading from a phone).

I'd say you have to check the list for the admin and other actions and remove the permissions check
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline Chalky

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,360
  • Gender: Female
  • If in doubt, give me beer...
    • ChalkCat
Re: [TRICK] displaying the "unknown action" in the who's online list
« Reply #33 on: May 01, 2012, 08:49:45 AM »
Thanks :)

Is there no way of just changing the text?

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 55,120
  • Gender: Male
    • Kindred-999 on GitHub
Re: [TRICK] displaying the "unknown action" in the who's online list
« Reply #34 on: May 01, 2012, 09:50:40 AM »
you can change the text "nothing, or nothing you can see", but that would change every use of it, not just the admin instance.
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline OzzyMozzy

  • Jr. Member
  • **
  • Posts: 151
Re: [TRICK] displaying the "unknown action" in the who's online list
« Reply #35 on: May 01, 2012, 06:26:13 PM »
This might be a silly question but what file do I download to make this change? I haven’t done a Manual mod before, I thought this might be a good one to start off with.

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 55,120
  • Gender: Male
    • Kindred-999 on GitHub
Re: [TRICK] displaying the "unknown action" in the who's online list
« Reply #36 on: May 02, 2012, 07:54:25 AM »
lol....   actually, not that silly a question.
I started to write back for you to read the OP and realized that I had forgotten to indicate the filename in the OP. 'DOH!

fixed in the OP...  but the file is Sources/Who.php
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline OzzyMozzy

  • Jr. Member
  • **
  • Posts: 151
Re: [TRICK] displaying the "unknown action" in the who's online list
« Reply #37 on: May 06, 2012, 01:57:37 AM »
thanks i found it and made the change but i dont understand this bit, where do i find and put it?

'then add the following text string to modifications.YOURLANGUAGE.txt'

Offline OzzyMozzy

  • Jr. Member
  • **
  • Posts: 151
Re: [TRICK] displaying the "unknown action" in the who's online list
« Reply #38 on: May 06, 2012, 02:42:48 AM »
OMG i did it and it works, well it says 'portal' now instead. Is that right or did i miss something?

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 55,120
  • Gender: Male
    • Kindred-999 on GitHub
Re: [TRICK] displaying the "unknown action" in the who's online list
« Reply #39 on: May 06, 2012, 09:59:35 AM »
Some portals may interfere with the action list.... they assume that you are always in the portal unless you are doing something specific.
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline OzzyMozzy

  • Jr. Member
  • **
  • Posts: 151
Re: [TRICK] displaying the "unknown action" in the who's online list
« Reply #40 on: May 06, 2012, 09:21:19 PM »
That's ok at least it's not saying Unknown action anymore. thanks heaps

Offline Chalky

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,360
  • Gender: Female
  • If in doubt, give me beer...
    • ChalkCat
Re: [TRICK] displaying the "unknown action" in the who's online list
« Reply #41 on: June 24, 2012, 07:05:18 PM »
Hi, me again!  As I've said earlier in this topic, this trick is working great for me.  However, I decided to sort out my error logs, so I deleted all errors, went about my business and checked back.  Within a few minutes of leaving my computer on the auto-refreshing Who's Online, I had 30 instances of this error:

Quote
http://******.com/index.php?action=who
8: Undefined variable: scripturl
File: /home/content/**/*******/html/******/Sources/Who.php
Line: 451

Line 451 is this:

Code: [Select]
// Unlisted or unknown action.
else
$data[$k] = $txt['who_thisaction'] . '<a href="' . $scripturl . '?action=' . $actions['action'] . '">' . $actions['action'] . '</a>';

Please can you help me stop this error from occurring, or is everyone else getting it and it's just something I have to accept?  As I said, there are no problems with the trick itself, it does exactly what it should.

Thank you  :)

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 55,120
  • Gender: Male
    • Kindred-999 on GitHub
Re: [TRICK] displaying the "unknown action" in the who's online list
« Reply #42 on: June 24, 2012, 08:47:06 PM »
Hmmmmm... Really? Wonder why it does not trigger that for me.

Anyway, simple fix. Add
 global $scripturl;
Up above... At the start of the function, where the other global declarations are

« Last Edit: June 25, 2012, 11:39:16 AM by Kindred »
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline Chalky

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,360
  • Gender: Female
  • If in doubt, give me beer...
    • ChalkCat
Re: [TRICK] displaying the "unknown action" in the who's online list
« Reply #43 on: June 25, 2012, 11:28:06 AM »
Thanks Kindred, I think I've put it in the right place  ;)

Just emptied my error log again so I'll see what appears now.  Thanks for the fast response  :)

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 55,120
  • Gender: Male
    • Kindred-999 on GitHub
Re: [TRICK] displaying the "unknown action" in the who's online list
« Reply #44 on: June 25, 2012, 11:43:55 AM »
now that I can get to my code from an actual computer:

Code: (find in Sources/Who.php) [Select]
function determineActions($urls, $preferred_prefix = false)
{
  global $txt, $user_info, $modSettings, $smcFunc, $context;

Code: (add after) [Select]
global $scripturl;

edit- after looking through the code, I wonder why this error was not noticed before...   because, in the core, unedited code, it looks like $scripturl is not actually defined in the determineActions function. It must have been added by another mod to my code and I missed it for the trick.   Original code in the first post has been edited.
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline Chalky

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,360
  • Gender: Female
  • If in doubt, give me beer...
    • ChalkCat
Re: [TRICK] displaying the "unknown action" in the who's online list
« Reply #45 on: June 25, 2012, 12:00:20 PM »
Woohoo!  I had put it in the right place and that seems to have sorted it!  I have left it on the WO for ages and no more errors have appeared in the log.  Brilliant, thanks Kindred  :D

Offline Cutter65

  • Semi-Newbie
  • *
  • Posts: 81
    • Outdoor-talk Forum
Re: [TRICK] displaying the "unknown action" in the who's online list
« Reply #46 on: June 25, 2012, 07:11:35 PM »
Installed this tip today and it works great! ;D

Thanks Kindred!

Offline [UGP]Jeffry

  • Newbie
  • *
  • Posts: 3
Re: [TRICK] displaying the "unknown action" in the who's online list
« Reply #47 on: December 28, 2012, 01:10:51 PM »
Hello, first of all sorry for bumping this topic, but this seems to be useful and might be worth to discuss about.
So I have added the code of the first post, and now it shows

Viewing the portal

anywhere, where before Unknown Action was taking place.
Whats up to this portal thing? Can it be removed from the actions, because even if it shows that somebody is viewing the portal, they DO NOT view it. :/

Any ideas?

Offline sǝๅqɯɐɥS

  • SMF Hero
  • ******
  • Posts: 4,511
  • Gender: Male
    • i30 Owners Club
Re: [TRICK] displaying the "unknown action" in the who's online list
« Reply #48 on: December 28, 2012, 01:27:54 PM »
Just change the text to read

Not viewing the portal

Doddle ;)


Joking aside, do you actually have a portal installed?

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 55,120
  • Gender: Male
    • Kindred-999 on GitHub
Re: [TRICK] displaying the "unknown action" in the who's online list
« Reply #49 on: December 28, 2012, 04:23:59 PM »
right... so, if you have a portal installed, then it sounds like the default "action" is "portal" which comes across as "viewing the portal"

(as I just realized that we have already discussed, if you read back a  few messages)
Some portals may interfere with the action list.... they assume that you are always in the portal unless you are doing something specific.
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline babsbatgirlfan

  • Semi-Newbie
  • *
  • Posts: 74
Re: [TRICK] displaying the "unknown action" in the who's online list
« Reply #50 on: July 19, 2013, 09:29:24 PM »
Is there anyone here who could do this coding for me on my site? I cant ever figure out where anything is lol and i think it would be easier if I set up an admin account for someone lol. I hate the 'unknown action' and would like to know what everyone is doing.

my site is: http://www.dcnurpg.com

thank you so much.

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 55,120
  • Gender: Male
    • Kindred-999 on GitHub
Re: [TRICK] displaying the "unknown action" in the who's online list
« Reply #51 on: July 19, 2013, 09:43:08 PM »
THe instructions in the first post are pretty straight forward...

But, either way, an admin account would not work. You can not edit those files from admin.
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline babsbatgirlfan

  • Semi-Newbie
  • *
  • Posts: 74
Re: [TRICK] displaying the "unknown action" in the who's online list
« Reply #52 on: July 19, 2013, 10:12:02 PM »
Well I own the site so would it need to be done with my account then? I cannot find the areas, at all where to do these changes I have never been good at this stuff at all. Maybe if I PM you my info could you get it so the unknown action is gone and it showsd what everyone is doing? I just cannot find the right area to go into lol.

Offline Chalky

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,360
  • Gender: Female
  • If in doubt, give me beer...
    • ChalkCat
Re: [TRICK] displaying the "unknown action" in the who's online list
« Reply #53 on: July 20, 2013, 03:51:31 AM »
How do I use FTP? / What is FTP?

You need to download two free programs from the Internet. An FTP client such as FileZilla and a text editor such as Notepad ++. Then you grab the specified files from your server using FTP, keep a copy of them as backup, make the edits using the text editor (Word. Notepad, etc will not do, be sure to download one designed for the purpose), then upload your edited file using FTP, overwriting the existing one and you're done!  If you get a parse error replace with the copy of the file you saved as backup and try again  ;)

Offline NekoJonez

  • Full Member
  • ***
  • Posts: 501
  • Gender: Male
  • Stuff
    • @NekoJonez on Twitter
    • My blog
Re: [TRICK] displaying the "unknown action" in the who's online list
« Reply #54 on: April 29, 2014, 08:10:17 AM »
This is actually working great for me. I think SimplePortal messes up a lot.
Retro video game blogger, writer, actor, podcaster and general amazing dude.

Twitter
My Blog

Offline Study Force

  • SMF Hero
  • ******
  • Posts: 3,101
    • @studyforceps on Twitter
    • Study Force
Re: [TRICK] displaying the "unknown action" in the who's online list
« Reply #55 on: July 06, 2017, 10:27:55 AM »
Thanks for the trick, Kindred, I just noticed it!

However, I took a slightly different path. Instead of showing the vague action, I said why not skip it

Here's how I did it:

Find:
Code: [Select]
$data[$k] = $txt['who_unknown'];
Replace:
Code: [Select]
else
//$data[$k] = $txt['who_unknown'];
continue;

Hope this helps

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 68,055
    • Arantor on GitHub
Re: [TRICK] displaying the "unknown action" in the who's online list
« Reply #56 on: July 06, 2017, 11:05:24 AM »
The reason you generally pull the extra data is so you can figure out what is missing, rather than just making it go away.
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.

Offline Study Force

  • SMF Hero
  • ******
  • Posts: 3,101
    • @studyforceps on Twitter
    • Study Force
Re: [TRICK] displaying the "unknown action" in the who's online list
« Reply #57 on: July 06, 2017, 12:09:56 PM »
The reason you generally pull the extra data is so you can figure out what is missing, rather than just making it go away.

I agree. Do you have another suggestion how I could do it better?

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 68,055
    • Arantor on GitHub
Re: [TRICK] displaying the "unknown action" in the who's online list
« Reply #58 on: July 06, 2017, 02:59:34 PM »
The reason you generally pull the extra data is so you can figure out what is missing, rather than just making it go away.

I agree. Do you have another suggestion how I could do it better?

Not really - you take the information about unknown actions and create the matching $txt entries so they're no longer unknown actions...
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.