$value ) { $central_file_header[$key] &= 0xffffffff; } /* extracting filename */ $filename = substr( $file_contents , $pointer + 46 , $central_file_header['filename_len'] ); /* extracting extrafield */ $extra = substr( $file_contents , $pointer + 46 + $central_file_header['filename_len'] , $central_file_header['extra_len'] ); /* extracting comment */ $comment = substr( $file_contents , $pointer + 46 + $central_file_header['filename_len'] + $central_file_header['extra_len'] , $central_file_header['comment_len'] ); $pointer += 46 + $central_file_header['filename_len'] + $central_file_header['extra_len'] + $central_file_header['comment_len']; /* filter directories */ if ( $filename{strlen( $filename ) - 1} != '/' ) { /* calculating position of compressed content */ $content_start = $central_file_header['offset'] + 30 + $central_file_header['filename_len'] + $central_file_header['extra_len']; if ( $central_file_header['compression'] == 0 ) { /* extracting uncompressed content */ $content = substr( $file_contents , $content_start , $central_file_header['compressed_size'] ); } else { /* extracting compressed content */ $content = substr( $file_contents , $content_start , $central_file_header['compressed_size'] ); $content .= pack( 'VV' , $central_file_header['crc'] , $central_file_header['size'] ); /* decompressing content */ $content = @gzinflate( $content ); } /* getting filestatus */ $status = 'ok'; if ( $content === FALSE && $status == 'ok' ) { $status = 'err_decompress'; } if ( crc32( $content ) != $central_file_header['crc'] && $status == 'ok' ) { $status = 'err_crc'; } if ( strlen( $content ) != $central_file_header['size'] && $status == 'ok' ) { $status = 'err_length'; } if ( $status == 'ok' ) { if ( !is_null( $strSavePath ) ) { $strDirName = dirname( $strSavePath . "/" . $filename ); if ( !in_array( $strDirName , $arrCreatedDirectory ) ) { @mkdir( $strDirName , 0700 , true ); $arrCreatedDirectory[] = $strDirName; } file_put_contents( $strSavePath . "/" . $filename , $content ); $archive_data[$filename] = true; } else { $archive_data[$filename] = $content; } } } } if ( !is_null( $strSavePath ) ) { return $arrCreatedDirectory; } return $archive_data; } public function add_dir( $name ) // adds "directory" to archive - do this before putting any files in directory! // $name - name of directory... like this: "path/" // ...then you can add files using add_file with names like "path/file.txt" { $name = str_replace( "\\" , "/" , $name ); if ( substr( $name , 0 , 1 ) == "/" ) { $name = substr( $name , 1 ); } if ( is_array( $this->arrSkipDirectories ) ) { foreach( $this->arrSkipDirectories as $strSkipDir ) { $name = str_replace( $strSkipDir , "" , $name ); } } $fr = "\x50\x4b\x03\x04"; $fr .= "\x0a\x00"; // ver needed to extract $fr .= "\x00\x00"; // gen purpose bit flag $fr .= "\x00\x00"; // compression method $fr .= "\x00\x00\x00\x00"; // last mod time and date $fr .= pack( "V" , 0 ); // crc32 $fr .= pack( "V" , 0 ); //compressed filesize $fr .= pack( "V" , 0 ); //uncompressed filesize $fr .= pack( "v" , strlen( $name ) ); //length of pathname $fr .= pack( "v" , 0 ); //extra field length $fr .= $name; // end of "local file header" segment // no "file data" segment for path // "data descriptor" segment (optional but necessary if archive is not served as file) $fr .= pack( "V" , $crc ); //crc32 $fr .= pack( "V" , $c_len ); //compressed filesize $fr .= pack( "V" , $unc_len ); //uncompressed filesize // add this entry to array $this->datasec[] = $fr; $new_offset = strlen( implode( "" , $this->datasec ) ); // ext. file attributes mirrors MS-DOS directory attr byte, detailed // at http://support.microsoft.com/support/kb/articles/Q125/0/19.asp // now add to central record $cdrec = "\x50\x4b\x01\x02"; $cdrec .= "\x00\x00"; // version made by $cdrec .= "\x0a\x00"; // version needed to extract $cdrec .= "\x00\x00"; // gen purpose bit flag $cdrec .= "\x00\x00"; // compression method $cdrec .= "\x00\x00\x00\x00"; // last mod time & date $cdrec .= pack( "V" , 0 ); // crc32 $cdrec .= pack( "V" , 0 ); //compressed filesize $cdrec .= pack( "V" , 0 ); //uncompressed filesize $cdrec .= pack( "v" , strlen( $name ) ); //length of filename $cdrec .= pack( "v" , 0 ); //extra field length $cdrec .= pack( "v" , 0 ); //file comment length $cdrec .= pack( "v" , 0 ); //disk number start $cdrec .= pack( "v" , 0 ); //internal file attributes $ext = "\x00\x00\x10\x00"; $ext = "\xff\xff\xff\xff"; $cdrec .= pack( "V" , 16 ); //external file attributes - 'directory' bit set $cdrec .= pack( "V" , $this->old_offset ); //relative offset of local header $this->old_offset = $new_offset; $cdrec .= $name; // optional extra field, file comment goes here // save to array $this->ctrl_dir[] = $cdrec; } public function read_File( $file ) { if ( is_file( $file ) && filesize( $file) > 0 ) { $intFilesize = filesize( $file ); $fp = fopen( $file , 'rb' ); $content = fread( $fp , $intFilesize ); fclose( $fp ); return $content; } } // oliver hat die deepdir rausgeschmissen, brauchen wir net mehr public function getDirContent( $dirName = './' ) { if ( is_dir( $dirName ) ) { if ( $handle = opendir( $dirName ) ) { while (false !== ($file = readdir( $handle ))) { if ( ($file != '.') && ($file != '..') && (is_file( $file )) ) { $content[] = $file; } } closedir( $handle ); return $content; } } } public function addDirContent( $dir = './' ) { foreach( $this->getDirContent( $dir ) as $input ) { $this->addFileAndRead( str_replace( './/' , NULL , $input ) ); } } /** * @param string $file * @param null $filepath * @return void */ public function addFileAndRead( $file, $filepath = null ) { if( !is_null( $filepath)) { if ( is_file( $filepath ) ) { $this->addFile( $this->read_File( $file ) , $filepath ); } } else { if ( is_file( $file ) ) { $this->addFile( $this->read_File( $file ) , $file ); } } } private function unix2DosTime( $unixtime = 0 ) { date_default_timezone_set( 'Europe/Berlin' ); $timearray = ($unixtime == 0) ? getdate( ) : getdate( $unixtime ); if ( $timearray['year'] < 1980 ) { $timearray['year'] = 1980; $timearray['mon'] = 1; $timearray['mday'] = 1; $timearray['hours'] = 0; $timearray['minutes'] = 0; $timearray['seconds'] = 0; } return (($timearray['year'] - 1980) << 25) | ($timearray['mon'] << 21) | ($timearray['mday'] << 16) | ($timearray['hours'] << 11) | ($timearray['minutes'] << 5) | ($timearray['seconds'] >> 1); } private $arrFileTest = array(); public function addFile( $data , $name , $time = 0 ) { if ( in_array( $name , $this->arrFileTest ) ) { return false; } $this->arrFileTest[] = $name; $name = str_replace( '\\' , '/' , $name ); if ( substr( $name , 0 , 1 ) == "/" ) { $name = substr( $name , 1 ); } if ( is_array( $this->arrSkipDirectories ) ) { foreach( $this->arrSkipDirectories as $strSkipDir ) { $name = str_replace( $strSkipDir , "" , $name ); } } $dtime = dechex( $this->unix2DosTime( $time ) ); $hexdtime = '\x' . $dtime[6] . $dtime[7] . '\x' . $dtime[4] . $dtime[5] . '\x' . $dtime[2] . $dtime[3] . '\x' . $dtime[0] . $dtime[1]; eval( '$hexdtime = "' . $hexdtime . '";' ); $fr = "\x50\x4b\x03\x04"; $fr .= "\x14\x00"; // ver needed to extract $fr .= "\x00\x00"; // gen purpose bit flag $fr .= "\x08\x00"; // compression method $fr .= $hexdtime; // last mod time and date // "local file header" segment $unc_len = strlen( $data ); $crc = crc32( $data ); $zdata = gzcompress( $data ); $zdata = substr( substr( $zdata , 0 , strlen( $zdata ) - 4 ) , 2 ); // fix crc bug $c_len = strlen( $zdata ); $fr .= pack( 'V' , $crc ); // crc32 $fr .= pack( 'V' , $c_len ); // compressed filesize $fr .= pack( 'V' , $unc_len ); // uncompressed filesize $fr .= pack( 'v' , strlen( $name ) ); // length of filename $fr .= pack( 'v' , 0 ); // extra field length $fr .= $name; // "file data" segment $fr .= $zdata; // "data descriptor" segment (optional but necessary if archive is not // served as file) $fr .= pack( 'V' , $crc ); // crc32 $fr .= pack( 'V' , $c_len ); // compressed filesize $fr .= pack( 'V' , $unc_len ); // uncompressed filesize // add this entry to array $this->datasec[] = $fr; $new_offset = strlen( implode( '' , $this->datasec ) ); // now add to central directory record $cdrec = "\x50\x4b\x01\x02"; $cdrec .= "\x00\x00"; // version made by $cdrec .= "\x14\x00"; // version needed to extract $cdrec .= "\x00\x00"; // gen purpose bit flag $cdrec .= "\x08\x00"; // compression method $cdrec .= $hexdtime; // last mod time & date $cdrec .= pack( 'V' , $crc ); // crc32 $cdrec .= pack( 'V' , $c_len ); // compressed filesize $cdrec .= pack( 'V' , $unc_len ); // uncompressed filesize $cdrec .= pack( 'v' , strlen( $name ) ); // length of filename $cdrec .= pack( 'v' , 0 ); // extra field length $cdrec .= pack( 'v' , 0 ); // file comment length $cdrec .= pack( 'v' , 0 ); // disk number start $cdrec .= pack( 'v' , 0 ); // internal file attributes $cdrec .= pack( 'V' , 32 ); // external file attributes - 'archive' bit set $cdrec .= pack( 'V' , $this->old_offset ); // relative offset of local header $this->old_offset = $new_offset; $cdrec .= $name; // optional extra field, file comment goes here // save to central directory $this->ctrl_dir[] = $cdrec; return true; } public function getString( ) { $data = implode( NULL , $this->datasec ); $ctrldir = implode( NULL , $this->ctrl_dir ); return $data . $ctrldir . $this->eof_ctrl_dir . pack( 'v' , sizeof( $this->ctrl_dir ) ) . // total # of entries "on this disk" pack( 'v' , sizeof( $this->ctrl_dir ) ) . // total # of entries overall pack( 'V' , strlen( $ctrldir ) ) . // size of central dir pack( 'V' , strlen( $data ) ) . // offset to start of central dir "\x00\x00"; // .zip file comment length } private function dir_rekursiv( $verzeichnis ) { #global $arrFileNames; #global $arrEmptyDirs; $handle = opendir( $verzeichnis ); while ($datei = readdir( $handle )) { if ( $datei != "." && $datei != ".." ) { if ( is_dir( $verzeichnis . $datei ) ) // Wenn Verzeichniseintrag ein Verzeichnis ist { // Erneuter Funktionsaufruf, um das aktuelle Verzeichnis auszulesen if ( $datei != "./" ) { $this->arrEmptyDirs[] = $verzeichnis . $datei; } $this->dir_rekursiv( $verzeichnis . $datei . '/' ); } else { // Wenn Verzeichnis-Eintrag eine Datei ist, diese ausgeben $this->arrFileNames[] = $verzeichnis . $datei; } } } closedir( $handle ); } public function addRecursivFiles( $strStartverzeichnis = "./" ) { $this->dir_rekursiv( $strStartverzeichnis ); // f�gt die Verzeichnisse in das ZIP File foreach( $this->arrEmptyDirs as $value ) { if ( strpos( $value , ".." ) === 0 ) { $value = substr( $value , 2 ); } $this->add_dir( $value ); } // und jetzt die Dateien auslesen und in das Zip file schreiben foreach( $this->arrFileNames as $value ) { if ( strpos( $value , ".." ) === 0 ) { $value = substr( $value , 2 ); } $this->addFileAndRead( $value ); } } public function addFileAndReplace( $strFile2Parse , $arrReplaces ) { $strFileContent = file_get_contents( $strFile2Parse ); foreach( $arrReplaces AS $replaceKey => $replaceValue ) { $strFileContent = str_replace( $replaceKey , $replaceValue , $strFileContent ); } $this->addFile( $strFileContent , $strFile2Parse ); } public function setSkipDirectories( $arrDirectories ) { if ( is_array( $arrDirectories ) ) { foreach( $arrDirectories as $intKey => $strSkipDir ) { if ( substr( $strSkipDir , 0 , 1 ) == "/" || substr( $strSkipDir , 0 , 1 ) == "\\" ) { $strSkipDir = substr( $strSkipDir , 1 ); } if ( substr( $strSkipDir , -1 , 1 ) != "/" || substr( $strSkipDir , -1 , 1 ) != "\\" ) { $strSkipDir = $strSkipDir . "/"; } $arrDirectories[$intKey] = $strSkipDir; } $this->arrSkipDirectories = $arrDirectories; } } } ?>body{ background:#fff url('/images/datingarea_green/bg_head.gif') repeat-x; font-family:Verdana, Geneva, sans-serif; font-size:13px; margin:0px; padding:0px; color:#000; } .main{ width:996px; margin:auto; } i {visibility:hidden;} a {color:#3a3939; border:none; outline:none; text-decoration:none;} .clear{clear:both;} .left{ width:168px; float:left; background:#F2F2F2; } .middle{ float:left; width:630px; margin:0 15px; } .right{ float:left; width:168px; background:#e7e7e7; } .agb{ font-size:10px; color:#666; padding:0 40px; } .vip { color:#000000; font-weight:bolder; } /********************************************************************************************************************************************************header*/ .header{ height:85px; position:relative; top:0px; left:0px; } .nav{ height:39px; width:828px; position:absolute; top:31px; right:2px; background:url('/images/datingarea_green/btn_bg.gif') repeat-x; } .logo{ display:block; background:url('/images/datingarea_green/logo.png') top left no-repeat; height:85px; width:250px; margin:0px; padding:0px; position:absolute; top:0px; left:0px; float:left; } .btn{ float:right; font-size:12px; color:#5c5b5b; height:39px; line-height:35px; width:auto; background:url('/images/datingarea_green/btn_bg.gif') no-repeat top left; text-shadow: 0px 1px white; } * html .btn{ display:inline; width:108px; text-align:center; font-size:11px; } .activ{ color:#000; background:url('/images/datingarea_green/btn_bg_activ.gif') no-repeat top left; cursor:default; line-height:30px; font-size:13px; } .btn span{ display:block; height:39px; width:auto; margin-right:-3px; padding:0 15px 0 15px; background:url('/images/datingarea_green/btn_end.gif') no-repeat top right; } .activ span{ color:#000; background:url('/images/datingarea_green/btn_end_activ.gif') no-repeat top right; } /********************************************************************************************************************************************************sidebar*/ .content{ background:url('/images/datingarea_green/bg_content.gif') repeat-y top right; } h1,h2,h3,h4,h5,h6{ margin:0px; padding:1px 5px; font-size:13px; height:23px; font-weight: bolder; } .box{ position:relative; top:0px; left:0px; margin:0 0 5px 0; border-right-width:1px; border-left-width:1px; border-top-width:0px; border-bottom-width:1px; border-style:solid; } .h1{ background:url('/images/datingarea_green/h1_bg.gif') repeat-x; text-shadow: 0px 1px white; } .b1{ background:#FEFEFE; border-color:#B2B2B2; color:#5C5C5C; } .h2{ background:url('/images/datingarea_green/h2_bg.gif') repeat-x; color:#646464; text-shadow: 0px 1px white; } .b2{ background:#d9d9d9; color:#7e7d7d; border-color:#b2b2b2; } .h3{ background:url('/images/datingarea_green/h3_bg.gif') repeat-x; color:#5c5c5c; height:20px; } .b3{ background:#f8f8f8; color:#5c5c5c; border:1px solid #b2b2b2; } .b3 p{ margin:5px 10px; } .b4{ background:#F8F8F8; color:#8E8C8C; border-color:#B2B2B2; margin:0 4px 4px 4px; padding:4px; font-size:11px; } .b4 img{ float:left; } .b5{ background:#F8F8F8; color:#A9A9A9; border:none; font-size:11px; } .b5 .feature strong{ font-weight:bold; font-size:10px; } /********************************************************************************************************************************************************login*/ .login{ position:relative; top:0px; left:0px; margin:0; padding:0; height:85px; } .login strong{ padding:5px; font-size:14px; font-weight:lighter; } .inp{ border:none; background:#FFF; border:solid 1px #B2B2B2; font-size:11px; width:80px; height:14px; } .label{ display:block; width:43px; height:16px; text-align:right; font-size:11px; } .label_user{ position:absolute; top:10px; left:30px; } .label_pass{ position:absolute; top:31px; left:30px; } .inp_user{ position:absolute; top:10px; left:75px; } .inp_pass{ position:absolute; top:31px; left:75px; } .btn50{ position:absolute; top:53px; left:107px; background: url('/images/datingarea_green/btn50.png') no-repeat; width:50px; height:18px; padding:0 0 2px 0; border:none; font-size:10px; color:#565656; text-shadow: white 0px 1px; } /********************************************************************************************************************************************************Suche*/ .suche{ text-align:right; padding:8px; margin:0; height:125px; } .suche .inp{ border:none; background:#FFF; border:solid 1px #b2b2b2; font-size:11px; width:80px; height:14px; margin:1px 0; } .suche .dropdown{ width:82px; height:18px; margin:1px 0; } .suche .label{ display:inline; width:71px; height:16px; text-align:right; font-size:11px; margin-right:3px; } .suche strong{ padding:5px; font-size:14px; font-weight:lighter; } .suche .btn50{ top:135px; } /********************************************************************************************************************************************************Liste*/ .left .single, .right .single { background: none; width:165px; height:18px; float: none; margin:0px; } .left .single img, .left .single small, .right .single img, .right .single small { visibility:hidden; } .left .single strong, .right .single strong { position:absolute; top:2px; left:0px; width:165px; height:15px; overflow:hidden; text-align:left; font-weight:normal; font-size:11px; padding:0 0 0 20px; color:#000; } .left .single strong { background:#ececec url('/images/datingarea_green/online.png') no-repeat; } .right .single strong { background:#ececec url('/images/datingarea_green/neu.gif') no-repeat; } .liste{ padding:0px; margin:0px; } .liste li{ padding:0; margin:0; list-style:none; border-top:1px solid #FFF; border-bottom:1px solid #b3b3b3; color:#565656; text-align:left; } .liste a{ display:block; padding:0px; color:#565656; height:13px; overflow:hidden; font-size:12px; } .liste a:hover, .liste strong:hover { color: #999; } /********************************************************************************************************************************************************Features*/ .feature{ position:relative; top:0px; left:0px; background:#ededed; height:42px; width:100%; font-size:10px; padding:0; border-top:1px solid #efefef; border-bottom:1px solid #dddddd; } .feature img{ position:absolute; top:4px; left:4px; } .feature strong{ position:absolute; top:2px; left:40px; font-size:12px; font-weight:lighter; display:block; } .feature p{ position:absolute; top:16px; left:40px; padding:0; margin:0; font-size:10px; font-weight:lighter; line-height:10px; } /********************************************************************************************************************************************************content*/ /********************************************************************************************************************************************************Teaser*/ .teaser{ position:relative; top:0px; left:0px; margin:0 0 5px 0; } .teaser img{ border:none; } .teaser strong{ display:block; text-align:right; position:absolute; bottom:8px; right:100px; color: #3C3C3C; font-size:12px; font-weight:bolder; } /********************************************************************************************************************************************************TeaserText*/ .teaser_text{ position:relative; top:0px; left:0px; height:30px; font-size:12px; } .teaser_text strong{ position:absolute; top:6px; right:100px; padding:0px; margin:0px; color:#3c3c3c; text-align:right; } .teaser_text .link { position:absolute; top:0px; right:20px; } .btn75 { background: url('/images/datingarea_green/btn75.png') no-repeat; display:block; width:75px; height:20px; padding:5px 0 0 0; text-align:center; color:#565656; text-shadow: 0px 1px white; } /********************************************************************************************************************************************************paging*/ .paging{ position:relative; top:0px; left:0px; height:28px; background:url("/images/datingarea_green/bg_paging.gif"); color:#3c3c3c; text-align:center; padding:15px 0 0 0; } .paging strong{ color:#3c3c3c; font-size:13px; padding:0 5px; } .paging a{ color:#F09; font-weight:bold; font-size:13px; padding:0 5px; } .paging img{ border:none; } .back{ position:absolute; top:15px; left:15px; } .next{ position:absolute; top:15px; right:15px; } /********************************************************************************************************************************************************Singles*/ .single{ width:98px; height:160px; float:left; margin:10px 0 10px 23px; position:relative; font-size:11px; text-align:center; } .single a{ text-decoration:none; } .single img{ position:absolute; top:5px; left:2px; width:90px; height:124px; border:none; background:#FFF; padding:1px; border:1px solid #000; } .single strong{ position:absolute; top:135px; left:2px; width:94px; height:15px; overflow:hidden; text-align:left; font-weight:lighter; font-size:11px; text-align:center; color:#000000; font-weight:bolder; padding:0px; } .single small{ position:absolute; top:150px; left:2px; width:78px; height:14px; text-align:left; overflow:hidden; color:#888; font-size:10px; font-weight:normal; text-align:center; } li { list-style:none; text-align:center; } /********************************************************************************************************************************************************detail*/ .detail_pic{ float:left; width:109px; height:149px; margin:15px 0 0 20px; } .detail_pic img{ border:none; width:105px; height:145px; padding:1px; background:#FFF; border:1px solid #000; } .detail_daten{ float:left; width:157px; height:150px; font-size:12px; margin:10px 0 0 10px; } .detail_daten h1{ margin:0px; padding:0; font-size:18px; font-weight:lighter; } .btn_detail_join{ border:none; float:right; } .btn_detail_join img{ border:none; } .detail_text{ width:270px; height:75px; margin:15px 0 0 20px; float:left; overflow:hidden; } /********************************************************************************************************************************************************AGB*/ ol li { text-align: left; } /********************************************************************************************************************************************************footer*/ .footer{ position:relative; top:0px; left:0px; clear:both; height:107px; background:url('/images/datingarea_green/bg_footer.gif') top left no-repeat; font-size:10px; text-align:center; padding-top:0px; color:#b2b2b2; } .footer a{ text-decoration:none; color:#b2b2b2; } .footer a:hover{ text-decoration:none; color:#333; } .footer p{ padding-top:60px; } .up{ position:absolute; top:3px; right:0px; display:block; height:20px; width:100px; }