-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
132 lines (119 loc) · 4.91 KB
/
index.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
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
124
125
126
127
128
129
130
131
132
<!DOCTYPE html>
<?php
$a = $_GET['a'];
$b = $_GET['b'];
$o = $_GET['o'];
$w = $_GET['w'];
$url = "http://splitr.it/?a=".$a."&b=".$b."&o=".$o."&w=".$w;
?>
<html dir="ltr" lang="fr-FR">
<head>
<meta charset="UTF-8" />
<meta name='robots' content='index,follow' />
<meta property="og:type" content="website">
<meta property="og:title" content="J'utilise splitR.it">
<meta property="og:site_name" content="splitR.it">
<meta property="og:description" content="Combinez et partagez simplement deux adresses web en une en les affichant côte à côte dans la même fenêtre de votre navigateur.">
<meta property="og:url" content="<? echo $url;?>">
<meta property="og:image" content="http://splitr.it/images/fb.jpg">
<link href="css/reset.css" type="text/css" rel="stylesheet" />
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<link href="css/styles.css" type="text/css" rel="stylesheet" />
<link rel="stylesheet" href="css/iconic-glyphs.min.css">
<!--[if lt IE 9]>
<link rel="stylesheet" href="css/iconic-glyphs-legacy.css">
<![endif]-->
<script type="text/javascript" src="js/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="js/splitter.js"></script>
<title>splitR.it</title>
<script type="text/javascript">
$().ready(function(){
<? if ($o=='v'){?>
$("#wrap").splitter();
<?}else{?>
$("#wrap").splitter({type: "h"});
<?}?>
});
</script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-39603618-10', 'splitr.it');
ga('send', 'pageview');
</script>
</head>
<body>
<?if((!isset($a))||(!isset($b))){?>
<div id="form">
<h1 id="logo">splitR.it</h1>
<p>Combinez et partagez simplement deux adresses web en une en les affichant côte à côte dans la même fenêtre de votre navigateur.
<form method="get" role="form">
<div class="form-group">
<label for="urla">Première page</label>
<input class="form-control" required type="text" name="a" id="urla">
</div>
<div class="form-group">
<label for="urlb">Deuxième page</label>
<input class="form-control" required type="text" name="b" id="urlb">
</div>
<div class="form-group">
<label for="orientation">Orientation</label>
<select class="form-control input-sm" name="o" id="orientation">
<option value="v">Vertical</option>
<option value="h">Horizontal</option>
</select>
</div>
<button type="submit" class="btn btn-primary btn-lg btn-block">Créer</button>
</form>
</div>
<?}else{?>
<div id="wrap">
<div id="a">
<iframe src="<?php echo $a ?>" id="a-frame"></iframe>
</div>
<div id="b">
<iframe src="<?php echo $b ?>" id="b-frame"></iframe>
</div>
</div>
<div class="share">
<ul>
<li>
<button class="facebook" onclick="window.open('http://www.facebook.com/sharer.php?u=<?php echo rawurlencode($url) ;?>', 'Partager sur Facebook', 'width=600, height=350'); return false;">Facebook</button>
</li>
<li>
<button onclick="window.open('http://twitter.com/share?text=J%27utilise%20splitR%20pour%20afficher%20deux%20pages%20c%C3%B4te%20%C3%A0%20c%C3%B4te%20%21&url=<?php echo rawurlencode($url) ;?>', 'Partager sur Twitter', 'width=600, height=350'); return false;" class="twitter">Twitter</a>
</li>
<li class="permalink">
<?php function get_isgd_url($url)
{
$ch = curl_init();
$timeout = 5;
curl_setopt($ch,CURLOPT_URL,'http://is.gd/api.php?longurl='.$url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);
$content = curl_exec($ch);
curl_close($ch);
return $content;
}
$new_url = get_isgd_url(rawurlencode($url));?>
<button >
<span class="iconic" data-glyph="iconic-link-intact" title="iconic-link-intact" aria-hidden="true"></span>
</button>
<input class="form-control" value="<? echo $new_url;?>" />
</li>
<li>
<?php
if ($o=='v'){ $o_to = 'h';}else{$o_to = 'v';};
$url_rotate = "http://splitr.it/?a=".$a."&b=".$b."&o=".$o_to."&w=".$w;
?>
<a class="orientation" href="<?php echo $url_rotate;?>">
<span class="iconic" data-glyph="iconic-action-redo" title="iconic-action-redo" aria-hidden="true"></span>
</a>
</li>
</ul>
</div>
<?}?>
</body>
</html>