MyBB Community Forums

Full Version: $onlinemembers for index_whosonline
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I need to know in which part of which php file $onlinemembers gets value for index_whosonline?
Where $onlinemembers will be set particularly for search engine spiderbots?
Are you sure your not looking for ACP > Configuration > Spiders / Bots?

Otherwise it's the functions associated with whos online are in index.php and ./inc/functions_online.php I think.
(2010-03-02, 10:10 AM)TimB. Wrote: [ -> ]Are you sure your not looking for ACP > Configuration > Spiders / Bots?

Otherwise it's the functions associated with whos online are in index.php and ./inc/functions_online.php I think.

No I am not talking about ACP > Configuration > Spiders / Bots.

I looked at ./inc/functions_online.php and I think it just does query the _sessions table so spiderbots are already inserted in _sessions table before, right? I think this should be ./inc/class_sessions.php that looked for $_SERVER['HTTP_USER_AGENT'] to detect spiderbots to save them in _sessions table, right?

Wondering why I am asking this, because I want to add a spiderbot in my spider bots list in admin area but I don't know their user agent to add, so first I need to fetch their user agent.
I am thinking of this trick to list all USER_AGENT rather than actuall spidername temporarily to see their user agent name.
So I think to list all user agents I should change the code below in /inc/class_sessions.php to list all user agents in my index page.
Is that right? but as they are going to be saved in _sessions table I am still worry about db damage if I do this change, please advice. any better way to get that spider user agent name? or how can I just print all $this->useragent in my footer to get spider user agent name?


		// If no user still, then we have a guest.
		if(!isset($mybb->user['uid']))
		{
			// Detect if this guest is a search engine spider. (bots don't get a cookied session ID so we first see if that's set)

                                                // commented temporarily:
			/*if(!$this->sid)
			{
				$spiders = $cache->read("spiders");
				if(is_array($spiders))
				{
					foreach($spiders as $spider)
					{
						if(my_strpos(my_strtolower($this->useragent), my_strtolower($spider['useragent'])) !== false)
						{
							$this->load_spider($spider['sid']);
						}
					}
				}
			}*/
                                                                // added temporarily:
                                                               print($this->useragent);
                                    }
If you tell us the search engine then we might be able to find out for you Toungue
Thank you Polarbear541 for the PM, can one of superior developers of MyBB advice how can I get that particular user agent with php by printing out all visited user agents or so?