source: extensions/square_thumbnails/trunk/main.inc.php @ 9768

Last change on this file since 9768 was 9768, checked in by patdenice, 13 years ago

Compatible with addSimple method.

File size: 1.3 KB
Line 
1<?php
2/*
3Plugin Name: Square Thumbnails
4Version: auto
5Description: Add an option to make square thumbnails
6Plugin URI: auto
7Author: P@t
8Author URI: http://www.gauchon.com
9*/
10
11if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
12
13define('SQUARE_THUMB_PATH' , PHPWG_PLUGINS_PATH . basename(dirname(__FILE__)) . '/');
14
15if (defined('IN_ADMIN'))
16{
17  add_event_handler('init', 'square_thumbnails_init');
18
19  function square_thumbnails_init()
20  {
21    global $conf;
22
23    // Thumbnail creation page
24    if (isset($_GET['page']) and $_GET['page'] == 'thumbnail')
25    {
26      include(SQUARE_THUMB_PATH.'thumbnail.php');
27    }
28
29    // Upload Form
30    if (isset($_GET['page']) and $_GET['page'] == 'photos_add')
31    {
32      if (isset($_POST['submit_upload']) and @$conf['upload_form_thumb_square'])
33      {
34        include(SQUARE_THUMB_PATH.'functions.inc.php');
35      }
36
37      if (isset($_GET['section']) and $_GET['section'] == 'settings')
38      {
39        include(SQUARE_THUMB_PATH.'photo_add_settings.php');
40      }
41    }
42
43    // Uploadify
44    if (script_basename() == 'uploadify' and @$conf['upload_form_thumb_square'])
45    {
46      include(SQUARE_THUMB_PATH.'functions.inc.php');
47    }
48  }
49}
50
51add_event_handler('ws_add_methods', 'ws_add_method_load_square_functions');
52
53function ws_add_method_load_square_functions()
54{
55  include(SQUARE_THUMB_PATH.'functions.inc.php');
56}
57
58?>
Note: See TracBrowser for help on using the repository browser.