Ik gebruikt java van google, adsense.
Hij moet dus 3x include maar hij include dus maar 2x dus als je naar beneden scrolled zie je een leeg balkje.
Website: http://www.onlinestereo.org
In random-banner.php zit het stukje java van google adsense.
Script:
PHP
echo '<div id="rij">
<table>
<tr>';
while($row = mysql_fetch_array($res))
{
$zendernaam = str_replace(" ","-",$row['titel']);
echo '<td><div id="rz"><div id="imgrz"><a href="/zender/'.$row['id'].'/'.$zendernaam.'.html"><img src="/'.$row['img'].'" border="0" width="94" height="66"></a></div></div></td>';
if($i % 5 == 0)
{
echo '</tr>
</table>
</div>';
if ($i % 20 == 0)
{
echo '<div id="rijad"><div id="ad">';
include("random-banner.php");
echo '</div></div>';
}
echo '<div id="rij">
<table><tr>';
}
$i++;
}
echo ' </tr></table></div>';
}
Toon Meer
Hele Index:
PHP
<?php include("header.php"); include("stats.php"); ?>
<?php
$sql = "
SELECT
id
FROM
radio
";
$res = mysql_query($sql) or die(mysql_error());
$count = mysql_num_rows($res);
echo "Wij hebben momenteel <b>".$count."</b> zenders op onze website staan.<br /><br />";
?>
<br />
<br />
<b>5 meest geluisterd</b><br />
<?php
$sql = "
SELECT
*
FROM
radio
ORDER by views DESC LIMIT 0,5
";
if(!$res = mysql_query($sql))
{
trigger_error(mysql_error().'<br />In query: '.$sql);
}
elseif(mysql_num_rows($res) == 0)
{
echo 'Geen zenders gevonden';
}
else
{
echo '<div id="rij"><table><tr>';
while ($row =mysql_fetch_array($res))
{
$zendernaam = str_replace(" ","-",$row['titel']);
echo "<td><div id=\"rz\"><div id=\"imgrz\"><a href=\"/zender/".$row['id']."/$zendernaam.html\"><img src=\"/".$row['img']."\" border=\"0\" width=\"94\" height=\"66\"></a></div></div></td>";
}
echo '</tr></table></div>';
}
?>
<br />
<br />
<br />
</ul>
<div id="rechtscontentlast"></div>
</div>
<div id="rechtscontent">
<?php
echo '<h2>';
ini_set ('display_errors', 1);
error_reporting (E_ALL | E_STRICT);
if (isset ($_GET['cat']) && ctype_digit ($_GET['cat'])) {
$cat = $_GET['cat'];
}
else {
$cat = 111; // Hier kan je de ID veranderen van welke categorie je wilt laten zien op de index pagina
}
$sql = "
SELECT
*
FROM
cat
WHERE id = ". mysql_real_escape_string($cat)."
";
$res = mysql_query($sql);
$rij = mysql_fetch_object($res);
$naam = htmlspecialchars($rij->naam);
echo "<b>".$rij->naam."</b><br />";
$sql = "
SELECT
*
FROM
radio
WHERE cat = ". mysql_real_escape_string($cat)."
";
echo '</h2>';
echo '<ul>';
if(!$res = mysql_query($sql))
{
trigger_error(mysql_error().'<br />In query: '.$sql);
}
elseif(mysql_num_rows($res) == 0)
{
echo 'Geen zenders gevonden';
}
else
{
$i = 1;
echo '<div id="rij">
<table>
<tr>';
while($row = mysql_fetch_array($res))
{
$zendernaam = str_replace(" ","-",$row['titel']);
echo '<td><div id="rz"><div id="imgrz"><a href="/zender/'.$row['id'].'/'.$zendernaam.'.html"><img src="/'.$row['img'].'" border="0" width="94" height="66"></a></div></div></td>';
if($i % 5 == 0)
{
echo '</tr>
</table>
</div>';
if ($i % 20 == 0)
{
echo '<div id="rijad"><div id="ad">';
include("random-banner.php");
echo '</div></div>';
}
echo '<div id="rij">
<table><tr>';
}
$i++;
}
echo ' </tr></table></div>';
}
?>
<?php
include("footer.php");
?>
Toon Meer