Visualizzazione dei risultati da 1 a 2 su 2
  1. #1

    Problema con script array mi stampa l'ultimo blocco

    Ho questo script di cui vi riporto il listato
    Mi stampa l'ultimo blocco array
    Mi potreste dire dove sbaglio
    Premetto che è un blocco per CMS Icy Phoenix da visualizzare in Home Page
    Grazie per l'aiuto in anticipo

    Codice PHP:
    <?php
    /**
    *
    * @package Icy Phoenix
    * @version $Id: blocks_imp_info.php 61 2008-10-30 09:25:26Z Mighty Gorgon $
    * @copyright (c) 2008 Icy Phoenix
    * @license [url]http://opensource.org/licenses/gpl-license.php[/url] GNU Public License
    *
    */

    /**
    *
    * @Extra credits for this file
    * name: fucile - Fabrizio Di Silvestro
    * url: [url]http://www.fabriziodisilvestro.org/[/url]
    */

    if (!defined('IN_ICYPHOENIX'))
    {
        die(
    'Hacking attempt');
    }

    $os_system = array(
    // Array Windows
            
    'Windows NT 6.1' => array(
                    
    'img' => 'images/http_agents/os/winlong.png',
                    
    'name' => 'Windows Seven'
                                    
    ),
            
    'Windows NT 6.0' => array(
                    
    'img' => 'images/http_agents/os/winlong.png',
                    
    'name' => 'Windows Vista'
                                    
    ),
            
    'Windows NT 5.2' => array(
                    
    'img' => 'images/http_agents/os/win2003.png',
                    
    'name' => 'Windows 2003'
                                    
    ),
            
    'Windows NT 5.1' => array(
                    
    'img' => 'images/http_agents/os/winxp.png',
                    
    'name' => 'Windows XP'
                                    
    ),
            
    'Windows NT 5.0' => array(
                    
    'img' => 'images/http_agents/os/win2000.png',
                    
    'name' => 'Windows 2000'
                                    
    ),
            
    'Windows NT 4.9' => array(
                    
    'img' => 'images/http_agents/os/winme.png',
                    
    'name' => 'Windows Millenium'
                                    
    ),
            
    'Win' => array(
                    
    'img' => 'images/http_agents/os/win.png',
                    
    'name' => 'Windows'
                                    
    ),
    // Array Mac
            
    'Mac' => array(
                    
    'img' =>'images/http_agents/os/macosx.png',
                    
    'name' => 'Apple I-Mac'
                                    
    ),
            
    'PPC' => array(
                    
    'img' => 'images/http_agents/os/mac.png',
                    
    'name' => 'Apple Power-Pc'
                                    
    ),
    // Array Linux
            
    'Unix' => array(
                    
    'img' => 'images/http_agents/os/unix.png',
                    
    'name' => 'Unix System'
                                    
    ),
            
    'Linux' => array(
                    
    'img' => 'images/http_agents/os/linux.png',
                    
    'name' => 'Linux'
                                    
    ),
            
    'SuSE' => array(
                    
    'img' => 'images/http_agents/os/suse.png',
                    
    'name' => 'SUSE Linux'
                                    
    ),
            
    'Slackware' => array(
                    
    'img' => 'images/http_agents/os/slackware.png',
                    
    'name' => 'Slackware'
                                    
    ),
            
    'Mandrake' => array(
                    
    'img' => 'images/http_agents/os/mandrake.png',
                    
    'name' => 'Mandrake'
                                    
    ),
            
    'Fedora' => array(
                    
    'img' => 'images/http_agents/os/fedora.png',
                    
    'name' => 'Fedora'
                                    
    ),
            
    'Novell' => array(
                    
    'img' => 'images/http_agents/os/novell.png',
                    
    'name' => 'Novell'
                                    
    ),
            
    'Ubuntu' => array(
                    
    'img' => 'images/http_agents/os/ubuntu.png',
                    
    'name' => 'Ubuntu'
                                    
    ),
            
    'Kubuntu' => array(
                    
    'img' => 'images/http_agents/os/kubuntu.png',
                    
    'name' => 'Kubuntu'
                                    
    ),
            
    'Xubuntu' => array(
                    
    'img' => 'images/http_agents/os/xubuntu.png',
                    
    'name' => 'Xubuntu'
                                    
    ),
            
    'Edubuntu' => array(
                    
    'img' => 'images/http_agents/os/edubuntu.png',
                    
    'name' => 'Edubuntu'
                                    
    ),
            
    'Debian' => array(
                    
    'img' => 'images/http_agents/os/debian.png',
                    
    'name' => 'Debian'
                                    
    ),
            
    'Red Hat' => array(
                    
    'img' => 'images/http_agents/os/redhat.png',
                    
    'name' => 'Red Hat'
                                    
    ),
    // Array Other Browser
            
    'Nintendo DS' => array(
                    
    'img' => 'images/http_agents/os/unknown.png',
                    
    'name' => 'Nintendo DS'
                                    
    ),
            
    'FreeBSD' => array(
                    
    'img' => 'images/http_agents/os/unknown.png',
                    
    'name' => 'Sconosciuto'
                                    
    ),
            
    'SunOS' => array(
                    
    'img' => 'images/http_agents/os/unknown.png',
                    
    'name' => 'Sconosciuto'
                                    
    ));


    $browser = array(
    // Array Browser
            
    'MSIE 8.0' => array(
                    
    'img' => 'images/http_agents/browsers/msie.png',
                    
    'name' => 'Explorer Versione 8.0',
                                    ),
            
    'MSIE 7.0' => array(
                    
    'img' => 'images/http_agents/browsers/msie.png',
                    
    'name' => 'Explorer Versione 6.0',
                                    ),
            
    'MSIE 6.0' => array(
                    
    'img' => 'images/http_agents/browsers/msie.png',
                    
    'name' => 'Explorer Versione 6.0',
                                    ),
            
    'Firefox' => array(
                    
    'img' => 'images/http_agents/browsers/firefox.png',
                    
    'name' => 'Firefox',
                                    ),
            
    'Konqueror' => array(
                    
    'img' => 'images/http_agents/browsers/konqueror.png',
                    
    'name' => 'Konqueror',
                                    ),
            
    'Chrome' => array(
                    
    'img' => 'images/http_agents/browsers/chrome.png',
                    
    'name' => 'Chrome',
                                    ));


    // Array Print Os System
    $os_system_values = array();
    $os_system_img = array();
    $os_system_name = array();


    foreach(
    $os_system as $os_system_string => $os_system_get_string)
    {
    if(
    strpos($_SERVER['HTTP_USER_AGENT'], $os_system_string))
    {
        
    $os_system_values[] = $os_system_string;
        
    $os_system_img[] = $os_system[$os_system_string]['img'];
        
    $os_system_name[] = $os_system[$os_system_string]['name'];

    }}


    // Array Print Browser
    $browser_values = array();
    $browser_img = array();
    $browser_name = array();

    foreach(
    $browser as $browser_string => $browser_get_string)
    {
    if(
    strpos($_SERVER['HTTP_USER_AGENT'], $browser_string))
    {
        
    $browser_values[] = $browser_string;
        
    $browser_img[] = $browser[$browser_string]['img'];
        
    $browser_name[] = $browser[$browser_string]['name'];

    }}


    $template->assign_vars(array(
        
        
    'L_USER_IP'         => 'IP',
        
    'USER_IP'           => $_SERVER['REMOTE_ADDR'],
        
    'L_USER_SYSTEM'     => 'Sistema Operativo',
        
    'USER_SYSTEM_NAME'  => $os_system[$os_system_string]['name'],
        
    'USER_SYSTEM_IMG'   => $os_system[$os_system_string]['img'],
        
    'L_USER_BROWSER'    => 'Browser',
        
    'USER_BROWSER_NAME'  => $browser[$browser_string]['name'],
        
    'USER_BROWSER_IMG'   => $browser[$browser_string]['img']
        
        )
    );

    ?>
    Buona giornata da Fucile

  2. #2
    Ciao fucile, tutto quello che fai è alquanto inutile, hai già un file e tre funzioni che fanno quello che vuoi.

    Prova ad usare questo codice:
    Codice PHP:
    <?php
    /**
    *
    * @package Icy Phoenix
    * @version $Id: blocks_imp_info.php 61 2008-10-30 09:25:26Z Mighty Gorgon $
    * @copyright (c) 2008 Icy Phoenix
    * @license [url="http://opensource.org/licenses/gpl-license.php"][url]http://opensource.org/licenses/gpl-license.php[/url][/url] GNU Public License
    *
    */

    /**
    *
    * @Extra credits for this file
    * name: fucile - Fabrizio Di Silvestro
    * url: [url="http://www.fabriziodisilvestro.org/"][url]http://www.fabriziodisilvestro.org/[/url][/url]
    */

    if (!defined('IN_ICYPHOENIX'))
    {
        die(
    'Hacking attempt');
    }

    include_once(
    IP_ROOT_PATH 'includes/functions_mg_http.' PHP_EXT);

    $browser get_user_browser($_SERVER['HTTP_USER_AGENT']);
    $system get_user_os($_SERVER['HTTP_USER_AGENT']);

    $template->assign_vars(array(
        
    'USER_IP'            => htmlspecialchars($_SERVER['REMOTE_ADDR']),
        
    'USER_SYSTEM_NAME'    => $system['name'],
        
    'USER_SYSTEM_IMG'    => $system['img'],
        
    'USER_BROWSER_NAME'    => $browser['name'],
        
    'USER_BROWSER_IMG'    => $browser['img'],

        
    'L_USER_BROWSER'    => $lang['Browser'],
        
    #'L_USER_SYSTEM'        => 'Sistema Operativo',
        
    'L_USER_SYSTEM'        => $lang['Last_Used_OS'],
        
    'L_USER_IP'            => $lang['IP'],
    ));

    ?>

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.