[TRICK] displaying the "unknown action" in the who's online list

Started by Kindred, January 30, 2012, 10:20:00 PM

Previous topic - Next topic

OzzyMozzy

That's ok at least it's not saying Unknown action anymore. thanks heaps

Chalky

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:

// 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  :)

Kindred

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

Слaва
Украинi

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

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Chalky

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  :)

Kindred

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.
Слaва
Украинi

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

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Chalky

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

Cutter65

Installed this tip today and it works great! ;D

Thanks Kindred!

[UGP]Jeffry

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?

Shambles

Just change the text to read

Not viewing the portal

Doddle ;)


Joking aside, do you actually have a portal installed?

Kindred

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)
Quote from: Kindred 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.
Слaва
Украинi

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

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

babsbatgirlfan

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.

Kindred

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.
Слaва
Украинi

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

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

babsbatgirlfan

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.

Chalky

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  ;)

NekoJonez

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

Biology Forums

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:
$data[$k] = $txt['who_unknown'];

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


Hope this helps

Arantor

The reason you generally pull the extra data is so you can figure out what is missing, rather than just making it go away.

Biology Forums

Quote from: Arantor 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.

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

Arantor

Quote from: Stylus on July 06, 2017, 12:09:56 PM
Quote from: Arantor 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.

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...

Advertisement: