############################################################## 
##
## MOD Title:		  Browser Images
##
## MOD Author:		  aUsTiN => austin_inc@hotmail.com
##
## MOD Description:       Adds users browser images next to their names.
##
## MOD Version:           1.0.0
##
## MOD Help:		  http://phpbb-tweaks.com/
## 
## Installation Level:    Easy
##
## Installation Time:     5
##
## Files To Edit:         2
##
## Included Files:        10 (Images)
##
############################################################## 
############################################################## 
##
## Author Notes: 
##
############################################################## 
##
## MOD History: 
## 
##	Jul 04th 2005 - Version 1.0.0
##      	- Beta Released
##
############################################################## 
##
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
##
##############################################################
##
##	Definitions:
##
##		Root: Folder your config.php is located
##		templates/*/: Your template folder (All template folders are suggested)
##		lang_*/: Your current language folder (All lang folders are suggested)
##
##############################################################

-----------------------------------
----[ SQL ]------------------------
-----------------------------------

ALTER TABLE phpbb_users ADD user_browser VARCHAR(255) NOT NULL;

-----------------------------------
----[ UPLOAD FILES ]---------------
-----------------------------------

images/browser_images/*		=> Root/images/

-----------------------------------
----[ OPEN ]-----------------------
-----------------------------------

includes/functions.php

-----------------------------------
----[ FIND ]-----------------------
----------------------------------- 

?>

-----------------------------------
----[ BEFORE, ADD ]----------------
-----------------------------------

#======================================================================= |
#==== Start: == Browser Images ========================================= |
#==== v1.0.0 =========================================================== |
#====
	function set_viewing_user_agent()
		{
	global $HTTP_SERVER_VARS, $phpbb_root_path, $userdata, $db;
	#==== Empty Everything
	unset($user_agent, $avant, $msie, $mozilla, $firefox, $konqueror, $safari, $aol, $msn, $opera, $netscape, $image);
	#==== Set The Agent
	$user_agent = strtolower($HTTP_SERVER_VARS['HTTP_USER_AGENT']);
	#==== Set Up Images
	$avant 		= '<img src="'. $phpbb_root_path .'images/browser_images/avant.png" border="0" height="14" width="14">';
	$msie 		= '<img src="'. $phpbb_root_path .'images/browser_images/ie.png" border="0" height="14" width="14">';
	$mozilla 	= '<img src="'. $phpbb_root_path .'images/browser_images/mozilla.png" border="0" height="14" width="14">';
	$firefox 	= '<img src="'. $phpbb_root_path .'images/browser_images/firefox.png" border="0" height="14" width="14">';
	$konqueror 	= '<img src="'. $phpbb_root_path .'images/browser_images/konqueror.png" border="0" height="14" width="14">';
	$aol 		= '<img src="'. $phpbb_root_path .'images/browser_images/aol.gif" border="0" height="14" width="14">';
	$msn 		= '<img src="'. $phpbb_root_path .'images/browser_images/msn.JPEG" border="0" height="14" width="14">';
	$opera 		= '<img src="'. $phpbb_root_path .'images/browser_images/opera.png" border="0" height="14" width="14">';
	$netscape 	= '<img src="'. $phpbb_root_path .'images/browser_images/netscape.png" border="0" height="14" width="14">';
	$safari 	= '<img src="'. $phpbb_root_path .'images/browser_images/safari.png" border="0" height="14" width="14">';
	#==== Process Of Elimination
		if (@strstr($user_agent, 'msn'))
			$image = $msn;
		elseif (@strstr($user_agent, 'aol'))
			$image = $aol;
		elseif (@strstr($user_agent, 'avant browser'))
			$image = $avant;
		elseif (@strstr($user_agent, 'firefox'))
			$image = $firefox;
		elseif (@strstr($user_agent, 'konqueror'))
			$image = $konqueror;
		elseif (@strstr($user_agent, 'opera'))
			$image = $opera;
		elseif (@strstr($user_agent, 'netscape'))
			$image = $netscape;
		elseif (@strstr($user_agent, 'safari'))
			$image = $safari;
		elseif ( (@strstr($user_agent, 'mozilla')) && (@strstr($user_agent, 'gecko')) )
			$image = $mozilla;
		else
			$image = $msie;
		
		if ($userdata['user_id'] != ANONYMOUS)
			{
		$q = 'UPDATE '. USERS_TABLE .'
			  SET user_browser = \'&nbsp;'. $image .'\'
			  WHERE user_id = \''. $userdata['user_id'] .'\'';
		$db->sql_query($q);
			 }		
		}
#====
#==== Author: aUsTiN [austin@phpbb-amod.com] [http://phpbb-tweaks.com] = |
#==== End: ==== Browser Images ========================================= |	
#======================================================================= |

-----------------------------------
----[ CLOSE & SAVE ]---------------
-----------------------------------

-----------------------------------
----[ OPEN ]-----------------------
-----------------------------------

includes/page_header.php

-----------------------------------
----[ FIND ]-----------------------
----------------------------------- 

define('HEADER_INC', TRUE);

-----------------------------------
----[ AFTER, ADD ]-----------------
-----------------------------------

#======================================================================= |
#==== Start: == Browser Images ========================================= |
#==== v1.0.0 =========================================================== |
#====	
		set_viewing_user_agent();
#====
#==== Author: aUsTiN [austin@phpbb-amod.com] [http://phpbb-tweaks.com] = |
#==== End: ==== Browser Images ========================================= |	
#======================================================================= |

-----------------------------------
----[ FIND ]-----------------------
----------------------------------- 

 u.user_level,

-----------------------------------
----[ AFTER, ADD ]-----------------
-----------------------------------

 u.user_browser,

-----------------------------------
----[ FIND ]-----------------------
----------------------------------- 

					$user_online_link = '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=" . $row['user_id']) . '"' . $style_color .'>' . $row['username'] . '</a>'

-----------------------------------
----[ AFTER, ADD ]-----------------
-----------------------------------

. $row['user_browser']

-----------------------------------
----[ FIND ]-----------------------
----------------------------------- 

					$user_online_link = '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=" . $row['user_id']) . '"' . $style_color .'><i>' . $row['username'] . '</i></a>'

-----------------------------------
----[ AFTER, ADD ]-----------------
-----------------------------------

. $row['user_browser']


-----------------------------------
----[ CLOSE & SAVE ]---------------
-----------------------------------