MyBB Community Forums

Full Version: Add a location to fix "Unknown Location"?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
My forum: http://www.coding-forums.com

If I have a plugin like My Awards from MyBBCentral it shows up as "Unknown Location" on the who's online list. Obviously it's because it's not standard in MyBB and I know that, but I was curious on how I would add that location so it would show "Viewing Awards" or something along those lines.

Thanks for any replies!
Whaaa!! My super-secret plugin plans outed to the world. Oh wait - I posted them on a public forum Toungue
^^ Any further progress on this, Lee?
Sorry to bump a very old thread but I've gone through all the brainstorms of Omar & Lee and have come up with a simple jQuery solution. Obviously its not the best one, but can handle the situation most cases ...

All you have to do is to include the following script to 'online' template, before '{$footer}':

<script type="text/javascript">
jQuery(document).ready(function(){
    jQuery(jQuery('a:contains("Unknown Location")')).each(function () {
        jQuery(this).addClass('unknown'); // Just to capitalize the name, found easy with CSS
        var page = (jQuery(this).attr('href')); // Fetch the link
        page = page.substr(page.lastIndexOf("/") + 1);
        page = page.substr(0, page.lastIndexOf('.')) || page;
        jQuery(this).before('Viewing ').html(page); // Change linked text and prepend text 'Viewing' before it.
    });
});
</script>

And the live result is:

[Image: h5aGoST.png]

A fiddle for the same:

http://jsfiddle.net/effone/9KmzY/
Looks awesome, let me see if I can code the plugin in this three days break too
Here's the link to my forum: http://www.lucistarforum.com

I tried the script, and nothing changed.

I'm still getting Unknown Location. It's clickable, and all of my Postloop posters are listed when you click on it.

I don't want my usage of Postloop given away. A lot of people would be unwilling to converse with known post exchangers. Can you make a script that makes the unknown location unclickable?

Here's an example of what I mean:

[Image: oUAiVm.png]

And when you click on Unknown Location, all of my Postloop users and their post count is listed. I don't want that revealed to browsers and users.

[Image: mOnqZF.png]

I don't mind it showing Unknown Location, but I don't want it to be clickable.