Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Hardwired Theme autoscrolls down when logged in  (Read 4646 times)

0 Members and 1 Guest are viewing this topic.

skiahh

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Hardwired Theme autoscrolls down when logged in
« on: August 16, 2010, 05:25:47 pm »

Hi folks -

My gallery is at www.teamnavycycling.org/photos and works fine when not logged in.  When you log in, however, it scrolls you down to the welcome message and below, hiding all the tools you logged in for unless you scroll up.  My new, non-tech users are asking where their controls are once they log in!

At the end of the login string in the title bar is "message_icon=info#cpgMessageBlock" which I think is the offending section.  Is there a way to have the page just stay at the top once logged in? 

Thank you.

Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Hardwired Theme autoscrolls down when logged in
« Reply #1 on: September 01, 2010, 04:42:25 pm »

Just remove the anchor
Code: [Select]
<a name="cpgMessageBlock"></a>
Logged

skiahh

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: Hardwired Theme autoscrolls down when logged in
« Reply #2 on: September 02, 2010, 04:34:19 am »

Just remove the anchor
Code: [Select]
<a name="cpgMessageBlock"></a>

OK, thanks.  Can you tell me where to find that anchor, please?
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Hardwired Theme autoscrolls down when logged in
« Reply #3 on: September 02, 2010, 08:36:48 am »

Search in the theme.php file of your theme. If you don't find it there, copy this to your theme.php:
Code: [Select]
function theme_display_message_block() {
    global $lang_gallery_admin_menu, $lang_common, $CONFIG, $message_id;

    $superCage = Inspekt::makeSuperCage();
    $return = '';
    $message_id = '';
    $message_icon = '';
    $message_style = '';

    if ($superCage->get->keyExists('message_id')) {
      $message_id = $superCage->get->getEscaped('message_id');
    }

    if ($superCage->get->keyExists('message_icon')) {
        $message_icon = $superCage->get->getAlpha('message_icon');
    }

    if ($message_icon == 'error') {
        $message_style = 'cpg_message_error';
    } elseif ($message_icon == 'warning') {
        $message_style = 'cpg_message_warning';
    } elseif ($message_icon == 'validation') {
        $message_style = 'cpg_message_validation';
    } elseif ($message_icon == 'success') {
        $message_style = 'cpg_message_success';
    } else {
        $message_style = 'cpg_message_info';
    }

    if ($message_id != '') {
        $tempMessage = cpgFetchTempMessage($message_id);
        if ($tempMessage != '') {
            //$return .= '<a name="cpgMessageBlock"></a>';
            $return .= <<< EOT
            <div id="cpgMessage" class="cpg_user_message {$message_style}">
              {$tempMessage}
            </div>
EOT;
        }
    }
    if (GALLERY_ADMIN_MODE) {
        cpgCleanTempMessage(); // garbage collection: when the admin is logged in, old messages that failed to display for whatever reason are being removed to keep the temp_messages table clean
        $return .= cpg_alert_dev_version();
        // $return .= cpg_display_rss(); //add RSS feed from coppermine-gallery.net later
    } else { // not in admin mode
        //$return = '';
    }
    return $return;
}
Logged

skiahh

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: Hardwired Theme autoscrolls down when logged in
« Reply #4 on: September 02, 2010, 05:07:40 pm »

Awesome, thanks!
Logged
Pages: [1]   Go Up
 

Page created in 0.021 seconds with 19 queries.