Follow along with the video below to see how to install our site as a web app on your home screen.
Бележка: This feature may not be available in some browsers.
<html>
<head>
<title>Добавяне на новини</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="file/font.css" type="text/css">
</head>
<body>
<body>
</body>
</html>
<?php include('conf.php'); ?>
<?php include('bb.php'); ?>
<?php
if(isset($_POST['izprati'])){
$ime = $_POST['ime'];
$ime = htmlspecialchars($ime);
$ime = strip_tags($ime);
$novina = $_POST['novina'];
$snimka = $_POST['snimka'];
$snimka = htmlspecialchars($snimka);
$snimka = strip_tags($snimka);
$iztochnik = $_POST['iztochnik'];
$iztochnik = htmlspecialchars($iztochnik);
$iztochnik = strip_tags($iztochnik);
$author = $_POST['author'];
$author = htmlspecialchars($author);
$author = strip_tags($author);
$type = $_POST['type'];
$type = htmlspecialchars($type);
$type = strip_tags($type);
$files = $_FILES['avatar']['tmp_name'];
$names = $_FILES['avatar']['name'];
$link = $names;
$shirenie = end(explode('.',$names));
$maxwidth = "15000"; // максимална ширина
$maxheight = "15000"; // максималната височина
if($ime== NULL){
echo "Попълнете име";
exit;
}
elseif($novina==NULL){
echo "Попълнете новина";
exit;
}
elseif($author==NULL){
echo "Попълнете автор";
exit;
}
elseif($type==NULL){
echo "Попълнете категория";
exit;
}
else {
$img = $_FILES['file']['name'];
$path = move_uploaded_file($_FILES["file"]["tmp_name"],
"upload/" . $_FILES["file"]["name"]);
$zapis = mysql_query("INSERT INTO news(ime, nowina, snimka, iztochnik, awtor, type) VALUES('$ime','$novina','$img','$iztochnik','$author','$type')") or die(mysql_error());
echo "Новината е добавена!";
}
}
?>
<table border="0">
<center>
<form action="" enctype="multipart/form-data" method="POST">
Име на новина*:<br><input type="text" class="textbox" name="ime" size="80">
<br><br>
Снимка:<br> <input type='file' name='file' id='file' />
<br><br>
bb<br> colspan="2"><pre> [i] [u] [quote] [quote="someone"] [url] [url=someurl] [img] [color=fontcolor] [size=fontsize] [code ] </pre><br>
Новина*:<br><textarea name="novina" class="ckeditor" name="editor1" class="textbox" cols="95" rows="20"></textarea>
<br><br>
Източник:<br><input type="text" class="textbox" name="iztochnik">
<br><br>
Автор*:<br><select name="author">
<option value="">Избери автор</option>
<option value="Админ">Админ</option>
<option value="it ">it</option>
<option value="CS CZ">CS CZ</option>
<option value="CS Source">CS Source</option>
</select>
<br />
Категория*:<br><select name="type">
<option value="">Избери категория</option>
<option value="1">sport</option>
<option value="it ">it</option>
<option value="CS CZ">CS CZ</option>
<option value="CS Source">CS Source</option>
</select>
<br />
<input type="submit" name="izprati" value="Изпрати!">
<form>
<?php
function bbcode($text){
$text=preg_replace("/\[b\](.+?)\[\/b\]/s", '<b>$1</b>',$text);
$text=preg_replace("/\[i\](.+?)\[\/i\]/s", '<i>$1</i>',$text);
$text=preg_replace("/\[u\](.+?)\[\/u\]/s", '<u>$1</u>',$text);
$text=preg_replace("/\[quote\](.+?)\[\/quote\]/s", '<table cellspacing="1" width="100%" border="0"><tr><td>Quote:</td></tr><tr><td width="100%" style="border:solid 1px black">$1</td></tr></table>',$text);
$text=preg_replace("/\[quote\=(.+?)](.+?)\[\/quote\]/s", '<table cellspacing="1" width="100%" border="0"><tr><td>$1 ????:</td></tr><tr><td width="100%" style="border:solid 1px black">$2</td></tr></table>',$text);
$text=preg_replace("/\[url\](.+?)\[\/url\]/s", '<a href="$1">$1</a>',$text);
$text=preg_replace("/\[url\=(.+?)\](.+?)\[\/url\]/s", '<a href="$1">$2</a>',$text);
$text=preg_replace("/\[img\](.+?)\[\/img\]/s", '<img src="$1" alt="User submitted image" title="User submitted image"/>',$text);
$text=preg_replace("/\[color\=(.+?)\](.+?)\[\/color\]/s", '<span style="color:$1">$2</span>',$text);
$text=preg_replace("/\[size\=(.+?)\](.+?)\[\/size\]/s", '<span style="font-size:$1">$2</span>',$text);
$text=preg_replace("/\[code\](.+?)\[\/code\]/s",'<table cellspacing="1" width="100%" border="0"><tr><td>Code:</td></tr><tr><td width="100%" style="border:solid 1px black">$1</td></tr></table>',$text);
$text = nl2br($text);
return $text;
}
?>
<?php
$hostname = "mysql7.000webhost.com";
$dbuser = "a6080885_admin";
$dbpass = "asus123";
$dbname = "a6080885_new";
$connect = mysql_connect($hostname, $dbuser, $dbpass)or die(mysql_error());
mysql_select_db($dbname,$connect);
mysql_query("SET NAMES cp1251");
mysql_query("SET CHARACTERS cp1251");
?>
<html>
<head>
<link rel="stylesheet" href="file/brada.css" type="text/css">
</head>
</body>
</style>
<style type="text/css">
.SiteTree1
{
border:1px #000000 none;
background-image:url(http://vivaaa.netau.net/site1/news/file/kolon.jpg);
color:#000000;
font-family:Tahoma;
font-size:13px;
}
</style></head>
<body>
<div id="sitemap" class="SiteTree1" style="position:absolute;overflow:auto;left:84px;top:3px;width:205px;height:541px;z-index:0">
<dl>
<dd><a href="index.html" title="">index</a></dd>
</dl>
</div>
<?php
include ('conf.php'); //???????? config ?????
$our = mysql_query("SELECT * FROM news ORDER BY id DESC LIMIT 10"); //???????? ??? ???? ?? ?????? ?? ??
while($r=mysql_fetch_array($our)){
if (strlen($r['nowina'])>$broi)
{$totchki='...';}
else
{$totchki='';}
$kratko = substr($r['nowina'],0,$broi); //?????? ???????? ?? ?? ? ?????? ?? ??????? ???? ???????
}
/* ?????????? ?? ????? ????????? ?? ?? ???????? ?? ???????? */
$pp = "2";
// ???????? ??????? ????? ?????? ?? ????????
$table = "news";
$total = mysql_result(mysql_query("SELECT COUNT(id) FROM $table"),0);
$numofpages = $total / $pp;
if (!isset($_GET['page'])) {
$page = 1;
}
else {
$page = $_GET['page'];
}
$limitvalue = $page * $pp - ($pp);
/* ???????? ????????, ? ???? ?????? ?? ???????? ???? [username] */
$query = "SELECT * FROM $table ORDER BY id DESC LIMIT $limitvalue, $pp";
$result = mysql_query($query);
while($r=mysql_fetch_array($result))
{
echo "<center> <br>$r[ime]<br></div>";
echo "Upload: $r[nowina]<br><br>";
echo "Upload: $r[awtor]<br><br>";
echo " <img src=http://vivaaa.netau.net/site1/news/upload/$r[snimka] width=255px height=200px/><br><br>";
echo "Източник: $r[iztochnik]";
}
function per_page($link, $offset) {
global $numofpages, $page;
$numofpages = round($numofpages);
$pagesstart = round($page-$offset);
$pagesend = round($page+$offset);
/* ????????? ?? ??????? � ?? ???????? ???????? */
if ($page != "1" && round($numofpages) != "0") {
echo str_replace("%page", round($page-1), '<a href="'.$link.'"><font face="Trebuchet MS">�</font></a> ');
}
for($i = 1; $i <= $numofpages; $i++) {
if ($pagesstart <= $i && $pagesend >= $i) {
if ($i == $page) {
echo "<b>[$i]</b> ";
}
else {
echo str_replace("%page", "$i", '<a href="'.$link.'">'.$i.'</a> '); //????????? ?? ??????????
}
}
}
if (round($numofpages) == "0") {
echo "[$i]";
}
/* ????????? ?? ??????? � ?? ???????? ???????? */
if ($page != round($numofpages) && round($numofpages) != "0") {
echo str_replace("%page", round($page+1), '<a href="'.$link.'"><font face="Trebuchet MS">�</font></a>');
}
}
/* ????????? ?? ????? ???? ???????? ? ????? ?? ???????? */
echo '<br>';
echo '???? ????????: '.round($numofpages).'<br>';
per_page("?page=%page", "5");
?>