Skip to content

Commit e913352

Browse files
author
MFScripts
committed
Reservo-Image-Hosting-Script-Free
This image hosting script allows you to create your own image sharing website.
1 parent 90a4968 commit e913352

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+1688
-0
lines changed

.htaccess

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
AddType application/x-httpd-php .html
2+
php_flag register_globals on
3+
RewriteEngine on
4+
RewriteRule ^thumb-(.*).jpg$ view-image.html?img=$1&w=160&h=160 [QSA]
5+
RewriteRule ^showpic-(.*)/(.*)$ view-pic.html?img=$1 [QSA]
6+
RewriteRule ^download-(.*)/(.*)$ view-pic-original.html?img=$1&dl=1 [QSA]
7+
RewriteRule ^showoriginal-(.*)/(.*)$ view-pic-original.html?img=$1 [QSA]

ARW Scripts.url

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[InternetShortcut]
2+
URL=http://www.arwscripts.com/
3+
IDList=
4+
[{000214A0-0000-0000-C000-000000000046}]
5+
Prop3=19,2

_setup-instructions.txt

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Setup Instructions:
2+
3+
- Upload the main zip file to your hosting area.
4+
- Unzip the zip file ensuring all folders are kept.
5+
- Amend config.php with your sitename, siteurl and siteemail along with other optional amendments.
6+
- Modify the permissions on the following:
7+
storage => CHMOD 777
8+
storage/originals => CHMOD 777
9+
logs => CHMOD 777
10+
- Create a new database in mysql.
11+
- Import the .sql file stored within the sql directory.
12+
- Update db_connect.php in the root to connect correctly to your mysql database.
13+
- Add a http username/password to the admin directory.
14+
15+
You should now be set to go!
16+
17+
NOTE: If you receiving an 'Internal Server Error' when you try and load the site, it's probably because you have phpsuexec installed. You can resolve this error by removing the line 'php_flag register_globals on' from the .htaccess file within the root.

admin/index.html

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
<?php
2+
include_once("../config.php");
3+
include_once("../function-library.php");
4+
5+
$ptitle = "Free Image Hosting";
6+
$pkeys = "image hosting, free image host, image host, img host, upload picture";
7+
$pdesc = "Fast & Free Image Hosting";
8+
$selected = "ADMINAPPROVE";
9+
10+
include("../header.php");
11+
12+
if($_GET['yespub']) {
13+
$update = mysql_query("UPDATE images SET status = 'public' WHERE id = ".$_GET['yespub']." LIMIT 1");
14+
}
15+
elseif($_GET['yespri']) {
16+
$update = mysql_query("UPDATE images SET status = 'private' WHERE id = ".$_GET['yespri']." LIMIT 1");
17+
}
18+
elseif($_GET['yesadult']) {
19+
$update = mysql_query("UPDATE images SET status = 'adult' WHERE id = ".$_GET['yesadult']." LIMIT 1");
20+
}
21+
elseif($_GET['no']) {
22+
// remove image info
23+
$get_info = mysql_query("SELECT filename FROM images WHERE id = ".$_GET['no']." LIMIT 1");
24+
$filename = mysql_result($get_info, 0, filename);
25+
$fullpath = "../storage/originals/".$filename;
26+
unlink($fullpath);
27+
$update = mysql_query("UPDATE images SET status = 'removed', filename = 'removed.jpg' WHERE id = ".$_GET['no']." LIMIT 1");
28+
}
29+
30+
// get total
31+
$get_total = mysql_query("SELECT COUNT(id) AS total FROM images WHERE status = 'new'");
32+
$total_pen = mysql_result($get_total, 0, total);
33+
34+
?>
35+
36+
<table width="100%" cellpadding="10" cellspacing="0"><tr><td valign="top">
37+
38+
Use the following page to browse all items awaiting approval. (currently <b><?php echo $total_pen; ?> item<?php if($total_pen != 1) echo "s"; ?></b> pending). Any inappropriate items should be removed immediately from the system:<br><br>
39+
40+
<?php
41+
// get recent
42+
$tracker = 0;
43+
$get_recent = mysql_query("SELECT id, dateadded, filesize, originalheight, originalwidth FROM images WHERE status = 'new' ORDER BY dateadded DESC LIMIT 30");
44+
if($get_recent) {
45+
if(mysql_numrows($get_recent) > 0) {
46+
echo '<table width="100%" cellpadding="3" cellspacing="0">';
47+
while($row = mysql_fetch_array($get_recent)) {
48+
if($tracker == 0) echo "<tr>";
49+
echo "<td valign='top' align='center'>";
50+
echo "<a href='index.html?yesadult=".$row[id]."'>APPROVE ADULT</a><br>";
51+
echo "<a href='index.html?yespub=".$row[id]."'>APPROVE PUBLIC</a><br>";
52+
echo "<a href='index.html?yespri=".$row[id]."'>APPROVE NON-PUBLIC</a><br>";
53+
echo "<a href='index.html?no=".$row[id]."'>REMOVE</a>";
54+
echo "<br>";
55+
echo "<a href='../view-pic.html?img=".$row[id]."'><img src='../view-image.html?img=".$row[id]."&w=110&h=110' border='0' width='110' alt='".$site_url." - click here to view this image' style='border:1px solid #cccccc;'></a>";
56+
echo "</td>";
57+
if($tracker == 4) {
58+
$tracker = 0;
59+
echo "</tr>";
60+
}
61+
else $tracker++;
62+
}
63+
echo '</table>';
64+
}
65+
else echo "<b>There are no items awaiting approval.</b>";
66+
}
67+
else echo "<b>There are no items awaiting approval.</b>";
68+
69+
?>
70+
71+
</td></tr></table>
72+
<?php
73+
include("../footer.php");
74+
?>

