Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Sign in to follow this  
MarthaD

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:

http://www.oscommerce.com/community/contributions,4202/

 

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){
echo TEXT_ACTOR;
$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>';
	$coma++;

 

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....

 

<?php
$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)) {
?>

<tr>
<td><?php


// 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);
?>
</td>
</tr>

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×