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 : 104.21.89.46 your ip : 172.69.214.81 H O M E |
Filename | /var/www/html/sman1baleendahok/modul/tag_berita.php |
Size | 2.09 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 18:21 |
Actions | edit | rename | delete | download (gzip) |
View | text | code | image |
<?php
if(!defined("CMSBalitbang")) {
die("<h1>Permission Denied</h1>You don't have permission to access the this page.");
}
$tag = '<link type="text/css" rel="stylesheet" href="../plugins/news/base.css"/>
<link type="text/css" rel="stylesheet" href="../plugins/news/theme.css"/>
<script src="../js/jquery-1.4.2.min.js" type="text/javascript"></script>
<script type="text/javascript" src="../js/jquery.accessible-news-slider.js"></script>
<script type="text/javascript">
// when the DOM is ready, convert the feed anchors into feed content
jQuery(document).ready(function() {
jQuery("#newsslider1").accessNews(
{
title:"",
subtitle:"",
});
});
</script>';
$tag .='<div style="width:445px;margin:auto; background-color:#FFFFFF;">
<ul id="newsslider1">';
$sql="select * from t_news order by id desc limit 0,8";
if(!$query=mysql_query($sql)) die ("Pengambilan gagal1 berita $id");
while ($row=mysql_fetch_array($query)) {
$isi = strip_tags($row[isi]);
$max = 200; // maximal 300 karakter
$min = 150; // 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 )."...";
}
$nfile = "../images/berita/gb$row[id].jpg";
$gb="";
if (file_exists($nfile)) {
$gb='<img src="'.$nfile.'" width="82" height="50" id="gbr" >';
}
$tag .= '<li>
<a href="index.php?id=berita&kode='.$row['id'].'">'.$gb.'</a>
<p class="title"><a href="index.php?id=berita&kode='.$row['id'].'">'.$row['subject'].'</a></p>
<p class="description">'.$isi.'<br /><a href="index.php?id=berita&kode='.$row['id'].'"> » selengkapnya</a></p>
</li>';
}
$tag .="</ul></div>";
?>
if(!defined("CMSBalitbang")) {
die("<h1>Permission Denied</h1>You don't have permission to access the this page.");
}
$tag = '<link type="text/css" rel="stylesheet" href="../plugins/news/base.css"/>
<link type="text/css" rel="stylesheet" href="../plugins/news/theme.css"/>
<script src="../js/jquery-1.4.2.min.js" type="text/javascript"></script>
<script type="text/javascript" src="../js/jquery.accessible-news-slider.js"></script>
<script type="text/javascript">
// when the DOM is ready, convert the feed anchors into feed content
jQuery(document).ready(function() {
jQuery("#newsslider1").accessNews(
{
title:"",
subtitle:"",
});
});
</script>';
$tag .='<div style="width:445px;margin:auto; background-color:#FFFFFF;">
<ul id="newsslider1">';
$sql="select * from t_news order by id desc limit 0,8";
if(!$query=mysql_query($sql)) die ("Pengambilan gagal1 berita $id");
while ($row=mysql_fetch_array($query)) {
$isi = strip_tags($row[isi]);
$max = 200; // maximal 300 karakter
$min = 150; // 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 )."...";
}
$nfile = "../images/berita/gb$row[id].jpg";
$gb="";
if (file_exists($nfile)) {
$gb='<img src="'.$nfile.'" width="82" height="50" id="gbr" >';
}
$tag .= '<li>
<a href="index.php?id=berita&kode='.$row['id'].'">'.$gb.'</a>
<p class="title"><a href="index.php?id=berita&kode='.$row['id'].'">'.$row['subject'].'</a></p>
<p class="description">'.$isi.'<br /><a href="index.php?id=berita&kode='.$row['id'].'"> » selengkapnya</a></p>
</li>';
}
$tag .="</ul></div>";
?>