coppermine-gallery.com/forum

Support => cpg1.5.x Support => cpg1.5 themes (visuals) => Topic started by: Venia on August 30, 2012, 08:30:18 AM

Title: Default URL "hides" ads
Post by: Venia on August 30, 2012, 08:30:18 AM
Hi all,

I need help figuring out how to remove #top_display_media from all my URLs when people click thumbs. The reason is that when people go straight to the image, they basically skip my ad. I found another thread, but cannot find the stated file anywhere and that thread is from 2010. Thanks in advance.
Title: Re: Default URL "hides" ads
Post by: Jeff Bailey on August 30, 2012, 05:33:42 PM
Please post a link.
http://forum.coppermine-gallery.net/index.php/topic,55415.msg270616.html#msg270616

Please post a link to the thread you're referring to.
Title: Re: Default URL "hides" ads
Post by: Venia on August 30, 2012, 06:17:58 PM
Sorry about that. Here's an example: http://www.hungergamesgallery.com/hungergames/displayimage.php?album=2&pid=65#top_display_media
Title: Re: Default URL "hides" ads
Post by: Jeff Bailey on August 31, 2012, 12:26:07 AM
Probably the easiest way to do this, is to add this to your custom themes theme.php right before the closing ?>

/******************************************************************************
** 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 function theme_display_image() already exists in your theme
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
Title: Re: Default URL "hides" ads
Post by: Venia on August 31, 2012, 12:33:51 AM
That worked great, thank you so much!
Title: Re: Default URL "hides" ads
Post by: Jeff Bailey on August 31, 2012, 12:35:29 AM
Glad it worked for you. Please resolve your thread.
http://forum.coppermine-gallery.net/index.php/topic,55415.msg270631.html#msg270631