codice:
############################ /* FUNZIONE PER MENU' A TENDINA 1 */ ############################### # # ################################################################################################# //funzione per menù a tendina senza selected function select_one($indice,$nome_array, $nome_select, $option_value, $option_name){ global $query_select, $catselect; $catselect[$indice]="<select name=\"$nome_select\" class=\"tendina\"> <option value=\"0\" selected>.: Seleziona :.</option>"; while ($nome_array = mysql_fetch_array($query_select[$indice])){ $catselect[$indice].="<option value=\"$nome_array[$option_value]\">$nome_array[$option_name]</option>"; } $catselect[$indice].="</select>"; return $catselect[$indice]; } # ==================================================================== # ############################ /* FUNZIONE PER MENU' A TENDINA 2 */ ############################### # # ################################################################################################# //funzione per menù a tendina con selected function select_two($indice, $nome_array, $nome_select, $option_value, $option_name,$nome_get, $parametro){ global $query_select_two, $catselect_two; if(!isset($_GET["$nome_get"])) $_GET["$nome_get"] = ""; $catselect_two[$indice] ="<select name=\"$nome_select\" class=\"tendina\">\n"; //uso un parametro per vedere se aggiungere o meno l'opzione NESSUNA if($parametro == 1) $catselect_two[$indice] .= "<option value=\"0\" selected>Nessuna</option>\n"; //uso un parametro per vedere se aggiungere o meno l'opzione GUEST if($parametro == 2) $catselect_two[$indice] .= "<option value=\"0\">Ospite</option>\n"; while ($nome_array = mysql_fetch_array($query_select_two[$indice])){ if(isset($nome_array["$option_value"]) && ($nome_array["$option_value"] == $_GET["$nome_get"])){ $catselect_two[$indice] .=" <option value=\"$nome_array[$option_value]\" selected>$nome_array[$option_name]</option>\n"; } else{ $catselect_two[$indice] .=" <option value=\"$nome_array[$option_value]\">$nome_array[$option_name]</option>\n"; } } $catselect_two[$indice] .="</select>\n"; return $catselect_two[$indice]; } # ==================================================================== # ############################ /* FUNZIONE PER MENU' A TENDINA 3 */ ############################### # # ################################################################################################# //funzione per menù a tendina con selected /*function select_three($indice, $nome_array, $nome_select, $option_value, $option_name,$nome_get, $parametro,$secondo_array,$key){ global $query_select_three, $catselect_three; $catselect_three[$indice] ="<select name=\"$nome_select\" class=\"tendina\">\n"; //uso un parametro per vedere se aggiungere o meno l'opzione NESSUNA if($parametro == 1) $catselect_three[$indice] .= "<option value=\"0\" selected>Nessuna</option>"; while ($nome_array = mysql_fetch_array($query_select_three[$indice])){ if(isset($nome_array["$option_value"]) && ($nome_array["$option_value"] == $secondo_array["$key"])){ $catselect_three[$indice] .=" <option value=\"$nome_array[$option_value]\" selected>$nome_array[$option_name] $secondo_array[$key]</option>\n"; } else{ $catselect_three[$indice] .=" <option value=\"$nome_array[$option_value]\">$nome_array[$option_name]</option>\n"; } } $catselect_three[$indice] .="</select>\n"; return $catselect_three[$indice]; $pub_template = $_SERVER["DOCUMENT_ROOT"]."\download\public_template"; $admin_tempdir = $_SERVER["DOCUMENT_ROOT"]."\download\_admin\\template"; }*/ # ==================================================================== # ############ /* FUNZIONI RELATIVE AL SERVER DOVE È INSTALLATO LO SCRIPT */ ############### # # ########################################################################################## if(!eregi("win",PHP_OS)){ $total_cpu = ""; $oggetto = ""; $data_server = ""; $cpuinfo = ""; //trovo l'uptempo $uptempo = (exec("uptime")); //informazioni sul processore $cpuinfo = @file("/proc/cpuinfo"); $conta = count($cpuinfo) - 1; for ($z = 0; $z < $conta; $z++) { list($oggetto, $data_server) = split(":", $cpuinfo[$z], 2); $oggetto = chop($oggetto); $data_server = chop($data_server); if ($oggetto == "processor") { $total_cpu++; $cpu_info = $total_cpu; } if ($oggetto == "vendor_id") { $cpu_info .= $data_server; } if ($oggetto == "model name") { $cpu_info .= $data_server; } if ($oggetto == "cpu MHz") { $cpu_info .= " " . floor($data_server); $cpu_ok = "yes"; } if ($oggetto == "cache size") { $cache = $data_server;} if ($oggetto == "bogomips") { $bogomips = $data_server;} } if($cpu_ok != "yes") { $cpu_info .= " unknown"; } $cpu_info .= " MHz\n"; $uptempo = str_replace("up",". Il server è up da",$uptempo); $uptempo = str_replace("days","giorni",$uptempo); $uptempo = str_replace("users","utenti",$uptempo); //$load["3"] = str_replace("load average:","",$load["3"]); //////////////////////////////////////////////////////////// //uptempo $uptempo =explode(",",$uptempo); $up = substr($uptempo[0],11); //users $users = $uptempo[2]; //load average $load = $uptempo[3].","; $load .= $uptempo[4].","; $load .= $uptempo[5]; } else { $up = "funzione non supportata dal sistema operativo in uso"; //users $users = "funzione non supportata dal sistema operativo in uso"; //load average $load = "funzione non supportata dal sistema operativo in uso"; $load .= ""; $load .= ""; $cpu_info = "funzione non supportata dal sistema operativo in uso"; } # ==================================================================== # ############################### /* VARIABILI SETTATE */ ################################## # # ########################################################################################## /* PAGINA VIEWCAT */ //nome immagine new define("NUOVA","new.gif"); //immagine trasparente define("SHIM","shim.gif"); //immagine hot define("HOT","hot.gif"); //subcategorie per riga define("SUBCAT_LIMIT",2); //intestazione quando ci sono solo sottocategorie define("ONLY_SUBCAT","Subcategorie presenti"); /*===================*/ /* PAGINA VIEWFILE */ //nome dell'utente guest define("GUEST","Collaboratore"); //recensione vuota define("NO_CORPO","Recensione non disponibile"); //il file non è più presente sul server define("NO_FILE_ONSERVER","File inesistente"); //file remoto define("REMOTE_FILE","Non disponibile"); //pagina esterna define("REMOTE_PAGE","Pagina per il download"); /*===================*/ /* PAGINA VOTO */ define("REGISTERED","Il tuo voto è stato registrato con successo"); define("NOT_REGISTERED","Attenzione! Hai già votato questa scheda"); define("REDIR_REGISTERED","Tra poco verrai rimandato alla scheda del file"); /*===================*/ /* PAGINA SEGNALA AD UN AMICO */ define("MAILED","La tua segnalazione è stata inoltrata con successo"); /*===================*/ /* DEFINIZIONE ERRORI */ define("NO_IDCAT","Non ha selezionato l'ID della categoria!"); define("CAT_NO","La categoria non esiste!"); define("CAT_NOVISIBLE","La categoria non è più disponibile!"); define("NO_IDFILE","Non ha selezionato l'ID del file!"); define("NO_FILE","Il file non è presente sul server!"); define("NO_SENDPERMISSION","Attenzione! Autorizzazione negata!"); define("NO_EMAIL","Il campo \"email\" è obbligatorio!"); define("NO_NAME","I campi \"nome\" sono obbligatori!"); /*===================*/ /* VARIE */ //limite per la pagina statistiche e IP voti define("LIMIT_OTHER",20); //icone per l'estensione nella pagina fileupload.php define("IMAGE","icona_image.gif"); define("ZIP","icona_zip.gif"); define("RAR","icona_winrar.gif"); define("GZ","icona_winrar.gif"); define("EXT_NONE","icona_undefined.gif"); define("SOUND","icona_sound.gif"); define("EXE","icona_exe.gif"); define("VIDEO","icona_video.gif"); define("DOC","icona_doc.gif"); /*===================*/ ?>