-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathphotoshelter-iframe.php
43 lines (38 loc) · 1.71 KB
/
photoshelter-iframe.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<script language="javascript">
var PS_WP_ROOT = '<?php echo get_bloginfo('wpurl'); ?>';
</script>
<style type="text/css">
<?php include( WP_PLUGIN_DIR . '/daily-photoshelter/style.css');?>
</style>
<?php
require_once( WP_PLUGIN_DIR . '/daily-photoshelter/photoshelter-psiframe.php');
echo "<script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'></script>";
echo "<script type='text/javascript' src='" . get_bloginfo('wpurl') . "/wp-content/plugins/daily-photoshelter/main.js'></script>";
global $psc;
$iframe = new PSIFrame($psc);
if (!empty($_GET['page_url'])) {
$qA = parse_url($_GET['page_url']);
parse_str($qA['query'], $page);
$_GET = array_merge($_GET, $page);
}
if (($_GET["G_ID"] || $_GET['gallery_id']) && !$_GET['I_ID'] && !$_GET['embedGallery']) {
$iframe->listImages($_GET['G_ID'], $_GET['G_NAME']);
} else if ($_GET["I_ID"]) {
$iframe->embedImg($_GET["I_ID"], $_GET['G_ID'], $_GET['G_NAME']);
} else if ($_POST['I_ID']){
$iframe->insertImg($_POST['I_ID'], $_POST['G_ID'], $_POST['WIDTH'], $_POST['F_HTML'], $_POST['F_BAR'], $_POST['G_NAME'], $_POST['F_CAP']);
} else if ($_GET['G_ID'] && $_GET['embedGallery']){
$iframe->embedGallery($_GET['G_ID'], $_GET['G_NAME']);
} else if ($_GET['embedGallery'] && $_POST['G_ID']) {
$iframe->insertGallery($_POST['G_ID'], $_POST['D_ID'], $_POST['G_NAME']);
} else if ($_GET['embedGalleryStatic']) {
$iframe->insertGalleryImage($_POST['G_ID'], $_POST['G_NAME'], $_POST["WIDTH"]);
} else if ($_POST["I_DSC"] || $_GET['I_DSC'] || $_GET['terms']) {
$term = $_POST["I_DSC"] ? $_POST["I_DSC"] : $_GET["I_DSC"];
$iframe->searchImages($term);
} else if ($_GET['recent']) {
$iframe->recent_images();
} else {
$iframe->listGalleries();
}
?>