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
| <?php
include "functions.php";
if($_REQUEST['step']=="2" || $_REQUEST['step']=="3"){
include "config.php";
include "conn.php";
}
if($_REQUEST['step']=='1'){
if($_REQUEST['do']=="save"){
mysql_connect($_REQUEST['db_hostname'],$_REQUEST['db_username'],$_REQUEST['db_password']);
mysql_select_db($_REQUEST['db_database']);
$strSql_1 = "DROP TABLE IF EXISTS `".$_REQUEST['db_table_prefix']."files`;";
$strSql_2 = "DROP TABLE IF EXISTS `".$_REQUEST['db_table_prefix']."site_config`;";
$strSql_3 = "DROP TABLE IF EXISTS `".$_REQUEST['db_table_prefix']."template_emails`;";
$strSql_4 = "
CREATE TABLE `".$_REQUEST['db_table_prefix']."files` (
`fileid` double NOT NULL auto_increment,
`key` varchar(255) default NULL,
`mailto` varchar(255) default NULL,
`mailfrom` varchar(255) default NULL,
`mailmessage` text,
`filename` varchar(255) default NULL,
`foldername` varchar(255) default NULL,
`filesize` int(10) default '0',
`uploadtime` int(10) NOT NULL default '0',
`downloads` int(10) NOT NULL default '0',
`ip` varchar(15) default NULL,
`lastaccess` int(10) NOT NULL default '0',
KEY `file_id` (`fileid`)
) TYPE=MyISAM AUTO_INCREMENT=3;";
$strSql_5= "
CREATE TABLE `".$_REQUEST['db_table_prefix']."site_config` (
`id` int(11) NOT NULL auto_increment,
`db_hostname` varchar(255) default NULL,
`db_database` varchar(255) default NULL,
`db_username` varchar(255) default NULL,
`db_password` varchar(255) default NULL,
`admin_login` varchar(255) default NULL,
`admin_password` varchar(255) default NULL,
`admin_email` varchar(255) default NULL,
`site_name` varchar(255) default NULL,
`site_url` varchar(255) default NULL,
`site_path` varchar(255) default NULL,
`servers` text default NULL,
`upload_folder` varchar(255) default NULL,
`max_size` int(11) default '0',
`max_days` int(11) default '0',
`max_downloads` int(11) default '0',
`wait_for_link` int(11) default '0',
`expire_link` int(11) default '0',
`disallow_extensions` varchar(255) default NULL,
`admin_rows_per_page` int(11) default '0',
`mail_from_email` varchar(255) default NULL,
`mail_from_name` varchar(255) default NULL,
`google_ads` text default NULL,
`google_adst` text default NULL,
`google_adsl` text default NULL,
`google_adsr` text default NULL,
PRIMARY KEY (`id`)
) TYPE=MyISAM AUTO_INCREMENT=2 ;";
$strSql_6 = "CREATE TABLE `".$_REQUEST['db_table_prefix']."template_emails` ( `email_id` double NOT NULL auto_increment, `email_template_name` varchar(255) default NULL, `email_subject` text, `email_matter` text, PRIMARY KEY (`email_id`) ) TYPE=MyISAM AUTO_INCREMENT=1 ";
$strSql_7 = "insert into `".$_REQUEST['db_table_prefix']."template_emails` VALUES ('1000', 'Receiver Emails', 'Receiver Delivery Notification', 'Hello,\r\n\r\nYou have got a file called {filename} ({filesize} KB) from {mailfrom}.\r\n\r\nFile description (submitted by user):\r\n-----------------------------------------------------------------------\r\n{message}\r\n-----------------------------------------------------------------------\r\n\r\nYou can click on the following link to download this file:\r\n{fileurl}\r\n\r\n\r\nThanks,\r\nyourdomain.com.')";
$strSql_8 = "insert into `".$_REQUEST['db_table_prefix']."template_emails` VALUES ('1001', 'Sender Emails', 'Sender Delivery Notification', 'Hello,\r\n\r\nYour file called {filename} ({filesize} KB) was uploaded successfully and sent to {mailto}.\r\n\r\nFile description (submitted by u):\r\n-----------------------------------------------------------------------\r\n{message}\r\n-----------------------------------------------------------------------\r\n\r\nYou can click on the following link to download this file:\r\n{fileurl}\r\n\r\n\r\nThanks,\r\nyourdomain.com.')";
$strSql_9 = "insert into `".$_REQUEST['db_table_prefix']."site_config` (db_hostname, db_database, db_username, db_password)
values('".$_REQUEST['db_hostname']."','".$_REQUEST['db_database']."','".
$_REQUEST['db_username']."','".$_REQUEST['db_password']."')";
mysql_query($strSql_1);
mysql_query($strSql_2);
mysql_query($strSql_3);
mysql_query($strSql_4);
mysql_query($strSql_5);
mysql_query($strSql_6);
mysql_query($strSql_7);
mysql_query($strSql_8);
mysql_query($strSql_9);
alert("Tables created successfully.");
$file = fopen("config.php", "w");
$strText = "<?php
session_start();
DEFINE('DB_HOSTNAME','".$_REQUEST['db_hostname']."');
DEFINE('DB_USERNAME','".$_REQUEST['db_username']."');
DEFINE('DB_PASSWORD','".$_REQUEST['db_password']."');
DEFINE('DB_DATABASE','".$_REQUEST['db_database']."');
DEFINE('DB_TABLE_PREFIX','".$_REQUEST['db_table_prefix']."');
?>";
fputs($file, $strText);
fclose($file);
goto("install.php?step=2&prefix=".&_REQUEST['db_table_prefix']);
}
}elseif($_REQUEST['step']=="2"){
$strSql = "select * from ".DB_TABLE_PREFIX."site_config";
$rsConfig = $conn->execute($strSql);
if($_REQUEST['do']=="save"){
$strSql = "select * from ".DB_TABLE_PREFIX."site_config";
$rsUpdate = $conn->execute($strSql);
$record = array();
$record['admin_login'] = $_REQUEST['admin_login'];
$record['admin_password'] = $_REQUEST['admin_password'];
$record['admin_email'] = $_REQUEST['admin_email'];
$record['site_name'] = $_REQUEST['site_name'];
$record['site_url'] = $_REQUEST['site_url'];
$record['site_path'] = stripslashes($_REQUEST['site_path']);
$record['servers'] = stripslashes($_REQUEST['servers']);
$record['upload_folder'] = $_REQUEST['upload_folder'];
$record['max_size'] = $_REQUEST['max_size'];
$record['max_days'] = $_REQUEST['max_days'];
$record['max_downloads'] = $_REQUEST['max_downloads'];
$record['wait_for_link'] = $_REQUEST['wait_for_link'];
$record['expire_link'] = $_REQUEST['expire_link'];
$record['admin_rows_per_page'] = $_REQUEST['admin_rows_per_page'];
$record['disallow_extensions'] = $_REQUEST['disallow_extensions'];
$record['mail_from_email'] = $_REQUEST['mail_from_email'];
$record['mail_from_name'] = $_REQUEST['mail_from_name'];
$record['google_ads'] = $_REQUEST['google_ads'];
$record['google_adst'] = $_REQUEST['google_adst'];
$record['google_adsl'] = $_REQUEST['google_adsl'];
$record['google_adsr'] = $_REQUEST['google_adsr'];
$strSql = $conn->getUpdateSQL($rsUpdate, $record);
$conn->execute($strSql);
$file = fopen("config.php", "w");
$strText = "<?php
session_start();
DEFINE('DB_HOSTNAME','".DB_HOSTNAME."');
DEFINE('DB_USERNAME','".DB_USERNAME."');
DEFINE('DB_PASSWORD','".DB_PASSWORD."');
DEFINE('DB_DATABASE','".DB_DATABASE."');
DEFINE('DB_TABLE_PREFIX','".DB_TABLE_PREFIX."');
DEFINE('ADMIN_LOGIN','".$_REQUEST['admin_login']."');
DEFINE('ADMIN_PASSWORD','".$_REQUEST['admin_password']."');
DEFINE('ADMIN_EMAIL','".$_REQUEST['admin_email']."');
DEFINE('SITE_NAME','".$_REQUEST['site_name']."');
DEFINE('SITE_URL','".$_REQUEST['site_url']."');
DEFINE('SITE_PATH','".$_REQUEST['site_path']."');
DEFINE('SERVERS','".$_REQUEST['servers']."');
DEFINE('UPLOAD_FOLDER','".$_REQUEST['upload_folder']."');
DEFINE('MAX_SIZE','".$_REQUEST['max_size']."');
DEFINE('MAX_DAYS','".$_REQUEST['max_days']."');
DEFINE('MAX_DOWNLOADS','".$_REQUEST['max_downloads']."');
DEFINE('WAIT_FOR_LINK', '".$_REQUEST['wait_for_link']."');
DEFINE('EXPIRE_LINK', '".$_REQUEST['expire_link']."');
DEFINE('DISALLOW_EXTENSIONS','".$_REQUEST['disallow_extensions']."');
DEFINE('ADMIN_ROWS_PER_PAGE', '".$_REQUEST['admin_rows_per_page']."');
DEFINE('MAIL_FROM_EMAIL','".$_REQUEST['mail_from_email']."');
DEFINE('MAIL_FROM_NAME','".$_REQUEST['mail_from_name']."');
DEFINE('GOOGLE_ADS', '".stripslashes($_REQUEST['google_ads'])."');
DEFINE('GOOGLE_ADSt', '".stripslashes($_REQUEST['google_adst'])."');
DEFINE('GOOGLE_ADSl', '".stripslashes($_REQUEST['google_adsl'])."');
DEFINE('GOOGLE_ADSr', '".stripslashes($_REQUEST['google_adsr'])."');
?>";
fputs($file, $strText);
fclose($file);
alert("Configuration saved successfully.");
goto("install.php?step=3");
}
$strSql = "select * from ".DB_TABLE_PREFIX."site_config";
$rsConfig = $conn->execute($strSql);
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Sharelor Files Sender Installation Wizard</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</script>
<style type="text/css">
<!--
body
{
color: #faad1e;
}
a:link, a:visited
{
color: #fad27d;
text-decoration: none;
}
a:hover, a:active
{
color: #E56717;
text-decoration: none;
background-color: transparent;
}
-->
</style>
</script>
</head>
<body bgcolor=#ffffff style="cursor: default">
<table width=530 align=center cellspacing=1 cellpadding=0 bgcolor=#faad1e>
<tr align=center bgcolor=#faedca height=44><td><font face=verdana size=6 color=#fad27d><b>Sharelor Files Sender</td></tr>
<tr><td bgcolor=faedc0>
<tr align=center bgcolor=#faedca height=15><td><font face=verdana size=1 color=#faad1e></td></tr><tr><td bgcolor=faedc0>
<?php if(!$_REQUEST['step']=="2"){ ?>
<form name="form1" method="post" action="install.php?step=1&do=save">
<div align="center"><span class="smallBoldHeading">Sharelor Files Sender Installation Wizard : Step 1/2 </span><br>
<br>
</div>
<table width="450" border="0" align="center" cellpadding="3" cellspacing="1">
<tr>
<td width="186">Host Name </td>
<td width="299"><div align="right">
<input name="db_hostname" type="text" class="input300" id="db_hostname" value="localhost">
</div></td>
</tr>
<tr>
<td>Database Name</td>
<td><div align="right">
<input name="db_database" type="text" class="input300" id="db_database">
</div></td>
</tr>
<tr>
<td>Database Username</td>
<td><div align="right">
<input name="db_username" type="text" class="input300" id="db_username">
</div></td>
</tr>
<tr>
<td>Database Password</td>
<td><div align="right">
<input name="db_password" type="text" class="input300" id="db_password">
</div></td>
</tr>
<tr>
<td>Table Prefix </td>
<td><input name="db_table_prefix" type="text" class="input300" id="db_table_prefix" value="xl_"></td>
</tr>
<tr>
<td> </td>
<td><div align="right"></div></td>
</tr>
<tr>
<td colspan="2"><input name="Submit2" type="submit" class="button" value="Proceed to step 2"> <div align="right"></div></td>
</tr>
</table>
</form>
<p> </p>
<?php
}
if($_REQUEST['step']=="2"){
?>
<form name="form2" method="post" action="install.php?step=2&do=save">
<div align="center" class="smallBoldHeading">Sharelor Files Sender Installation Wizard : Step 2/2 <br>
<br>
</div>
<table width="480" border="0" align="center" cellpadding="1" cellspacing="1">
<tr valign="top">
<td class="textNormal">Admin Login </td>
<td>
<div align="right">
<input name="admin_login" type="text" class="input300" id="admin_login" value="<?php echo $rsConfig->fields['admin_login']; ?>">
</div></td>
</tr>
<tr valign="top">
<td class="textNormal">Admin Password </td>
<td>
<div align="right">
<input name="admin_password" type="text" class="input300" id="admin_password" value="<?php echo $rsConfig->fields['admin_password']; ?>">
</div></td>
</tr>
<tr valign="top">
<td class="textNormal"> </td>
<td> </td>
</tr>
<tr valign="right">
<td width="170" class="textNormal">Admin Email </td>
<td width="0">
<div align="right">
<input name="admin_email" type="text" class="input300" id="admin_email" value="<?php echo $rsConfig->fields['admin_email']; ?>">
</div></td>
</tr>
<tr valign="top">
<td class="textNormal">Site Name </td>
<td width="0">
<div align="right">
<input name="site_name" type="text" class="input300" id="site_name" value="<?php echo $rsConfig->fields['site_name']; ?>">
</div></td>
</tr>
<tr valign="top">
<td class="textNormal">Site URL </td>
<td width="0">
<div align="right">
<input name="site_url" type="text" class="input300" value="<?php echo $rsConfig->fields['site_url']; ?>">
</div></td>
</tr>
<tr valign="top">
<td class="textNormal">Site Path </td>
<td width="0">
<div align="right">
<input name="site_path" type="text" class="input300" value="<?php echo $rsConfig->fields['site_path']; ?>">
(<?php echo $_SERVER['DOCUMENT_ROOT']; ?>) </div></td>
</tr>
<tr valign="top">
<td class="textNormal"><div align="left">Rotating Servers</div></td>
<td>
<div align="right">
<input name="servers" type="text" class="input300" id="servers" value="<?php echo $rsConfig->fields['servers']; ?>">
</div></td>
</tr>
<tr valign="top">
<td class="textNormal"> </td>
<td> </td>
</tr>
<tr valign="top">
<td class="textNormal">Upload Folder </td>
<td width="0">
<div align="right">
<input name="upload_folder" type="text" class="input300" value="<?php echo $rsConfig->fields['upload_folder']; ?>">
(/files/) </div></td>
</tr>
<tr valign="top">
<td class="textNormal"> </td>
<td width="0"><div align="right"></div></td>
</tr>
<tr valign="top">
<td class="textNormal">Maximum Upload Size </td>
<td width="0">
<div align="right">
<input name="max_size" type="text" class="input100" value="<?php echo $rsConfig->fields['max_size']; ?>">
</div></td>
</tr>
<tr valign="top">
<td class="textNormal">Maximum Upload Days </td>
<td width="0">
<div align="right">
<input name="max_days" type="text" class="input100" value="<?php echo $rsConfig->fields['max_days']; ?>">
</div></td>
</tr>
<tr valign="top">
<td class="textNormal">Maximum Downloads</td>
<td width="0">
<div align="right">
<input name="max_downloads" type="text" class="input100" value="<?php echo $rsConfig->fields['max_downloads']; ?>">
</div></td>
</tr>
<tr valign="top">
<td class="textNormal">Waiting Time To Display Link</td>
<td><div align="right">
<input name="wait_for_link" type="text" class="input100" id="wait_for_link" value="<?php echo $rsConfig->fields['wait_for_link']; ?>">
</div></td>
</tr>
<tr valign="top">
<td class="textNormal">Expire Link After <i>n</i> Seconds</td>
<td><div align="right">
<input name="expire_link" type="text" class="input100" id="expire_link" value="<?php echo $rsConfig->fields['expire_link']; ?>">
</div></td>
</tr>
<tr valign="top">
<td class="textNormal"> </td>
<td> </td>
</tr>
<tr valign="top">
<td class="textNormal"><div align="left">Display Rows In Admin </div></td>
<td><div align="right">
<input name="admin_rows_per_page" type="text" class="input100" id="admin_rows_per_page" value="<?php echo $rsConfig->fields['admin_rows_per_page']; ?>">
</div></td>
</tr>
<tr valign="top">
<td class="textNormal"> </td>
<td width="0"><div align="right"></div></td>
</tr>
<tr valign="top">
<td class="textNormal">Extensions Not Allowed</td>
<td width="0">
<div align="right">
<input name="disallow_extensions" type="text" class="input300" value="<?php echo $rsConfig->fields['disallow_extensions']; ?>">
(exe|php|asp|htm|html|pl|cgi) </div></td>
</tr>
<tr valign="top">
<td class="textNormal"> </td>
<td width="0"><div align="right"></div></td>
</tr>
<tr valign="top">
<td class="textNormal">From Email </td>
<td><div align="right">
<input name="mail_from_email" type="text" class="input300" id="mail_from_email" value="<?php echo $rsConfig->fields['mail_from_email']; ?>">
</div></td>
</tr>
<tr valign="top">
<td class="textNormal">From Name In Emails </td>
<td width="0">
<div align="right">
<input name="mail_from_name" type="text" class="input300" value="<?php echo $rsConfig->fields['mail_from_name']; ?>">
</div></td>
</tr>
<tr valign="top">
<td><p>Ad code (bottom) </p>
<p class="style1">leave blank for none</p>
<p class="style1 style2">Some ad companies may not allow you to show more than one of their ads on your site at the same time on the same page </p></td>
<td><div align="right">
<textarea name="google_ads" rows="6" class="input_textarea_300" id="google_ads"><?php echo GOOGLE_ADS; ?></textarea>
</div></td>
<td class="star_red"> </td>
</tr>
<tr valign="top">
<td><p>Ad code (top)</p>
<p><span class="style1">leave blank for none</span></p></td>
<td><div align="right">
<textarea name="google_adst" rows="6" class="input_textarea_300" id="google_adst"><?php echo GOOGLE_ADSt; ?></textarea>
</div></td>
<td class="star_red"> </td>
</tr>
<tr valign="top">
<td><p>Ad code (left)</p>
<p><span class="style1">leave blank for none</span></p></td>
<td><div align="right">
<textarea name="google_adsl" rows="6" class="input_textarea_300" id="google_adsl"><?php echo GOOGLE_ADSl; ?></textarea>
</div></td>
<td class="star_red"> </td>
</tr>
<tr valign="top">
<td><p>Ad code (right)</p>
<p><span class="style1">leave blank for none</span></p></td>
<td><div align="right">
<textarea name="google_adsr" rows="6" class="input_textarea_300" id="google_adsr"><?php echo GOOGLE_ADSr; ?></textarea>
</div></td>
<td class="star_red"> </td>
</tr>
<tr valign="top">
<td class="linkNav"> </td>
<td width="0"><div align="right"></div></td>
</tr>
<tr>
<td> </td>
<td><div align="right"></div></td>
</tr>
<tr>
<td colspan="2"><div align="right"></div>
<div align="left">
<input name="Submit" type="submit" class="button" value="Submit">
</div></td>
</tr>
</table>
</form>
<p> </p>
<?php
}elseif($_REQUEST['step']=="3"){
?>
<table width="500" border="0" align="center" cellpadding="3" cellspacing="1">
<tr>
<td><p align="center" class="smallBoldHeading">Sharelor Files Sender
Installation Completed</p>
<p align="center"><br>
OK done! Now please delete the install.php file from the server before access to your ADMIN PANEL and HOME PAGE or else it will restart the setup.</p>
<p align="center">Go to <a href="index.php" class="link">ADMIN PANEL</a> | Go to <a href="<?php echo SITE_URL."/index.php"; ?>" class="link">VIEW HOME PAGE</a> </p>
<p> </p></td>
</tr>
</table>
<?php } ?>
</body>
<div align="center"><font size="-2"><a href="http://www.sharelor.com" target="_blank">Copyright © 2006 Sharelor.com. All Rights Reserved.</a></font></div>
</html> |