MyBB Community Forums

Full Version: Naming the code as a "Location"
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How can I, in the PHP code, make it so that the user's location is not - "Unknown Location" whilst in the Who's Online?

I have the RPG addon, and would prefer (example) "Itemshop" instead of "Unknown Location" which links to itemshop.php.

That would be great!

Thanx
In online.php find:

		// default
		default:
			$locationname = "<a href=\"$user[location]\">Unknown Location</a>";
			break;

And above it add

		// Your Section
		case "section":
			$locationname = "<a href=\"$user[location]\">Unknown Location</a>";
			break;

Then still in online.php find:

		default:
			$user['activity'] = "unknown";
			break;

And above it add:

		case "section":
			$user['activity'] = "section";
			break;

This is a rough example, if you need any help look at the rest of the online.php code above those lines and you'll see howit works. Smile
What are the 'activities' and 'locations' bits about? What do i put and I assume that you mean to change 'section' to what I want?
The locations in the what() function are the myBB files, such as announcements.php, attachment.php, calendar.php etc. The activities in the show() function are the activities available on that page.

A good example is the code for recognising online.php. It is one location (online.php), but there are two activities for that page, "wol" (Who's Online) and "woltoday" (Who was online today).