Topic: Editing index.php master file (JS help) / Images stretching

Hey guys,

Really loving SimpleViewer Pro and svManager (this is my first experience with it).  I have a client where I'm putting in 60+ galleries in their portfolio on their Drupal website (beta mode right now).

I'm using the latest version of both as I just purchased them yesterday (10/19/2010) but the trouble I'm having is this:

1) The Drupal drop-down menus are hiding behind the first few iFrame embedded SV galleries I've made (see example here: http://www.jhlconstructors.net/drupal/r … featured).  Now, after doing some research on here, I know that I need to insert params.wmode = "transparent"; somewhere in the index.php master file (located here: /svmanager/plugins/simpleviewer2/sv2master/index.php).  Since I do not know JavaScript, I need to know where I put this line in the index.php file. 

Here is the index.php code I currently have:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" >
    <?php
      /* Leave this block of php code intact if customizing this page */
      error_reporting(0);
      $preferences = file_get_contents('preferences.txt');
      $preferences = unserialize($preferences);
      $title = htmlspecialchars($preferences['htmlTitle'], ENT_QUOTES, 'UTF-8');
      $galleryWidth = isset($preferences['galleryWidth']) ? "'".$preferences['galleryWidth']."'" : "'100%'";
      $galleryHeight = isset($preferences['galleryHeight']) ? "'".$preferences['galleryHeight']."'" : "'100%'";
      $useFlash = isset($preferences['useFlash']) ? strtolower($preferences['useFlash']) : 'true';
      $backgroundColor = isset($preferences['backgroundColor']) ? $preferences['backgroundColor'] : '0x222222';
      $backgroundColor = "'".ltrim(str_replace('0x', '', $backgroundColor), '#')."'";
    ?>
    <title><?php print $title; ?></title>
  </head>
  <body>
    <!--START SIMPLEVIEWER EMBED -->
    <script type="text/javascript" src="svcore/js/simpleviewer.js"></script>
    <script type="text/javascript">
      $(document).ready(function () {
        SV.simpleviewer.load(
          'sv-container',
          <?php print $galleryWidth ?>,
          <?php print $galleryHeight ?>,
          <?php print $backgroundColor; ?>,
          <?php print $useFlash ?>);
      });
    </script>
    <div id="sv-container"></div>
    <!--END SIMPLEVIEWER EMBED -->
  </body>
</html>

2) In addition to the issue I have above, I am having an issue with "tall" photos not working right (see example here: http://www.jhlconstructors.net/drupal/r … s-featured and view the 2nd and 4th thumbnails).  Most of the photos I have are of the dimension 600x300 but the client has a few where they are reversed: 300x600.  Is there a way to just make it fit in the 600x300 image window I have there?  This would mean that it wouldn't stretch or anything like that for tall photos.  I would just want it to appear smaller to where the tall photos would appear at 150x300 (no stretching).

Thanks in advance for your help!  cool

-Wes

Re: Editing index.php master file (JS help) / Images stretching

I was able to fix #2 above by setting optionName = "optionValue" in the settings.ini file and setting Image scaling to "SCALE_UP".

#1 is still a mystery to me - any JavaScript gurus out there that know where to put the transparent variable in the index.php file?

Re: Editing index.php master file (JS help) / Images stretching

Use this as the content of the <body>:

<!--START SIMPLEVIEWER EMBED -->
<script type="text/javascript" src="svcore/js/simpleviewer.js"></script>
<script type="text/javascript">
var params = {};
params.wmode = "transparent";
  $(document).ready(function () {
    SV.simpleviewer.load(
      'sv-container',
      <?php print $galleryWidth ?>,
      <?php print $galleryHeight ?>,
      <?php print $backgroundColor; ?>,
      <?php print $useFlash ?>, null, params);
  });
</script>
<div id="sv-container"></div>
<!--END SIMPLEVIEWER EMBED -->
Steven Speirs
SimpleViewer Support Team.

Re: Editing index.php master file (JS help) / Images stretching

Hi Steven,

Thanks so much for the reply.  Unfortunately, that didn't work.  I made the change to the index.php file, created a brand new gallery, and then put that gallery in the iFrame of the Drupal page - same result: the flash is hiding the menu.

Here's the URL of the Drupal page showing the new gallery I just made:
http://www.jhlconstructors.net/drupal/r … s-featured

Here's the URL of the SV2 gallery:
http://www.jhlconstructors.net/svmanager/g7/

Here's the source code it now spits out - does everything look right to you there?

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" >
        <title>Testing Pro Gallery 4</title>
  </head>
  <body>
<!--START SIMPLEVIEWER EMBED -->
<script type="text/javascript" src="svcore/js/simpleviewer.js"></script>
<script type="text/javascript">
var params = {};
params.wmode = "transparent";
  $(document).ready(function () {
    SV.simpleviewer.load(
      'sv-container',
      '100%',
      '100%',
      'FFFFFF',
      true), null, params;
  });

</script>
<div id="sv-container"></div>
<!--END SIMPLEVIEWER EMBED -->
  </body>
</html>

I did notice that the params.wmode = "transparent"; is now included in the code...is there a typo by chance in any of the code above?

-Wes

Re: Editing index.php master file (JS help) / Images stretching

Sorry.
There was a ')' in the wrong place.  I've amended the code in my previous post.

Steven Speirs
SimpleViewer Support Team.

Re: Editing index.php master file (JS help) / Images stretching

That fixed it!  Thanks Steven.  Your help is really, really appreciated.  You guys have an awesome product!