WebWork Magazin - Webseiten erstellen lassen, Online Medien, html

Webhoster, Webhosting Provider und Domain registrieren

Home | Registrieren | Einloggen | Suchen | Aktuelles | GSL-Webservice | Suleitec Webhosting
Reparatur-Forum | Elektro forum | Ersatzteilshop Haushalt und Elektronik


Homepage und Webhosting-Forum

HTML, XHTML, CSS , style, XML, Javascript und mehr, Fragen, Tipps und Anregungen zu diesen Basic Techniken - hier rein !


Forum » HTML, CSS - Hilfe für das Erstellen einer Homepage » ESAY Donloader Script » Antworten
Benutzername:
Passwort: Passwort vergessen?
Inhalt der Nachricht: Fett | Kursiv | Unterstrichen | Link | Bild | Smiley | Zitat | Zentriert | Quellcode| Kleiner Text
Optionen: Emailbenachrichtigung bei Antworten
 

Die letzten 5 Postings in diesem Thema » Alle anzeigen
von Ori
Ja. Ideen und Arbeit sollte man würdigen. Obwohl ich mir bei der Herkunft nicht so sicher bin, ob das angebracht ist.

Lies weiter; wenn Du schon auf Seite 67 bist, kann es nicht mehr lange dauern und Du hast alle Puzzleteile zusammen. Schon mal hier probiert? Immer schön weiterklicken.
von Psycho-Killer
Dann hat es halt der admin von Sm gemachtO.o
ist das denn so schlimm?

Ich bin im PHP buch gerade mal auf site 67
gibt es dafür irgendwo ein tut
von Mondschatten
...Dein Kumpel hat sich dann auch noch im Script namentlich verewigt, was Du als guter Freund von ihm sicher absichtlich so stehen lassen hast...

1:
<p><font size="2" face="Tahoma"><a href="http://www.Scriptmafia.eu/">Easy Downloader V1.2 by Scriptmafia  &copy; 2007<a></font><br><br>


Kumpelhafte Grüße
Mondschatten
von Ori
Guter Kumpel, den Du da hast. Deswegen schreibt er Dir auch auf Englisch?

Du erwartest nicht im Ernst, dass jemand hier mehr als 500 Zeilen Code durcharbeitet?
Konkrete (< 50 Zeilen) oder interessante Probleme bekommen eine Lösung.

Davon abgesehen, ist des Rätsels Lösung ganz einfach; speichere irgendwo (Datenbank, Textdateien, ...), welche IP-Adressen etwas heruntergeladen haben und die Zeit dazu. Wenn eine bekannte IP auftaucht, prüfst Du den Zeitstempel und gibst entweder nach oder eben nicht.

Dazu brauchst Du grundlegende Kenntnisse von dem, was in Deinem Skript passiert (Also PHP.. HTTP und HTML wären auch nicht verkehrt. der Rest steht ja in den Kommentaren); schließlich brauchst Du noch irgendwo Schreibrechte (Dateisystem, Datenbank) zum Speichern und ein wenig Zeit, um all das umzusetzen.


Viel Spaß dabei!
von Psycho-Killer
Hallo,
Mein Kumpel hat mir ein Download Script gemacht!
also ich packe eine rar Datei in einem Ordner und mann kann es dann von der Homepages laden.

Nun habe ich folgende frage!
Wie kann ich es machen wenn eine IP eine bestimmt datei runter läd das erst nach 5 min wieder machen kann?
Also nur die Date die Sie zuvor runter geladen hat!
alle andere Dateien kann Sie runterladen!

Kann leider noch nicht GUT PHP, aber ich hoffe mir kann einer helfen

