Mobile Browsing Unknown Location

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Amaury
    Senior Member
    • Mar 2012
    • 1807
    • 4.2.X

    prefix_vb4_foruminstallanswered_title_rich Mobile Browsing Unknown Location

    When looking at the Who's Online page or a profile of someone browsing via mobile, I see this:
    Unknown Location
    /mobile.php?do=gridmenu
    Any way to fix that to something like Browsing via Mobile? Is this something I should ask about at vBulletin.org Forum?
    Last edited by BirdOPrey5; Tue 29 Jan '13, 11:16am.
    Former vBulletin user
  • BirdOPrey5
    Senior Member
    • Jul 2008
    • 9613
    • 5.6.3

    #2
    This should be logged as a bug but the reality is at this point I doubt it would make it in the list of fixes for 4.x. (JIRA: http://tracker.vbulletin.com/browse/VBIV-15599)

    So here is a fix,

    Create a new plugin in Plugin Manager-

    Product: vBulletin
    Title: Unknown Location Mobile Style Fix
    Hook: online_location_unknown

    PHP Code:
    PHP Code:
    if (strpos($userinfo['location'], 'mobile.php') !== false
    {
      
    $userinfo['action'] = 'Browsing via mobile style';
      
    $handled true;

    Set active to YES, and SAVE.

    Optionally you can upload the attached plugin. NOTE- This gets uploaded via Plugins NOT Imported via Products.
    Attached Files
    Last edited by BirdOPrey5; Tue 29 Jan '13, 3:20am.

    Comment

    • Amaury
      Senior Member
      • Mar 2012
      • 1807
      • 4.2.X

      #3
      Originally posted by Joe D.
      This should be logged as a bug but the reality is at this point I doubt it would make it in the list of fixes for 4.x. (JIRA: http://tracker.vbulletin.com/browse/VBIV-15599)

      So here is a fix,

      Create a new plugin in Plugin Manager-

      Product: vBulletin
      Title: Unknown Location Mobile Style Fix
      Hook: online_location_unknown

      PHP Code:
      PHP Code:
      if (strpos($userinfo['location'], 'mobile.php') !== false
      {
        
      $userinfo['action'] = 'Browsing via mobile style';
        
      $handled true;

      Set active to YES, and SAVE.

      Optionally you can upload the attached plugin. NOTE- This gets uploaded via Plugins NOT Imported via Products.
      Thanks, Joe. It works.

      I did a test by viewing the grid on Google Chrome and then viewing my profile as a guest on Mozilla Firefox:
      Click image for larger version

Name:	Menu Grid.png
Views:	1
Size:	317.5 KB
ID:	3691189

      Now, out of curiosity, can you create plugins to fix any unknown locations or to overwrite other locations?

      For example, most group-related things use Viewing Group List, but I would want to use, for example, Viewing Discussion [Name] or Viewing Group Discussion [Name] when viewing a group discussion.
      Former vBulletin user

      Comment

      • BirdOPrey5
        Senior Member
        • Jul 2008
        • 9613
        • 5.6.3

        #4
        Doing unknown locations is easy... Using the plugin above to start edit mobile.php to be whatever php file the unknown activity is occurring on. And change the action string to whatever you wish.

        I don't know how one would go about trying to override existing locations- may need manual file edits and a lot more work to pull the discussion name, you can ask on vbulletin.org for help like that.

        Comment

        • Amaury
          Senior Member
          • Mar 2012
          • 1807
          • 4.2.X

          #5
          Originally posted by Joe D.
          Doing unknown locations is easy... Using the plugin above to start edit mobile.php to be whatever php file the unknown activity is occurring on. And change the action string to whatever you wish.

          I don't know how one would go about trying to override existing locations- may need manual file edits and a lot more work to pull the discussion name, you can ask on vbulletin.org for help like that.
          Thanks, Joe.

          Please mark this as answered.
          Former vBulletin user

          Comment

          • Amaury
            Senior Member
            • Mar 2012
            • 1807
            • 4.2.X

            #6
            First of all, thank you very much, Joe. I was finally able to fix the unknown locations for deleted or moderated group discussions with this:

            Code:
            if (strpos($userinfo['location'], 'moderation.php?do=viewdiscussions') !== false) 
            {
              $userinfo['action'] = 'Viewing Moderated Group Discussions';
              $handled = true;
            }
            I still can't figure out how to separate the two, though. For example, when viewing other deleted or moderated items, such as VMs, you see Viewing Deleted [Name] or Viewing Moderated [Name]. I currently just have it saying Viewing Moderated Group Discussions for both deleted and moderated group discussions. I tried adding the deleted and moderated specifiers at the end: moderation.php?do=viewdiscussions&type=deleted and moderation.php?do=viewdiscussions&type=moderated. However, those didn't seem to do anything.

            Anyway, I'll ask about that on vBulletin.org Forum. If you have an answer, though, feel more than free to help out.

            The reason I'm back here is because I was wondering how you add hyperlinks to the action string. forum.php is what we use for our index page, but you can view it with index.php as well. When viewing it from that, though, it was giving off an unknown location.

            I fixed it by creating this plugin:

            Code:
            if (strpos($userinfo['location'], 'index.php') !== false) 
            {
              $userinfo['action'] = 'Viewing Index';
              $handled = true;
            }
            How would I add a hyperlink so it would say Viewing Index KH-MediaFlare Forum? I mean, I can add (and I did) KH-MediaFlare Forum to the action string, but it just looks weird as plain text.

            Thanks in advance.
            Former vBulletin user

            Comment

            • BirdOPrey5
              Senior Member
              • Jul 2008
              • 9613
              • 5.6.3

              #7
              To add a hyperlink, under the $userinfo['action'] = ... Line add the following line:

              PHP Code:
               $userinfo['where'] = '<a href="custompage.php?'.$vbulletin->session->vars[sessionurl].'">Doing Something Here</a>'
              Your other questions I'm sorry I really don't know offhand and they are well into the "custom coding" territory that vBulletin.org is for.

              Comment

              • Amaury
                Senior Member
                • Mar 2012
                • 1807
                • 4.2.X

                #8
                Originally posted by Joe D.
                To add a hyperlink, under the $userinfo['action'] = ... Line add the following line:

                PHP Code:
                 $userinfo['where'] = '<a href="custompage.php?'.$vbulletin->session->vars[sessionurl].'">Doing Something Here</a>'
                Your other questions I'm sorry I really don't know offhand and they are well into the "custom coding" territory that vBulletin.org is for.
                Thanks, Joe!

                And gotcha. The first part of the post was more of a side note than an actual question.
                Former vBulletin user

                Comment

                widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                Working...