20. april 2004 - 22:42
Der er
4 kommentarer og 1 løsning
Se resten i tagwall
hej eksperter.. Vil gerne spørge om hjælp til noget med tal i bunden.. Når jeg har min tagwall har jeg sat den til limit 12, er der nogen der kan indsætte koden til så der komme tal i bunden, så man kan se de 12 næste.. osv.. her er koden til min tagwall: <?php $result4 = mysql_query("select * from tttagwall ORDER By id desc LIMIT 12"); $nr = mysql_num_rows($result4); if ($nr > 0) { while($row4 = mysql_fetch_array($result4)) { $row4[text] = str_replace(":D","<img src='smileys/superlol.gif'>", $row4[text]); $row4[text] = str_replace(":d","<img src='smileys/superlol.gif'>", $row4[text]); $row4[text] = str_replace(";)","<img src='smileys/cool.jpg'>", $row4[text]); $row4[text] = str_replace(":S","<img src='smileys/arhh.jpg'>", $row4[text]); $row4[text] = str_replace("kys","<img src='smileys/kys.jpg'>", $row4[text]); $row4[text] = str_replace("(x)","<img src='smileys/kys.jpg'>", $row4[text]); $row4[text] = str_replace(":'(","<img src='smileys/cry.jpg'>", $row4[text]); $row4[text] = str_replace(":)","<img src='smileys/smil.gif'>", $row4[text]); echo '<center>'; echo'<table width="400" border="0" cellpadding="1" cellspacing="1" bgcolor="#000000"> <tr> <td bgcolor="#eeeeee"><span class="image"> <table width="100" border="0" cellspacing="0" cellpadding="0"> <tr><td>Skrevet af:<b></td> <td>'; if ($row4[email] == null){ } else { echo '<a href="mailto:'; echo $row4[email]; echo '">'; } echo '<span class="style2">'; echo $row4[navn]; echo'</a></b></b>'; echo '</td> </tr> </table><br> '; echo '</span></b>'; echo nl2br($row4[text]); echo '</tr> </table><br>';} } ?>
Annonceindlæg fra Jobindex
20. april 2004 - 22:48
#1
prøv <?php if( isset($_GET['page']) ) $page = intval($_GET['page']); else $page = 0; $step = 12; $resultCount = mysql_query("SELECT count(*) FROM tttagwall") or die(mysql_error()); $total = mysql_result($resultCount,0,0); $result4 = mysql_query("select * from tttagwall ORDER By id desc LIMIT " . ($page*$step) . ",$step"); $nr = mysql_num_rows($result4); if ($nr > 0) { while($row4 = mysql_fetch_array($result4)) { $row4[text] = str_replace(":D","<img src='smileys/superlol.gif'>", $row4[text]); $row4[text] = str_replace(":d","<img src='smileys/superlol.gif'>", $row4[text]); $row4[text] = str_replace(";)","<img src='smileys/cool.jpg'>", $row4[text]); $row4[text] = str_replace(":S","<img src='smileys/arhh.jpg'>", $row4[text]); $row4[text] = str_replace("kys","<img src='smileys/kys.jpg'>", $row4[text]); $row4[text] = str_replace("(x)","<img src='smileys/kys.jpg'>", $row4[text]); $row4[text] = str_replace(":'(","<img src='smileys/cry.jpg'>", $row4[text]); $row4[text] = str_replace(":)","<img src='smileys/smil.gif'>", $row4[text]); echo '<center>'; echo'<table width="400" border="0" cellpadding="1" cellspacing="1" bgcolor="#000000"> <tr> <td bgcolor="#eeeeee"><span class="image"> <table width="100" border="0" cellspacing="0" cellpadding="0"> <tr><td>Skrevet af:<b></td> <td>'; if ($row4[email] == null){ } else { echo '<a href="mailto:'; echo $row4[email]; echo '">'; } echo '<span class="style2">'; echo $row4[navn]; echo'</a></b></b>'; echo '</td> </tr> </table><br> '; echo '</span></b>'; echo nl2br($row4[text]); echo '</tr> </table><br>';} } if( $total > (($page+1)*$step) ) print '<a href="tagwall.php?page=' . $page+1 . '">Næste</a>'; ?>
20. april 2004 - 22:53
#2
det virker ikke den skriver 1">Næste i bunden af siden
20. april 2004 - 22:55
#3
print '<a href="tagwall.php?page=' . ($page+1) . '">Næste</a>';
21. april 2004 - 10:52
#4
Jeg bruger selv den her metode: $tags_ad_gangen = 12; if (!$start_nr OR $start_nr < 0) { $start_nr = 0; } $count = mysql_query("SELECT * FROM tttagwall"); $antal = mysql_num_rows($count); $result4 = mysql_query("SELECT * FROM tttagwall order by id desc limit $start_nr, $tags_ad_gangen"); if ($antal > ($start_nr + $tags_ad_gangen)) { $naeste_start_nr = $start_nr + $tags_ad_gangen; $naeste = "<a href='tagwall.php?start_nr=$naeste_start_nr'>Næste</a>"; } else { $naeste = "Næste"; } if ($start_nr > 0 && ($start_nr - $tags_ad_gangen) < $antal) { $forrige_start_nr = $start_nr - $tags_ad_gangen; $forrige = "<a href='tagwall.php?start_nr=$forrige_start_nr'>Forrige</a>"; } else { $forrige = "Forrige"; } if ($antal > 0) { while($row4 = mysql_fetch_array($result4)) { $row4[text] = str_replace(":D","<img src='smileys/superlol.gif'>", $row4[text]); $row4[text] = str_replace(":d","<img src='smileys/superlol.gif'>", $row4[text]); $row4[text] = str_replace(";)","<img src='smileys/cool.jpg'>", $row4[text]); $row4[text] = str_replace(":S","<img src='smileys/arhh.jpg'>", $row4[text]); $row4[text] = str_replace("kys","<img src='smileys/kys.jpg'>", $row4[text]); $row4[text] = str_replace("(x)","<img src='smileys/kys.jpg'>", $row4[text]); $row4[text] = str_replace(":'(","<img src='smileys/cry.jpg'>", $row4[text]); $row4[text] = str_replace(":)","<img src='smileys/smil.gif'>", $row4[text]); echo '<center>'; echo'<table width="400" border="0" cellpadding="1" cellspacing="1" bgcolor="#000000"> <tr> <td bgcolor="#eeeeee"><span class="image"> <table width="100" border="0" cellspacing="0" cellpadding="0"> <tr><td>Skrevet af:<b></td> <td>'; if ($row4[email] == null){ } else { echo '<a href="mailto:'; echo $row4[email]; echo '">'; } echo '<span class="style2">'; echo $row4[navn]; echo'</a></b></b>'; echo '</td> </tr> </table><br> '; echo '</span></b>'; echo nl2br($row4[text]); echo '</tr> </table><br>';} } } echo "<div align='center'>$forrige - $naeste<br><strong>$antal</strong> beskeder ialt</div>";
21. april 2004 - 22:48
#5
hej
Vi tilbyder markedets bedste kurser inden for webudvikling