TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

March 29, 2024, 08:18:26 AM

Login with username, password and session length
Members
Stats
  • Total Posts: 195,106
  • Total Topics: 21,213
  • Online today: 358
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 72
  • Total: 72

Displays your Browser and system info

Started by humanporkrind, January 05, 2006, 05:08:27 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Porky

Both are java.html blocks.

Interntet Browser
<script>

/*Displaying a user's browser type script
*/

if (document.all)
var version=/MSIE \d+.\d+/

if (!document.all)
document.write("You are using "+navigator.appName+" "+navigator.userAgent)
else
document.write("You are using "+navigator.appName+" "+navigator.appVersion.match(version))

</script>


Operating System
<SCRIPT LANGUAGE="JavaScript">

<!--
function checkOS() {
  if(navigator.userAgent.indexOf('IRIX') != -1)
    { var OpSys = "Irix"; }
  else if((navigator.userAgent.indexOf('Win') != -1) &&
  (navigator.userAgent.indexOf('95') != -1))
    { var OpSys = "Windows95"; }
  else if(navigator.userAgent.indexOf('Win') != -1)
    { var OpSys = "Windows3.1 or NT"; }
  else if(navigator.userAgent.indexOf('Mac') != -1)
    { var OpSys = "Macintosh"; }
  else { var OpSys = "other"; }
  return OpSys;
}
// -->

</SCRIPT>

<script>
<!--
var OpSys = checkOS();
document.write(OpSys);
//-->
</script>


ontap

#1
you could put it all into one javascript?....


<script Language="JavaScript">

/* Displays A User's Browser Type */

if (document.all)
var version=/MSIE \d+.\d+/

if (!document.all)
document.write("You Are Using "+navigator.appName+" "+navigator.userAgent)
else
document.write("You Are Using "+navigator.appName+" "+navigator.appVersion.match(version))

/* Displays A User's Operating System */

function checkOS() {
  if(navigator.userAgent.indexOf('IRIX') != -1)
    { var OpSys = "Irix"; }
  else if((navigator.userAgent.indexOf('Win') != -1) &&
  (navigator.userAgent.indexOf('95') != -1))
    { var OpSys = "Windows95"; }
  else if(navigator.userAgent.indexOf('Win') != -1)
    { var OpSys = "Windows3.1 or NT"; }
  else if(navigator.userAgent.indexOf('Mac') != -1)
    { var OpSys = "Macintosh"; }
  else { var OpSys = "Other"; }
  return OpSys;
}
var OpSys = checkOS();
document.write(OpSys);
</Script>

bloc

#2
OS,host, IP,browser can already be drawn without javascript , even last login...something like this maybe?

global $user_info;

echo '<div class="smalltext"><b>Browser:</b> '.$_SERVER['HTTP_USER_AGENT'].'<br />';
echo '<b>IP:</b> '.$user_info['ip'].'<br />';
echo '<b>Last visit:</b> '.timeformat($user_info['last_login']).'</div>';


In a php-block of course.

[attachment deleted by admin]


G6Cad

That was a fun thing :) Thanks Bloc and OnTap


deadpoeticstar

where would this go? cause thats interesting and nice


deadpoeticstar

woops...lol my bad...lol i thought it needed to be added to something