Browser Icon auf Index anzeigen

Hier findet Ihr Modifikationen (MODs) für phpBB3 Olympus (3.0.x)
Forumsregeln
Support für die MODs findet Ihr auf http://www.phpbb.de
Bereich: phpBB 3.0: MOD Support
Benutzeravatar
Dr.Death
Site Admin
Site Admin
Beiträge: 1952
Registriert: 05.02.2005 15:41
Wohnort: Xanten
Kontaktdaten:

Browser Icon auf Index anzeigen

Beitrag von Dr.Death » 11.10.2010 13:53

MOD Name: Browser Icon auf Index anzeigen
Author: Mr_Simon
MOD Beschreibung: Zeigt die verwendeten Browser als Icon auf dem Index an
MOD Version: Unbekannt

Demo:

Quelle: http://forums.phpbb-fr.com/aide-dev-ada ... l#p1171566
Download: Icon Download: http://www.megaupload.com/?d=4BZCQZ4X

ÖFFNE:
includes/functions.php

FINDE:

Code: Alles auswählen

$sql = 'SELECT username, username_clean, user_id, user_type, user_allow_viewonline, user_colour
            FROM ' . USERS_TABLE . '
            WHERE ' . $db->sql_in_set('user_id', $online_users['online_users']) . '
            ORDER BY username_clean ASC';
      $result = $db->sql_query($sql);        
ERSETZE MIT:

Code: Alles auswählen

    /* Origine
        $sql = 'SELECT username, username_clean, user_id, user_type, user_allow_viewonline, user_colour
                FROM ' . USERS_TABLE . '
                WHERE ' . $db->sql_in_set('user_id', $online_users['online_users']) . '
                ORDER BY username_clean ASC';
        $result = $db->sql_query($sql);
    Origine*/    
        
        // Browser  agent----------------------
        $sql = 'SELECT u.username, u.username_clean, u.user_id, u.user_type, u.user_allow_viewonline, u.user_colour, s.session_browser, s.session_user_id, s.session_start
                FROM ' . USERS_TABLE .' u, ' . SESSIONS_TABLE . ' s
                WHERE ' . $db->sql_in_set('user_id', $online_users['online_users']) . '
                AND u.user_id = s.session_user_id
                ORDER BY username_clean ASC, session_start DESC';
        $result = $db->sql_query($sql);    
        // Browser  agent----------------------                   
FINDE:

Code: Alles auswählen

$online_userlist .= ($online_userlist != '') ? ', ' . $user_online_link : $user_online_link;


ERSETZEN MIT:

Code: Alles auswählen

					// $online_userlist .= ($online_userlist != '') ? ', ' . $user_online_link : $user_online_link;

					// Browser  agent----------------------
					if (preg_match('`'.$row['username'].'`', $online_userlist))
					{
						// l'utilisateur est déjà dans la liste(plusieurs sessions)
					}
					else
					{
						$online_userlist .= ($online_userlist != '') ? ', ' . $user_online_link : $user_online_link;
						$online_userlist = $online_userlist . switch_agent($row['session_browser']);
					}
					// Browser  agent----------------------


FINDE:

Code: Alles auswählen

function phpbb_user_session_handler()
{
	global $phpbb_hook;

	if (!empty($phpbb_hook) && $phpbb_hook->call_hook(__FUNCTION__))
	{
		if ($phpbb_hook->hook_return(__FUNCTION__))
		{
			return $phpbb_hook->hook_return_result(__FUNCTION__);
		}
	}

	return;
}
DANACH EINFÜGEN:

Code: Alles auswählen

