'.$title.''; } // GET FACTIONS $aFactions = Array(); $aFactionCSS = Array(); $sql = 'SELECT f.faction_id, f.faction_name, f.image FROM tf_character_factions cf, tf_factions f WHERE cf.faction_id = f.faction_id AND cf.version_id = '.number($version_id).' ORDER BY f.faction_name ASC'; $res = mysql_query($sql) OR die(mysql_error()); while($row = mysql_fetch_assoc($res)) { extract($row); /*$aFactions[] = ''.$faction_name.' '.$faction_name.'';*/ $aFactions[] = ''.$faction_name.''; $aFactionCSS[] = $image; } $iRand = rand(0, (count($aFactionCSS) - 1)); $css = Left($aFactionCSS[$iRand], Len($aFactionCSS[$iRand]) - 4); // GET SUBGROUPS $aSubgroups = Array(); $sql = 'SELECT f.subgroup_id, f.subgroup_name FROM tf_character_subgroups cf, tf_subgroups f WHERE cf.subgroup_id = f.subgroup_id AND cf.version_id = '.number($version_id).' ORDER BY f.subgroup_name ASC'; $res = mysql_query($sql) OR die(mysql_error()); while($row = mysql_fetch_assoc($res)) { extract($row); $aSubgroups[] = ''.$subgroup_name.''; } // GET TECH SPECS $aSpecs = Array(); $sql = 'SELECT t.type, ts.value, (SELECT SUM(value) FROM tf_character_techspec_stats WHERE version_id = ts.version_id) AS total FROM tf_techspec_types t, tf_character_techspec_stats ts WHERE t.type_id = ts.type_id AND ts.version_id = '.number($version_id).' AND (SELECT SUM(value) FROM tf_character_techspec_stats WHERE version_id = ts.version_id) > 0 ORDER BY t.type_id ASC'; $res = mysql_query($sql) OR die(mysql_error()); while($row = mysql_fetch_assoc($res)) { $aSpecs[] = $row; $spec_total = $row['total']; } $tech_spec_bio = GetField('bio', 'SELECT bio FROM tf_character_techspecs WHERE version_id = '.number($version_id).' LIMIT 1'); // GET MAIN IMAGE $sImage = ''; $sql = 'SELECT r.gallery_id, r.is_takara, r.is_reissue, r.tstamp, c.version_name AS char_name, c.alt_name AS char_jname, c.url AS version_url, ri.image_name, s.series_id, s.title AS series_title, s.url AS series_url FROM toy_galleries r LEFT JOIN tf_series s ON r.series_id = s.series_id LEFT JOIN toy_gallery_images ri ON ri.gallery_id = r.gallery_id, tf_character_versions c WHERE c.version_id = '.number($version_id).' AND c.version_id = r.version_id AND ri.is_main_image = 1 AND r.is_active = 1 LIMIT 1'; $res = mysql_query($sql) OR die(mysql_error()); $iHowMany = mysql_num_rows($res); if ($iHowMany > 0) { $row = mysql_fetch_assoc($res); extract($row); $char_name = (!isEmpty($is_takara) ? (!isEmpty($char_jname) ? $char_jname : $char_name) : $char_name); $url = '/transformers-toys/gallery/'.$series_url.'/'.$version_url.'/'.$gallery_id.'/'; $series_title = (!isEmpty($is_takara) ? (!isEmpty($alt_title) ? $alt_title : $series_title) : $series_title); if (!isEmpty($image_name) && is_file(STATIC_PATH.'/images/toys/files/'.sprintf('%02s', $series_id).'/r_'.$image_name)) { $imgSize = getimagesize(STATIC_PATH.'/images/toys/files/'.sprintf('%02s', $series_id).'/r_'.$image_name); $sImage = ''.$series_title.' '.$char_name.' gallery'; } } // GET UNIVERSE BIOS $sql = 'SELECT heading, content FROM tf_character_bios WHERE version_id = '.number($version_id).' ORDER BY id ASC'; $res = mysql_query($sql) OR die(mysql_error()); while($row = mysql_fetch_assoc($res)) { extract($row); $aProfile[] = $row; } // GET IMAGES $aImages = Array(); $sql = 'SELECT ci.cat_id, ci.image, c.category, c.directory FROM tf_character_images ci, tf_image_categories c WHERE ci.cat_id = c.cat_id AND ci.version_id = '.number($version_id).' AND ci.image IS NOT NULL AND ci.image <> "" ORDER BY ci.cat_id ASC, ci.sort_order ASC'; $res = mysql_query($sql) OR die(mysql_error()); while($row = mysql_fetch_assoc($res)) { extract($row); $aImages[$directory][] = $image; $aImageCategories[$directory] = $category; } // GET CARTOON APPEARANCES $aCartoonAppearances = Array(); $sql = "SELECT ca.*, c.title, c.episode_id, s.series_id, s.title AS series_title FROM tf_cartoon_appearances ca, tf_cartoons c, tf_series s WHERE ca.version_id = ".number($version_id)." AND ca.cartoon_id = c.cartoon_id AND c.series_id = s.series_id ORDER BY s.lft ASC, c.sort_order ASC"; $res = mysql_query($sql) OR die(mysql_error()); while($row = mysql_fetch_assoc($res)) { $aCartoonAppearances[] = $row; } // GET COMIC BOOK APPEARANCES $aComicAppearances = Array(); $sql = "SELECT c.comic_id, c.issue_id, c.title, c.subtitle, c.series_id, c.publication_date, s.title AS series_title, (SELECT image FROM tf_comic_covers WHERE comic_id = c.comic_id ORDER BY RAND() LIMIT 1) AS image FROM tf_comics c, tf_comic_appearances r, tf_comic_series s WHERE r.version_id = ".number($version_id)." AND r.comic_id = c.comic_id AND c.series_id = s.series_id ORDER BY s.sort_order, c.sort_order ASC"; $res = mysql_query($sql) or die(mysql_error()); while($row = mysql_fetch_assoc($res)) { $aComicAppearances[] = $row; } if ((!isEmptyArray($aSpecs) || !isEmptyArray($aImages['techspecs'])) && !in_array('techspecs', array_keys($aImages))) { $aMenu[] = 'Tech Spec'; } if ((!isEmptyArray($aProfile) || !isEmptyArray($aImages['universe'])) && !in_array('universe', array_keys($aImages))) { $aMenu[] = 'Transformers Universe'; } if (!isEmptyArray($aImages)) { foreach (array_keys($aImages) AS $image_type) { $aMenu[] = ''.UCWords($aImageCategories[$image_type]).''; } } if (!isEmptyArray($aComicAppearances)) { $aMenu[] = 'Comic Appearances'; } if (!isEmptyArray($aCartoonAppearances)) { $aMenu[] = 'Cartoon Appearances'; } $ebay_keywords = ($ebay_keywords.' '.remove_special_characters($ebay_name)); $pagetitle = $version_name.' - '.strip_tags(implode(', ', $aSeries)); $extracss = Array('vsd', 'gallery', 'jquery.lightbox-0.5'); $extrajs = Array('jquery.lightbox-0.5', 'vsd-character-images'); $section_id = 30; DisplayHeader(); ?>