-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy paththumb.php
45 lines (40 loc) · 1.55 KB
/
thumb.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
<?php
##################################################
#
# Copyright (c) 2004-2025 OIC Group, Inc.
#
# This file is part of Exponent
#
# Exponent is free software; you can redistribute
# it and/or modify it under the terms of the GNU
# General Public License as published by the Free
# Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# GPL: http://www.gnu.org/licenses/gpl.txt
#
##################################################
/** @define "BASE" "." */
if (defined('EXPONENT')) return;
// bootstrap some exponenty goodness
include_once('exponent_bootstrap.php');
if (!defined('SYS_SESSION_KEY')) define('SYS_SESSION_KEY',PATH_RELATIVE);
if (isset($_GET['id'])) {
// Since bootstrap doesn't setup the session we need to define this
// otherwise the expFile can't find it's table desc from cache.
// Initialize the Database Subsystem
$db = expDatabase::connect(DB_USER,DB_PASS,DB_HOST.':'.DB_PORT,DB_NAME,'',false,BASE . 'tmp/thumb_sql.log');
$file_obj = new expFile((int)($_GET['id']));
//$_GET['src'] = "/" . $file_obj->directory.$file_obj->filename;
// $_GET['src'] = $file_obj->path;
$_GET['src'] = $file_obj->path_relative; // fix for using v1.7.12+
unset(
$_GET['id'],
$_GET['square']
);
}
if (isset($_GET['src']) && substr($_GET['src'],0,1) != '/' && substr($_GET['src'],0,4) != 'http') {
$_GET['src'] = PATH_RELATIVE . $_GET['src']; //kludge since phpThumb v1.17.2+ needs a full path to work correctly
}
require_once(BASE."external/phpThumb/phpThumb.php");
?>