BIBLIO POPULER

About Online Public Access Catalogue in SLiMS (theme modification, effective search, etc.)

Moderators: wynerst, buitenzorg812, purwoko, sutriadi, ido, Dicarve, ridorido

Post Reply
endazone
Posts: 16
Joined: 09 Dec 2011, 13:17

BIBLIO POPULER

Post by endazone » 03 May 2016, 09:20

Mau tanya,
Bisakah membuat biblio paling banyak dilihat dan paling banyak didownload?

Saya coba menambahkan 2 tabel pada biblio:

viewer int(11) Yes Null
download_biblio int(11) No None

Pada sidebar seulanga saya menambahkan:

<!-- license -->
<div class="block-header">Banyak Dilihat</div>
<p>
<?php
$lastseen = $dbs->query('SELECT b.biblio_id, ma.author_name, b.publish_year, b.title FROM biblio AS b
LEFT JOIN biblio_author AS ba ON b.biblio_id=ba.biblio_id
LEFT JOIN mst_author AS ma ON ba.author_id=ma.author_id
GROUP BY b.biblio_id
ORDER BY b.viewer DESC
LIMIT 5');
?>
<?php

while($wow = $lastseen->fetch_assoc()){
echo "<tr>";
echo "<td align='left'>".$i."</td>";
echo "<td><div class='black_a'><a href='index.php?p=show_detail&id=".$wow['biblio_id']."'>{$wow['author_name']}.{$wow['publish_year']}.<strong>{$wow['title']}</strong>.</a></div></td>";
echo "</tr>";
}

?>
</p>
<!-- license end -->

<!-- Awards -->
<div class="block-header">Banyak Diunduh</div>
<p>
<?php
$lastseen = $dbs->query('SELECT b.biblio_id, ma.author_name, b.publish_year, b.title FROM biblio AS b
LEFT JOIN biblio_author AS ba ON b.biblio_id=ba.biblio_id
LEFT JOIN mst_author AS ma ON ba.author_id=ma.author_id
GROUP BY b.biblio_id
ORDER BY b.download_biblio DESC
LIMIT 5');
?>
<?php

while($wow = $lastseen->fetch_assoc()){
echo "<tr>";
echo "<td align='left'>".$i."</td>";
echo "<td><div class='black_a'><a href='index.php?p=show_detail&id=".$wow['biblio_id']."'>{$wow['author_name']}.{$wow['publish_year']}.<strong>{$wow['title']}</strong>.</a></div></td>";
echo "</tr>";
}

?>
</p>
<!-- Awards end -->

Muncul daftar entri, tapi fungsi yang saya maksud tidak jalan.

Mohon bantuannya. Terima kasih banyak.

Post Reply