Advertisement
Vodkaholic

Untitled

May 30th, 2011
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. <?php
  2. $cdb = new PDO('mysql:dbname=xx;host=localhost', 'xxx', 'xxx');
  3.  
  4. foreach ($cdb->query("SELECT * FROM images ORDER BY posted DESC LIMIT 3") AS $img)
  5.  
  6. {
  7. $twofirst = substr($img['hash'], 0, 2);
  8. echo '
  9. <a style="position: relative; display: block; height: 140px;" href="/booru/post/view/' . $img['id'] . '" target="_top">
  10.  
  11. <img src="booru/timthumb.php?src=images/' . $twofirst . '/' . $img['hash'] . '&h=125&w=125&q=100" width="125px" style="border-style: none"/>
  12. </a>
  13. ';
  14.  
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement