source: extensions/FacebookPlug/Server/upload_photo.php @ 8483

Last change on this file since 8483 was 8483, checked in by rub, 14 years ago

Server upload

  • Property svn:eol-style set to LF
File size: 3.6 KB
Line 
1<?php
2// +-----------------------------------------------------------------------+
3// | FacebookPlug - a Piwigo Plugin                                        |
4// | Copyright (C) 2010-2011 Ruben ARNAUD - rub@piwigo.org                 |
5// +-----------------------------------------------------------------------+
6// | This program is free software; you can redistribute it and/or modify  |
7// | it under the terms of the GNU General Public License as published by  |
8// | the Free Software Foundation                                          |
9// |                                                                       |
10// | This program is distributed in the hope that it will be useful, but   |
11// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
12// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
13// | General Public License for more details.                              |
14// |                                                                       |
15// | You should have received a copy of the GNU General Public License     |
16// | along with this program; if not, write to the Free Software           |
17// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
18// | USA.                                                                  |
19// +-----------------------------------------------------------------------+
20
21define('FACEBOOKPLUG_ROOT_PATH','./');
22
23require_once 'include/common.php';
24
25?>
26<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
27<html>
28<head>
29  <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.4.min.js"></script>
30</head>
31<body>
32  <center>
33    <div id="loading"><img src="./image/image_85486.gif" alt="Loading"></div>
34    <div id="infos">
35      <img src="./image/infos.png" alt="Infos">
36      <a id ="info_a" href="" onclick="window.open(this.href); return false;">
37        <img src="<?php echo addslashes($_GET['u']) ?>" alt="Image" style="height:50px">
38      </a>
39    </div>
40    <div id="errors">
41        <img src="./image/errors.png" alt="Error">
42        <textearea id="error_result"></textearea>
43    </div>
44  </center>
45 
46  <script type="text/javascript">
47    $(document).ready(function () {
48      $("#errors").hide();
49      $("#infos").hide();
50      $.get(
51      './do_upload_photo.php',
52      {u:"<?php echo addslashes($_GET['u']) ?>", pu: "<?php echo addslashes($_GET['pu']) ?>", pt: "<?php echo addslashes($_GET['pt']) ?>", gt: "<?php echo addslashes($_GET['gt']) ?>"},
53      function(data) {
54        $("#loading").hide();
55        is_ok = ! isNaN(data);
56        if (is_ok)
57        {
58          div_id = "#infos";
59          fb_photo_page = 'http://www.facebook.com/photo.php?fbid='+data;
60          $('#info_a').attr('href', fb_photo_page);
61        }
62        else
63        {
64          div_id = "#errors";
65          $('#error_result').html(data);
66        }
67        $(div_id).show();
68        $(div_id).fadeOut(3000, function ()
69          {
70            if (is_ok) { window.open(fb_photo_page); }
71            window.close();
72          });
73      });
74  });
75  </script>
76<!-- google-analytics -->
77<script type="text/javascript">
78  var _gaq = _gaq || [];
79  _gaq.push(['_setAccount', 'UA-2272624-7']);
80  _gaq.push(['_trackPageview']);
81
82  (function() {
83    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
84    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
85    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
86  })();
87
88</script>
89<!-- google-analytics -->
90</body>
91</html>
Note: See TracBrowser for help on using the repository browser.