| @@ -1,58 +1,58 @@ | ||
| 1 | 1 | <?php |
| 2 | -/** | |
| 3 | - * Plugin Name: Image Source Control Lite | |
| 4 | - * Version: 3.12.0 | |
| 5 | - * Plugin URI: https://imagesourcecontrol.com/ | |
| 6 | - * Description: Image Source Control saves the source of an image, lists them and warns if it is missing. | |
| 7 | - * Author: Thomas Maier | |
| 8 | - * Author URI: https://imagesourcecontrol.com/ | |
| 9 | - * License: GPL v3 | |
| 2 | +/* | |
| 3 | + Plugin Name: Image Source Control | |
| 4 | + Version: 1.3.5 | |
| 5 | + Plugin URI: http://webgilde.com/en/image-source-control/ | |
| 6 | + Description: The Image Source Control saves the source of an image, lists them and warns if it is missing. | |
| 7 | + Author: Thomas Maier | |
| 8 | + Author URI: http://www.webgilde.com/ | |
| 9 | + License: GPL v3 | |
| 10 | + | |
| 11 | + Image Source Control Plugin for WordPress | |
| 12 | + Copyright (C) 2012, Thomas Maier - thomas.maier@webgilde.com | |
| 13 | + | |
| 14 | + This program is free software: you can redistribute it and/or modify | |
| 15 | + it under the terms of the GNU General Public License as published by | |
| 16 | + the Free Software Foundation, either version 3 of the License, or | |
| 17 | + (at your option) any later version. | |
| 18 | + | |
| 19 | + This program is distributed in the hope that it will be useful, | |
| 20 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 21 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 22 | + GNU General Public License for more details. | |
| 23 | + | |
| 24 | + You should have received a copy of the GNU General Public License | |
| 25 | + along with this program. If not, see <http://www.gnu.org/licenses/>. | |
| 10 | 26 | * |
| 11 | - * Image Source Control Plugin for WordPress | |
| 12 | - * Copyright (C) 2012-2026, Thomas Maier & webgilde GmbH | |
| 27 | + * Followed the following tutorials | |
| 28 | + * http://wpengineer.com/2076/add-custom-field-attachment-in-wordpress/ | |
| 29 | + * http://bueltge.de/eigene-felder-dateiverwaltung-wordpress/1226/ (same like above, but in German) | |
| 13 | 30 | * |
| 14 | - * This program is free software: you can redistribute it and/or modify | |
| 15 | - * it under the terms of the GNU General Public License as published by | |
| 16 | - * the Free Software Foundation, either version 3 of the License, or | |
| 17 | - * (at your option) any later version. | |
| 18 | 31 | * |
| 19 | - * This program is distributed in the hope that it will be useful, | |
| 20 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 21 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 22 | - * GNU General Public License for more details. | |
| 23 | - * | |
| 24 | - * You should have received a copy of the GNU General Public License | |
| 25 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
| 26 | 32 | */ |
| 27 | 33 | |
| 28 | -if ( defined( 'ISCVERSION' ) ) { | |
| 29 | - wp_die( 'You can only activate Image Source Control once. Please disable the other version first.' ); | |
| 34 | +//avoid direct calls to this file | |
| 35 | +if (!function_exists('add_action')) { | |
| 36 | + header('Status: 403 Forbidden'); | |
| 37 | + header('HTTP/1.1 403 Forbidden'); | |
| 38 | + exit(); | |
| 30 | 39 | } |
| 31 | 40 | |
| 32 | -define( 'ISCVERSION', '3.12.0' ); | |
| 33 | -define( 'ISCNAME', 'Image Source Control' ); | |
| 34 | -define( 'ISCDIR', basename( __DIR__ ) ); | |
| 35 | -define( 'ISCPATH', plugin_dir_path( __FILE__ ) ); | |
| 36 | -define( 'ISCBASE', plugin_basename( __FILE__ ) ); // plugin base as used by WordPress to identify it. | |
| 37 | -define( 'ISCBASEURL', plugin_dir_url( __FILE__ ) ); // URL to the plugin directory. | |
| 41 | +define('ISCVERSION', '1.3.5'); | |
| 42 | +define('ISCNAME', 'Image Source Control'); | |
| 43 | +define('ISCTEXTDOMAIN', 'isc'); | |
| 44 | +define('ISCDIR', basename(dirname(__FILE__))); | |
| 45 | +define('ISCPATH', plugin_dir_path(__FILE__)); | |
| 46 | +define('WEBGILDE', 'http://webgilde.com/en/image-source-control'); | |
| 38 | 47 | |
| 39 | -// Load the autoloader. | |
| 40 | -require_once ISCPATH . 'includes/class-autoloader.php'; | |
| 41 | -\ISC\Autoloader::get()->initialize(); | |
| 48 | +load_plugin_textdomain(ISCTEXTDOMAIN, false, dirname(plugin_basename(__FILE__)) . '/languages/'); | |
| 42 | 49 | |
| 43 | -if ( is_admin() ) { | |
| 44 | - new ISC\Admin(); | |
| 45 | -} elseif ( ! is_admin() && ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) ) { | |
| 46 | - // include frontend functions. | |
| 47 | - new ISC_Public(); | |
| 48 | - require_once ISCPATH . 'includes/functions.php'; | |
| 49 | -} | |
| 50 | +require_once(ISCPATH . 'isc.class.php'); | |
| 50 | 51 | |
| 51 | -// deprecated. Added here for backward compatibility. Will be removed in future versions. | |
| 52 | -new ISC_Class(); | |
| 52 | +global $my_isc; | |
| 53 | +$my_isc = new ISC_CLASS(); | |
| 53 | 54 | |
| 54 | -if ( ! class_exists( 'ISC_Pro_Model', false ) && file_exists( ISCPATH . 'pro/isc-pro.php' ) ) { | |
| 55 | - require_once ISCPATH . 'pro/isc-pro.php'; | |
| 55 | +function isc_list($post_id = 0) { | |
| 56 | + global $my_isc; | |
| 57 | + echo $my_isc->list_post_attachments_with_sources($post_id); | |
| 56 | 58 | } |
| 57 | - | |
| 58 | -new ISC_Block_Options(); | |