PHP interesse |
|
Waarom doet dit het niet?
<?php
include_once 'include/config.inc.php';
include_once 'include/ubb.inc.php';
$db = new db;
$list_query = $db->dbselect('', 'berichten', '', 'id DESC', '', '0,8');
while($list = mysql_fetch_assoc($list_query)) {
$lijst_query = $db->dbselect('', 'leden', 'id="'.$list['userid'].'"', '', '', '');
$lijst = mysql_fetch_assoc($lijst_query);
$input .= '<table>
<tr>
<td valign="top"><img src="'.$lijst['foto'].'" width="50" height="50"></td>
<td valign="top"><a href="profiel.php?id='.$lijst['id'].'"><b>'.$lijst['gebruikersnaam'].'</b></a><br>'.bb_bericht($list['bericht']).'</td>
</tr>
</table>,';
}
?>
<a href="add.php">Plaats jouw bericht met foto in deze balk! Klik hier!</a>
<script>
var berichten = "Array(<?php echo($input);?>)";
//////////////////
var teller = -2;
window.setInterval(veranderen,30000);
window.onload = function() {veranderen()};
function veranderen()
{
oDiv = document.getElementById('berichtenbalk');
if(teller+2>berichten.length-1)
teller = 0;
else
teller +=2;
oDiv.innerHTML = berichten[teller]
if(berichten[teller+1]) oDiv.innerHTML += berichten[teller+1];
}
</script>
<table><tr><td valign="top"><div id='berichtenbalk'>berichtenbalk</div></td></tr></table>
<?php include_once 'include/config.inc.php'; include_once 'include/ubb.inc.php'; $db = new db; $list_query = $db->dbselect('', 'berichten', '', 'id DESC', '', '0,8'); $lijst_query = $db->dbselect('', 'leden', 'id="'.$list['userid'].'"', '', '', ''); $input .= '<table> <tr> <td valign="top"><img src="'.$lijst['foto'].'" width="50" height="50"></td> <td valign="top"><a href="profiel.php?id='.$lijst['id'].'"><b>'.$lijst['gebruikersnaam'].'</b></a><br>'.bb_bericht($list['bericht']).'</td> </tr> </table>,'; } ?> <a href="add.php">Plaats jouw bericht met foto in deze balk! Klik hier!</a> <script> var berichten = "Array( <?php echo($input);? >)"; ////////////////// var teller = -2; window.setInterval(veranderen,30000); window.onload = function() {veranderen()}; function veranderen() { oDiv = document.getElementById('berichtenbalk'); if(teller+2>berichten.length-1) teller = 0; else teller +=2; oDiv.innerHTML = berichten[teller] if(berichten[teller+1]) oDiv.innerHTML += berichten[teller+1]; } </script> <table><tr><td valign="top"><div id='berichtenbalk'>berichtenbalk</div></td></tr></table>
Ik blijf proberen |