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: Removing menubar  (Read 6172 times)

0 Members and 1 Guest are viewing this topic.

PavvelB

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Removing menubar
« on: December 09, 2014, 10:04:21 pm »

Hello
I have question, how to remove the menubar which is visible above picture? Marked red in attached screenshot.
Thanks
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Removing menubar
« Reply #1 on: December 09, 2014, 11:14:43 pm »

Copy function theme_display_image (all functions are in theme/sample/theme.php). Check first if the function is not already in your theme.php.

Code: [Select]
/******************************************************************************
** 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
******************************************************************************/

and remove:

Code: [Select]
    starttable();
    echo $nav_menu;
    endtable();

If you want to just remove buttons from the menu (not all the menu) : copy function $template_img_navbar.

Code: [Select]
/******************************************************************************
** Section <<<$template_img_navbar>>> - START
******************************************************************************/
// HTML template for the image navigation bar
$template_img_navbar = <<<EOT

        <tr>
                <td align="center" valign="middle" class="navmenu" width="48"><a href="{THUMB_TGT}" class="navmenu_pic" title="{THUMB_TITLE}"><img src="{LOCATION}images/navbar/thumbnails.png" align="middle" border="0" alt="{THUMB_TITLE}" /></a></td>
<!-- BEGIN pic_info_button -->
                <!-- button will be added by displayimage.js -->
                <td id="pic_info_button" align="center" valign="middle" class="navmenu" width="48"></td>
<!-- END pic_info_button -->
<!-- BEGIN slideshow_button -->
                <!-- button will be added by displayimage.js -->
                <td id="slideshow_button" align="center" valign="middle" class="navmenu" width="48"></td>
<!-- END slideshow_button -->
                <td align="center" valign="middle" class="navmenu" width="100%">{PIC_POS}</td>
<!-- BEGIN report_file_button -->
                <td align="center" valign="middle" class="navmenu" width="48"><a href="{REPORT_TGT}" class="navmenu_pic" title="{REPORT_TITLE}" rel="nofollow"><img src="{LOCATION}images/navbar/report.png" border="0" align="middle" alt="{REPORT_TITLE}" /></a></td>
<!-- END report_file_button -->
<!-- BEGIN ecard_button -->
                <td align="center" valign="middle" class="navmenu" width="48"><a href="{ECARD_TGT}" class="navmenu_pic" title="{ECARD_TITLE}" rel="nofollow"><img src="{LOCATION}images/navbar/ecard.png"  border="0" align="middle" alt="{ECARD_TITLE}" /></a></td>
<!-- END ecard_button -->
<!-- BEGIN nav_start -->
                <td align="center" valign="middle" class="navmenu" width="48"><a href="{START_TGT}" class="navmenu_pic" title="{START_TITLE}"><img src="{LOCATION}images/navbar/{START_IMAGE}" border="0" align="middle" alt="{START_TITLE}" /></a></td>
<!-- END nav_start -->
<!-- BEGIN nav_prev -->
                <td align="center" valign="middle" class="navmenu" width="48"><a href="{PREV_TGT}" class="navmenu_pic" title="{PREV_TITLE}"><img src="{LOCATION}images/navbar/{PREV_IMAGE}" border="0" align="middle" alt="{PREV_TITLE}" /></a></td>
<!-- END nav_prev -->
<!-- BEGIN nav_next -->
                <td align="center" valign="middle" class="navmenu" width="48"><a href="{NEXT_TGT}" class="navmenu_pic" title="{NEXT_TITLE}"><img src="{LOCATION}images/navbar/{NEXT_IMAGE}" border="0" align="middle" alt="{NEXT_TITLE}" /></a></td>
<!-- END nav_next -->
<!-- BEGIN nav_end -->
                <td align="center" valign="middle" class="navmenu" width="48"><a href="{END_TGT}" class="navmenu_pic" title="{END_TITLE}"><img src="{LOCATION}images/navbar/{END_IMAGE}" border="0" align="middle" alt="{END_TITLE}" /></a></td>
<!-- END nav_end -->

        </tr>

EOT;
/******************************************************************************
** Section <<<$template_img_navbar>>> - END
******************************************************************************/

and remove want you don't want. Remember that in this function you can not remove BEGIN and END. You will get an error: Template error Failed to find block <!-- BEGIN...etc. Will break your gallery.

Example: if you want to remove all buttons but keep pic info button:

Code: [Select]
/******************************************************************************
** Section <<<$template_img_navbar>>> - START
******************************************************************************/
// HTML template for the image navigation bar
$template_img_navbar = <<<EOT

        <tr>

<!-- BEGIN pic_info_button -->
                <!-- button will be added by displayimage.js -->
                <td id="pic_info_button" align="center" valign="middle" class="navmenu" width="48"></td>
<!-- END pic_info_button -->
<!-- BEGIN slideshow_button -->
<!-- END slideshow_button -->
<!-- BEGIN report_file_button -->
<!-- END report_file_button -->
<!-- BEGIN ecard_button -->
<!-- END ecard_button -->
<!-- BEGIN nav_start -->
<!-- END nav_start -->
<!-- BEGIN nav_prev -->
<!-- END nav_prev -->
<!-- BEGIN nav_next -->
<!-- END nav_next -->
<!-- BEGIN nav_end -->
<!-- END nav_end -->

        </tr>

EOT;
/******************************************************************************
** Section <<<$template_img_navbar>>> - END
******************************************************************************/
« Last Edit: May 02, 2015, 11:06:35 pm by allvip »
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Removing menubar
« Reply #2 on: December 09, 2014, 11:22:54 pm »

If you remove all the menu, you may like this plugin:

Picture navigation plugin for cpg1.5.x:  http://forum.coppermine-gallery.net/index.php/topic,68456.0.html
Adds go to the prev/next image to the left and right of the image.

Read page 2 reply#29 to #33 if you want to use custom images for the plugin.

This way you can have this: see attachment.

Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Removing menubar
« Reply #3 on: December 09, 2014, 11:52:39 pm »

Related topics:

Responsive filmstrip (filmstrip divs no tables): http://forum.coppermine-gallery.net/index.php/topic,77558.0.html

Replace filmstrip arows with text:  http://forum.coppermine-gallery.net/index.php/topic,76739.0.html

Images to fit screen resolution plugin ( responsive image plugin ) : http://forum.coppermine-gallery.net/index.php/topic,77586.0.html
Logged

PavvelB

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: Removing menubar
« Reply #4 on: December 10, 2014, 08:49:12 pm »

I choose the solution with template_img_navbar, it's working :)
Thanks a lot
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Removing menubar
« Reply #5 on: December 10, 2014, 09:35:04 pm »

You can also move the code:
Example: under the picture.
Move:
Code: [Select]
    starttable();
    echo $nav_menu;
    endtable();


under:

Code: [Select]
    starttable();
    echo $picture;
    endtable();

With css you can float it to the left or right of the picture.
Replace tables with divs.

Same thing for template_img_navbar function.
Logged
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 19 queries.