1: 
2: 
3: 
4: 
5: 
6: 
7: 
8: 
9: 
10: 
11: 
12: 
13: 
14: 
15: 
16: 
17: 
18: 
19: 
20: 
21: 
22: 
23: 
24: 
25: 
26: 
27: 
28: 
29: 
30: 
31: 
32: 
33: 
34: 
35: 
36: 
37: 
38: 
39: 
40: 
41: 
42: 
43: 
44: 
45: 
46: 
47: 
48: 
49: 
50: 
51: 
52: 
53: 
54: 
55: 
56: 
57: 
58: 
59: 
60: 
61: 
62: 
63: 
64: 
65: 
66: 
67: 
68: 
69: 
70: 
71: 
72: 
73: 
74: 
75: 
76: 
77: 
78: 
79: 
80: 
81: 
82: 
83: 
84: 
85: 
86: 
87: 
88: 
89: 
90: 
91: 
92: 
93: 
94: 
95: 
96: 
97: 
98: 
99: 
100: 
101: 
102: 
103: 
104: 
105: 
106: 
107: 
108: 
109: 
110: 
111: 
112: 
113: 
114: 
115: 
116: 
117: 
118: 
119: 
120: 
121: 
122: 
123: 
124: 
125: 
126: 
127: 
128: 
129: 
130: 
131: 
132: 
133: 
134: 
135: 
136: 
137: 
138: 
139: 
140: 
141: 
142: 
143: 
144: 
145: 
146: 
147: 
148: 
149: 
150: 
151: 
152: 
153: 
154: 
155: 
156: 
157: 
158: 
159: 
160: 
161: 
162: 
163: 
164: 
165: 
166: 
167: 
168: 
169: 
170: 
171: 
172: 
173: 
174: 
175: 
176: 
177: 
178: 
179: 
180: 
181: 
182: 
183: 
184: 
185: 
186: 
187: 
188: 
189: 
190: 
191: 
192: 
193: 
194: 
195: 
196: 
197: 
198: 
199: 
200: 
201: 
202: 
203: 
204: 
205: 
206: 
207: 
208: 
209: 
210: 
211: 
212: 
213: 
214: 
215: 
216: 
217: 
218: 
219: 
220: 
221: 
222: 
223: 
224: 
225: 
226: 
227: 
228: 
229: 
230: 
231: 
232: 
233: 
234: 
235: 
236: 
237: 
238: 
239: 
240: 
241: 
242: 
243: 
244: 
245: 
246: 
247: 
248: 
249: 
250: 
251: 
252: 
253: 
254: 
255: 
256: 
257: 
258: 
259: 
260: 
261: 
262: 
263: 
264: 
265: 
266: 
267: 
268: 
269: 
270: 
271: 
272: 
273: 
274: 
275: 
276: 
277: 
278: 
279: 
280: 
281: 
282: 
283: 
284: 
285: 
286: 
287: 
288: 
289: 
290: 
291: 
292: 
293: 
294: 
295: 
296: 
297: 
298: 
299: 
300: 
301: 
302: 
303: 
304: 
305: 
306: 
307: 
308: 
309: 
310: 
311: 
312: 
313: 
314: 
315: 
316: 
317: 
318: 
319: 
320: 
321: 
322: 
323: 
324: 
325: 
326: 
327: 
328: 
329: 
330: 
331: 
332: 
333: 
334: 
335: 
336: 
337: 
338: 
339: 
340: 
341: 
342: 
343: 
344: 
345: 
346: 
347: 
348: 
349: 
350: 
351: 
352: 
353: 
354: 
355: 
356: 
357: 
358: 
359: 
360: 
361: 
362: 
363: 
364: 
365: 
366: 
367: 
368: 
369: 
370: 
371: 
372: 
373: 
374: 
375: 
376: 
377: 
378: 
379: 
380: 
381: 
382: 
383: 
384: 
385: 
386: 
387: 
388: 
389: 
390: 
391: 
392: 
393: 
394: 
395: 
396: 
397: 
398: 
399: 
400: 
401: 
402: 
403: 
404: 
405: 
406: 
407: 
408: 
409: 
410: 
411: 
412: 
413: 
414: 
415: 
416: 
417: 
418: 
419: 
420: 
421: 
422: 
423: 
424: 
425: 
426: 
427: 
428: 
429: 
430: 
431: 
432: 
433: 
434: 
435: 
436: 
437: 
438: 
439: 
440: 
441: 
442: 
443: 
444: 
445: 
446: 
447: 
448: 
449: 
450: 
451: 
452: 
453: 
454: 
455: 
456: 
457: 
458: 
459: 
460: 
461: 
462: 
463: 
464: 
465: 
466: 
467: 
468: 
469: 
470: 
471: 
472: 
473: 
474: 
475: 
476: 
477: 
478: 
479: 
480: 
481: 
482: 
483: 
484: 
485: 
486: 
487: 
488: 
489: 
490: 
491: 
492: 
493: 
494: 
495: 
496: 
497: 
498: 
499: 
500: 
501: 
502: 
503: 
504: 
505: 
506: 
507: 
508: 
509: 
510: 
511: 
512: 
513: 
514: 
515: 
516: 
517: 
518: 
519: 
520: 
521: 
522: 
523: 
524: 
525: 
526: 
527: 
528: 
529: 
530: 
531: 
532: 
533: 
534: 
535: 
536: 
537: 
538: 
539: 
540: 
541: 
542: 
543: 
544: 
545: 
546: 
547: 
548: 
549: 
550: 
551: 
552: 
553: 
554: 
555: 
556: 
557: 
558: 
559: 
560: 
561: 
562: 
563: 
564: 
565: 
566: 
567: 
568: 
569: 
570: 
571: 
572: 
573: 
574: 
575: 
576: 
577: 
578: 
579: 
580: 
581: 
582: 
583: 
584: 
585: 
586: 
587: 
588: 
589: 
590: 
591: 
592: 
593: 
594: 
595: 
596: 
597: 
598: 
599: 
600: 
601: 
602: 
603: 
604: 
605: 
606: 
607: 
608: 
609: 
610: 
611: 
612: 
613: 
614: 
615: 
616: 
617: 
618: 
619: 
620: 
621: 
622: 
623: 
624: 
625: 
626: 
627: 
628: 
629: 
630: 
631: 
632: 
633: 
634: 
635: 
636: 
637: 
638: 
639: 
640: 
641: 
642: 
643: 
644: 
645: 
646: 
647: 
648: 
649: 
650: 
651: 
652: 
653: 
654: 
655: 
656: 
657: 
658: 
659: 
660: 
661: 
662: 
663: 
664: 
665: 
666: 
667: 
668: 
669: 
670: 
671: 
672: 
673: 
674: 
675: 
676: 
677: 
678: 
679: 
680: 
681: 
682: 
683: 
684: 
685: 
686: 
687: 
688: 
689: 
690: 
691: 
692: 
693: 
694: 
695: 
696: 
697: 
698: 
699: 
700: 
701: 
702: 
703: 
704: 
705: 
706: 
707: 
708: 
709: 
710: 
711: 
712: 
713: 
714: 
715: 
716: 
717: 
718: 
719: 
720: 
721: 
722: 
723: 
724: 
725: 
726: 
727: 
728: 
729: 
730: 
731: 
732: 
733: 
734: 
735: 
736: 
737: 
738: 
739: 
740: 
741: 
742: 
743: 
744: 
745: 
746: 
747: 
748: 
749: 
750:
<?
$ctrackerdir = "/www/ctracker1/ctracker.php";
include $ctrackerdir;
# Configure the following variables:
#--------------------------------------------------------------------------
# List the extentions of the files that you want to be displayed.
# If the file extention is not listed below (not in $display_list), 
# IT WON'T BE LISTED BY THIS SCRIPT!!
# The script ignores files with file extentions that are not listed here...
#--------------------------------------------------------------------------

