$hitungjumlah = $koneksi_db->sql_query("SELECT * FROM artikel WHERE publikasi=1 and month(tgl)='{$bulan}' and year(tgl)='{$tahun}' ORDER BY hits DESC LIMIT {$awal},{$jml}"); $jumlah = $koneksi_db->sql_numrows($hitungjumlah); if ($jumlah > 1) { $perintah = "SELECT * FROM artikel WHERE publikasi=1 ORDER BY hits DESC LIMIT {$awal},{$jml}"; $hasil = mysql_query($perintah); echo '<div id="terpopuler"><ul class="ui-tabs-nav">'; while ($data = $koneksi_db->sql_fetchrow($hasil)) { $judul = AuraCMSSEO($data[1]); $gambar = $data['gambar'] == '' ? '<img src="mod/news/images/normal/news-default.jpg">' : '<img src="mod/news/images/normal/' . $data['gambar'] . '">'; //$id = $data[0]; echo '<li class="ui-tabs-nav-item">'; echo '<a href="article-' . $judul . '.html" title="' . $data[1] . '"><span>' . $gambar . '' . limitTxt($data[1], 50) . '</span></a></li>'; } echo "</ul>"; echo '</div>'; } else { $perintah = "SELECT * FROM artikel WHERE publikasi=1 ORDER BY hits DESC LIMIT {$awal},{$jml}"; $hasil = mysql_query($perintah); echo '<div id="terpopuler"><ul class="ui-tabs-nav">'; while ($data = $koneksi_db->sql_fetchrow($hasil)) { $judul = AuraCMSSEO($data[1]); $gambar = $data['gambar'] == '' ? '<img src="mod/news/images/normal/news-default.jpg">' : '<img src="mod/news/images/normal/' . $data['gambar'] . '">'; //$id = $data[0]; echo '<li class="ui-tabs-nav-item">'; echo '<a href="article-' . $judul . '.html" title="' . $data[1] . '"><span>' . $gambar . '' . limitTxt($data[1], 50) . '</span></a></li>'; } echo "</ul>"; echo '</div>'; } $out = ob_get_contents(); ob_end_clean();
<?php if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { header("HTTP/1.1 404 Not Found"); exit; } ob_start(); global $koneksi_db, $maxdata; $jml = $maxdata; $awal = 0; $perintah = "SELECT * FROM artikel WHERE publikasi=1 ORDER BY id DESC LIMIT {$awal},{$jml}"; $hasil = mysql_query($perintah); echo "<ul>"; while ($data = mysql_fetch_row($hasil)) { $judul = AuraCMSSEO($data[1]); $id = $data[0]; echo '<li><a href="article-' . $id . '-' . $judul . '.html" title="' . $data[1] . '">' . limitTxt($data[1], 19) . '</a></li>'; } echo "</ul>"; $out = ob_get_contents(); ob_end_clean();