-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnoticias.php
101 lines (81 loc) · 3.07 KB
/
noticias.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
<?php require_once ('conexion.php');
$menu = 'noticias';
if (!isset($_SESSION['paginacion'])) {
$_SESSION['paginacion'] = 0;
} else if (isset($_SESSION['paginacion']) && $_SESSION['paginacion'] != 0) {
$porpagina += $_SESSION['paginacion'];
}
$accion_post = sprintf("SELECT * FROM post ORDER BY id DESC LIMIT $porpagina ");
$consulta_post = mysqli_query($conexion, $accion_post);
$datos_post = mysqli_fetch_assoc($consulta_post);
$cantidad_post = mysqli_num_rows($consulta_post);
require_once('inc/head.php');
?>
<body>
<?php include 'inc/header.php';?>
<div class="ed-container">
<div class="main-conent ed-container">
<div class="ed-item m-75 l-75">
<div id="listar">
<br><br>
<div class="first-post">
<div class="ed-container">
<div class="ed-item l-25 m-25">
<img src="static/img/HELMI1.png">
</div>
<div class="ed-item m-75 l-75">
<h2><a class="title-pub"> ¡Bienvenidos a Icanux! </a> </h2>
<p class="content-pub">
Este primer post marca el inicio de nuestro nuevo sitio web, y el punto de partida para las posteriores secciones de noticias que estaremos compartiendo e informando a toda la comunidad de Linux, y del software libre.
</p>
<p>¡Nos estamos leyendo! <br><br>
- La familia ICANUX</p>
<img src="static/img/icanux.jpg" style="border-radius: 10px;">
<br><br>
</div>
</div>
</div>
<?php
if ($cantidad_post != 0) {
do {
$imagenes = $datos_post['image'];
$partes = explode('####', $imagenes);
?>
<div class="ed-container">
<div class="ed-item l-25 m-25">
<?php if ($imagenes != '') {?>
<img src="static/img/upload/<?php echo $partes[0];?>">
<?php } else {?>
<img src="static/img/HELMI1.png">
<?php }?>
</div>
<div class="ed-item m-75 l-75">
<h2><a class="title-pub" href=" <?php echo $dato[0];?>post/<?php echo $datos_post['seo'];?> "><?php echo $datos_post['title'];
?></a> </h2>
<p class="content-pub">
<?php echo substr(strip_tags($datos_post['content']), 0, 1000);?></p><br><br>
<div class="etiqueta etiqueta-pequenia fecha">
<p>
<time datetime="<?php echo $datos_post['fecha'];?>">
Publicado el dia <strong><?php echo date('d/m/Y H:i', strtotime($datos_post['fecha']));?></strong>
</time>
</p></div>
</div>
</div>
<div class="texto-centrado main-center" id="cargar">
<a onclick="paginar();" class="button button-enviar" id="ocultar">cargar mas</a>
</div>
<?php } while ($datos_post = mysqli_fetch_assoc($consulta_post));
}?>
</div>
<br>
</div>
<aside class="ed-item m-25 l-25">
<?php include ('inc/sidebar.php');?>
</aside>
</div>
</div>
<?php include 'inc/footer.php';?>
</body>
</html>
<?php mysqli_free_result($consulta_post);