source: trunk/plog-admin/plog-thumb.php @ 590

Revision 590, 894 bytes checked in by sidtheduck, 19 months ago (diff)

Large commit based on work with Kim Parsell and myself
Should be ready for a release candidate after this commit.
Items worked on:

  • Large overhaul for code cleanup and syntax standardization
  • Security fixes for folder permissions on all server environments (now all directories should be set to 0755 and all files set to 0644)
  • Works compeletely with safe_mode restrictions using FTP commands
  • Beginnings of plugin usage (no architecture yet, but start of code standardization and addon code)
  • Fixing comments and adding security
  • More error messages
  • Minor fixes to upgrade and install process
  • Should fix tickets #188, #206, #194, #195, #197, #201, #203, #204, #89, #174, #200
  • Many other minor edits that I can't remember now (hopefully future commits will be much smaller and deal with individual issues, enhancements, or bugs)
Line 
1<?php
2// this will create a picture thumbnail on disk
3// first it will be used for import only.
4
5// load configuration variables from database, plog-globals, & plog-includes/plog-functions
6require_once(dirname(dirname(__FILE__)).'/plog-load-config.php');
7require_once(PLOGGER_DIR.'plog-admin/plog-admin-functions.php');
8
9// set up the default error message
10$found = plog_tr('No such image');
11
12if (empty($_GET['img'])) {
13        exit($found);
14}
15
16$files = get_files(PLOGGER_DIR.'plog-content/uploads');
17
18$up_dir = PLOGGER_DIR.'plog-content/uploads';
19
20foreach($files as $file) {
21        if (md5($file) == $_GET['img']) {
22                $rname = substr($file, strlen($up_dir)+1);
23
24                $thumbpath = generate_thumb($up_dir.'/'.$rname, 'import-'.substr(md5($file), 0, 2),THUMB_SMALL);
25                $found = '<img src="'.$thumbpath.'" alt="" /></div>';
26                //echo "found $relative_name!";
27                break;
28        }
29}
30close_db();
31close_ftp();
32echo $found;
33
34?>
Note: See TracBrowser for help on using the repository browser.