-
Notifications
You must be signed in to change notification settings - Fork 0
/
noticia.php
69 lines (65 loc) · 1.95 KB
/
noticia.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
<!DOCTYPE html>
<html lang="pt">
<head>
<?php
ob_start();
include 'includes/head.php';
?>
</head>
<body>
<!-- cover container -->
<?php include 'includes/header.php' ?>
<!-- menu -->
<?php include 'includes/menu.php' ?>
<section id="main" class="vereador section">
<?php
require_once('phpQuery/phpQuery-onefile.php');
//load each vereador page
$actual_link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
$link = explode('=',$actual_link);
$url = $link[count($link) - 1];
$urlNoticia = 'http://www.camarapf.rs.gov.br/noticia/' .$url;
$html = file_get_contents($urlNoticia);
phpQuery::newDocumentHTML($html);
?>
<div class="noticia content clearfix">
<?php
//gets news name and throw to the page title
$titleNews = pq('h1:last')->text();
$subtitleNews = pq('h3:first')->text();
$buffer=ob_get_contents();
ob_end_clean();
$buffer=str_replace("%TITLE%","Notícias - " .$titleNews .' - ' .$subtitleNews,$buffer);
echo $buffer;
//put class in title
pq('h1')->addClass('noticia__titulo');
//put class in subtitle
pq('h3')->addClass('noticia__subtitulo');
//gtes the date
$date = pq('.post-meta span')->text();
//image switch atributes
pq('.align-left')->attr('class','noticia__img');
//remove animateScroll
pq('.animate-onscroll.justify')->remove();
//remove data
pq('.post-meta')->remove();
//content
$da = pq('.col-lg-12.col-md-12.col-sm-12:first');
//put fancybox date
pq('a.jackbox ')->attr('data-fancybox','gallery');
?>
<span class="noticia__data"><?php echo $date ?></span>
<?php echo $da ?>
</div>
</section>
<?php include 'includes/footer.php' ?>
<!--Javascript-->
<script src="assets/fancybox/jquery.fancybox.min.js"></script>
<script src="assets/js/main.js"></script>
<script>
$(document).ready(function() {
$("[data-fancybox]").fancybox();
});
</script>
</body>
</html>