Skip to content

Instantly share code, notes, and snippets.

@palpalani
Created October 28, 2013 21:00
Show Gist options
  • Save palpalani/7204597 to your computer and use it in GitHub Desktop.
Save palpalani/7204597 to your computer and use it in GitHub Desktop.
global $db;
$upload_dir = get_misc_data('upload_directory');
$thumb_dir = get_misc_data('upload_thdirectory');
$link_id = $this->_vars['link_id'];
$sql = sprintf("SELECT file_name FROM " . table_prefix . "files WHERE file_link_id='%d' AND file_size='240x650' AND file_comment_id=0", $link_id);
if ($thumbnail = $db->get_var($sql)) {
echo "<img src='". my_pligg_base . $thumb_dir ."/$thumbnail'> ";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment