Author Topic: function get_thumbnail_code question  (Read 5400 times)

0 Members and 1 Guest are viewing this topic.

Offline ascanio

  • Hero Member
  • *****
  • Posts: 569
    • View Profile
    • http://www.surfourspace.net
function get_thumbnail_code question
« on: August 24, 2007, 08:49:38 PM »
hello every one
im trying to do this

Code: [Select]
$sql = "SELECT youtube_id
       FROM ".IMAGES_TABLE."
       WHERE image_id = $image_id";
$image_row = $site_db->query_firstrow($sql);

so i can use the youtube_id inside of the thumbnail function and i also had to add $site_db
but when i did this it worked but it slowed down the home page

did i made something wrong?

thanks

Code: [Select]
function get_thumbnail_code($media_file_name, $thumb_file_name = "", $image_id, $cat_id, $image_name = "", $mode = "", $show_link = 1, $open_window = 0) {
  global $site_db, $site_sess, $config, $user_info, $setting;

$sql = "SELECT youtube_id
       FROM ".IMAGES_TABLE."
       WHERE image_id = $image_id";
$image_row = $site_db->query_firstrow($sql);

$thumbnails_rating = $config['starrating_thumbs'];

  if (!check_media_type($media_file_name)) {
    $thumb = "<img src=\"".ICON_PATH."/404.gif\" border=\"0\" alt=\"\" />";
  }
  else {
    if (!get_file_path($thumb_file_name, "thumb", $cat_id, 0, 0)) {
      $file_src = ICON_PATH."/".get_file_extension($media_file_name).".gif";
      $image_info = @getimagesize($file_src);
      $width_height = (!empty($image_info[3])) ? " ".$image_info[3] : "";
      $thumb = "<img src=\"".$file_src."\" border=\"0\"".$width_height." alt=\"".$image_name."\" />";
    }
    else {
      $file_src = get_file_path($thumb_file_name, "thumb", $cat_id, 0, 1);
      $image_info = @getimagesize($file_src);
      $width_height = (!empty($image_info[3])) ? " ".$image_info[3] : "";
        $thumb = "<img src=\"".$file_src."\" border=\"".$config['image_border']."\" width=\"128\" alt=\"".$image_name."\" onMouseOver=\"mousOverImage(this,'".$image_row['youtube_id']."',1)\" onMouseOut=\"clearTimeout(timer)\" />";

// ################## Start Mod Star Rating * Mouseover/ Hover * Rating without pagereload ##############
    if (check_permission("auth_vote", $cat_id)) {
      $thumb .= rating_bar(''.$image_id.'','$thumbnails_rating_images','$rating_images','$thumbnails_rating_image_width',''.$thumbnails_rating.'');
    }
    else {
      $thumb .= rating_bar(''.$image_id.'','$thumbnails_rating_images','$rating_images','$thumbnails_rating_image_width',''.$thumbnails_rating.'');
    }
// ################## End Mod Star Rating * Mouseover/ Hover * Rating without pagereload ##############
    }
  }

  if ($show_link) {
    if ($open_window) {
      $thumb = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&amp;mode=".$mode : ""))."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".$thumb."</a>";
    }
    else {
      $thumb = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&amp;mode=".$mode : ""))."\">".$thumb."</a>";
    }
  }
  return $thumb;
}

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: function get_thumbnail_code question
« Reply #1 on: August 24, 2007, 11:09:59 PM »
Is possible rating_bar conflict (or ressource much) with youtube_id.
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline ascanio

  • Hero Member
  • *****
  • Posts: 569
    • View Profile
    • http://www.surfourspace.net
Re: function get_thumbnail_code question
« Reply #2 on: August 24, 2007, 11:21:00 PM »
what?

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: function get_thumbnail_code question
« Reply #3 on: August 24, 2007, 11:51:20 PM »
Sorry, bad english ... I do best I explain ...  :|
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?