-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathindex.php
More file actions
112 lines (107 loc) · 4.84 KB
/
index.php
File metadata and controls
112 lines (107 loc) · 4.84 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
<?php
session_start();
include_once(__DIR__."/config.php");
include_once(__DIR__."/login/config.php");
if(isset($_GET['salir'])) {
session_destroy();
header("Location: ".$sitio);
exit();
}
$mobile=false;
if(preg_match("/(Blackberry|SymbianOS|iPod|iPhone|Android|Opera Mini|Windows Phone)/i",$_SERVER['HTTP_USER_AGENT'])) {
if(!preg_match("/(iPad)/i",$_SERVER['HTTP_USER_AGENT'])){ $mobile=true; }
}
include_once("utils.php");
$utils = new Utils();
//include_once("galleta.php");
?>
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="foros">
<meta name="author" content="Jorge Martínez M @toro">
<title>Foros tar.mx</title>
<link rel="stylesheet" href="estilo.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css" integrity="sha384-PsH8R72JQ3SOdhVi3uxftmaW6Vc51MKb0q5P2rRUpPvrszuE4W1povHYgTpBfshb" crossorigin="anonymous">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
</head>
<body>
<div class="container">
<div class="masthead">
<h3><a href="<?php echo $sitio;?>" class="text-muted">Foros</a></h3>
<nav class="navbar navbar-expand-lg navbar-light bg-light rounded mb-3">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarCollapse" aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarCollapse">
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" href="<?php echo $sitio;?>">Inicio <span class="sr-only">(current)</span></a></li>
<li class="nav-item"><a class="nav-link" href="/">tar.mx</a></li>
</ul>
<?php
//imagen usuario
if(!isset($_SESSION[ME])) {
printf('<span class="navbar-text float-right"><a href="login/" onclick="return windowLogin();">entrar</a></span>',$sitio);
} else {
@printf('<span class="navbar-text float-right"><a href="%s?perfil=me"><img src="%s" height="30" alt="me" /></a></span>',$sitio,$utils->pic([$_SESSION['data']->social, $_SESSION['data']->perfil, $_SESSION['data']->avatar,$_SESSION['data']->alta,$_SESSION['data']->socialid],14));
}
?>
</div>
</nav>
</div>
<?php
if(isset($_GET['nuevo'])) {
include_once("editor.php");
} elseif(isset($_GET['view'])) {
include_once("view.php");
} elseif(isset($_GET['foro'])) {
include_once("foros.php");
} elseif(isset($_GET['perfil'])) {
include_once("perfil.php");
} elseif(isset($_GET['privacidad'])) {
include_once("privacidad.php");
} else {
include_once("portada.php");
}
?>
<!-- Site footer -->
<hr />
<footer class="footer">
<p class="text-center">
<?php
echo date('Y');
?>
<a href="<?php echo $sitio;?>?privacidad=me">privacidad</a> /
<?php
include_once("ping.php");
if(isset($_SESSION[ME])) {
printf(' / <a href="%s?salir=1">salir</a>',$sitio);
} else {
printf(' / <a href="login/" onclick="return windowLogin();">entrar</a>',$sitio);
}
?>
/ <a href="https://github.com/cuatl/foros">código fuente</a>
</p>
</footer>
</div> <!-- /container -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.3/umd/popper.min.js" integrity="sha384-vFJXuSJphROIrBnz7yo7oB41mKfc8JzQZiCq4NCceLEaO4IHwicKwpJf9c9IpFgh" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/js/bootstrap.min.js" integrity="sha384-alpBpkh1PFOepccYVYDB4do5UnbKysX5WZXm3XxPqe5iKTfUKjNkCk9SaVuEZflJ" crossorigin="anonymous"></script>
<script>
//ventana de login
var windowLogin = function() {
var ancho = 600; var alto = 500;
var left = (window.screen.width / 2) - (ancho/2);
window.open('login/','login','width='+ancho+',screenX='+left+',height=500,screenY=100,toolbar=no,menubar=no,scrollbars=no,location=no,directories=no,history=no');
return false;
}
</script>
</body>
</html>
<pre>
<?php
//print_r($_SESSION);
?>
</pre>