Ich möchte auf meiner HP ein Fotoalbum einrichten das auch bewertet werden kann.....leider bin ich nicht so begabt was Scripts vor allem in englisch angeht.
Ich verstehe nicht wie genau ich den Ordner anlegen soll in dem die hoch geladenen Fotos abgelegt werden.
Hier mal der Code..
PHP
<?php
/* ######################## DATABASE ######################## */
// Database server
$db_server = "localhost";
// Database name
$db_name = "my_database";
// Database username
$db_user = "root";
// Database password
$db_password = "pwd";
// Database table to store image information
// (will be created automatically)
$db_table_pictures = "image_voting_pictures";
// Database table to store the comments
// (will be created automatically)
$db_table_comments = "image_voting_comments";
/* ##################### CONFIGURATION ###################### */
// Complete URL of the script
// (begins with http://, ends with slash)
$url = "http://yourdomain.com/Image_voting/";
// Relative path to the images folder
// (folder where the images are stored).
// Must be empty (then images are stored in the same folder
// where the script is running) or relative with an ending
// slash.
//
// Example 1 (Windows):
// Script folder: C:\apache\htdocs\site\php\image_voting\
// Images folder: C:\apache\htdocs\site\img\upload\
// --> $img = "../../img/upload/";
//
// Example 2 (Unix):
// Script folder: /var/www/html/site/php/image_voting/
// Images folder: /var/www/html/site/img/upload/
// --> $img = "../../img/upload/";
//
// The images folder must be writable!
// (Windows: adjust security, Unix: chmod 777)
$img = "../images/";
// Maximum length of comments (maximum 255)
$comment_size = 255;
// Maximum points for voting
$max_points = 10;
// Minimum votes for pictures to appear in toplist
$min_votes = 20;
// Maximum image width
$img_width = 640;
// Maximum image height
$img_height = 480;
// Image format
// 1 = GIF, 2 = JPG, 3 = PNG, 4 = SWF
$img_format = 2;
// Maximum file size of images
// 102400 = 100KB
$img_size = 102400;
// Email-address of administrator
// (will be informed on new pictures
$webmaster = "you@yourdomain.com";
// Administration password
$password = "admin";
// Number of images to be shown on the administration page
$admin_show = 10;
// Title (will be displayed in the browser's header
$title = "Image voting";
/* ######################### LAYOUT ######################### */
// Header to be used on each page
$header = <<<EOT
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="style.css" rel="stylesheet" type="text/css">
<title>$title</title>
</head>
<body>
<table align="center" border="0" cellpadding="0" cellspacing="0" width="$img_width">
<tr>
<td align="center" colspan="2">
<a href="index.php">Vote!</a> |
<a href="toplist.php">Toplist</a> |
<a href="create_new.php">Upload image</a> |
<a href="admin.php">Administration</a>
<hr>
</td>
</tr>
<tr>
<td align="center" colspan="2">
EOT;
// Footer to be used on each page
$footer = <<<EOT
</td>
</tr>
</table>
</body>
</html>
EOT;
// Login form
$login = <<<EOT
<form action="admin.php" method="get">
Password: <input name="pw" type="password"> <input type="submit" value="Login">
</form>
EOT;
/* ############# SCRIPT (EDIT AT YOUR OWN RISK) ############# */
switch($img_format){
case 1:
$img_format_info = ".gif";
break;
case 2:
$img_format_info = ".jpg";
break;
case 3:
$img_format_info = ".png";
break;
case 4:
$img_format_info = ".swf";
break;
}
?>
Alles anzeigen