Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Hardwired Theme autoscrolls down when logged in  (Read 2972 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: 15759
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: 15759
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.018 seconds with 20 queries.