Changeset 31410


Ignore:
Timestamp:
Mar 8, 2016, 5:59:15 PM (5 years ago)
Author:
ddtddt
Message:

[extensions] - DownloadFromThumbnail

Location:
extensions/DownloadFromThumbnail
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • extensions/DownloadFromThumbnail/dst.tpl

    r31376 r31410  
    33jQuery('.dowpica').click(function(){
    44    var id= $(this).data('id');
    5     jQuery.post("plugins/DownloadSinceThumbnail/save_history.php", {
     5    jQuery.post("plugins/DownloadFromThumbnail/save_history.php", {
    66        dsp_his: id,
    77    });
  • extensions/DownloadFromThumbnail/index.php

    r31376 r31410  
    11<?php
     2// +-----------------------------------------------------------------------+
     3// | Download From Thumbnail plugin for piwigo                             |
     4// +-----------------------------------------------------------------------+
     5// | Copyright(C) 2015-2016 ddtddt               http://temmii.com/piwigo/ |
     6// +-----------------------------------------------------------------------+
     7// | This program is free software; you can redistribute it and/or modify  |
     8// | it under the terms of the GNU General Public License as published by  |
     9// | the Free Software Foundation                                          |
     10// |                                                                       |
     11// | This program is distributed in the hope that it will be useful, but   |
     12// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
     13// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
     14// | General Public License for more details.                              |
     15// |                                                                       |
     16// | You should have received a copy of the GNU General Public License     |
     17// | along with this program; if not, write to the Free Software           |
     18// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
     19// | USA.                                                                  |
     20// +-----------------------------------------------------------------------+
     21
    222$url = '../';
    323header( 'Request-URI: '.$url );
  • extensions/DownloadFromThumbnail/language/en_UK/description.txt

    r31376 r31410  
    1 Download since album page (thumbnail)
     1Download photo from album page (link on thumbnail)
  • extensions/DownloadFromThumbnail/language/en_UK/index.php

    r31376 r31410  
    11<?php
    22// +-----------------------------------------------------------------------+
    3 // | Plugin Piwigo -                                     |
     3// | Download From Thumbnail plugin for piwigo                             |
    44// +-----------------------------------------------------------------------+
    5 // | Copyright(C) 2015 SAS TEMMII                  http://temmii.org |
     5// | Copyright(C) 2015-2016 ddtddt               http://temmii.com/piwigo/ |
    66// +-----------------------------------------------------------------------+
    77// | This program is free software; you can redistribute it and/or modify  |
  • extensions/DownloadFromThumbnail/main.inc.php

    r31377 r31410  
    66Plugin URI: http://piwigo.org/ext/extension_view.php?eid=
    77Author: ddtddt
    8 Author URI: http://temmii.com/
     8Author URI: http://temmii.com/piwigo/
    99*/
     10// +-----------------------------------------------------------------------+
     11// | Download From Thumbnail plugin for piwigo                             |
     12// +-----------------------------------------------------------------------+
     13// | Copyright(C) 2015-2016 ddtddt               http://temmii.com/piwigo/ |
     14// +-----------------------------------------------------------------------+
     15// | This program is free software; you can redistribute it and/or modify  |
     16// | it under the terms of the GNU General Public License as published by  |
     17// | the Free Software Foundation                                          |
     18// |                                                                       |
     19// | This program is distributed in the hope that it will be useful, but   |
     20// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
     21// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
     22// | 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, write to the Free Software           |
     26// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
     27// | USA.                                                                  |
     28// +-----------------------------------------------------------------------+
    1029
    1130defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
     
    4766  }
    4867
    49  // $image_ids = array_map(create_function('$i', 'return $i["id"];'), $pictures);
    50 
    5168  $query = '
    5269  SELECT enabled_high
  • extensions/DownloadFromThumbnail/maintain.class.php

    r31377 r31410  
    11<?php
     2// +-----------------------------------------------------------------------+
     3// | Download From Thumbnail plugin for piwigo                             |
     4// +-----------------------------------------------------------------------+
     5// | Copyright(C) 2015-2016 ddtddt               http://temmii.com/piwigo/ |
     6// +-----------------------------------------------------------------------+
     7// | This program is free software; you can redistribute it and/or modify  |
     8// | it under the terms of the GNU General Public License as published by  |
     9// | the Free Software Foundation                                          |
     10// |                                                                       |
     11// | This program is distributed in the hope that it will be useful, but   |
     12// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
     13// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
     14// | General Public License for more details.                              |
     15// |                                                                       |
     16// | You should have received a copy of the GNU General Public License     |
     17// | along with this program; if not, write to the Free Software           |
     18// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
     19// | USA.                                                                  |
     20// +-----------------------------------------------------------------------+
     21
    222defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
    323
     
    1434
    1535  function activate($plugin_version, &$errors=array()){
    16         $image_type = implode(",", get_enums(HISTORY_TABLE, 'image_type')).",dft_download";
    17         $query = "ALTER TABLE ". HISTORY_TABLE ." CHANGE `image_type` `image_type` ENUM( '".$image_type."' ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL";
    18         $result = pwg_query($query);
     36        if(!in_array("dft_download", get_enums(HISTORY_TABLE, 'image_type')))
     37          {
     38          $image_type = "'".implode("','", get_enums(HISTORY_TABLE, 'image_type'))."','dft_download'";
     39          $query = "ALTER TABLE ". HISTORY_TABLE ." CHANGE `image_type` `image_type` ENUM( ".$image_type." ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL";
     40          $result = pwg_query($query);
     41          }
    1942  }
    2043
  • extensions/DownloadFromThumbnail/save_history.php

    r31377 r31410  
    11<?php
    2 
     2// +-----------------------------------------------------------------------+
     3// | Download From Thumbnail plugin for piwigo                             |
     4// +-----------------------------------------------------------------------+
     5// | Copyright(C) 2015-2016 ddtddt               http://temmii.com/piwigo/ |
     6// +-----------------------------------------------------------------------+
     7// | This program is free software; you can redistribute it and/or modify  |
     8// | it under the terms of the GNU General Public License as published by  |
     9// | the Free Software Foundation                                          |
     10// |                                                                       |
     11// | This program is distributed in the hope that it will be useful, but   |
     12// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
     13// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
     14// | General Public License for more details.                              |
     15// |                                                                       |
     16// | You should have received a copy of the GNU General Public License     |
     17// | along with this program; if not, write to the Free Software           |
     18// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
     19// | USA.                                                                  |
     20// +-----------------------------------------------------------------------+
    321
    422define('PHPWG_ROOT_PATH','../../');
     
    1432
    1533pwg_log($_POST['dsp_his'], 'dft_download');
    16 /*
    17 
    18 $query = 'UPDATE '.IMAGES_TABLE.' SET hit=hit+1 WHERE id = '.$_POST['dsp_his'].';';
    19 pwg_query($query);
    20 
    21 $do_log = $conf['log'];
    22 if (is_admin())
    23 {
    24   $do_log = $conf['history_admin'];
    25 }
    26 if (is_a_guest())
    27 {
    28   $do_log = $conf['history_guest'];
    29 }
    30 
    31 if (!$do_log)
    32 {
    33   exit();
    34 }
    35 
    36 if (!empty($_POST['section']))
    37 {
    38   $page['section'] = pwg_db_real_escape_string($_POST['section']);
    39 }
    40 if (!empty($_POST['catid']))
    41 {
    42   $page['category']['id'] = pwg_db_real_escape_string($_POST['catid']);
    43 }
    44 if ('tags'==@$page['section'] and !empty($_POST['tagids']))
    45 {
    46   $tags_string = pwg_db_real_escape_string($_POST['tagids']);
    47 }
    48 
    49   $query = '
    50 INSERT INTO '.HISTORY_TABLE.'
    51   (
    52     date,
    53     time,
    54     user_id,
    55     IP,
    56     section,
    57     category_id,
    58     image_id,
    59     image_type,
    60     tag_ids,
    61     lightbox
    62   )
    63   VALUES
    64   (
    65     CURDATE(),
    66     CURTIME(),
    67     '.$user['id'].',
    68     \''.$_SERVER['REMOTE_ADDR'].'\',
    69     '.(isset($page['section']) ? "'".$page['section']."'" : 'NULL').',
    70     '.(isset($page['category']['id']) ? $page['category']['id'] : 'NULL').',
    71     '.$image_id.',
    72     "picture",
    73     '.(isset($tags_string) ? "'".$tags_string."'" : 'NULL').',
    74     "true"
    75   )
    76 ;';
    77 
    78 pwg_query($query);*/
Note: See TracChangeset for help on using the changeset viewer.