Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Movie Details - Image on tooltip


Recommended Posts

Hi all... Need a hand with some if esle stuff please. I have installed the movie details contribution found here:



The author is not around or doesn't care to assist, so I am stuck with a couple of things... The base contribution allows for showing an image when you mouse over a director or actor name in the product info page. What it doesnt account for is if there is no image for said actor or director... Original code for this particular item is below. Can anyone help me with the code to show nothing if no image is in the db?


$actor_query = tep_db_query("select mp.people_id, mp.actor, mp.picture from " . TABLE_MOVIES_PEOPLE . " mp natural join " . TABLE_MOVIES_INFO . " mi where mi.people_id = mp.people_id and mi.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and mp.actor != '' order by mi.movies_info_id");
if (tep_db_num_rows($actor_query) > 0){
$coma = 1;
while ($actor = tep_db_fetch_array($actor_query)){
	echo '<a href="' . tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, 'people=' . $actor['people_id']) . '" onMouseOver="showWMTT('. $actor['people_id'] .')" onMouseOut="hideWMTT()" alt="' . TEXT_SEE_ALL_MOVIES . $actor['actor'] . '" title="' . TEXT_SEE_ALL_MOVIES . $actor['actor'] . '">' . $actor['actor'] . '</a>' . (($coma < tep_db_num_rows($actor_query)) ? ', ' : '');
	echo '<div class="tooltip" id="'.$actor['people_id'].'"><img src="' . DIR_WS_IMAGES . $actor['picture'] . '" /></div>';


My next issue is in trying to take the same code and use it as in the manufacturers box so that a drop down list is generated that links over to the advanced search results page as in the original contribution.... Again, could use a helping hand here as this is what I have, but it comes up short (wont direct to advanced serahc with a good result and wont quite display properly - leaves some blank lines in between actor names for some reaso - which i think is a result of the directors listings being tied in to the people id....


$actor_query = tep_db_query("select people_id, actor from " . TABLE_MOVIES_PEOPLE . " order by people_id");
 if ($number_of_rows = tep_db_num_rows($actor_query)) {


// Display a drop-down
     $actor_array = array();
     if (tep_db_num_rows($actor_query) < 2){
       $actor_array[] = array('id' => '', 'text' => 'Browse By Actor');

     while ($actor = tep_db_fetch_array($actor_query)) {
       $actor = ((strlen($actor['actor']) > MAX_DISPLAY_MANUFACTURER_NAME_LEN) ? substr($actor['actor'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '..' : $actor['actor']);
       $actor_array[] = array('id' => $actor['actor'],
                                      'text' => $actor);

     $info_box_contents = array();
     $info_box_contents[] = array('form' => tep_draw_form('actor', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, 'people=' . $actor['people_id']), 'get'),
                                  'text' => tep_draw_pull_down_menu('actor', $actor_array, (isset($HTTP_GET_VARS['actor']) ? $HTTP_GET_VARS['actor'] : ''), 'onChange="this.form.submit();" size="' . MAX_MANUFACTURERS_LIST . '" style="width: 95%"') . tep_hide_session_id());

   new infoBox($info_box_contents);

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...