Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $id=$_GET['id'];
- if (!isset($id)){
- $id=0;
- };
- $page=$_GET['page'];
- if (!isset($page)){
- $page=0;
- };
- ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1" />
- <meta name="apple-mobile-web-app-capable" content="yes" />
- <meta name="apple-mobile-web-app-status-bar-style" content="black" />
- <title>
- </title>
- <link rel="stylesheet" href="https://ajax.aspnetcdn.com/ajax/jquery.mobile/1.2.0/jquery.mobile-1.2.0.min.css" />
- <link rel="stylesheet" href="my.css" />
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js">
- </script>
- <script src="https://ajax.aspnetcdn.com/ajax/jquery.mobile/1.2.0/jquery.mobile-1.2.0.min.js">
- </script>
- <script src="my.js">
- </script>
- </head>
- <body>
- <!-- Home -->
- <div data-role="page" id="page1">
- <div data-theme="a" data-role="header">
- <h3 id="name">
- Novine(t)
- </h3>
- <div data-role="collapsible-set">
- <div data-role="collapsible" data-collapsed="true">
- <h3>
- <center>Kategorije</center>
- </h3>
- <div>
- <a href="index.php?id=0" data-transition="fade">
- Naslovnica
- </a>
- </div>
- <div>
- <a href="index.php?id=1" data-transition="fade">
- Vijesti
- </a>
- </div>
- <div>
- <a href="index.php?id=2" data-transition="fade">
- Internet
- </a>
- </div>
- <div>
- <a href="index.php?id=3" data-transition="fade">
- Lifestyle
- </a>
- </div>
- <div>
- <a href="index.php?id=4" data-transition="fade">
- Recenzije
- </a>
- </div>
- </div>
- </div>
- </div>
- <div data-role="content">
- <?php
- $con = mysql_connect("**************","*********","************");
- if (!$con)
- {
- die('Could not connect: ' . mysql_error());
- }
- mysql_select_db("novineti_wordpress", $con) or die('Invalid query: ' . mysql_error());
- mysql_query("SET NAMES 'utf8'");
- mysql_query("SET CHARACTER_SET 'utf8'");
- $limit1= $page * 10;
- $result = mysql_query("SELECT * FROM wp_posts WHERE post_status='publish' ORDER BY `wp_posts`.`post_date` DESC LIMIT ".$limit1.",10") or die('Invalid query: ' . mysql_error());
- while($row = mysql_fetch_array($result))
- {
- $string=$row['post_content'];
- preg_match('<img[a-zA-Z0-9_\^\$\.\|\{\[\}\]\(\)\*\+\?\\~`!@#%&-=;:",/\n\s]*/>', $string, $link);
- if (empty($link[0])) {
- } else {
- $link5 = explode('src="', $link[0]);
- $link6 = explode('" ', $link5[1]);
- echo '<div class="ui-grid-a">
- <div class="ui-block-a">
- <div style="width: 90%; height: 100%; position: relative; background-color: #fbfbfb; border: 1px solid #b8b8b8;">
- <img src="'.$link6[0].'" alt="image" width="100%"/>
- </div>
- </div>
- <div class="ui-block-b">
- '.$row['post_title'].'
- </div>
- </div>';
- echo "<br />";
- }
- }
- mysql_close($con);
- ?>
- <?php echo $_GET['page'] ?>
- </div>
- <center>
- <a href="index.php?id=
- <?php
- echo $id;
- ?>
- &page=
- <?php
- if( $page==0) {
- echo $page;
- $pageminus=$page;
- }else{
- $pageminus=$page-1;
- echo $pageminus;
- } ?>
- ">
- <?php echo $pageminus+1; ?>< </a><?php echo $page+1; ?>
- <a href="index.php?id=<?php echo $id ?>&page=<?php $pageplus=$page+1; echo $pageplus; ?>">><?php echo $pageplus+1; ?></a></center>
- <div data-theme="a" data-role="footer">
- <h3 id="copyright">
- © Novine(t) | 2012-2013<br />
- </h3>
- </div>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement