Apache/2.4.7 (Ubuntu) Linux sman1baleendah 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) safemode : OFF MySQL: ON | Perl: ON | cURL: OFF | WGet: ON > / var / www / html / sman1baleendahok / modul / | server ip : 172.67.156.115 your ip : 172.70.100.187 H O M E |
Filename | /var/www/html/sman1baleendahok/modul/tag_bukutamu.php |
Size | 1.15 kb |
Permission | rw-rw-r-- |
Owner | ulung : ulung |
Create time | 27-Apr-2025 11:12 |
Last modified | 05-Feb-2025 08:55 |
Last accessed | 06-Jul-2025 15:57 |
Actions | edit | rename | delete | download (gzip) |
View | text | code | image |
<?php
$tag .='<table width="97%" border="0" align=center >';
$query = "SELECT * FROM t_buku order by id_buku desc limit 0,5";
$result = mysql_query($query) or die("Query failed banner");
while ($row = mysql_fetch_array($result)) {
$isi = strip_tags($row[komentar]);
$max = 300; // maximal 300 karakter
$min = 200; // minimal 150 karakter
if( strlen( $isi ) > $max ) {
$pecah = substr( $isi, 0, $max );
$akhirParagrap = strrpos( $pecah, "\n" );
$akhirKalimat = strrpos( $pecah, '.' );
$akhirSubKalimat = strrpos( $pecah, ',' );
$spasiTerakhir = strrpos( $pecah, ' ' );
if( $akhirParagrap >= $min ) {
$potong = $akhirParagrap;
}elseif( $akhirKalimat >= $min ) {
$potong = $akhirKalimat;
}elseif( $akhirSubKalimat >= $min ) {
$potong = $akhirSubKalimat;
}else {
$potong = $spasiTerakhir;
}
$isi = substr( $isi, 0, $potong+1 )."...";
}
$tag .="<tr><td valign=top width=10><img src='../images/mn-panah3.gif' ></td><td>$isi ...</td></tr>";
}
$tag .="</table><div class='more'>:: <a href='index.php?id=lih_buku' >Selengkapnya</a> </div></center>";
?>
$tag .='<table width="97%" border="0" align=center >';
$query = "SELECT * FROM t_buku order by id_buku desc limit 0,5";
$result = mysql_query($query) or die("Query failed banner");
while ($row = mysql_fetch_array($result)) {
$isi = strip_tags($row[komentar]);
$max = 300; // maximal 300 karakter
$min = 200; // minimal 150 karakter
if( strlen( $isi ) > $max ) {
$pecah = substr( $isi, 0, $max );
$akhirParagrap = strrpos( $pecah, "\n" );
$akhirKalimat = strrpos( $pecah, '.' );
$akhirSubKalimat = strrpos( $pecah, ',' );
$spasiTerakhir = strrpos( $pecah, ' ' );
if( $akhirParagrap >= $min ) {
$potong = $akhirParagrap;
}elseif( $akhirKalimat >= $min ) {
$potong = $akhirKalimat;
}elseif( $akhirSubKalimat >= $min ) {
$potong = $akhirSubKalimat;
}else {
$potong = $spasiTerakhir;
}
$isi = substr( $isi, 0, $potong+1 )."...";
}
$tag .="<tr><td valign=top width=10><img src='../images/mn-panah3.gif' ></td><td>$isi ...</td></tr>";
}
$tag .="</table><div class='more'>:: <a href='index.php?id=lih_buku' >Selengkapnya</a> </div></center>";
?>