Visualizzazione dei risultati da 1 a 4 su 4
  1. #1
    Utente di HTML.it L'avatar di danlupo
    Registrato dal
    Jul 2009
    Messaggi
    314

    Problema Include due file..

    Salve è meglio che chiedo a voi..

    Ho questa situazione

    Codice PHP:
      <?php
      session_start
    ();
    require_once(
    $_SERVER['DOCUMENT_ROOT'].'/includes/costanti.php');
    require(
    DRPHP.'uservar.php');
    if ((
    $accesso==TRUE)&&($utente!=''))
    {
    define(ADVPAG,$_SERVER['PHP_SELF'].'?fold=galls');
    define (DRG,DRRA.'gallery/');
    define (PG,PARA.'gallery/');

           
    ?>
      <script>
        $(function() {
            $( "#tabs" ).tabs();
        });
        </script>
            <script type="text/javascript" charset="utf-8">
      $(document).ready(function(){
      $("a[rel^='prettyPhoto']").prettyPhoto({
                animation_speed: 'slow', /* fast/slow/normal */
                slideshow: 10000, /* false OR interval time in ms */
                autoplay_slideshow: false, /* true/false */
                opacity: 0.80, /* Value between 0 and 1 */
                show_title: false, /* true/false */
                allow_resize: true, /* Resize the photos bigger than viewport. true/false */
                default_width: 500,
                default_height: 344,
                counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */
                theme: 'facebook', /* light_rounded / dark_rounded / light_square / dark_square / facebook */
                horizontal_padding: 20, /* The padding on each side of the picture */
                hideflash: false, /* Hides all the flash object on a page, set to TRUE if flash appears over prettyPhoto */
                wmode: 'opaque', /* Set the flash wmode attribute */
                autoplay: true, /* Automatically start videos: True/False */
                modal: false, /* If set to true, only the close button will close the window */
                deeplinking: true, /* Allow prettyPhoto to update the url to enable deeplinking. */
                overlay_gallery: true, /* If set to true, a gallery will overlay the fullscreen image on mouse over */
                keyboard_shortcuts: true, /* Set to false if you open forms inside prettyPhoto */
                changepicturecallback: function(){}, /* Called everytime an item is shown/changed */
                callback: function(){}, /* Called when prettyPhoto is closed */
                ie6_fallback: true,
                            social_tools: ''

                    });
        });
    </script>


    <h1> Galleria</h1>
    <div id="tabs">
        <div id='htab'>
            <ul>
        [*][url="#tabs-1"][img]<?php echo PAIMG.[/img]' alt='View Profile'/>[/url]
        [*][url="#tabs-2"][img]<?php echo PAIMG.[/img]' 
    alt='Edit Profile'/>[/url]         
            [/list]
            </
    div>
            <
    div id='ctab'>
        <
    div id="tabs-1">
    <
    div id='avvisi'>
      <?
    php
           
    include(DRPAGRA.'gallery/pubblica.php');
           
    ?>
    </div>
    </div>
    <div id="tabs-2">
    <div id='avvisi'>
      <?php
      
    include(DRPAGRA.'gallery/privata.php');
           
    ?>
    </div>
    </div>
    </div>
    </div>
    </div>
        <?php
    }
    else
    {
    header("Location: ".PAPAGES."reservedarea/main.php");
    }
    ?>
    Con i due file da includere che sono simili:

    Pubblica
    Codice PHP:
    <?php
    if (isset($_GET['cartellapu']))
    {
    $tempdir=$_GET['cartellapu'];
        
    cartelle(DRGALLS.$tempdir.'/',DRGALLS,PAGALLS,ADVPAG,'cartellapu');
    }
    else
    {
        
    cartelle(DRGALLS,DRGALLS,PAGALLS,ADVPAG,'cartellapu');    
    }
    ?>
    Privata
    Codice PHP:
    <?php 
    if (isset($_GET['cartellapr']))
    {
    $tempdir=$_GET['cartellapr'];
        
    cartelle(DRG.$tempdir.'/',DRG,PG,ADVPAG,'cartella');
    }
    else
    {
        
    cartelle(DRG,DRG,PG,ADVPAG,'cartella');
    }
    ?>
    Funzione Cartelle
    Codice PHP:

    function cartelle($cartella,$std,$pa,$reto,$posta)
    {
       echo  
    "<div id='headadv'>";
        echo 
    "<div id='foldadv'>";
        
    $startdir=$std;
        
    $cartella=str_ireplace("_"," ",$cartella);
        
    $directories array_filter(glob($cartella.'*',GLOB_ONLYDIR ));
           if(
    $startdir!=$cartella)
        {
            
    $parentdir=dirname($cartella);
            if ((
    $parentdir.'/')==$startdir)
            {
                echo 
    "[url='".$reto."'][img]".PAIMG."folderup.png[/img]<h6>..</h6>[/url]";
            }
            else
            {
            
    $dirup=str_ireplace($startdir''$parentdir); 
    echo 
    "[url='".$reto."&$posta=".$dirup."'][img]".PAIMG."folderup.png[/img]<h6>..</h6>[/url]";
            }
        }
        foreach (
    $directories as $key => $value)  
           {
            
    $dirstr_ireplace($startdir,'',$value);
            
    $dirx=str_ireplace($_GET[$posta].'/','',$dir);
            
    $dir=str_ireplace(" ","_",$dir);
            
            echo 
    "[url='".$reto."&$posta=".$dir."'][img]".PAIMG."folder.png[/img]<h6>$dirx</h6>[/url]";
         
        
           }
     
    echo 
    "</div>";
    echo 
    "<div id='titlefold'>";

    if (
    $cartella!=$startdir)
    {
    $h3 =str_ireplace($parentdir,'',$cartella);
    $h3=str_ireplace('/','',$h3);
    $h2='HOME - ';
    if (
    $parentdir.'/' !=$startdir)
    {
    $temph=str_ireplace($startdir,'',$parentdir);
    $bcexplode('/',$temph);
    foreach (
    $bc as $k=>$v)
    {
    $h2.=strtoupper($v).' - ';    
    }

    }
    }

    else
    {
        
    $h2='';
        
    $h3="HOME";
    }
    $h2=substr($h2,0,strlen($h2)-3);
    echo 
    "<h2>".$h2."</h2>";
    echo 
    "<h3>".$h3."</h3>";    

    echo 
    "</div>";
    echo 
    "</div>";
    echo 
    "<div id='imggalls'>";
    $imggalls=array_filter(glob($cartella.'*.{png,jpg}'GLOB_BRACE)); 
    echo 
    "<ul class='gallery clearfix'>";
                         foreach (
    $imggalls as $key => $value)  
       {
        
    $imgv=str_ireplace($cartella,'',$value);
            
    $value=str_ireplace($cartella,'',$value);
    $cart=str_ireplace($startdir,$pa,$cartella);    
    $imgurl=$cart.$value;
      echo 
    "[url='$imgurl'][img]$imgurl[/img][/url]";

       }    
    echo 
    "[/list]";
    echo 
    "</div>";
    echo 
    "</div>";
    }
    ?> 
    Il Problema è che nel primo funziona correttamente sia il php che il css mentre nel secondo no e non riesco a capire l'errore..

  2. #2
    Utente di HTML.it
    Registrato dal
    Apr 2004
    Messaggi
    3,709
    "no" in che senso? ci sono percorsi relativi diversi... forse è quello...

  3. #3
    Utente di HTML.it L'avatar di danlupo
    Registrato dal
    Jul 2009
    Messaggi
    314
    Il problema penso fosse stato sulle variabili GET e sulle Costanti che ho riscritto ed a parte un IF sembra funzionare

  4. #4
    Utente di HTML.it L'avatar di danlupo
    Registrato dal
    Jul 2009
    Messaggi
    314
    Scusate ma questa parte:

    Codice PHP:
    '*.{png,jpg}' 
    è possibile metterla sotto forma di variabile ??

    Perchè se no devo riscrivere 3 volte la stessa funzione: 1 dove raccolgo solo le immagini, 1 dove raccolgo delle note in PDF ed una dove ho un'area download quindi con *.*..

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.