PHP Skripts:
Code
<div style='margin-bottom:3px;border-radius:3px; font-size:9pt;font-family:arial;'><table width='100%' border='0' cellspacing='0' cellpadding='1'>
<?php
$host = 'localhost'; //Hosts
$db = 'db'; //Datubāze
$user = 'users''; //Lietotājs
$pw = 'parole'; //Parole
$limit = '5'; //Limits
$connect = mysql_connect($host, $user, $pw) or die('Neizdevās pieslēgties: ' . mysql_error()); //Savienojamies ar datubāzi
mysql_select_db($db) or die ('Neizdevās izvēlēties datubāzi: '); //Izvēlamies datubāzi
mysql_query('text/html; charset=utf8'); //Čarsets
$q = mysql_query("SELECT * FROM topics ORDER BY last_post DESC LIMIT ".$limit."") or die(mysql_error());
while ($row = mysql_fetch_array($q)) {
echo "
<tr>
<td valign='top'><a class='latestTr' href='/f/index.php/topic/>";
echo $row['tid'];
echo "-";
echo $row['title_seo'];
echo "'><div id='latestTr'>
<img src='/imgs/bubble.png' style='float:left;'/>
<b>".$row['title'];
echo "</b> <br>[" .$row['last_poster_name'];
echo "] Komentāri: " .$row['posts'];
echo "</div></a></td></tr>";
}
?>
</table>
</div>
CSS
Code
#latestTr {
padding:3px;
-webkit-box-shadow: inset 0px -1px 0px 0px #f1f4db;
box-shadow: inset 0px -1px 0px 0px #f1f4db;
border-bottom:1px solid #cacaca;
background: #fcfff4;
background: -moz-linear-gradient(top, #fcfff4 0%, #e9e9ce 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#fcfff4), color-stop(100%,#e9e9ce));
background: -webkit-linear-gradient(top, #fcfff4 0%,#e9e9ce 100%);
background: -o-linear-gradient(top, #fcfff4 0%,#e9e9ce 100%);
background: -ms-linear-gradient(top, #fcfff4 0%,#e9e9ce 100%);
background: linear-gradient(to bottom, #fcfff4 0%,#e9e9ce 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fcfff4', endColorstr='#e9e9ce',GradientType=0 );
}
#latestTr:hover {
border-left:1px solid #cacaca;
border-right:1px solid #cacaca;
text-shadow: -1px 1px 0px white;
}
a.latestTr {
color: #3d3d3d;
font-size: 9pt;
text-decoration:none;
font-family:Arial;
}
#latestTr img {
margin-right:3px;
}