Файл: public_html/article.php
Строк: 174
<?php
include 'admin/config.php';
echo dbconn();
if (!isset($_GET["id"])) {
header('Location: '.$configsiteurl.'404.php');
}
if (!isset($_GET["name"])) {
header('Location: '.$configsiteurl.'404.php');
}
$id = $_GET["id"];
$name = $_GET["name"];
$articledate = mysql_result(mysql_query("SELECT item_date FROM rssarticles WHERE id = '$id'"), 0);
$articletitle = mysql_result(mysql_query("SELECT item_title FROM rssarticles WHERE id = '$id'"), 0);
$articlecontent = mysql_result(mysql_query("SELECT item_content FROM rssarticles WHERE id = '$id'"), 0);
$articlelink = mysql_result(mysql_query("SELECT item_url FROM rssarticles WHERE id = '$id'"), 0);
$articlecategory = mysql_result(mysql_query("SELECT item_category_id FROM rssarticles WHERE id = '$id'"), 0);
$queryexists = mysql_query("SELECT * FROM rssarticles WHERE id='$id'");
if(mysql_num_rows($queryexists) != 0)
{
}
else
{
header('Location: 404.php');
}
if (isset($_POST["search"])) {
$searchterm = $_POST["search"];
header('Location: '.$configsiteurl.'search/'.$searchterm.'/1');
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title><?php echo str_replace("-"," ",$articletitle);?></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="Digitask.ru">
<link href="/css/bootstrap.min.css" rel="stylesheet">
<link href="/css/bootstrap-responsive.min.css" rel="stylesheet">
<link href="/css/font-awesome.min.css" rel="stylesheet">
<style type="text/css">
html, body { height:100%; }
#push, #footer { height: 60px; }
#wrap { min-height: 100%;height: auto !important;height: 100%;margin: 0 auto -30px; }
</style>
<style type="text/css">
.side-bx {
background: #151515 url(http://ourpropaganda.com/autoblog/img/side-pattern.png);
padding: 20px;
color: #fff;
-moz-box-shadow: 0 5px 15px 0 rgba(0,0,0,.05) inset,
0 -5px 15px 0 rgba(0,0,0,.05) inset;
-webkit-box-shadow: 0 5px 15px 0 rgba(0,0,0,.05) inset,
0 -5px 15px 0 rgba(0,0,0,.05) inset;
box-shadow: 0 5px 15px 0 rgba(0,0,0,.05) inset,
0 -5px 15px 0 rgba(0,0,0,.05) inset;
-moz-border-radius: 8px;
-webkit-border-radius: 8px;
border-radius: 8px;
}
/* row buffer */
.buffer {
padding: 40px 0 20px 0;
}
</style>
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=<?php echo $configfbappid ?>";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
</head>
<body class="preview" id="top">
<div id="wrap">
<!-- Navbar
================================================== -->
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<a class="brand" href="/"><img src="/img/logoo.png" width="32px"></a>
<div class="nav-collapse collapse" id="main-menu">
<ul class="nav" id="main-menu-left">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Категории <b class="caret"></b></a>
<ul class="dropdown-menu">
<?php
$resultcat = mysql_query("SELECT * FROM cats ORDER BY cat");
while($rowcat = mysql_fetch_array( $resultcat )) {
?>
<li><a href="<?php echo $configsiteurl ?>category/<?php echo $rowcat["id"]?>/<?php echo $rowcat["cat"]?>/1"><?php echo $rowcat["cat"]?></a></li>
<?php } ?>
</ul>
</li>
</ul>
<ul class="nav pull-right" id="main-menu-right">
<form class="navbar-form pull-right" method="post">
<a href="<?php echo $configsiteurl ?>rss.php"></a>
<input class="span4" type="text" name="search" placeholder="Поиск по <?php echo $configsitename ?>у">
<button type="submit" class="btn">Поиск</button>
</form>
</ul>
</div>
</div>
</div>
</div>
<div class="container" style="margin-top:80px">
<div class="row buffer" id="main">
<div class="span8">
<div class="main-bx">
<h3><?php echo str_replace("-"," ",$articletitle);?></h3>
<p style="font-size:12px"><abbr class="timeago" title="<?php echo $articledate?>"><?php echo $articledate?></abbr></p>
<p stye="font-size:16px"><?php echo $articlecontent?></p>
<p><A href="<?php echo $articlelink?>">Источник</a></p>
<div class="share42init"></div>
<script type="text/javascript" src="/share42/share42.js"></script>
</div>
<div style="margin-top:50px" class="fb-comments" data-href="<?php echo $configsiteurl ?>article/<?php echo $id ?>/<?php echo $name ?>" data-width="600px" data-num-posts="10"></div>
</div>
<?php
$ad_sql=mysql_query("Select * from ads WHERE type='1'");
$ad_count=mysql_num_rows($ad_sql);
if($ad_count!=0) {
?>
<div class="span4">
<div class="side-bx">
<i class="icon-list"></i>
<strong>Похожие записи</strong>
<ul>
<?php
$resultrelated = mysql_query("SELECT * FROM rssarticles WHERE item_category_id = '$articlecategory ' ORDER BY rand() LIMIT 4");
while($rowrelated = mysql_fetch_array( $resultrelated )) {
?>
<li style="margin-bottom:10px"><a style="color:white" href="<?php echo $configsiteurl ?>article/<?php echo $rowrelated["id"]?>/<?php echo $rowrelated["item_title"]?>"><?php echo $rowrelated["item_title"]?></a></li>
<?php } ?>
</ul>
<?php
$resulad = mysql_query("SELECT * FROM ads WHERE placement='1' ORDER BY rand() LIMIT 1");
while($rowads = mysql_fetch_array( $resulad )) {
$adid = $rowads["id"];
$adtype = mysql_result(mysql_query("SELECT type FROM ads WHERE id = '$adid'"), 0);
if ($adtype == '1') {
echo '<h5 style="text-align:center">' . $rowads["title"] . '</h5>';
echo $rowads["code"];
} else {
;
echo '<a style="color:black" href="' . $rowads["link"] . '" target="_blank"><h5 style="text-align:center">' . $rowads["title"] . '</h5></a>';
echo '<a href="' . $rowads["link"] . '" target="_blank">';
echo '<img style="text-align:center" src="'.$configsiteurl.'admin/uploads/'.$rowads["image"].'">';
echo '</a>';
}
?>
<?php echo $adcode ?>
</div>
</div>
<?php
}} else {
?>
<div class="span4">
<div class="side-bx">
<i class="icon-list"></i>
<strong>Related Articles</strong>
<ul>
<?php
$resultrelated = mysql_query("SELECT * FROM rssarticles WHERE item_category_id = '$articlecategory ' ORDER BY rand() LIMIT 10");
while($rowrelated = mysql_fetch_array( $resultrelated )) {
?>
<li style="margin-bottom:10px"><a style="color:white" href="<?php echo $configsiteurl ?>article/<?php echo $rowrelated["id"]?>/<?php echo $rowrelated["item_title"]?>"><?php echo $rowrelated["item_title"]?></a></li>
<?php } ?>
</ul>
</div>
</div>
<?php
}
?>
</div>
</div><!-- /container -->
<?
include ('foot.php');
?>