$display_list = " rar zip";

#--------------------------------------------------------------------------
# Path to downloads.  This path can be outside of the server path insuring no leaching!
# Must use a trailing slash "/"
#
# Here are some examples.
# $path = "./"; Downloads live where this file (index.php) lives (Default)
# $path = "../../";  Up 2 directories (relative to index.php)
# $path = "c:/downloads/public/applications/";  Absolute location.
#--------------------------------------------------------------------------

$path = "./downloads/";

#--------------------------------------------------------------------------
# Path to Header and Footer files.
#--------------------------------------------------------------------------

$header = "file_info/header.htm";
$footer = "file_info/footer.htm";

#--------------------------------------------------------------------------
# Default number of records per page:
# Changing this variable will modify the number of downloads
# listed on one page before pagination starts.
#--------------------------------------------------------------------------

$defaultrpp = 1000;

#--------------------------------------------------------------------------
# Enable JPG Thumbnailing.
# 0 if GD library is NOT available.
# 1 if GD library is available.
# $thumbsize is the horizontal size of the thumb nail in pixels.
#--------------------------------------------------------------------------

$gdlib = 1;
$thumbsize = "50";

#--------------------------------------------------------------------------
# Background Color set - Alternates background color of download entries.
# If you don't want it to alternate colors, make both colors the same value.
# For light backgrounds suggested values are:
# $color1 = "#efefef";
# $color2 = "#ffffff";
# For dark back grounds suggested values are:
# $color1 = "#484848";
# $color2 = "#010101";
# or use your own custom colors.
#--------------------------------------------------------------------------

$color1 = "#484848";
$color2 = "#010101";

#--------------------------------------------------------------------------
# Customize html at top of form 
#
# Width of table.  
# Can be in percent like "100%"
# Or can be in pixels like "800"
#--------------------------------------------------------------------------

$table_width = "640";

#--------------------------------------------------------------------------
# "Search Box Description" attributes:
# You can change the way the "Search Box Description" link looks
# with the following variables
#--------------------------------------------------------------------------

$display_search_tag = "<b><i><font color=#FFFFFF>";  # html on tags for "Search Box Description"
$display_search_tag_end = "</font></i></b>";  #------- html "off" tags for "Search Box Description"
$display_search_font = "tahoma";  #------------------- Font for "Search Box Description"
$display_search_size = "1";  #------------------------ Font size for "Search Box Description"

#--------------------------------------------------------------------------
# "Top 10 Downloads" attributes:
# You can change the way the "Top 10 Downloads" link looks
# with the following variables
#--------------------------------------------------------------------------

$display_top10 = 1;  #------------------- Display the "Top 10 Downloads" link? 0 = no 1 = yes
$display_top10_tag = "<b>";  #----------- html on tags for "Top 10 Downloads"
$display_top10_tag_end = "</b>";  #------ html "off" tags for "Top 10 Downloads"
$display_top10_font = "tahoma";  #------- Font for "Top 10 Downloads"
$display_top10_size = "2";  #------------ Font size for "Top 10 Downloads"

#--------------------------------------------------------------------------
# when search results are displayed, show the 
# original search term in this color and size.
#--------------------------------------------------------------------------

$search_color = "yellow";
$search_size = "2";

#--------------------------------------------------------------------------
# Customize html for download entry
#
# Display the "Download Icon"?
# 0 = no 1 = yes
#--------------------------------------------------------------------------

$display_download_icon = 1;

#--------------------------------------------------------------------------
# Which icon set do you want to display?
# icons1 or icons2 or icons3?
# (More icon sets are in the works.)
#--------------------------------------------------------------------------

$icons = "icons1";

#--------------------------------------------------------------------------
# "File Name" attributes:
# You can change the way the "file name" link looks
# with the following variables.
#--------------------------------------------------------------------------

$display_filename = 1;  #------------------- Display the "File Name" link? 0 = no 1 = yes
$display_filename_tag = "<b>";  #----------- html on tags for "File Name"
$display_filename_tag_end = "</b>";  #------ html "off" tags for "File Name"
$display_filename_font = "tahoma";  #------- Font for "File Name"
$display_filename_size = "2";  #------------ Font size for "File Name"

#--------------------------------------------------------------------------
# "Description" attributes:
# You can change the way the "Description" looks
# with the following variables.
#--------------------------------------------------------------------------

$display_description = 1;  #------------------- Display the "Description"? 0 = no 1 = yes
$display_description_tag = "<b>";  #----------- html on tags for "Description"
$display_description_tag_end = "</b>";  #------ html "off" tags for "Description"
$display_description_font = "tahoma";  #------- Font for "Description"
$display_description_size = "1";  #------------ Font size for "Description"

#--------------------------------------------------------------------------
# "More Info" attributes:
# You can change the way the "More Info" link looks
# with the following variables.
#--------------------------------------------------------------------------

$display_moreinfo = 0;  #------------------- Display the "More Info" link? 0 = no 1 = yes
$display_moreinfo_tag = "<b>";  #----------- html on tags for "More Info"
$display_moreinfo_tag_end = "</b>";  #------ html "off" tags for "More Info"
$display_moreinfo_font = "tahoma";  #------- Font for "More Info"
$display_moreinfo_size = "1";  #------------ Font size for "More Info"

#--------------------------------------------------------------------------
# "File Type" attributes:
# You can change the way the "File Type" looks
# with the following variables.
#--------------------------------------------------------------------------

$display_filetype = 1;  #------------------- Display the "File Type"? 0 = no 1 = yes
$display_filetype_tag = "<b><i>";  #-------- html on tags for "File Type"
$display_filetype_tag_end = "</i></b>";  #-- html "off" tags for "File Type"
$display_filetype_font = "tahoma";  #------- Font for "File Type"
$display_filetype_size = "1";  #------------ Font size for "File Type"
$display_filetype_color = "yellow";  #------ Font Color for "File type"

#--------------------------------------------------------------------------
# "File Size" attributes:
# You can change the way the "File Size" looks
# with the following variables.
#--------------------------------------------------------------------------

$display_filesize = 1;  #------------------- Display the "File Size"? 0 = no 1 = yes
$display_filesize_tag = "<b>";  #----------- html on tags for "File Size"
$display_filesize_tag_end = "</b>";  #------ html "off" tags for "File Size"
$display_filesize_font = "tahoma";  #------- Font for "File Size"
$display_filesize_size = "1";  #------------ Font size for "File Size"

#--------------------------------------------------------------------------
# "Accessed" attributes:
# You can change the way the "Accessed" looks
# with the following variables.
#--------------------------------------------------------------------------

$display_accessed = 1;  #--------------- Display the "Accessed"? 0 = no 1 = yes
$display_accessed_tag = "<b>";  #------- html on tags for "Accessed"
$display_accessed_tag_end = "</b>";  #-- html "off" tags for "Accessed"
$display_accessed_font = "tahoma";  #--- Font for "Accessed"
$display_accessed_size = "1";  #-------- Font size for "Accessed"

#--------------------------------------------------------------------------
# "File Dated" attributes:
# You can change the way the "File Dated" looks
# with the following variables.
#--------------------------------------------------------------------------

$display_filedate = 1;  #--------------- Display the "File Date"? 0 = no 1 = yes
$display_filedate_tag = "<b>";  #------- html on tags for "File Date"
$display_filedate_tag_end = "</b>";  #-- html "off" tags for "File Date"
$display_filedate_font = "tahoma";  #--- Font for "File Date"
$display_filedate_size = "1";  #-------- Font size for "File Date"

#--------------------------------------------------------------------------
# "Pagination" attributes:
# You can change the way the "Pagination" looks
# with the following variables.
#--------------------------------------------------------------------------

$display_pagination_tag = "<b>";  #------- html on tags for "Pagination"
$display_pagination_tag_end = "</b>";  #-- html "off" tags for "Pagination"
$display_pagination_font = "tahoma";  #--- Font for "Pagination"
$display_pagination_size = "1";  #-------- Font size for "Pagination"
$display_selected_size = "2";  #---------- Font size for current page in "Pagination"

#---------------------------------------------------------------------------
# ---- Do not edit below here -------



# Start timing code.
#-------------------
$t_start = array_sum(explode(' ', microtime()));

# If a download has already been selected,
#----------------------------------------- 
If ($_GET["file"]){

	# Get the filename to be downloaded
	#----------------------------------
	$file = $_GET["file"];
	$file = stripslashes($file);
	$file = htmlspecialchars($file);
	$mainpath = "$path$file";

	# Increment download count
	#-------------------------
	$filename = "./file_info/descriptions/$file.0";
	$newfile = fopen($filename,"r");
	$content = fread($newfile, filesize($filename));
	fclose($newfile);
	$fileinfo = explode ("|",$content);
	$fileinfo[0] ++;

	# Save the new file count
	#------------------------
	$content = implode("|", $fileinfo);
	$newfile = fopen($filename,"w");
	fwrite($newfile, $content);
	fclose($newfile);

	# Translate file name properly for Internet Explorer
	#---------------------------------------------------
	if (strstr($_SERVER['HTTP_USER_AGENT'], "MSIE")){
		$file = preg_replace('/\./', '%2e', $file, substr_count($file, '.') - 1);
	}

	# Make sure the file exists before sending headers
	#-------------------------------------------------
	if(!$fdl=@fopen($mainpath,'r')){
	   die("Cannot Open File!");
	} else {

	# Send the headers then send the file
	#------------------------------------
	header("Cache-Control: ");# leave blank to avoid IE errors
	header("Pragma: ");# leave blank to avoid IE errors
	header("Content-type: application/octet-stream");
	header("Content-Disposition: attachment; filename=\"".$file."\"");
	header("Content-length:".(string)(filesize($mainpath)));
	sleep(1);
	fpassthru($fdl);
	}
	
}else{

	# GD Library thumbnail function.
	#-------------------------------
	function thumbnail($i,$nw,$p,$nn) {

    		$img=imagecreatefromjpeg("$i");
    		$ow=imagesx($img);
    		$oh=imagesy($img);
    		$scale=$nw/$ow;
    		$nh=ceil($oh*$scale);
    		$newimg=imagecreateTrueColor($nw,$nh);
    		imagecopyresized($newimg,$img,0,0,0,0,$nw,$nh,$ow,$oh);
    		imagejpeg($newimg, $p.$nn);
    		$heigth = $nh;
    		return ($heigth);
	}

	# Get input from user.
	#---------------------
	$admin = $_GET["admin"];
	$rpp1 = $_POST["D2"]; #records per page
	$rpp2 = $_GET["rpp"]; #records per page
	$sortorder1 = $_GET["so"]; #sort order
	$sortorder2 = $_POST["D1"]; #sort order
	$search = $_POST["T1"]; #search term
	$c1 = $_POST["C1"]; #Checkbox to search thru both filename and description.
	$match = 0;

	# Open header file (if it exsists) and display it.
	#-------------------------------------------------
	if (file_exists($header)){
		$newfile = fopen($header,"r");
		$content = fread($newfile, filesize($header));
		fclose($newfile);
		print $content;
	}

	$sortorder1 = (ucfirst($sortorder1));
	$sortorder2 = (ucfirst($sortorder2));

	# Set sort order depending on user input.
	#----------------------------------------

	# Default sort order is Alphabetical.
	#------------------------------------
	if ((!$sortorder1) && (!$sortorder2)){
		$sortorder = "Alphabetical";
		$so = "&so=Alphabetical";
	}

	# Sort by filesize and date.
	#---------------------------
	if ($sortorder2){
		$sortorder = $sortorder2;
		$so = "&so=$sortorder";
	}

	# Sort by # of times the file has been Accessed.
	#-----------------------------------------------
	If ($sortorder1){
		$sortorder = $sortorder1;
		$so = "&so=$sortorder";
	}

	# Get current page to be displayed.
	#----------------------------------
	$currentpage = $_GET["page"];
	if ($currentpage < 1){
		$currentpage = 1;
	}

	# If no records per page is selected, set the default.
	#-----------------------------------------------------
	if ((!$rpp1) && (!$rpp2)){
		$records_per_page = $defaultrpp;
		$rpp3 = "&rpp=$records_per_page";
	}

	# Otherwise, set the user defined record per page.
	#--------------------------------------------------
	If ($rpp2){
		$records_per_page = $rpp2;
		$rpp3 = "&rpp=$records_per_page";
	}
	If ($rpp1){
		$records_per_page = $rpp1;
		$rpp3 = "&rpp=$records_per_page";
	}

	# Read current directory.
	#------------------------
	$d = dir($path);
	while (false !== ($file = $d->read())) {
		if ($file != "." && $file != "..") {

			# Get all the file attributes.
			#-----------------------------
			$size = filesize("$path$file");
      			$type = filetype("$path$file");
      			$ext = strrchr("$path$file",'.');
			$modified = stat("$path$file");
			$displayname = str_replace (strrchr ($file, "."), "", $file);

			# If it is a file (not a directory) and the file extention is in $display_list..
			#-------------------------------------------------------------------------------
			if (($type == file) && (preg_match ("/$ext/i", $display_list))) {

				# Format the Dispayed filename.. replace underscore with a space
				# and Change each word to start with an upper case letter.
				#---------------------------------------------------------------
				$displayname = str_replace("_"," ",$displayname);
				$displayname = strtolower($displayname);
				$displayname = ucwords($displayname);
				$filedate = date("m-d-y",$modified[9]);

				# See if description file exsists. If not, create it.
				#---------------------------------------------------------------------------
				$filedescription = "./file_info/descriptions/$file.0";
				if (!file_exists($filedescription)) {
					$newfile = fopen($filedescription,"w");
					$content = "0|No Description Available|http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=$displayname &btnI=I%27m+Feeling+Lucky|".time();
					fwrite($newfile, $content);
					fclose($newfile);
					$data = explode("|", $content);
					# RSS Feed goes here.  We want to add any new files to the feed
				}
				ELSE
				{
					# If the file does exist, read its data.
					#---------------------------------------
					$newfile = fopen($filedescription,"r");
					$content = fread($newfile, filesize($filedescription));
					fclose($newfile);
				}
									$data = explode("|", $content);
				$accesses = $data[0];
				$upload_date = $data[3];
				
				# Format the output depending on sort order and search criteria.
				#---------------------------------------------------------------
				if ((!$search) && ($sortorder == "Alphabetical")){
					$filename[$totalfiles] = "$displayname|$displayname|$file|$ext|$size|$filedate|$content|$upload_date";
				}
				if ((!$search) && ($sortorder == "File Size")){
					$filename[$totalfiles] = "$size|$displayname|$file|$ext|$size|$filedate|$content|$upload_date";
				}
				if ((!$search) && ($sortorder == "Accesses")){
					$filename[$totalfiles] = "$accesses|$displayname|$file|$ext|$size|$filedate|$content|$upload_date";
				}
				if ((!$search) && ($sortorder == "Latest Files")){
					$filename[$totalfiles] = "$upload_date|$displayname|$file|$ext|$size|$filedate|$content|$upload_date";
				}

				# Search both File Name and Description.
				#---------------------------------------
				if (($search) && ($C1)){
					#$searchtext = "Your search for <b><font color= $search_color size = $search_size >\"$search\"</font></b> yielded these results:";
					$records_per_page = 0;
					$currentpage = 1;
					$pos = preg_match ("/$search/i", "$displayname$content");
					if ($pos){
						$filename[$totalfiles] = "$accesses|$displayname|$file|$ext|$size|$filedate|$content|$upload_date";
						$match++;
					}
					$searchtext = "Your search for <b><font color= $search_color size = $search_size >\"$search\"</font></b> yielded $match results:";
				}

				# Search File Name Only.
				#-----------------------
				if ($search){
					#$searchtext = "Your search for <b><font color= $search_color size = $search_size >\"$search\"</font></b> yielded these results:";
					$records_per_page = 0;
					$currentpage = 1;
					$pos = preg_match ("/$search/i", "$displayname");
					if ($pos){
						$filename[$totalfiles] = "$accesses|$displayname|$file|$ext|$size|$filedate|$content|$upload_date";
						$match++;
					}
					$searchtext = "Your search for <b><font color= $search_color size = $search_size >\"$search\"</font></b> yielded $match results:";
				}
				$totalbytes = $totalbytes + $size;
				$totalfiles++;
			}
		}
	}

	# Sort by filename.
	#------------------
	if (($filename) && ($sortorder == "Alphabetical")){
		sort ($filename,SORT_REGULAR);
		reset ($filename);
		$select1 = "selected";
		$select2 = "";
		$select3 = "";
		$select4 = "";
		$match = 1;
	}

	# Sort by file Size.
	#-------------------
	if (($filename) && ($sortorder == "File Size")){
		rsort ($filename,SORT_NUMERIC);
		reset ($filename);
		$select1 = "";
		$select2 = "selected";
		$select3 = "";
		$select4 = "";
		$match = 1;
	}

	# Sort by accesses.
	#------------------
	if (($filename) && ($sortorder == "Accesses")){
		rsort ($filename,SORT_NUMERIC);
		reset ($filename);
		$select1 = "";
		$select2 = "";
		$select3 = "selected";
		$select4 = "";
		$match = 1;
	}

	# Sort by Date.
	#--------------
	if (($filename) && ($sortorder == "Latest Files")){
		rsort ($filename,SORT_NUMERIC);
		reset ($filename);
		$select1 = "";
		$select2 = "";
		$select3 = "";
		$select4 = "selected";
		$match = 1;
	}

	# Pagination Start.
	#------------------
	if ($records_per_page < 1){
		$records_per_page = $totalfiles + 1;
	}
	If ($totalfiles > $records_per_page){
		$totalpages = ceil($totalfiles/$records_per_page);
		$flag = 0;
		if ($currentpage > $totalpages){
			$currentpage = 1;
		}
	}ELSE{
		$flag = 1;
	}

	# Print out the top of the form and search criteria boxes.
	#---------------------------------------------------------
	?>

	<table border="0" width="<? echo "$table_width"; ?>" align = "center">
	<form method="POST" action="<? echo "$PHP_SELF?page=$currentpage"; ?>"
 	 <tr>
    	<td width="33%"><font size="<? echo $display_search_size; ?>" face="<? echo $display_search_font; ?>"><? echo $display_search_tag; ?>Sorting Order:<? echo $display_search_tag_end; ?></font>
 	<select size="1" name="D1">
    	<option <? echo $select1; ?>>Alphabetical</option>
    	<option <? echo $select2; ?>>File Size</option>
    	<option <? echo $select3; ?>>Accesses</option>
    	<option <? echo $select4; ?>>Latest Files</option>
  	</select>
  	<br><font size="<? echo $display_search_size; ?>" face="<? echo $display_search_font; ?>">
  	</td>
  	<td width="33%">
	<? 
	if ($display_top10 == 1){
      		print "<p align=\"center\"><a href=\"$PHP_SELF?page=1&rpp=10&so=Accesses\">$display_top10_tag<font size=\"$display_top10_size\" face=\"$display_top10_font\">Top
      		10 Downloads!</font>$display_top10_tag_end</a></p>";
	}
	?>
  	</td>
    	<td width="34%">
      	<p align="right"><font face="<? echo $display_search_font; ?>" size="<? echo $display_search_size; ?>"><? echo $display_search_tag; ?> Search for a File Name <? echo $display_search_tag_end; ?></font><br>
      	<input type="text" name="T1" size="22"><br>
    	</td>
	</form>
	</table>
	<center><font size="2" face="Tahoma"><?echo $searchtext; ?></font></center>

	<?

	# Start main loop.
	#-----------------

	if ($match > 0){
   		while (list ($key, $val) = each ($filename)) {
			if ($key >= ($records_per_page-$records_per_page)+(($currentpage-1)*$records_per_page) && $key <= ($records_per_page-1)+(($currentpage-1)*$records_per_page)){
				$fileattr = explode("|", $val);

				# Fix and format Byte Length
				#---------------------------
				if ($fileattr[4] < pow(2,10)){
					$size = "$fileattr[4] B";
				}
				if ($fileattr[4] >= pow(2,10) && $fileattr[4] < pow(2,20)) {
					$size = round($fileattr[4] / pow(2,10), 2)." KB";
				}
				if ($fileattr[4] >= pow(2,20) && $fileattr[4] < pow(2,30)) {
					$size = round($fileattr[4] / pow(2,20), 2)." MB";
				}
				if ($fileattr[3] > pow(2,30)) {
					$size = round($fileattr[4] / pow(2,30), 2)." GB";
				}

				# Alternate colors between white and grey (or black and grey) on table entries.
				#------------------------------------------------------------------------------
				if ($color == $color1){
					$color = $color2;
				}ELSE{
					$color = $color1;
				}

				# Get correct icon file depending on file extention.
				#---------------------------------------------------
				$ext = substr ($fileattr[3], 1, 3);
				$ext = (strtolower($ext));
				$iconfile = "./file_info/thumbs/th_$fileattr[2]";
				$nw = 100;
				$nh = 64;
				$xtrainfo = "Jpeg image ";
				if (($ext == "jpg") && (!file_exists($iconfile)) && ($gdlib == 1)){
					$ht = thumbnail("$path$fileattr[2]",$thumbsize,"./file_info/thumbs/","th_$fileattr[2]");
				}

				# Get the correct icon file if image exists with same name as filename.
				#----------------------------------------------------------------------
				if (($ext <> "jpg") or ($gdlib == 0)){
					$xtrainfo = "$ext file";
					$iconfile = "file_info/icons/$icons/x.gif";
					$iconfile1 = "file_info/icons/$icons/$ext.gif";
					$iconfile2 = "file_info/thumbs/th_$fileattr[1].jpg";
					$nw = 64;
					$nh = 64;
					
					if (file_exists($iconfile1)) {
						$iconfile = $iconfile1;
					}
					if (file_exists($iconfile2)) {
						$iconfile = $iconfile2;
					}
				}


				# Print html results.
				#--------------------
				?>

				<table cellSpacing="0" cellPadding="3" width="<? echo "$table_width"; ?>" bgColor="<? echo $color ?>" border="0" align="center">
		 		<tbody>
		    		<tr vAlign="top">

				<?
				# Display Download Icon.
				#-----------------------
				if ($display_download_icon == 1){
					print "<td align=\"middle\" width=\"12%\">";
					print "<a href=\"./index.php?file=$fileattr[2]\"  >";
		        		print "<img border=\"0\" src=\"";
		        		print "$iconfile \" ></a></td>";
				}
		        	print "<td width=\"50%\" valign=\"top\" align=\"left\">";
			
				# Display the File Name.
				#-----------------------
				if ($display_filename == 1){
					print "$display_filename_tag<font size=\"$display_filename_size\" face=\"$display_filename_font\">\n";
					print "<a href=\"./index.php?file=$fileattr[2]\">\n";
		        		print "$fileattr[1]</a>$display_filename_tag_end<br>\n";
				}

				# Display the File Type.
				#-----------------------
				if ($display_filetype == 1){
					print "<font face=\"$display_filetype_font\" color=\"$display_filetype_color\" size=\"$display_filetype_size\">$display_filetype_tag$xtrainfo$display_filetype_tag_end</font>\n";
				}	

			# Display the File Size.
				#-----------------------
				if ($display_filesize == 1){
		        		print "<td align=\"right\" width=\"12%\" valign=\"middle\"><font size=\"$display_filesize_size\" face=\"$display_filesize_font\">$display_filesize_tag Größe<br>$size</font>$display_filesize_tag_end</td>\n";
				}

				# Display Accessed.
				#------------------
				if ($display_accessed == 1){
		        		print "<td align=\"right\" width=\"12%\" valign=\"middle\"><font size=\"$display_accessed_size\" face=\"$display_accessed_font\">$display_accessed_tag Downloads<br>$fileattr[6] $display_accessed_tag_end</font></td>\n";
				}

				# Display File Date.
				#-------------------

				$file_time = date("d-m-y", $fileattr[9]);
				if ($display_filedate == 1){
				        print "<td align=\"right\" width=\"12%\" valign=\"middle\"><font size=\"$display_filedate_size\" face=\"$display_filedate_font\">$display_filedate_tag Upload<br>$file_time</font>$display_filedate_tag_end</td>\n";
				}
				print "</tr></tbody></table>\n";
			}
   		}
	}
	#-------------------------------------------------------------------------------------
	# End main loop.

	# Generate page number links.
	#----------------------------
	print "<table border=\"0\" width=\"$table_width\" align =\"center\"><tr><td>";
	if ($flag == 0){
		$previouspage = $currentpage-1;
		if ($previouspage < 1){
			$previouspage = 1;
		}
		$nextpage = $currentpage+1;
		if ($nextpage > $totalpages){
			$nextpage = $totalpages;
		}
		print "<center><p><font face=\"$display_pagination_font\" size=\"2\">$display_pagination_tag <a href=\"$PHP_SELF?page=$previouspage$rpp3$so\">Back</a> | ";
		$z = 1;
		while ($z <= $totalpages){
			if ($z == $currentpage){
				$size = $display_selected_size;
			}ELSE{
				$size = $display_pagination_size;
			}
			print "<font face=\"$display_pagination_font\" size=\"$size\"><b><a href=\"$PHP_SELP?page=$z$rpp3$so\">$z</a><font face=\"$display_pagination_font\" size=\"$display_pagination_size \"> | ";
			$z++;
		}
		print "<font face=\"Tahoma\" size=\"2\"><a href=\"$PHP_SELF?page=$nextpage$rpp3$so\">Next</a>";
		print "$display_pagination_tag_end </font></p></center></td></tr><tr><td>";
	}

	#.Fix and format Byte Length.
	#----------------------------
	if ($totalbytes < pow(2,10)){
		$totalsize = "$totalbytes B";
	}
	if ($totalbytes >= pow(2,10) && $totalbytes < pow(2,20)) {
		$totalsize = round($totalbytes / pow(2,10), 2)." KB";
	}
	if ($totalbytes >= pow(2,20) && $totalbytes < pow(2,30)) {
		$totalsize = round($totalbytes / pow(2,20), 2)." MB";
	}
	if ($totalbytes > pow(2,30)) {
		$totalsize = round($totalbytes / pow(2,30), 2)." GB";
	}

	?>
    <center> 
	<p><font size="2" face="Tahoma"><a href="http://www.Scriptmafia.eu/">Easy Downloader V1.2 by Scriptmafia  &copy; 2007<a></font><br><br>
	<font size="1" face="Tahoma"><b>Vorhandene Scripts: <? echo $totalfiles; ?></b></font><br>
	<font size="1" face="Tahoma"><b>Gesamtgröße: <? echo $totalsize; ?></b></font><br>
    </center>
	<?

	# End of timed code here.
	#------------------------
	$exec_time = array_sum(explode(' ', microtime())) - $t_start;
	$exec_time1 = (ceil($exec_time * 10000))/10000;
	print"<font size=\"1\" face=\"Tahoma\"><b><center>Ladezeit: $exec_time1 sec.</center></b></font><br>";

	# Open footer file and display it (if it exists).
	#------------------------------------------------
	if (file_exists($footer)){
		$newfile = fopen($footer,"r");
		$content = fread($newfile, filesize($footer));
		fclose($newfile);
		print $content;
	}
}
?>

Nach oben