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

    Warning: Invalid argument supplied for foreach()

    Salve a tutti, come si deduce da titolo il mio problema e con questo errore Warning: Invalid argument supplied for foreach() in D:\wamp\www\...\layouts\left-top-right-bottom_frames.php on line 134

    il codice incriminato è quello indicato dalla frecciolina -->:
    Codice PHP:
    <div id="framecontentTop">
        <div class="innertube">

            <div class="colonne_top">
            <?php 
                         
    -->                foreach($PARAMETERS['top_column']['box'] as $box)
                    {
                        echo 
    '<div class="'.$box['class'].'">';
                        
                        
    gdrcd_load_modules('pages/'.$box['page'].'.inc.php');
                    
                        echo 
    '</div>';
                    
                    }
                            
            
    ?>
            </div>

        </div>
    </div>
    Come posso risolvere il problema? Grazie a tutti per l'eventuale aiuto!

    N.B. Sono un Grafico e di PHP ne mastico giusto quel poco che mi serve per mettere mani alla grafica, quindi vi chiedo il favore di mettere eventuali soluzioni in formato passo passo. Vi ringrazio ancora per tutto l'aiuto che potrete darmi.

    Edit:
    Dimenticavo lo stesso errore me lo da con la riga 199 della stessa pagina php, il codice incriminato e sempre quello indicato dalla frecciolina -->:
    Codice PHP:
    <div id="framecontentBottom">
        <div class="innertube">

            <div class="colonne_bot">
            <?php 
                         
    -->                foreach($PARAMETERS['bottom_column']['box'] as $box)
                    {
                        echo 
    '<div class="'.$box['class'].'">';
                        
                        
    gdrcd_load_modules('pages/'.$box['page'].'.inc.php');
                    
                        echo 
    '</div>';
                    
                    }
                            
            
    ?>
            </div>

        </div>
    </div>
    Vi ringrazio di nuovo per l'aiuto!

  2. #2
    stampa il contenuto di $PARAMETERS, forse non e' quello che ti aspetti. Prima del foreach ovviamente.

    Codice PHP:
    <?php

    echo "<pre>";
    print_r($PARAMETERS);

    Il silenzio è spesso la cosa migliore. Pensa ... è gratis.

  3. #3
    Mi compare un Array, questa:
    Codice PHP:
    Array
    (
        [
    database] => Array
            (
                [
    username] => root
                
    [password] => 
                [
    database_name] => gdr_db
                
    [url] => localhost
            
    )

        [
    mode] => Array
            (
                [
    encriptpassword] => OFF
                
    [encriptalgorithm] => SHA-1
                
    [welcome_message_homepage] => ON
                
    [allow_audio] => ON
                
    [dices] => ON
                
    [chat_avatar] => ON
                
    [map_tooltip] => ON
                
    [user_bbcode] => ON
                
    [alert_password_change] => ON
                
    [chat_from_bottom] => OFF
                
    [give_only_if_online] => ON
                
    [popup_choise] => ON
                
    [alert_pm_via_pagetitle] => ON
                
    [user_online_state] => OFF
                
    [gotomap_list] => OFF
                
    [log_back_location] => ON
                
    [mapwise_links] => ON
                
    [auto_meteo] => OFF
                
    [skillsystem] => OFF
                
    [filterdocuments] => ON
                
    [emailconfirmation] => OFF
                
    [racialinfo] => ON
                
    [chaticons] => ON
                
    [spymessages] => OFF
                
    [privaterooms] => OFF
                
    [spyprivaterooms] => ON
            
    )

        [
    info] => Array
            (
                [
    site_name] => GDR Prova
                
    [site_url] => [url]http://localhost/gdrcd5.1_beta/[/url]
                
    [webmaster_name] => A.M.
                [
    webmaster_email] => [email]alice.mandelli@samm-webart.it[/email]
                [
    homepage_name] => Home
                
    [dbadmin_name] => A.M.
            )

        [
    languages] => Array
            (
                [
    set] => IT-it
            
    )

        [
    themes] => Array
            (
                [
    current_theme] => advanced
                
    [kind_of_layout] => left-top-right-bottom
            
    )

        [
    top_column] => Array
            (
                [
    activate] => ON
            
    )

        [
    bottom_column] => Array
            (
                [
    activate] => ON
            
    )

        [
    left_column] => Array
            (
                [
    activate] => ON
                
    [box] => Array
                    (
                        [
    info_location] => Array
                            (
                                [class] => 
    info
                                
    [page] => info_location
                            
    )

                        [
    frame_messaggi] => Array
                            (
                                [class] => 
    msgs
                                
    [page] => frame_messaggi
                            
    )

                        [
    link_menu] => Array
                            (
                                [class] => 
    menu
                                
    [page] => link_menu
                            
    )

                    )

            )

        [
    right_column] => Array
            (
                [
    activate] => ON
                
    [box] => Array
                    (
                        [
    frame_presenti] => Array
                            (
                                [class] => 
    presenti
                                
    [page] => frame_presenti
                            
    )

                    )

            )

        [
    names] => Array
            (
                [
    users_name] => Array
                    (
                        [
    sing] => Utente
                        
    [plur] => Utenti
                    
    )

                [
    currency] => Array
                    (
                        [
    sing] => Credito
                        
    [plur] => Crediti
                        
    [short] => CF
                    
    )

                [
    private_message] => Array
                    (
                        [
    sing] => Comunicazione
                        
    [plur] => Comunicazioni
                        
    [image_file] => 
                        [
    image_file_onclick] => 
                        [
    image_file_new] => 
                    )

                [
    forum] => Array
                    (
                        [
    sing] => Bacheca
                        
    [plur] => Bacheche
                        
    [image_file] => 
                        [
    image_file_onclick] => 
                    )

                [
    guild_name] => Array
                    (
                        [
    sing] => Sezione
                        
    [plur] => Sezioni
                        
    [lead] => Caposezione
                        
    [members] => Membri
                        
    [type] => 
                    )

                [
    race] => Array
                    (
                        [
    sing] => Specie
                        
    [plur] => Specie
                        
    [lead] => Referente
                    
    )

                [
    master] => Array
                    (
                        [
    sing] => Master
                        
    [plur] => Master
                    
    )

                [
    moderators] => Array
                    (
                        [
    sing] => Moderatore
                        
    [plur] => Moderatori
                    
    )

                [
    administrator] => Array
                    (
                        [
    sing] => Gestore
                        
    [plur] => Gestori
                    
    )

                [
    gamemenu] => Menu
                
    [market_name] => Mercato
                
    [maps_location] => Off Game
                
    [base_location] => Off Game
                
    [stats] => Array
                    (
                        [
    car0] => Capacità di Gioco
                        
    [car1] => Disponibilità
                        
    [car2] => Conoscenze Ambientali
                        
    [car3] => Conoscenza Scientifico-Tecnologica
                        
    [car4] => Socializzazione
                        
    [car5] => Leadership
                        
    [hitpoints] => Punti ferita
                    
    )

            )

        [
    date] => Array
            (
                [
    offset] => 0
                
    [base_temperature] => -4
            
    )

        [
    settings] => Array
            (
                [
    first_map] => -1
                
    [first_money] => 0
                
    [posts_per_page] => 15
                
    [records_per_page] => 15
                
    [messages_per_page] => 40
                
    [messages_limit] => 50
                
    [minimum_employment] => 10
                
    [guilds_limit] => 1
                
    [resell_price] => 0
                
    [first_px] => 0
                
    [max_hp] => 100
                
    [px_x_rank] => 10
                
    [skills_cap] => 10
                
    [initial_cars_cap] => 10
                
    [cars_cap] => 10
                
    [cars_sum] => 40
                
    [view_logs] => 10
                
    [audiotype] => Array
                    (
                        [.
    mp3] => audio/mpeg
                        
    [.mid] => audio/x-mid
                        
    [.midi] => audio/x-mid
                        
    [.wav] => audio/x-wav
                    
    )

                [
    audio_new_messagges] => beep.wav
                
    [skills_dices] => Array
                    (
                        [
    d4] => 4
                        
    [d6] => 6
                        
    [d8] => 8
                        
    [d10] => 10
                        
    [d12] => 12
                        
    [d20] => 20
                        
    [d100] => 100
                    
    )

                [
    chat_avatar] => Array
                    (
                        [
    width] => 50
                        
    [height] => 50
                    
    )

                [
    map_tooltip] => Array
                    (
                        [
    offset_y] => 20
                        
    [offset_x] => 20
                    
    )

                [
    forum_bbcode] => Array
                    (
                        [
    type] => bbd
                    
    )

                [
    user_bbcode] => Array
                    (
                        [
    type] => bbd
                    
    )

                [
    bbd] => Array
                    (
                        [
    free_html] => ON
                        
    [imageshack] => OFF
                        
    [image_max_width] => 300
                        
    [image_max_height] => 300
                        
    [youtube] => OFF
                        
    [images_ext] => Array
                            (
                                [
    0] => jpg
                                
    [1] => jpeg
                                
    [2] => png
                                
    [3] => gif
                            
    )

                    )

                [
    alert_password_change] => Array
                    (
                        [
    alert_from_signup] => ON
                    
    )

            )

        [
    pegi] => Array
            (
                [
    violenza] => Array
                    (
                        [
    image_file] => 117.gif
                        
    [text] => Gioco che contiene scene di violenza
                    
    )

                [
    paura] => Array
                    (
                        [
    image_file] => 113.gif
                        
    [text] => Gioco che può allarmare o spaventare i bambini 
                    
    )

                [
    volgarita] => Array
                    (
                        [
    image_file] => 115.gif
                        
    [text] => Gioco che contiene espressioni volgari
                    
    )

                [
    online] => Array
                    (
                        [
    image_file] => 237.gif
                        
    [text] => Gioco online
                    
    )

                [
    18+] => Array
                    (
                        [
    image_file] => 156.gif
                        
    [text] => Per un pubblico adulto
                    
    )

            )

        [
    menu] => Array
            (
                [
    refresh] => Array
                    (
                        [
    text] => Aggiorna
                        
    [url] => main.php?dir=-1
                        
    [image_file] => 
                        [
    image_file_onclick] => 
                    )

                [
    map] => Array
                    (
                        [
    text] => Mappa
                        
    [url] => main.php?page=mappaclick&map_id=1
                        
    [image_file] => 
                        [
    image_file_onclick] => 
                    )

                [
    profile] => Array
                    (
                        [
    text] => Scheda
                        
    [url] => main.php?page=scheda&pg=Super
                        
    [image_file] => 
                        [
    image_file_onclick] => 
                    )

                [
    forum] => Array
                    (
                        [
    text] => Bacheca
                        
    [url] => main.php?page=forum
                        
    [image_file] => 
                        [
    image_file_onclick] => 
                    )

                [
    backend] => Array
                    (
                        [
    text] => Gestione
                        
    [url] => main.php?page=gestione
                        
    [image_file] => 
                        [
    image_file_onclick] => 
                    )

                [
    services] => Array
                    (
                        [
    text] => Servizi
                        
    [url] => main.php?page=uffici
                        
    [image_file] => 
                        [
    image_file_onclick] => 
                    )

                [
    user_services] => Array
                    (
                        [
    text] => Menu utente
                        
    [url] => main.php?page=utenti
                        
    [image_file] => 
                        [
    image_file_onclick] => 
                    )

                [
    quit] => Array
                    (
                        [
    text] => Esci
                        
    [url] => logout.php
                        
    [image_file] => 
                        [
    image_file_onclick] => 
                    )

            ) 
    segue...

  4. #4
    parte seconda array:
    Codice PHP:

        
    [office_page_name] => Servizi
        
    [office] => Array
            (
                [
    image_file] => 
                [
    pg_list] => Array
                    (
                        [
    text] => Anagrafe
                        
    [url] => main.php?page=servizi_anagrafe
                        
    [access_level] => 0
                    
    )

                [
    guilds_adm] => Array
                    (
                        [
    text] => Amministrazione sezione
                        
    [url] => main.php?page=servizi_adm_gilde
                        
    [access_level] => 0
                    
    )

                [
    job] => Array
                    (
                        [
    text] => Lavoro
                        
    [url] => main.php?page=servizi_lavoro
                        
    [access_level] => 0
                    
    )

                [
    guilds] => Array
                    (
                        [
    text] => Sezioni
                        
    [url] => main.php?page=servizi_gilde
                        
    [access_level] => 0
                    
    )

                [
    market] => Array
                    (
                        [
    text] => Mercato
                        
    [url] => main.php?page=servizi_mercato
                        
    [access_level] => 0
                    
    )

                [
    bank] => Array
                    (
                        [
    text] => Servizi bancari
                        
    [url] => main.php?page=servizi_banca
                        
    [access_level] => 0
                    
    )

            )

        [
    user_page_name] => Menù utente
        
    [user] => Array
            (
                [
    plot] => Array
                    (
                        [
    text] => Ambientazione
                        
    [url] => main.php?page=user_ambientazione
                        
    [access_level] => 0
                    
    )

                [
    name] => Array
                    (
                        [
    text] => Cambio nome
                        
    [url] => main.php?page=user_cambio_nome
                        
    [access_level] => 3
                    
    )

                [
    pass] => Array
                    (
                        [
    text] => Cambio password
                        
    [url] => main.php?page=user_cambio_pass
                        
    [access_level] => 0
                    
    )

                [
    delete] => Array
                    (
                        [
    text] => Cancella account
                        
    [url] => main.php?page=user_cancella_pg
                        
    [access_level] => 4
                    
    )

                [
    races] => Array
                    (
                        [
    text] => Elenco razze
                        
    [url] => main.php?page=user_razze
                        
    [access_level] => 0
                    
    )

                [
    rules] => Array
                    (
                        [
    text] => Regolamento
                        
    [url] => main.php?page=user_regolamento
                        
    [access_level] => 0
                    
    )

                [
    stats] => Array
                    (
                        [
    text] => Statistiche del sito
                        
    [url] => main.php?page=user_stats&links=yes
                        
    [access_level] => 0
                    
    )

            )

        [
    administration_page_name] => Gestione
        
    [administration] => Array
            (
                [
    image_file] => 
                [
    log_chat] => Array
                    (
                        [
    text] => Log chat
                        
    [url] => main.php?page=log_chat
                        
    [access_level] => 3
                    
    )

                [
    log_eventi] => Array
                    (
                        [
    text] => Log eventi
                        
    [url] => main.php?page=log_eventi
                        
    [access_level] => 3
                    
    )

                [
    skills] => Array
                    (
                        [
    text] => Gestione abilità
                        
    [url] => main.php?page=gestione_abilita
                        
    [access_level] => 4
                    
    )

                [
    plot] => Array
                    (
                        [
    text] => Gestione ambientazione
                        
    [url] => main.php?page=gestione_ambientazione
                        
    [access_level] => 4
                    
    )

                [
    forums] => Array
                    (
                        [
    text] => Gestione bacheche
                        
    [url] => main.php?page=gestione_bacheche
                        
    [access_level] => 4
                    
    )

                [
    guilds] => Array
                    (
                        [
    text] => Gestione gilde e ruoli
                        
    [url] => main.php?page=gestione_gilde
                        
    [access_level] => 4
                    
    )

                [
    locations] => Array
                    (
                        [
    text] => Gestione luoghi
                        
    [url] => main.php?page=gestione_luoghi
                        
    [access_level] => 4
                    
    )

                [
    maps] => Array
                    (
                        [
    text] => Gestione mappe
                        
    [url] => main.php?page=gestione_mappe
                        
    [access_level] => 4
                    
    )

                [
    items] => Array
                    (
                        [
    text] => Gestione oggetti
                        
    [url] => main.php?page=gestione_mercato
                        
    [access_level] => 4
                    
    )

                [
    levels] => Array
                    (
                        [
    text] => Gestione permessi
                        
    [url] => main.php?page=gestione_permessi
                        
    [access_level] => 4
                    
    )

                [
    races] => Array
                    (
                        [
    text] => Gestione razze
                        
    [url] => main.php?page=gestione_razze
                        
    [access_level] => 4
                    
    )

                [
    rules] => Array
                    (
                        [
    text] => Gestione regolamento
                        
    [url] => main.php?page=gestione_regolamento
                        
    [access_level] => 4
                    
    )

                [
    maintenance] => Array
                    (
                        [
    text] => Manutenzione
                        
    [url] => main.php?page=gestione_manutenzione
                        
    [access_level] => 4
                    
    )

            )



  5. #5
    codice:
       [top_column] => Array
            (
                [activate] => ON
            )
    
        [bottom_column] => Array
            (
                [activate] => ON
            )
    
        [left_column] => Array
            (
                [activate] => ON
                [box] => Array
    infatti in top_column e bottom_column hai solo [activate]. [box] e' solo in left_column e right_column, ma sono a loro volta un array

    Quindi per quei primi due non hai alcun foreach da eseguire ma solo la lettura del contenuto dell'indice [activate]

    Il silenzio è spesso la cosa migliore. Pensa ... è gratis.

  6. #6
    Quindi dovrei aggiungere [box] ha bottom e top...

    credo di aver capito dove l'errore.. in config.inc e cioè qui:
    Codice PHP:
    /*CONFIGURAZIONE DELLE COLONNE*/
        
        // ON: è attiva la colonna/riga specificata
        // OFF: è disattiva
        
    $PARAMETERS['top_column']['activate']    ='ON';
        
    $PARAMETERS['bottom_column']['activate']='ON';
        
    $PARAMETERS['left_column']['activate']    ='ON';
        
    $PARAMETERS['right_column']['activate']    ='ON';
        
        
        
    /*COLONNA SINISTRA */
        
    $PARAMETERS['left_column']['box']['info_location']['class']='info';
        
    $PARAMETERS['left_column']['box']['info_location']['page']='info_location'//Meteo e informazioni sul luogo.
        
    $PARAMETERS['left_column']['box']['frame_messaggi']['class']='msgs'
        
    $PARAMETERS['left_column']['box']['frame_messaggi']['page']='frame_messaggi'//Link ai messaggi ed al forum.
        
    $PARAMETERS['left_column']['box']['link_menu']['class']='menu';
        
    $PARAMETERS['left_column']['box']['link_menu']['page']='link_menu'//Menu' del gioco.
        
        /*COLONNA DESTRA*/
        
    $PARAMETERS['right_column']['box']['frame_presenti']['class']='presenti';
        
    $PARAMETERS['right_column']['box']['frame_presenti']['page']='frame_presenti'//Presenti. 
    mancano le configurazione delle altre 2 colonne, che suppongo debba fare cosi, correggimi se sbaglio:
    Codice PHP:
    /*RIGHA IN ALTO*/
        
    $PARAMETERS['top_column']['box'][' ']['class']=' ';
        
    $PARAMETERS['top_column']['box'][' ']['page']=' '

    /*RIGHA IN BASSO*/
        
    $PARAMETERS['bottom_column']['box'][' ']['class']=' ';
        
    $PARAMETERS['bottom_column']['box'][' ']['page']=' '
    e poi negli apici prima e dopo class e page devo inserire quello che voglio far comparire li giusto?

    Edit:
    Funziona, grazie dell'aiuto!

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.