Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- ////////////////////////////////////
- /////CMS PECHENKO /////
- /////index.php /////
- ///////////////////////////////////
- require_once "force.php";
- include "mysql.php";
- $head = mysql_query(SELECT head FROM `pechenko`);
- $per_page=10;
- if (isset($_GET['page'])) $page=($_GET['page']-1); else $page=0;
- $start=abs($news*$per_page);
- $q="SELECT * FROM `pechenko_news` ORDER BY id LIMIT $start,$per_page";
- $res=mysql_query($q);
- while($row=mysql_fetch_array($res)) {
- echo ++$start.". ".$row['field']."<br>\n";
- }
- $q="SELECT count(*) FROM `pechenko_news`";
- $res=mysql_query($q);
- $row=mysql_fetch_row($res);
- $total_rows=$row[0];
- $num_pages=ceil($total_rows/$per_page);
- for($i=1;$i<=$num_pages;$i++) {
- if ($i-1 == $page) {
- echo $i." ";
- } else {
- echo '<a href="'.$_SERVER['PHP_SELF'].'?page='.$i.'">'.$i."</a> ";
- }
- }
- $res=mysql_query($q);
- while($row=mysql_fetch_array($res)) {
- echo ++$start.". ".$row['field']."<br>\n";
- }
- if($_SERVER['REMOTE_ADDR'] == $ip) echo "Привет админчег! Зайди в <a href='admin.php'>админку</a>";
- $main = file_get_contents("skin/index.tpl");
- $feedback = file_get_contents("skin/feedback.php");
- $main = $result;
- $result = strtr($result, array(
- "{head}" => $head,
- ));
- if($_GET['mod']==feedback)
- $feedback = $result;
- $result = strtr($result, array(
- "{head}" => $head,
- ;
- echo $result;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement