Advanced search  


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.

Pages: [1]   Go Down

Author Topic: Hide Login of my theme  (Read 2487 times)

0 Members and 1 Guest are viewing this topic.


  • Coppermine frequent poster
  • ***
  • Country: es
  • Offline Offline
  • Gender: Male
  • Posts: 296
    • Adolfo Ventas - Naturaleza Andaluza
Hide Login of my theme
« on: October 12, 2022, 01:46:44 pm »

Hello friends. In my previous topic; Chaoticsoul had the login button hidden from the sidebar menu. My website is personal, there is no logic for guests to have a Login button (I used directly gallery/login.php).

In my new theme this part of the sidebar menu has this code;

Code: [Select]
<div id="content" class="site-content">
<div id="primary" class="content-area">
<div id="main" class="site-main">

I don't want to hide the whole "admin_menu".

I imagine that this theme inherits functions from I have hidden this part of the code and I have managed to prevent the Login button from appearing in the menu:

Code: [Select]
  // HTML template for template sys_menu buttons
  if (!isset($sys_menu_buttons)) { //{THEMES}
    if (array_key_exists('allowed_albums', $USER_DATA) && is_array($USER_DATA['allowed_albums']) && count($USER_DATA['allowed_albums'])) {
    // Login and Logout don't have a spacer as only one is shown, and either would be the last option.

The problem arrives when entering (login), it gives an error. Therefore, this is not the way:

Code: [Select]
Template error
Failed to find block 'login' (#<!-- BEGIN login -->(.*?)<!-- END login -->#s) in :

            <!-- BEGIN home -->
        <a href="{HOME_TGT}" title="{HOME_TITLE}" >{HOME_LNK}</a>
  <!-- END home -->  <!-- BEGIN contact -->
        <a href="{CONTACT_TGT}" title="{CONTACT_TITLE}" >{CONTACT_LNK}</a>
  <!-- END contact -->  <!-- BEGIN my_gallery -->
        <a href="{MY_GAL_TGT}" title="{MY_GAL_TITLE}" >{MY_GAL_LNK}</a>
  <!-- END my_gallery -->  <!-- BEGIN allow_memberlist -->
        <a href="{MEMBERLIST_TGT}" title="{MEMBERLIST_TITLE}" >{MEMBERLIST_LNK}</a>
  <!-- END allow_memberlist -->  <!-- BEGIN my_profile -->
        <a href="{MY_PROF_TGT}" title="{MY_PROF_TITLE}" >{MY_PROF_LNK}</a>
  <!-- END my_profile -->  <!-- BEGIN enter_admin_mode -->
        <a href="{ADM_MODE_TGT}" title="{ADM_MODE_TITLE}" >{ADM_MODE_LNK}</a>
  <!-- END enter_admin_mode -->  <!-- BEGIN leave_admin_mode -->
        <a href="{USR_MODE_TGT}" title="{USR_MODE_TITLE}" >{USR_MODE_LNK}</a>
  <!-- END leave_admin_mode -->  <!-- BEGIN sidebar -->
        <a href="{SIDEBAR_TGT}" title="{SIDEBAR_TITLE}" >{SIDEBAR_LNK}</a>
  <!-- END sidebar -->  <!-- BEGIN upload_pic -->
        <a href="{UPL_PIC_TGT}" title="{UPL_PIC_TITLE}" >{UPL_PIC_LNK}</a>
  <!-- END upload_pic -->  <!-- BEGIN register -->
        <a href="{REGISTER_TGT}" title="{REGISTER_TITLE}" >{REGISTER_LNK}</a>
  <!-- END register -->  <!-- BEGIN logout -->
        <a href="{LOGOUT_TGT}" title="{LOGOUT_TITLE}" >{LOGOUT_LNK}</a>
  <!-- END logout -->

I've checked the theme styling but it affects the whole menu section and I can't hide just the login button.

The code that generates my page is this, but I don't know what file it is in:

Code: [Select]
<!--  BEGIN login -->
<a href="login.php?referer=index.php%3Fmessage_id%3D2eb5ecc84e963cd4ecaaca42d340b462%26message_icon%3Dinfo" title="Validarse en el sistema - para usuarios registrados">Entrar</a>
<!--  END login -->

Any suggestion?  :-\


  • Coppermine frequent poster
  • ***
  • Country: es
  • Offline Offline
  • Gender: Male
  • Posts: 296
    • Adolfo Ventas - Naturaleza Andaluza
Re: Hide Login of my theme
« Reply #1 on: October 18, 2022, 08:36:08 pm »

The solution was quite simple, I did not know that there was a plugin that did exactly what I was looking for, hide the Login for guests;

Updated form CPG 1.5.x version (original thread)

Problem solved :)
Pages: [1]   Go Up

Page created in 0.016 seconds with 19 queries.