adult-warning.html

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php
2+
include_once("config.php");
3+
include_once("function-library.php");
4+
5+
$ptitle = "Free Image Hosting";
6+
$pkeys = "image hosting, free image host, image host, img host, upload picture";
7+
$pdesc = "Fast & Free Image Hosting";
8+
$selected = "WARNING";
9+
10+
include("header.php");
11+
?>
12+
13+
<table width="100%" cellpadding="10" cellspacing="0"><tr><td valign="top" align="center">
14+
15+
<br><br><font style="font-size:22px; color:red;"><b>CONTENT WARNING:</b></font><br><br><br>
16+
17+
You are about to view content which may be of an adult nature<br>
18+
and hence you must be over the legal age for your country<br>
19+
before you proceed.<br><br>
20+
Please confirm below that you are permitted to view adult content<br>
21+
and you wish to continue.<br><br><br>
22+
<form method="POST" action="view-pic.html?img=<?php echo $img; ?>">
23+
<input type="hidden" name="img" value="<?php echo $img; ?>">
24+
<input type="hidden" name="adult" value="yes">
25+
<input type="submit" name="submit" value="continue" style="border:2px solid green;">&nbsp;&nbsp;&nbsp;
26+
<input type="reset" name="reset" value="no thanks" style="border:2px solid red;" onClick="javascript:window.location='http://<?php echo $site_url; ?>';">
27+
</form>
28+
29+
</td></tr></table>
30+
31+
<?php
32+
include("footer.php");
33+
?>

clean-up.php

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
// script to handle deletions of old images
4+
// only images which have not been accessed since $days_to_keep_images
5+
// days will be removed.
6+
7+
include_once("config.php");
8+
9+
$ago = date('Y-m-d H:i:s', strtotime("-".$days_to_keep_images." days"));
10+
$get_images = mysql_query("SELECT id, filename FROM images WHERE lastaccessed < '".$ago."' AND status != 'removed'");
11+
while($row = mysql_fetch_array($get_images)) {
12+
$fullpath = "storage/originals/".$row['filename'];
13+
unlink($fullpath);
14+
$update = mysql_query("UPDATE images SET status = 'removed', filename = 'removed.jpg' WHERE id = ".$row['id']." LIMIT 1");
15+
}
16+
17+
?>

config.php

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?php
2+
3+
error_reporting(0);
4+
5+
// db bits here
6+
include_once("db_connect.php");
7+
8+
// site details
9+
$site_name = "Your Site Name"; // site name/title
10+
$site_url = "yourdomain.com"; // site url. Lowercase. Excluding the www. Remove any ending forward slash '/'. i.e. 'mysitename.com'.
11+
$site_admin = "[email protected]"; // email address used for the contact page
12+
13+
// other bits
14+
$max_upload_size = "2097152"; // maximum image filesize permitted
15+
$max_upload_display_size = "2mb"; // displays on the homepage
16+
$days_to_keep_images = 60; // after how many days of inactivity images should be removed
17+
$permit_hotlinking = TRUE; // whether or not to allow images to be directly linked from external sites
18+
19+
$watermark = "images/watermark.png"; // path to watermark image - must be a PNG - Leave blank for no watermark
20+
$watermark_alpha = 50; // measured from 1 to 100 this is the transparency of the watermark image
21+
$watermark_pos = "bottom-right"; // watermark position. Options are top-left, top-right, bottom-left, bottom-right, center
22+
23+
$show_delete_code = TRUE; // if TRUE, the user is given a unique url to delete the image. This is shown on the completition of upload page. (index.html)
24+
25+
$show_pass_option = TRUE; // if TRUE, the user is given the option to specify a password on an image
26+
27+
$default_upload_view = "MULTIPLE"; // should be set to 'SINGLE' or 'MULTIPLE' to set either the single or Flash multiple uploader tool, as the default homepage view
28+
29+
ini_set("memory_limit", "100M");
30+
31+
?>

contact.html

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<?php
2+
include_once("config.php");
3+
include_once("function-library.php");
4+
5+
$ptitle = "Free Image Hosting";
6+
$pkeys = "image hosting, free image host, image host, img host, upload picture";
7+
$pdesc = "Fast & Free Image Hosting";
8+
$selected = "CONTACT";
9+
10+
$showform = TRUE;
11+
12+
if(isset($sendit)) {
13+
$errorstring = "";
14+
$youremail = strtolower(preparedata($youremail));
15+
if(strlen($youremail) == 0) $errorstring .="You must specify your email.<br>";
16+
if(strlen($subject) == 0) $errorstring .="You must specify a subject.<br>";
17+
if(strlen($message) == 0) $errorstring .="You have not entered a message.<br>";
18+
if(strlen($youremail) < 9 || strlen($youremail) > 64) $errorstring .= "Please enter a valid email address.<br>";
19+
else
20+
{
21+
$emailtail = strstr($youremail, '@');
22+
if(!strstr($youremail, '@') || !strstr($emailtail, '.')) $errorstring .= "Please enter a valid email address.<br>";
23+
}
24+
if(strlen($errorstring) == 0){
25+
$subject = "Contact from the ".$site_url." site - ".$subject;
26+
$sent = mail($site_admin, $subject, $message, "FROM: ".$youremail);
27+
if($sent) $showform = FALSE;
28+
}
29+
}
30+
31+
include("header.php");
32+
?>
33+
34+
<table width="100%" cellpadding="10" cellspacing="0"><tr><td valign="top">
35+
36+
<?php
37+
if($showform == TRUE) {
38+
?>
39+
If you have any questions or comments about the site or services we offer, feel free to contact us using the form below:<br><br>
40+
<table width="100%" cellpadding="0" cellspacing="0" border="0" align="center">
41+
<tr><form method="post" action="contact.html"><input type="hidden" name="sendit" value="yes"><td style="padding:0px;" align="left"><br>
42+
<?php if(strlen($errorstring) > 0) echo "<table cellpadding=\"8\" cellspacing=\"0\" border=\"0\" align=\"center\"><tr><td><font class=\"error\"><b>Error(s) Found:</b><br><br>$errorstring</td></tr></table><br><br>";?>
43+
<table cellpadding="5" cellspacing="0" border="0">
44+
<tr><td width="80"><b>Your Email:</b></td><td><input type="text" name="youremail" class="form" style="width:150px;" value="<?php echo stripslashes($youremail); ?>"></td></tr>
45+
<tr><td><b>Subject:</b></td><td><input type="text" name="subject" class="form" style="width:150px;" value="<?php echo stripslashes($subject); ?>"></td></tr>
46+
<tr><td valign="top"><b>Message:</b></td><td><textarea name="message" class="form" style="width:300px;" rows="6"><?php echo stripslashes($message); ?></textarea></td></tr>
47+
<tr><td></td><td><input type="submit" value="send" class="form">&nbsp;&nbsp;<input type="reset" value="reset" class="form"></td></tr>
48+
<tr><td colspan="2" align="right"></td></tr>
49+
</table><br>
50+
</td></form></tr>
51+
</table>
52+
<?php
53+
}
54+
else echo "<b>Your message has been sent to ".$site_name.". We will endeavour to respond within the next 48 hours.<br><br>Thanks for your comments,<br>".$site_url."</b><br><br>";
55+
?>
56+
57+
</td></tr></table>
58+
59+
<?php
60+
include("footer.php");
61+
?>

db_connect.php

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
3+
/* Setup MySQL Access */
4+
5+
$DBhost = "localhost";
6+
$DBuser = "";
7+
$DBpass = "";
8+
$DBname = "";
9+
mysql_connect($DBhost, $DBuser, $DBpass) or die ("Cannot connect to database server");
10+
mysql_select_db($DBname) or die ("Cannot select site database");
11+
12+
?>

delete.html

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?php
2+
include_once("config.php");
3+
include_once("function-library.php");
4+
5+
$ptitle = "Free Image Hosting";
6+
$pkeys = "image hosting, free image host, image host, img host, upload picture";
7+
$pdesc = "Fast & Free Image Hosting";
8+
9+
include("header.php");
10+
?>
11+
12+
<table width="100%" cellpadding="10" cellspacing="0"><tr><td valign="top">
13+
14+
<?php
15+
// delete image
16+
$d = $_GET['d'];
17+
$get_filename = mysql_query("SELECT filename FROM images WHERE tracker = '".preparedata($d)."' LIMIT 1");
18+
$filename = mysql_result($get_filename, 0, filename);
19+
$uploaddir = 'storage/originals/';
20+
21+
$delete = mysql_query("DELETE FROM images WHERE tracker = '".preparedata($d)."' LIMIT 1");
22+
if($delete) {
23+
@unlink($uploaddir.$filename);
24+
@unlink($uploaddir."110/".$filename);
25+
@unlink($uploaddir."160/".$filename);
26+
@unlink($uploaddir."500/".$filename);
27+
@unlink($uploaddir."720/".$filename);
28+
@unlink($uploaddir."5000/".$filename);
29+
echo "<b>Your image has successfully been removed.</b><br><br>";
30+
}
31+
else echo "<b>There has been an error looking up the image details, please try again later.</b><br><br>";
32+
echo "<a href='index.html'>home</a><br><br>";
33+
?>
34+
35+
</td></tr></table>
36+
<?php
37+
include("footer.php");
38+
?>

enter-password.html

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
include_once("config.php");
3+
include_once("function-library.php");
4+
5+
$ptitle = "Free Image Hosting";
6+
$pkeys = "image hosting, free image host, image host, img host, upload picture";
7+
$pdesc = "Fast & Free Image Hosting";
8+
$selected = "WARNING";
9+
10+
include("header.php");
11+
?>
12+
13+
<table width="100%" cellpadding="10" cellspacing="0"><tr><td valign="top" align="center">
14+
15+
<br><br><font style="font-size:22px; color:green;"><b>ENTER PASSWORD:</b></font><br><br><br>
16+
Please enter the password below to access this image:<br><br>
17+
<form method="POST" action="view-pic.html?img=<?php echo $img; ?>">
18+
<input type="hidden" name="img" value="<?php echo $img; ?>">
19+
<input type="password" name="p" value="">
20+
<input type="submit" name="submit" value="continue" style="border:2px solid green;">
21+
</form>
22+
23+
</td></tr></table>
24+
25+
<?php
26+
include("footer.php");
27+
?>

faq.html

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?php
2+
include_once("config.php");
3+
include_once("function-library.php");
4+
5+
$ptitle = "Free Image Hosting";
6+
$pkeys = "image hosting, free image host, image host, img host, upload picture";
7+
$pdesc = "Fast & Free Image Hosting";
8+
$selected = "FAQ";
9+
10+
include("header.php");
11+
?>
12+
13+
<table width="100%" cellpadding="10" cellspacing="0"><tr><td valign="top">
14+
15+
<b>Is this free? </b><br>
16+
Yes 100% Free for all users.<br><br>
17+
18+
<b>Will my images be removed? </b><br>
19+
Images not accessed within <?php echo $days_to_keep_images; ?> days will be removed.<br><br>
20+
21+
<b>How many images can I upload?</b><br>
22+
You can upload as many images as you want, as long as each one adheres to the Terms of Service.<br><br>
23+
24+
<b>Which image types am I allowed to upload?</b><br>
25+
You may upload .jpg, .jpeg, .gif (non animated) and .png image types.<br><br>
26+
27+
<b>Are there any restrictions to the size of my uploaded images?</b><br>
28+
Each image you upload must be less than <?php echo $max_upload_display_size; ?> in size. If it is greater than that amount, your image will be rejected.<br><br>
29+
30+
<b>Can I edit my images using <?php echo $site_name; ?>?</b><br>
31+
No. Most people use graphics editing programs such as PhotoShop or Paint Shop Pro, or software that comes with printers, scanners, or digital cameras to edit their images.<br><br>
32+
33+
<b>Can I upload music or videos?</b><br>
34+
No. Music hosting is not allowed due to copyright concerns. Video hosting is not allowed due to large file sizes.<br><br>
35+
36+
<b>How much space can I use?</b><br>
37+
You have an unlimited amount of space for storing your images. <?php echo $site_name; ?> continuously buys harddrives to compensate for the amount of images that <?php echo $site_name; ?>'s visitors upload.
38+
39+
</td></tr></table>
40+
<?php
41+
include("footer.php");
42+
?>

fileUpload.swf

47.7 KB
Binary file not shown.

0 commit comments

Comments
 (0)