| 3 |
lars |
1 |
<?php
|
|
|
2 |
#==============================================================================
|
|
|
3 |
# Änderungen nur in diesem Bereich vornehmen!
|
|
|
4 |
define( 'CUST_ID', 'KUNDENNUMMER' ); # Kundennummer
|
|
|
5 |
define( 'CUST_KEY', 'CRYPT-KEY' ); # Crypt-Key
|
|
|
6 |
#==============================================================================
|
|
|
7 |
|
|
|
8 |
#Version 1.3
|
|
|
9 |
define( 'CLSERVER', 'http://mycliplister.com/cliplister/' );
|
|
|
10 |
define( 'REQ_BASE_EMBD', CLSERVER . "play/" . CUST_ID . "/" );
|
|
|
11 |
define( 'REQ_BASE_PBTN', CLSERVER . "playBtn/" . CUST_ID . "/" );
|
|
|
12 |
define( 'REQ_BASE_CPLAY', CLSERVER . "plist/" . CUST_ID . "/" );
|
|
|
13 |
|
|
|
14 |
define( 'tagPbtn',
|
|
|
15 |
'<iframe onload="cliplister()" id="clipBtn__PRODUKT_" style="Z-INDEX: 999;" scrolling="no" width="34px" height="34px" scrolling="no" frameborder="0" src="_URL_"></iframe>' );
|
|
|
16 |
|
|
|
17 |
define( 'tagHidden',
|
|
|
18 |
'<iframe id="cliplister__PRODUKT_" frameborder="0" vspace="0" hspace="0" marginwidth="0" marginheight="0" ' .
|
|
|
19 |
' style="Z-INDEX: 999; visibility:hidden; width:_WIDTH_px; height:_HEIGHT_px; " scrolling="no" ' .
|
|
|
20 |
'name="_URL_" ></iframe>' );
|
|
|
21 |
|
|
|
22 |
define( 'tagNotHidden',
|
|
|
23 |
'<iframe onload="cliplister()" id="cliplister__PRODUKT_" frameborder="0" vspace="0" hspace="0" marginwidth="0" marginheight="0" ' .
|
|
|
24 |
' scrolling="no" style="Z-INDEX: 999; visibility:visible; width:_WIDTH_px; height:_HEIGHT_px;"' .
|
|
|
25 |
' src="_URL_" ></iframe>' );
|
|
|
26 |
|
|
|
27 |
function encrypt( $request )
|
|
|
28 |
{
|
|
|
29 |
$iv = 'c1191573-clip-07';
|
|
|
30 |
$td = mcrypt_module_open( "rijndael-128", "", "cbc", $iv );
|
|
|
31 |
mcrypt_generic_init( $td, CUST_KEY, $iv );
|
|
|
32 |
$result = bin2hex( mcrypt_generic( $td, $request ) );
|
|
|
33 |
mcrypt_generic_deinit( $td );
|
|
|
34 |
mcrypt_module_close( $td );
|
|
|
35 |
|
|
|
36 |
return "1" . $result;
|
|
|
37 |
}
|
|
|
38 |
|
|
|
39 |
|
|
|
40 |
|
|
|
41 |
function cliplister( $productKey, $prodKeyType = 0, $quality = "320x240",
|
|
|
42 |
$fsk = 16, $lang = "de,##", $refId = "" )
|
|
|
43 |
{
|
|
|
44 |
if ( !isset( $prodKeyType ) )
|
|
|
45 |
$prodKeyType = 0;
|
|
|
46 |
|
|
|
47 |
if ( isset( $refId ) )
|
|
|
48 |
$refId = str_replace( '-', '–', $refId );
|
|
|
49 |
|
|
|
50 |
$seqNum = substr( microtime(), 2, 5 );
|
|
|
51 |
|
|
|
52 |
|
|
|
53 |
|
|
|
54 |
|
|
|
55 |
$reqString = REQ_BASE_PBTN . encrypt( $seqNum . "-" . time() . "-" .
|
|
|
56 |
str_replace( '-', '–', $productKey ) . "-" . $prodKeyType .
|
|
|
57 |
"-" . $quality . "-" . $fsk . "-" . $lang . "-" . $refId );
|
|
|
58 |
|
|
|
59 |
|
|
|
60 |
$html = str_replace( "_URL_", $reqString, tagPbtn );
|
|
|
61 |
$html = str_replace( "_PRODUKT_", $productKey, $html );
|
|
|
62 |
|
|
|
63 |
if ( !serverAvailable( $reqString ) )
|
|
|
64 |
$html = "";
|
|
|
65 |
return $html;
|
|
|
66 |
}
|
|
|
67 |
;
|
|
|
68 |
|
|
|
69 |
|
|
|
70 |
|
|
|
71 |
function cliplisterDivEmbed( $productKey, $prodKeyType = 0, $width = 320,
|
|
|
72 |
$height = 240, $quality = "320x240", $hidden = 0, $indirect = 0, $fsk =
|
|
|
73 |
16, $lang = "de,##", $refId = "", $BannerId = "1" )
|
|
|
74 |
{
|
|
|
75 |
|
|
|
76 |
if ( !isset( $prodKeyType ) )
|
|
|
77 |
$prodKeyType = 0;
|
|
|
78 |
|
|
|
79 |
if ( isset( $refId ) )
|
|
|
80 |
{
|
|
|
81 |
$refId = str_replace( '-', '–', $refId );
|
|
|
82 |
}
|
|
|
83 |
|
|
|
84 |
|
|
|
85 |
$seqNum = substr( microtime(), 2, 5 );
|
|
|
86 |
|
|
|
87 |
|
|
|
88 |
$reqString = REQ_BASE_EMBD . encrypt( $seqNum . "-" . time() . "-" .
|
|
|
89 |
str_replace( '-', '–', $productKey ) . "-" . $prodKeyType .
|
|
|
90 |
"-" . $quality . "-" . $fsk . "-" . $lang . "-" . $refId );
|
|
|
91 |
|
|
|
92 |
|
|
|
93 |
|
|
|
94 |
if ( $indirect != 0 )
|
|
|
95 |
{
|
|
|
96 |
$reqString = $reqString . "/ind";
|
|
|
97 |
}
|
|
|
98 |
|
|
|
99 |
$reqString = $reqString . "?h=" . $height . "&w=" . $width .
|
|
|
100 |
"&BANNERID=" . $BannerId;
|
|
|
101 |
$html = "<script src=" . $reqString .
|
|
|
102 |
" type='text/javascript'></script>";
|
|
|
103 |
if ( !serverAvailable( $reqString ) )
|
|
|
104 |
$html = "";
|
|
|
105 |
return $html;
|
|
|
106 |
}
|
|
|
107 |
;
|
|
|
108 |
|
|
|
109 |
|
|
|
110 |
function cliplisterEmbed( $productKey, $prodKeyType = 0, $width = 320, $height =
|
|
|
111 |
240, $quality = "320x240", $hidden = 0, $indirect = 0, $fsk = 16, $lang =
|
|
|
112 |
"de,##", $refId = "" )
|
|
|
113 |
{
|
|
|
114 |
|
|
|
115 |
if ( !isset( $prodKeyType ) )
|
|
|
116 |
$prodKeyType = 0;
|
|
|
117 |
|
|
|
118 |
if ( $hidden == 0 )
|
|
|
119 |
{
|
|
|
120 |
$html = tagNotHidden;
|
|
|
121 |
}
|
|
|
122 |
else
|
|
|
123 |
{
|
|
|
124 |
$html = tagHidden;
|
|
|
125 |
}
|
|
|
126 |
|
|
|
127 |
if ( isset( $refId ) )
|
|
|
128 |
$refId = str_replace( '-', '–', $refId );
|
|
|
129 |
|
|
|
130 |
|
|
|
131 |
$seqNum = substr( microtime(), 2, 5 );
|
|
|
132 |
$reqString = REQ_BASE_EMBD . encrypt( $seqNum . "-" . time() . "-" .
|
|
|
133 |
str_replace( '-', '–', $productKey ) . "-" . $prodKeyType .
|
|
|
134 |
"-" . $quality . "-" . $fsk . "-" . $lang . "-" . $refId );
|
|
|
135 |
|
|
|
136 |
if ( $indirect != 0 )
|
|
|
137 |
{
|
|
|
138 |
$reqString = $reqString . "/ind";
|
|
|
139 |
}
|
|
|
140 |
$html = str_replace( "_URL_", $reqString, $html );
|
|
|
141 |
$html = str_replace( "_WIDTH_", $width, $html );
|
|
|
142 |
$html = str_replace( "_HEIGHT_", $height, $html );
|
|
|
143 |
$html = str_replace( "_PRODUKT_", $productKey, $html );
|
|
|
144 |
|
|
|
145 |
if ( !serverAvailable( $reqString ) )
|
|
|
146 |
$html = "";
|
|
|
147 |
return $html;
|
|
|
148 |
}
|
|
|
149 |
|
|
|
150 |
|
|
|
151 |
function cliplisterCliplistEmbed( $cliplistId, $prodKeyType = 0, $width =
|
|
|
152 |
320, $height = 240, $quality = "320x240", $hidden = 0, $indirect = 0,
|
|
|
153 |
$fsk = 16, $lang = "de,##", $refId = "" )
|
|
|
154 |
{
|
|
|
155 |
|
|
|
156 |
if ( !isset( $prodKeyType ) )
|
|
|
157 |
$prodKeyType = 0;
|
|
|
158 |
|
|
|
159 |
if ( $hidden == 0 )
|
|
|
160 |
{
|
|
|
161 |
$html = tagNotHidden;
|
|
|
162 |
}
|
|
|
163 |
else
|
|
|
164 |
{
|
|
|
165 |
$html = tagHidden;
|
|
|
166 |
}
|
|
|
167 |
|
|
|
168 |
if ( isset( $refId ) )
|
|
|
169 |
$refId = str_replace( '-', '–', $refId );
|
|
|
170 |
|
|
|
171 |
|
|
|
172 |
$seqNum = substr( microtime(), 2, 5 );
|
|
|
173 |
$prodKeyType = 100 * 2 + ( int )$prodKeyType;
|
|
|
174 |
$reqString = REQ_BASE_EMBD . encrypt( $seqNum . "-" . time() . "-" .
|
|
|
175 |
$cliplistId . "-" . $prodKeyType . "-" . $quality . "-" . $fsk .
|
|
|
176 |
"-" . $lang . "-" . $refId );
|
|
|
177 |
|
|
|
178 |
if ( $indirect != 0 )
|
|
|
179 |
{
|
|
|
180 |
$reqString = $reqString . "/ind";
|
|
|
181 |
}
|
|
|
182 |
;
|
|
|
183 |
|
|
|
184 |
$html = str_replace( "_URL_", $reqString, $html );
|
|
|
185 |
$html = str_replace( "_WIDTH_", $width, $html );
|
|
|
186 |
$html = str_replace( "_HEIGHT_", $height, $html );
|
|
|
187 |
|
|
|
188 |
if ( !serverAvailable( $reqString ) )
|
|
|
189 |
$html = "";
|
|
|
190 |
return $html;
|
|
|
191 |
}
|
|
|
192 |
|
|
|
193 |
|
|
|
194 |
function cliplisterCliplistDivEmbed( $cliplistId, $prodKeyType = 0, $width =
|
|
|
195 |
320, $height = 240, $quality = "320x240", $hidden = 0, $indirect = 0,
|
|
|
196 |
$fsk = 16, $lang = "de,##", $refId = "", $BannerId = "1" )
|
|
|
197 |
{
|
|
|
198 |
|
|
|
199 |
if ( !isset( $prodKeyType ) )
|
|
|
200 |
$prodKeyType = 0;
|
|
|
201 |
|
|
|
202 |
if ( isset( $refId ) )
|
|
|
203 |
{
|
|
|
204 |
$refId = str_replace( '-', '–', $refId );
|
|
|
205 |
}
|
|
|
206 |
|
|
|
207 |
$seqNum = substr( microtime(), 2, 5 );
|
|
|
208 |
$prodKeyType = 100 * 2 + ( int )$prodKeyType;
|
|
|
209 |
$reqString = REQ_BASE_EMBD . encrypt( $seqNum . "-" . time() . "-" .
|
|
|
210 |
$cliplistId . "-" . $prodKeyType . "-" . $quality . "-" . $fsk .
|
|
|
211 |
"-" . $lang . "-" . $refId );
|
|
|
212 |
|
|
|
213 |
if ( $indirect != 0 )
|
|
|
214 |
{
|
|
|
215 |
$reqString = $reqString . "/ind";
|
|
|
216 |
}
|
|
|
217 |
$reqString = $reqString . "?h=" . $height . "&w=" . $width .
|
|
|
218 |
"&BANNERID=" . $BannerId;
|
|
|
219 |
|
|
|
220 |
$html = "<script src=" . $reqString .
|
|
|
221 |
" type='text/javascript'></script>";
|
|
|
222 |
if ( !serverAvailable( $reqString ) )
|
|
|
223 |
$html = "";
|
|
|
224 |
return $html;
|
|
|
225 |
}
|
|
|
226 |
;
|
|
|
227 |
|
|
|
228 |
|
|
|
229 |
|
|
|
230 |
|
|
|
231 |
|
|
|
232 |
function serverAvailable( $url )
|
|
|
233 |
{
|
|
|
234 |
$url = parse_url( CLSERVER );
|
|
|
235 |
$fp = @fsockopen( $url['host'], 80, $errno, $errstr, 10 );
|
|
|
236 |
if ( !$fp )
|
|
|
237 |
{
|
|
|
238 |
return false;
|
|
|
239 |
}
|
|
|
240 |
else
|
|
|
241 |
{
|
|
|
242 |
return true;
|
|
|
243 |
fclose( $fp );
|
|
|
244 |
}
|
|
|
245 |
}
|
|
|
246 |
?>
|
|
|
247 |
<script language="javascript" type="text/javascript">
|
|
|
248 |
// <!--
|
|
|
249 |
function clHandleFrame(iframe)
|
|
|
250 |
{
|
|
|
251 |
if( iframe.id.substr(0,10)=="cliplister" || iframe.id.substr(0,7)=="clipBtn") {
|
|
|
252 |
var test = new Image();
|
|
|
253 |
test.onload = function() {
|
|
|
254 |
if (test.width<2) {
|
|
|
255 |
iframe.style.height="0";
|
|
|
256 |
iframe.style.width="0";
|
|
|
257 |
iframe.style.visibility="hidden";
|
|
|
258 |
}
|
|
|
259 |
}
|
|
|
260 |
var s = iframe.src.replace(/\/ind/g,"");
|
|
|
261 |
test.src = s.replace(/playBtn/g,"play")+"/cx";
|
|
|
262 |
}
|
|
|
263 |
}
|
|
|
264 |
|
|
|
265 |
function cliplister()
|
|
|
266 |
{
|
|
|
267 |
var iframes = document.getElementsByTagName("iframe");
|
|
|
268 |
var i;
|
|
|
269 |
for(i=0;i<iframes.length;i++) {
|
|
|
270 |
clHandleFrame(iframes[i]);
|
|
|
271 |
}
|
|
|
272 |
}
|
|
|
273 |
// -->
|
|
|
274 |
</script>
|