// Browser  agent----------------------
function switch_agent($user_agent)
{   
   global $template, $user, $img;
      
   $agentstring = strtolower($user_agent);

   if (false !== strpos($agentstring, 'amaya'))
   {
      $browser = ' <img src="images/agent/AM.png" alt="Amaya" title="Amaya" border="0" />';
   }
   else if (false !== strpos($agentstring, 'safari'))
   {
      $browser = ' <img src="images/agent/SF.png" alt="Safari" title="Safari" border="0" />';
   }
   else if (false !== strpos($agentstring, 'opera'))
   {
      $browser = ' <img src="images/agent/OP.png" alt="Opera" title="Opera" border="0" />';
   }
   else if (false !== strpos($agentstring, 'amigavoyager'))
   {
      $browser = ' <img src="images/agent/AV.png" alt="Amigavoyager" title="Amigavoyager" border="0" />';
   }
   else if (false !== strpos($agentstring, 'amiga-aweb'))
   {
      $browser = ' <img src="images/agent/AW.png" alt="Amiga-aweb" title="Amiga-aweb" border="0" />';
   }
   else if (false !== strpos($agentstring, 'browsex'))
   {
      $browser = ' <img src="images/agent/BX.png" alt="Browsex" title="Browsex" border="0" />';
   }
   else if (false !== strpos($agentstring, 'camino'))
   {
      $browser = ' <img src="images/agent/CA.png" alt="Camino" title="Camino" border="0" />';
   }
   else if (false !== strpos($agentstring, 'chimera'))
   {
      $browser = ' <img src="images/agent/CH.png" alt="Chimera" title="Chimera" border="0" />';
   }
   else if (false !== strpos($agentstring, 'chrome'))
   {
      $browser = '<img src="images/agent/CR.png" alt="Chrome" title="Chrome" border="0" />';
   }
   else if (false !== strpos($agentstring, 'firebird'))
   {
      $browser = ' <img src="images/agent/FB.png" alt="Firebird" title="Firebird" border="0" />';
   }
   else if (false !== strpos($agentstring, 'mozilla firebird'))
   {
      $browser = ' <img src="images/agent/FB.png" alt="Mozilla Firebird" title="Mozilla Firebird" border="0" />';
   }
   else if (false !== strpos($agentstring, 'firefox'))
   {
      $browser = ' <img src="images/agent/FF.png" alt="Firefox" title="Firefox" border="0" />';
   }
   else if (false !== strpos($agentstring, 'galeon'))
   {
      $browser = ' <img src="images/agent/GA.png" alt="Galeon" title="Galeon" border="0" />';
   }
   else if (false !== strpos($agentstring, 'hotjava'))
   {
      $browser = ' <img src="images/agent/HJ.png" alt="Hotjava" title="Hotjava" border="0" />';
   }
   else if (false !== strpos($agentstring, 'ibrowse'))
   {
      $browser = ' <img src="images/agent/IB.png" alt="Ibrowse" title="Ibrowse" border="0" />';
   }
   else if (false !== strpos($agentstring, 'icab'))
   {
      $browser = ' <img src="images/agent/IC.png" alt="Icab" title="Icab" border="0" />';
   }
   else if (false !== strpos($agentstring, 'microsoft internet explorer'))
   {
      $browser = ' <img src="images/agent/IE.png" alt="Internet Explorer" title="Internet Explorer" border="0" />';
   }
   else if (false !== strpos($agentstring, 'internet explorer'))
   {
      $browser = ' <img src="images/agent/IE.png" alt="Internet Explorer" title="Internet Explorer" border="0" />';
   }
   else if (false !== strpos($agentstring, 'msie'))
   {
      $browser = ' <img src="images/agent/IE.png" alt="Internet Explorer" title="Internet Explorer" border="0" />';
   }
   else if (false !== strpos($agentstring, 'k-meleon'))
   {
      $browser = ' <img src="images/agent/KM.png" alt="K-meleon" title="K-meleon" border="0" />';
   }
   else if (false !== strpos($agentstring, 'konqueror'))
   {
      $browser = ' <img src="images/agent/KO.png" alt="Konqueror" title="Konqueror" border="0" />';
   }
   else if (false !== strpos($agentstring, 'links'))
   {
      $browser = ' <img src="images/agent/LI.png" alt="Links" title="Links" border="0" />';
   }
   else if (false !== strpos($agentstring, 'lynx'))
   {
      $browser = ' <img src="images/agent/LX.png" alt="Lynx" title="Lynx" border="0" />';
   }
   else if (false !== strpos($agentstring, 'ncsa mosaic'))
   {
      $browser = ' <img src="images/agent/MC.png" alt="Ncsa mosaic" title="Ncsa mosaic" border="0" />';
   }
   else if (false !== strpos($agentstring, 'mozilla'))
   {
      $browser = '<img src="images/agent/MO.png" alt="Mozilla" title="Mozilla" border="0" />';
   }
   else if (false !== strpos($agentstring, 'netscape'))
   {
      $browser = ' <img src="images/agent/NS.png" alt="Netscape" title="Netscape" border="0" />';
   }
   else if (false !== strpos($agentstring, 'netscape6'))
   {
      $browser = '<img src="images/agent/NS.png" alt="Netscape" title="Netscape" border="0" />';
   }
   else if (false !== strpos($agentstring, 'omniweb'))
   {
      $browser = ' <img src="images/agent/OW.png" alt="Omniweb" title="Omniweb" border="0" />';
   }
   else if (false !== strpos($agentstring, 'phoenix'))
   {
      $browser = ' <img src="images/agent/PX.png" alt="Phoenix" title="Phoenix" border="0" />';
   }
   else if (false !== strpos($agentstring, 'seamonkey'))
   {
      $browser = ' <img src="images/agent/SM.png" alt="Seamonkey" title="Seamonkey" border="0" />';
   }
   else
   {
      $browser = '';
   }

   return $browser;
}
// Browser  agent----------------------        



Die Browser Images müssen in das Verzeichnis:
images/agent/
enpackt werden.
Dateianhänge
imageset.zip
(19.47 KiB) 589-mal heruntergeladen
imageset.zip
(19.47 KiB) 589-mal heruntergeladen
Doc. :schein:

Werbung wird nicht durch www.lpi-clan.de bereitgestellt, sondern durch Google. Besucher dieser Links werden gebeten sorgfaeltig mit den angebotenen Produkten/Seiten umzugehen.