Advertisement:

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

Offline OzzyMozzy

  • Semi-Newbie
  • *
  • Posts: 80
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 ChalkCat

  • Support Specialist
  • SMF Hero
  • *
  • Posts: 1,410
  • Gender: Female
  • Forum Tea Maker - go on have a cuppa!
    • 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

  • Support Specialist
  • SMF Master
  • *
  • Posts: 31,373
  • Gender: Male
    • wagner999 on Facebook
    • @Kindred_999 on Twitter
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 forums.  Thank you.

Offline ChalkCat

  • Support Specialist
  • SMF Hero
  • *
  • Posts: 1,410
  • Gender: Female
  • Forum Tea Maker - go on have a cuppa!
    • 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

  • Support Specialist
  • SMF Master
  • *
  • Posts: 31,373
  • Gender: Male
    • wagner999 on Facebook
    • @Kindred_999 on Twitter
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 forums.  Thank you.

Offline ChalkCat

  • Support Specialist
  • SMF Hero
  • *
  • Posts: 1,410
  • Gender: Female
  • Forum Tea Maker - go on have a cuppa!
    • 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: 67
    • 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 Shambles

  • SMF Hero
  • ******
  • Posts: 2,087
  • 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

  • Support Specialist
  • SMF Master
  • *
  • Posts: 31,373
  • Gender: Male
    • wagner999 on Facebook
    • @Kindred_999 on Twitter
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 forums.  Thank you.