source: extensions/FacebookPlug/Server/trunk/upload_photo.php @ 22040

Last change on this file since 22040 was 8517, checked in by rub, 13 years ago

Add admin page

  • Property svn:eol-style set to LF
File size: 3.7 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(FACEBOOKPLUG_ROOT_PATH.'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  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
30  <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.4.min.js"></script>
31</head>
32<body>
33  <center>
34    <div id="loading"><img src="./image/image_85486.gif" alt="Loading"></div>
35    <div id="infos">
36      <img src="./image/infos.png" alt="Infos">
37      <a id ="info_a" href="" onclick="window.open(this.href); return false;">
38        <img src="<?php echo addslashes($_GET['u']) ?>" alt="Image" style="height:50px">
39      </a>
40    </div>
41    <div id="errors">
42        <img src="./image/errors.png" alt="Error">
43        <textearea id="error_result"></textearea>
44    </div>
45  </center>
46 
47  <script type="text/javascript">
48    $(document).ready(function () {
49      $("#errors").hide();
50      $("#infos").hide();
51      $.get(
52      './do_upload_photo.php',
53      {u:"<?php echo addslashes($_GET['u']) ?>", pu: "<?php echo addslashes($_GET['pu']) ?>", pt: "<?php echo addslashes($_GET['pt']) ?>", gt: "<?php echo addslashes($_GET['gt']) ?>"},
54      function(data) {
55        $("#loading").hide();
56        is_ok = ! isNaN(data);
57        if (is_ok)
58        {
59          div_id = "#infos";
60          fb_photo_page = 'http://www.facebook.com/photo.php?fbid='+data;
61          $('#info_a').attr('href', fb_photo_page);
62        }
63        else
64        {
65          div_id = "#errors";
66          $('#error_result').html(data);
67        }
68        $(div_id).show();
69        $(div_id).fadeOut(3000, function ()
70          {
71            if (is_ok) { window.open(fb_photo_page); }
72            window.close();
73          });
74      });
75  });
76  </script>
77<!-- google-analytics -->
78<script type="text/javascript">
79  var _gaq = _gaq || [];
80  _gaq.push(['_setAccount', 'UA-2272624-7']);
81  _gaq.push(['_trackPageview']);
82
83  (function() {
84    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
85    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
86    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
87  })();
88
89</script>
90<!-- google-analytics -->
91</body>
92</html>
Note: See TracBrowser for help on using the repository browser.