Created
December 31, 2013 19:13
-
-
Save anonymous/8201006 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once ( "inc/mysql.classe.php" ); | |
require_once ( "inc/paginator.class.php" ); | |
// Conexão | |
$MySQL = new MysqlConnect(); | |
$MySQL->connect(); | |
function noticiaspag() { | |
$connection = new PDO("mysql:dbname=".MYSQL_DATABASE.";host=" . MYSQL_IP, MYSQL_USUARIO, MYSQL_SENHA); | |
$sql = $connection->query("SELECT * FROM noticias ORDER BY id DESC"); | |
return $sql->fetchAll(PDO::FETCH_ASSOC); | |
} | |
$paginator = new Paginator(noticiaspag(), 2); | |
$paginator->link = "index.php?send=noticias"; | |
$i = 1; | |
foreach ($paginator->data() as $show) { | |
if($_GET['page'] <= 1) : | |
$calculo_rank = $i; | |
else : | |
$calculo_rank = ($i + ($_GET['page'] * 2)) - 2; | |
endif; | |
?> | |
<div class="row" style="padding-top:140px;"> | |
<div class="large-4 small-12 columns news"> | |
<a href="#"> | |
<img src="<?php echo $show['imagem']; ?>" class="th"> | |
</a><div class="large-12 medium-12 panel news"><a href="#"> | |
<?php echo $show['titulo']; ?><br><br> | |
<b>Fonte: </b></a><a href="<?php echo $show['fontelink']; ?>" class="button tiny radius bt1"><?php echo $show['fonte']; ?></a> | |
</div> | |
</div> | |
</div> | |
<?php $i++;}?> | |
<table width="100%" border="0" cellspacing="3" cellpadding="0"> | |
<tr> | |
<td width="1%"> </td> | |
<td width="99%"><ul class="ul"> | |
<?php echo $paginator->numbers(); ?> | |
</ul></td> | |
</tr> | |
</table> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment