Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- * Hurrchan 0.1.x EDIT
- * Recent Images Script CRAPPY EDIT, v 1.3
- * http://www.hurrchan.net/dev/
- *
- * NEW IN THIS VERSION:
- * - Uses config.php to get database & site information
- * - Added the ability to omit boards completely
- * - Added the ability to display the thread number under the image
- *
- * Report software bugs to services@hurrchan.net
- */
- $only_op = false; // Enable this if you want to show only OP's pic
- $displayimages = 10; // Number of images to display
- $nsfw = Array('a', 'b', 'c'); // NSFW boards to not display images from
- $hidensfw = true; // Replace images from NSFW boards with a placeholder
- $nsfwholder = "nsfw.png"; // Path to NSFW image placeholder
- $showthreadname = true; // Show thread number link under each image
- $omitboards = "1, 2"; // ID numbers of boards to omit completely
- /*
- * DO NOT MODIFY ANYTHING BELOW THIS LINE UNLESS YOU KNOW WHAT YOU'RE DOING
- */
- require_once ('config.php');
- $sqlquery = "SELECT HIGH_PRIORITY * FROM `".KU_DBPREFIX."posts` WHERE (`file_type` = 'jpg' OR `file_type` = 'gif' OR `file_type` = 'png') AND `boardid` NOT IN (". $omitboards .") AND `is_deleted` = 0";
- if ($only_op)
- $sqlquery .= " AND `parentid` = 0";
- $sqlquery .= " ORDER BY `timestamp` DESC LIMIT " . $displayimages ;
- $results = $tc_db->GetAll($sqlquery);
- echo "<br />";
- foreach ($results as $result) {
- $real_parentid = ($result['parentid'] == 0) ? $result['id'] : $result['parentid'];
- $result['boardname'] = $tc_db->GetOne("SELECT `name` FROM `".KU_DBPREFIX."boards` WHERE `id` = '".$result['boardid']."'");
- echo '<td align="center"><br /><a href="'. KU_WEBPATH . '/' . $result['boardname'] . '/res/'. $real_parentid . '.html#'. $result['id'] . '">';
- if (in_array($result['boardname'], $nsfw)) {
- if ($hidensfw) {
- echo '<img src="' . $nsfwholder . '"border="0">';
- if ($showthreadname) {
- echo "<br />";
- echo '>>>/' . $result['boardname'] . '/' . $result['id'] . '</a></tr>';
- } else {
- echo '</a></td>';
- }
- } else {
- echo '<img src="'. KU_WEBPATH . '/' . $result['boardname'] . '/thumb/'. $result['file'] . 's.'. $result['file_type'] . '" width="'. $result['thumb_w'] . '" height="'. $result['thumb_h'] . '" border="0" />';
- if ($showthreadname) {
- echo "<br />";
- echo '>>>/' . $result['boardname'] . '/' . $result['id'] . '</a></td>';
- } else {
- echo '</a></td>';
- }
- }
- } else {
- echo '<img src="'. KU_WEBPATH . '/' . $result['boardname'] . '/thumb/'. $result['file'] . 's.'. $result['file_type'] . '" width="'. $result['thumb_w'] . '" height="'. $result['thumb_h'] . '" border="0" />';
- if ($showthreadname) {
- echo "<br />";
- echo '>>>/' . $result['boardname'] . '/' . $result['id'] . '</a></tr>';
- } else {
- echo '</a></td>';
- }
- }
- }
- echo "</tr>";
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement