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: Hide Login of my theme  (Read 3827 times)

0 Members and 1 Guest are viewing this topic.

KchoPrro

  • 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">
{ADMIN_MENU}
{MESSAGE_BLOCK}
{GALLERY}

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

I imagine that this theme inherits functions from themes.inc.php. 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}
    // {HREF_LNK}{HREF_TITLE}{HREF_TGT}{BLOCK_ID}{SPACER}{HREF_ATTRIBUTES}
    addbutton($sys_menu_buttons,'{HOME_LNK}','{HOME_TITLE}','{HOME_TGT}','home',$template_sys_menu_spacer);
    addbutton($sys_menu_buttons,'{CONTACT_LNK}','{CONTACT_TITLE}','{CONTACT_TGT}','contact',$template_sys_menu_spacer);
    addbutton($sys_menu_buttons,'{MY_GAL_LNK}','{MY_GAL_TITLE}','{MY_GAL_TGT}','my_gallery',$template_sys_menu_spacer);
    addbutton($sys_menu_buttons,'{MEMBERLIST_LNK}','{MEMBERLIST_TITLE}','{MEMBERLIST_TGT}','allow_memberlist',$template_sys_menu_spacer);
    if (array_key_exists('allowed_albums', $USER_DATA) && is_array($USER_DATA['allowed_albums']) && count($USER_DATA['allowed_albums'])) {
      addbutton($sys_menu_buttons,'{UPL_APP_LNK}','{UPL_APP_TITLE}','{UPL_APP_TGT}','upload_approval',$template_sys_menu_spacer);
    }
    addbutton($sys_menu_buttons,'{MY_PROF_LNK}','{MY_PROF_TITLE}','{MY_PROF_TGT}','my_profile',$template_sys_menu_spacer);
    addbutton($sys_menu_buttons,'{ADM_MODE_LNK}','{ADM_MODE_TITLE}','{ADM_MODE_TGT}','enter_admin_mode',$template_sys_menu_spacer);
    addbutton($sys_menu_buttons,'{USR_MODE_LNK}','{USR_MODE_TITLE}','{USR_MODE_TGT}','leave_admin_mode',$template_sys_menu_spacer);
    addbutton($sys_menu_buttons,'{SIDEBAR_LNK}','{SIDEBAR_TITLE}','{SIDEBAR_TGT}','sidebar',$template_sys_menu_spacer);
    addbutton($sys_menu_buttons,'{UPL_PIC_LNK}','{UPL_PIC_TITLE}','{UPL_PIC_TGT}','upload_pic',$template_sys_menu_spacer);
    addbutton($sys_menu_buttons,'{REGISTER_LNK}','{REGISTER_TITLE}','{REGISTER_TGT}','register',$template_sys_menu_spacer);
    //addbutton($sys_menu_buttons,'{LOGIN_LNK}','{LOGIN_TITLE}','{LOGIN_TGT}','login','');
    addbutton($sys_menu_buttons,'{LOGOUT_LNK}','{LOGOUT_TITLE}','{LOGOUT_TGT}','logout','');
    // 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?  :-\
Logged

KchoPrro

  • 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 :)
Logged
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 20 queries.