-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
111 lines (101 loc) · 2.99 KB
/
index.php
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
<?php
/* -----------------------------------------
Chevereto - Script de hosting de imagenes
Nightly Build 2.0 (25/07/2010)
http://www.chevereto.com/
Released under the GPL 2.0
Copyright (C) 2008 by Rodolfo Berrios
<inbox at rodolfoberrios dot com>
----------------------------------------- */
/* Please link us.. http://chevereto.com/ */
//setup the basepath. aka, where this script runs from.(wih this i mean index.php)
define('BASEPATH', getcwd() );
//load up the lib
require_once(BASEPATH . '/lib/chevereto.class.php');
$chevereto = new chevereto();
$chevereto->init();
//is resize set?
if (isset($_POST['resize']) && $_POST['resize'] > $config['min_re_size']): $resize = $_POST['resize']; else: $resize = false; endif;
//is something posted? aka some one wants to upload
if ( isset($_POST['tab']) && $_POST['tab'] == "local" ){
$chevereto->toWorking($_FILES['localUP']['tmp_name'], $_FILES['localUP']['name']);
$imagedata = $chevereto->process($_FILES['localUP'], $_POST['tab'] ,$resize);
$chevereto->redirect('self', '?v=' . $imagedata['uploadedFiles']); //redirect to viewer
}elseif ( isset($_POST['tab']) && $_POST['tab'] == "remote" ) {
//remote. First get the files in $config['dir']['working'] and then proccess them.
$filenames = $chevereto->getRemote($_POST['remota']);//post remota can be an array.
$chevereto ->process($filenames, $_POST['tab'] ,$resize);
}
//ES
// DETERMINAMOS QUE MOSTRAMOS Y HACEMOS
// 1 = Mostrar formulario.
// 2 = Muetsra el visualizador
// 3 = Sube un archivo
// 4 = muestra la pag del error de redimensionamiento
// 5 = Muestra una pag. estatica
// spit = devuelve los mensajes de error.
//EN
// Show and DETERMINE WHAT WE DO --> $modo && $chevereto->mode
// 1 = Show form.
// 2 = display resize fom
// 3 = Upload a file
// 4 = shows the error of downsizing pag
// 5 = Display a pag. static aka 404
// Spit = returns the error messages.
// Modo pagina
if (isset($page)) {
unset($modo);
$modo = 5;
// haga el switch
switch ($page) {
// Los errores
case '400':
$h1 = TITLE_400;
$explained = DESC_400;
break;
case '401':
$h1 = TITLE_401;
$explained = DESC_401;
break;
case '403':
$h1 = TITLE_403;
$explained = DESC_403;
break;
case '404':
$h1 = TITLE_404;
$explained = DESC_404;
break;
case '500':
$h1 = TITLE_500;
$explained = DESC_500;
case '503':
$h1 = TITLE_503;
$explained = DESC_503;
break;
// Los directorios
case 'up':
$h1 = TITLE_DIR_NO;
$explained = DESC_DIR_NO;
break;
case 'up/temp':
$h1 = TITLE_DIR_NO;
$explained = DESC_DIR_NO;
break;
case 'up/working':
$h1 = TITLE_DIR_NO;
$explained = DESC_DIR_NO;
break;
case 'images':
$h1 = TITLE_DIR_NO;
$explained = DESC_DIR_NO;
break;
default:
$h1 = TITLE_404;
$explained = DESC_404;
$page = 'generico';
break;
}
$titulo = $h1.ESP_TITULO;
}
include('./site-files/wrapper.php');
?>