View file dwapnews_1.2/index.php

File size: 3.67Kb
<?
include ("config.php");
?>
<? if ($version=="html"){ echo "<html>
<head ('Content-type: text/vnd.wap.wml');>
<title>Новости $homesite</title>
<style type='text/css'>
		.top
	{
		border-top: solid 3px #000000;
		background-color: #FFFF00;
		border-bottom: solid 3px #CCCCCC;
	}
	.cov
	{
		padding-left: 4px;
		padding-top: 2px;
		padding-bottom: 4px;
		border-top: solid 1px #CCCCCC;
	}
		.news
	{
		background-color: #009900;
		border-top: solid 1px #FFFFFF;
    	border-bottom: solid 1px #FFFFFF;
		color: #FFFFFF;
		padding: 3px;
		}
			.dwap
	{
		background-color: #FFFF99;
		border-top: solid 1px #000000;
    	border-bottom: solid 1px #000000;
		color: #333333;
		padding: 3px;
        		}
	
		.btm
	{
		background-color: #BBBBBB;
		border-top: solid 1px #999999;
		color: #FFFFFF;
		padding: 3px;
	}
		.atation
	{
		color: #FF0000;
		text-decoration: underline;
	}
	</style>
<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD/wml_1.1.xml\">
<meta http-equiv='Cache-Control' content='no-cache' forua='true'/>
</head>

<body>";} else {header("Content-type:text/vnd.wap.wml"); 
echo "
<?xml version=\"1.0\" encoding=\"utf-8\"?>
<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.2//EN\" \"http://www.wapforum.org/DTD/wml1.2.dtd\">\n
<wml>
<card id=\"\" title=\"Новости $homesite\">";}?>

<?if ($version=="html"){echo "<div class='cov' align='center'>";} else { echo "<p align='center'><small>";}?> <img src="http://dwap.tj/images/dwap_logo.gif"/><br/>
  http://dwap.tj 
  <?if ($version=="html"){echo "</div>";} else {echo "</small></p>";}?><p>
  <?if ($version=="html"){echo "<div class='top' align='center'></div>";} ?>
  <?if ($version=="html"){echo "<div class='cov'> <span class='atation'> ";}else {echo "<small><small>---<br/> ";}?>
Реклама
  <?if ($version=="html"){echo "</div> </span> ";} else {echo "<br/>---<br/><br/></small>";}?>
  <?
$q=mysql_query ("Select * from news order by addtime DESC ");
$c=mysql_num_rows($q);
for ($i=0; $i<$c; $i++){
?>
  <?
if ($version=="html"){ echo "<div class='news'>";}?>
  <b>..:: 
  <?
$title=mysql_result ($q, $i, 'title');
$addtime=mysql_result ($q, $i, 'addtime');
$newsid=mysql_result ($q, $i, 'id');
echo date ("d/m/y", "$addtime");
echo " - $title";
?>
  </b> 
  <?if ($version=="html"){ echo "</div>";} else ?>
  <?if ($version=="html"){ echo "<div class='dwap'>";} else {echo "<br/>";}?>
  :: 
  <?
  $news=mysql_result ($q, $i, 'news');
echo "$news<br/>";
$com=mysql_query ("Select  * from newscomments WHERE newsid='$newsid'");
$comkol=mysql_num_rows($com);
echo "<a href='comment.php?version=$version&amp;newsid=$newsid&amp;login=$login&amp;pass=$pass'>[Коментарии $comkol]</a>";
?>
  <?if ($version=="html"){ echo "</div>";}  else {echo "<br/><br/>******<br/>";}?>
  <?}?>
  <?if ($version=="html"){echo "<div>";}else {echo "---<br/><b> ";}?>
Рекомендуем: 
  <?if ($version=="html"){echo "</div>";}else {echo "<br/></b> ";}?>
  <?if ($version=="html"){echo "<div class='cov'> <span class='atation'> ";}else {echo "<small>";}?>
Реклама
  <?if ($version=="html"){echo "</div> </span> ";} else {echo "<br/>---<br/><br/></small>";}?>
  <small>
  <?if ($version=="html"){echo "<div class='btm'>[<a href='?version=wap&amp;login=$login&amp;pass=$pass'>wap</a> | html]";} else {echo "[wap | <a href='?version=html&amp;login=$login&amp;pass=$pass'>html</a>]";} ?>
    <br/>&#169; <a href="<?echo $homeurl?>"><?echo $homesite?></a> , 2006-2007 <br/>
</small> 
<?if ($version=="html"){echo "</div> ";} else {echo"</small>";} ?>
</p><? if ($version=="html"){ echo "</body></html>";} else {echo "</card></wml>";}?>