coppermine-gallery.com/forum

Support => cpg1.5.x Support => cpg1.5 miscellaneous => Topic started by: CanuckHQ on September 28, 2012, 02:37:48 AM

Title: Coppermine Skips Header
Post by: CanuckHQ on September 28, 2012, 02:37:48 AM
Hello everyone. This is my first post here on the forums. I have a question about Coppermine's action of skipping the header and focusing on the image being displayed. This behavoir also happens when logging out of Coppermine in that the top of the page is not visible. You have to scroll up to see the top of the page.

My question is, does anyone have any idea how to stop this default behavior of skipping over the header and displaying the middle of the page? My viewers have to scroll up to see the top of the page.

Thanks!
Title: Re: Coppermine Skips Header
Post by: Jeff Bailey on September 28, 2012, 04:22:12 AM
Please remember to read the board rules.
http://forum.coppermine-gallery.net/index.php?index.php/topic,55415.0.html

The answer to your problem: http://forum.coppermine-gallery.net/index.php/topic,66581.msg332381.html#msg332381
Title: Re: Coppermine Skips Header
Post by: ΑndrĂ© on September 28, 2012, 10:12:36 AM
Quote from: CanuckHQ on September 28, 2012, 02:37:48 AM
This behavoir also happens when logging out of Coppermine
Copy the function theme_display_message_block from themes/sample/theme.php to your theme's theme.php file if it doesn't exist. Then, find
$return .= '<a name="cpgMessageBlock"></a>';
and remove it completely.
Title: Re: Coppermine Skips Header
Post by: CanuckHQ on September 28, 2012, 03:54:23 PM
Thanks Jeff and Andre. Both of your suggestions are essentially the same and both work great to resolve my login/logout issue. Now if could just figure out how to stop the same thing from happening when someone clicks on a thumbnail that would be great.

Here are the details of my installation since I failed to post it in the orginal post:
Coppermine version: 1.5.18 (stable)
Theme: Curve
PHP version: 5.3.14
MySQL version: 5.5.25-cll
Apache version: 2.2.22

Gallery URL: http://www.canuckhq.ca
Title: Re: Coppermine Skips Header
Post by: Jeff Bailey on September 28, 2012, 09:16:36 PM
If the function theme_display_image() doesn't already exist in your custom theme, paste this in theme.php

/******************************************************************************
** Section <<<theme_display_image>>> - START
******************************************************************************/
function theme_display_image($nav_menu, $picture, $votes, $pic_info, $comments, $film_strip)
{
    global $CONFIG, $LINEBREAK;

    $superCage = Inspekt::makeSuperCage();

    $width = $CONFIG['picture_table_width'];

    //echo '<a name="top_display_media"></a>'; // set the navbar-anchor
    starttable();
    echo $nav_menu;
    endtable();

    starttable();
    echo $picture;
    endtable();
    if ($CONFIG['display_film_strip'] == 1) {
        echo $film_strip;
    }


    echo $votes;

    $picinfo = $superCage->cookie->keyExists('picinfo') ? $superCage->cookie->getAlpha('picinfo') : ($CONFIG['display_pic_info'] ? 'block' : 'none');
    echo $LINEBREAK . '<div id="picinfo" style="display: '.$picinfo.';">' . $LINEBREAK;
    starttable();
    echo $pic_info;
    endtable();
    echo '</div>' . $LINEBREAK;

    echo '<a name="comments_top"></a>';
    echo '<div id="comments">' . $LINEBREAK;
        echo $comments;
        echo '</div>' . $LINEBREAK;

}
/******************************************************************************
** Section <<<theme_display_image>>> - END
******************************************************************************/


if it does exist
Find
    echo '<a name="top_display_media"></a>'; // set the navbar-anchor
Replace with
    //echo '<a name="top_display_media"></a>'; // set the navbar-anchor

You page shows a 500 error for me. But, if
Quote from: CanuckHQ on September 28, 2012, 03:54:23 PM
Coppermine version: 1.5.18 (stable)
is correct you need to upgrade.
http://forum.coppermine-gallery.net/index.php/topic,74682.0.html
Title: Re: Coppermine Skips Header
Post by: CanuckHQ on September 28, 2012, 10:41:43 PM
Hi Jeff, Thanks for the info. Your suggestion worked perfectly! I now have my gallery working to my preferences.
I was getting the 500 error eariler today also. Now sure whats up with that but the site is working fine now.

I am a little aprehensive about upgrading the gallery to version 1.5.20 since I have made changes to some of the php files and would hate to loose all those changes. Not to mention all the time I have invested in tracking down solutions some of the problems I encountered with plugins.

Thanks for providing such a great gallery!
Title: Re: Coppermine Skips Header
Post by: Jeff Bailey on September 28, 2012, 10:46:30 PM
Sorry but if you you don't upgrade, we can't support you any longer and you run the risk of being hacked and losing all your changes anyway.