MyBB Community Forums

Full Version: [Ask]Code to Displaying IP Address for Guest
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
As subject, anyone know what/where php code should be change. If I want to display IP Address for Guest Posting? Smile

T.i.a
Do you want the guests to view the ip addresses or you want their ip addresses to be visable when they post which I think it will be shown as default.
Yes, if any Guest posting. Other member can see this guest IP address Smile
I am not sure, shown by default. I check
{$post['iplogged']}
still there.
Well, I try
Do you want all the members to see the ip of the guests? And do you want all the members to see the all the ips of other members as well? Cos if it is the latest, it can be done at Configuration-Posting-Log Posting IP Addresses. If you want the other members to see only the ip of guests but not the other ips, then it can be done with some tweaking. The file you need is functions.post.php in the /inc/ folder. And the code for the ip''s:

if($mybb->settings['logip'] != "no")
		{
			if($mybb->settings['logip'] == "show")
			{
				eval("\$post['iplogged'] = \"".$templates->get("postbit_iplogged_show")."\";");
			}
			else if($mybb->settings['logip'] == "hide" && $ismod)
			{
				eval("\$post['iplogged'] = \"".$templates->get("postbit_iplogged_hiden")."\";");
			}
			else
			{
				$post['iplogged'] = "";
			}
		}
		else
		{
			$post['iplogged'] = "";
		}

	}

To pull out the guests posts only you will need this:

$post['usergroup'] == 1

Then use an if...elseif statement to achive what you need. Hope it helps.