ve en esasi bu skriptde (men elave etdiyim) bosluq gorseniz bizimle lutfen bolushun tekliflerinizi.
Mustafa muallim Allah sizden razi olsun ve size islerinizde uqurlar ve ne zaman Baku-ye gelseniz beni arayin.
Sayqilarimla Azer
script asaqida
<!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″ />
<title>Dahi Tasarim . CoM</title>
<style type=”text/css”>
<!–
a:link {
color: #0066FF;
text-decoration: underline;
}
a:visited {
text-decoration: underline;
color: #0033CC;
}
a:hover {
text-decoration: none;
color: #FFFFFF;
}
a:active {
text-decoration: underline;
}
–>
</style></head>
<body>
<? // baglan php yi yukluyoruz
include(“baglan.php”);
// bu satýrda adres satýrýndan (GET metodu) no bilgisi gelmiþmi diye kontrol ediyoruz…
$no=$_GET[“no”];
//eger $no yoksa demekki talep edilen bir haberin devami yok
//biz en son kaydi veritabanýndan cekiyoruz
if (!$no)
{$sorgu=mysql_query(“select * from haber where aktif=’aktif’ order by no desc limit 1”);
}
else
// eger $no varsa istenilen nolu haberi veritabanýndan cekiyoruz
{$sorgu=mysql_query(“select * from haber where no=’$no'”);
}
while($satir=mysql_fetch_row($sorgu))
{
$baslik=$satir[1];
$ozet=$satir[2];
$metin=$satir[3];
$kucukresim=$satir[4];
$buyukresim=$satir[5];
$metin=str_replace (“\n”,”<br />”,$metin);
// \n br ile admin sayfasýnda aciklama kismina girdigimiz enterlari
// br ye cevirip alt satir yapiyoruz
}
?>
<table border=”1″ cellpadding=”10″ cellspacing=”10″ bordercolor=”#666666″ bgcolor=”#CCCCCC”>
<tr>
<td width=”500″ valign=”top” bgcolor=”#FFCC00″ name=”buyukresim”>
<?php if ( !empty( $buyukresim ) ): ?>
<img alt=”” src=”<?=$buyukresim; ?>”>
<?php else: ?>
<img alt=”No image” src=”/yukle/haber_buyuk/noimage.jpeg”>
<?php endif; ?>
<div class=”indent1″>
<h1><?=$baslik; ?> <span></span></h1>
<p><?=$metin; ?></p></td>
<td width=”170″ valign=”top” bgcolor=”#FF9900″>
//buradan baslamisam
<?
define(‘MAX_SEHIFE’, 4);
$db = mysql_connect(“localhost”, “db_name”, “password”) or die(“bazaya qosulmadi!”);
mysql_select_db(“db_name”) or die(“Baza secilmedi!”);
$rs = mysql_query(“SELECT COUNT(aktif) FROM haber”) or die(“Qosula bilmedi”);
list($total) = mysql_fetch_row($rs);
$sehife_sayi = ceil($total / MAX_SEHIFE);
$sehife = intval(@$_GET[“sehife”]);
if (0 == $sehife){
$sehife = 1;
}
$start = MAX_SEHIFE * ($sehife – 1);
$max = MAX_SEHIFE;
$rs = mysql_query(“SELECT no, kucukresim, ozet, aciklama, baslik FROM haber where aktif=’aktif’ ORDER BY no
DESC LIMIT $start, $max”) or die(“sahv var!”);
?>
<?php
while($satir1=mysql_fetch_row($rs))
{
$no=$satir1[0];
$ozet=$satir1[2];
$aciklama=$satir1[3];
$kucukresim=$satir1[1];
$baslik=$satir1[4];
?>
<?php
if(file_exists($kucukresim)){
echo “<p><a href=’index.php?no=$no’>
<img alt=” src=’$kucukresim’ />
<br><span>$baslik</span></a><br />$ozet
</p>”;
}
else {
echo “<p><a href=’index.php?no=$no’>
<img alt=” src=’/yukle/haber_buyuk/noimage.jpeg’ />
<br><span>$baslik</span></a><br />$ozet
</p>”;
}
}
?>
</td>
</tr>
<tr>
<td colspan=”2″ bgcolor=”#669933″><ul>
<?
$sorgu=mysql_query(“select * from haber where aktif=’aktif’ order by no desc limit 0,20”);
// haberlerin sadece basliklarini ekranda gosterip link verecegiz
while($satir=mysql_fetch_row($sorgu))
{
$no=$satir[0];
$baslik=$satir[1];
echo “<li> <a href=index.php?no=$no>$baslik</a></li>”;
}
?>
</ul></td>
</tr>
</table>
<table border=”0″ cellpadding=”5″ align=”center”>
<tr>
<td>Istedigin sehifeye get:</td>
<?php
for ($i = 1; $i < $sehife_sayi; $i++) {
$txt = $i;
if ($sehife != $i)
$txt = “<a href=\”” . $_SERVER[“PHP_SELF”] . “?sehife=$i\”>$txt</a>”;
?>
<td align=”center”><?= $txt ?></td>
<?php
}
?>
</tr>
</table>
<hr>
</div>
<?
if ($sorgu) mysql_free_result($sorgu);
if ($rs) mysql_free_result($rs);
if ($baglan) mysql_close($baglan);
?>
</body>
</html>