I got Drupal 6.2 installed on my test server for a client and got his phpBB forums integrated with the phpBBforum integration module. Now there's an unnecessary scroll bar on the frame no matter what I do with the scroll settings in the phpbbforum module settings. Is there any way to do away with it and just make the main page scroll as much as needed for phpBB, or at least only be there when really needed?

Comments

digitalhead’s picture

It's been several days since I posted my question and my deadline for this to go live is this weekend. Any suggestions?

Anonymous’s picture

Topic:
http://drupal.org/node/217369

The post by:
metaphysics - April 4, 2008 - 06:48

Post title: CSS Frame Fix

This may help with removing the problem with the scrollbar...

In the CSS find

html {
font-size: 100%;
/* Always show a scrollbar for short pages - stops the jump when the scrollbar appears. non-IE browsers */
height: 100%;
margin-bottom: 1px;
}

and change it to:
html {
font-size: 100%;
/* Always show a scrollbar for short pages - stops the jump when the scrollbar appears. non-IE browsers
height: 100%;
margin-bottom: 1px; */
}

Alternatively, you can just remove the bottom three lines, but this works the same. I don't know if this helps, but great module, and I hope that you can figure out how to do it without these frames soon!

So yeah it looks like it might be an Iframe problem. I don't know the module, but you will have to tweak the settings. I don't know how to set variable height in Iframes (never use them), but I do know you can set a fixed height, but don't know if it will be the solution for a forum with variable height. Hope this helps you on your way a bit.

digitalhead’s picture

Thanks, I got it taken care of by altering the phpbbforum.module by changing the scrollbar settings all to no.

side note: The frame created by phpbbforum automatically resized in my case, which my client has 150 topics listed per page, so yeah, it's a rather long page. It shows up nearly perfectly.

~DH

HanleyDesigns’s picture

I've been looking at removing my scroll bars from my site too, http://cordiafreaks.com/cms/?q=phpbbforum/gallery/hot.php?start=0
As you can see, when it loads up, there are scroll bars within the frame until the frame has completely loaded, and then they dissappear... I think is unnecessary and quite unattractive...

I've looked in the 'phpbbforum.module' code but can't seem to edit it to stop these scrollbars from appearing...
Here's a section of the code that I believe is creating the bars, if someone can edit them for me or even suggest an alternative way, I'd be extremely thankful!

    // Frame
    $form['phpbbforum_page'] = array('#type' => 'fieldset',
      '#title' => t('phpBB page settings'),
      '#collapsible' => TRUE,
      '#collapsed' => FALSE);

    $form['phpbbforum_page']['phpbbforum_page_frame'] = array(
      '#type' => 'radios',
      '#title' => t('phpBB display way'),
      '#default_value' => variable_get("phpbbforum_page_frame", 0),
      //'#options' => array(0 => t('In the window'), 1 => t('In frame inside Drupal page'), 2 => t('In the Drupal page')),
      '#options' => array(0 => t('In the window'), 1 => t('In frame inside Drupal page')),
      '#description' => t("Change the way phpBB is displayed in Drupal.")
    );

    $target = variable_get("phpbbforum_page_frame", 0);
    if ($target == 1) {
      $form['phpbbforum_page']['phpbbforum_page_width'] = array(
        '#type' => 'textfield',
        '#title' => t("phpBB frame width"),
        '#default_value' => variable_get("phpbbforum_page_width", "100%"),
        '#size' => '6',
        '#maxlength' => '6',
        '#description' => t("Set the width of the Frame.")
      );
      $form['phpbbforum_page']['phpbbforum_page_height'] = array(
        '#type' => 'textfield',
        '#title' => t("phpBB frame height"),
        '#default_value' => variable_get("phpbbforum_page_height", "1024"),
        '#size' => '6', '#maxlength' => '6',
        '#description' => t("Set the height of the Frame.")
      );

      $form['phpbbforum_page']['phpbbforum_page_scroll'] = array(
        '#type' => 'radios',
        '#title' => t('Scrolling phpBB frame'),
        '#default_value' => variable_get("phpbbforum_page_scroll", 2),
        '#options' => array(0 => t('No'), 1 => t('Yes'), 2 => t('Auto')),
        '#description' => t("Should scrollbars be displayed if phpBB is too large to fit in the frame.")
      );
    }
  }

  return $form;
}

if (variable_get("phpbbforum_page_frame", 0) == '1' || variable_get("phpbbforum_page_frame", 0) == '2') {

  function _phpbbforum_page_inframe($path) {

    // Added this to allow the iframe to resize dynamically according to the
    // page height. -- Daen
    drupal_add_js(drupal_get_path('module', PHPBB_PAGE) .'/phpbbframe.js', 'module');

    $width = variable_get("phpbbforum_page_width", "100%");
    $height = variable_get("phpbbforum_page_height", "1024");
    $scrolling = variable_get("phpbbforum_page_scroll", 2);

    $output = '<iframe id="forumFrame" src="'. $path .'"'; // name="phpbbforum"';

    if ($width && $height) {
      $output .= ' width="'. $width .'"'.' height="'. $height .'"';
    }
    $output .= ' frameborder="0" framespacing="0"';
    if ($scrolling == 2)
      $output .= ' scrolling="auto"';
    elseif ($scrolling == 1)
      $output .= ' scrolling="yes"';
    else
      $output .= ' scrolling="no"';
    $output .= ' allowtransparency="false"';

    $output .= '><p>'. t('Sorry your browser does not work') .'</p></iframe>';

    return $output;
  }