-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpresenter.php
More file actions
123 lines (105 loc) · 3.69 KB
/
presenter.php
File metadata and controls
123 lines (105 loc) · 3.69 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<?php
error_reporting(E_ALL);
define('WP_USE_THEMES', false);
require_once( "../../../wp-load.php");
require_once( 'SimpleView.class.php' );
wp();
global $wpdb;
$SV = new SimpleView();
$id = ( isset($_GET['id']) ) ? (int) $_GET['id'] : 0;
$image = ( isset($_GET['i']) ) ? (int) $_GET['i'] : 0;
$sql = sprintf( "SELECT * FROM %s WHERE slideshow_id='%d' AND deleted='0' LIMIT %d,1", $wpdb->prefix.'ai_simpleview_images', $id, $image);
$result = $wpdb->get_row( $sql );
$updir = get_option('fileupload_url').'/ai-simpleview/'.$id.'/';
$img_src = $updir . $result->file_name;
if ( $image > 0 ) {
$img_nav_left = "<a href='presenter.php?id=".$id."&i=".($image-1)."' onclick='ReloadAds();'><img src='images/prev.png' alt='.' style='border: 0' /></a>";
} else {
$img_nav_left = " ";
}
if ( $image < $SV->count_images( $id )-1 ) {
$img_nav_right = "<a href='presenter.php?id=".$id."&i=".($image+1)."' onclick='ReloadAds();'><img src='images/next.png' alt='.' style='border: 0' /></a>";
} else {
$img_nav_right = " ";
}
?>
<html>
<head>
<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js'></script>
<link rel="stylesheet" type="text/css" href="presenter.css" />
<script language="JavaScript1.3">
function ReloadAds () {
var foo = window.parent.document.getElementById('iframe-ads');
foo.contentWindow.location.reload(true);
var bar = window.parent.document.getElementById('header-ads');
bar.contentWindow.location.reload(true);
// var tile14 = window.parent.document.getElementById('ads-tile14');
// var tile15 = window.parent.document.getElementById('ads-tile15');
// tile14.contentWindow.location.reload(true);
// tile15.contentWindow.location.reload(true);
}
$.getDocHeight = function() {
return Math.max(
$(document).height(),
$(window).height(),
document.documentElement.clientHeight
);
};
$('document').ready(function() {
var slide = window.parent.document.getElementById('slideframe');
var pic = 0;
function AssignFrameHeight() {
if ( $.browser.msie ) {
pic = this.document.body.scrollHeight-10;
} else {
pic = this.document.body.offsetHeight;
}
slide.style.height = pic + 'px';
}
if ( $.browser.safari || $.browser.opera ) {
$('#slideframe', window.parent.document).load(function() {
setTimeout( AssignFrameHeight, 0 );
});
var iSource = this.document.src;
this.document.src = '';
this.document.src = iSource;
} else {
$('#slideframe', window.parent.document).load(function() {
AssignFrameHeight();
});
}
});
//var D = window.parent.document.getElementById('slideframe');
//D.style.height = 250 +'px';
</script>
</head>
<body style="margin: 0; padding: 0;">
<div id="container">
<div id="header">
<table id="tblhead" border="0">
<tr>
<td id="navleft"><?php echo $img_nav_left; ?></td>
<td id="navcenter"><?php echo $SV->get_slide_name($id); ?> ( <span style="text-transform: none">Bild</span> <?php echo $image+1; ?>/<?php echo $SV->count_images( $id );?> )</td>
<td id="navright"><?php echo $img_nav_right; ?></td>
</table>
</div>
<div id='simpleview'>
<div id="slideimg">
<?php
if ( $image < $SV->count_images($id)-1 ) {
echo "<a href='presenter.php?id=".$id."&i=".($image+1)."' onclick='ReloadAds();'>";
}
?><img src="<?php echo $img_src; ?>" onload="try{window.parent.setSize(window.self, this.height+60, <?php echo $id; ?>);} catch (err){if(window.console){console.log(err);}}" style='z-index: 9999; width: 430px; border: 0' border='0' /><?php
if ( $image < $SV->count_images($id)-1 ) {
echo "</a>";
}
?></div>
</div>
<?php
if ( strlen($result->description) ) {
echo "<div id='slidedesc'>".$result->description."</div>\n";
}
?>
</div>
</body>
</html>