Advanced search  

News:

cpg1.5.46 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter recently discovered vulnerabilities. It is important that all users who run version cpg1.5.44 or older update to this latest version as soon as possible.
[more]

Pages: [1] 2   Go Down

Author Topic: How do I remove a button from the menu?  (Read 62371 times)

0 Members and 1 Guest are viewing this topic.

aibonlengket

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
How do I remove a button from the menu?
« on: December 17, 2005, 12:46:18 pm »

I hope I got the right place to ask this.

I have mambo 4.5.2.3 with cpg 1.4.2 integrated beautifully. I have it wraped in mambo. What I want to do is to erase the login/logout including the link in the cpg. It's in the {SYS_MENU} I think, if we are refering to the template. I did a hack in the /lang/english.php on line 128-131 to ignore it. It work, but when I log in there's a name of the user that have a link to take you to logut. because I have it wrapped in mambo, the frame takes you directly to the home page mambo; but still wrapped in the main mambo. can anybody help me please...
« Last Edit: January 07, 2006, 02:20:53 am by Casper »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Re: HELP PLEASE on erasing LOGIN/LOGOUT
« Reply #1 on: December 19, 2005, 08:08:37 am »

to edit a menu (or anything else), take a look at themes/sample/theme.php, find the menu section, copy it over to the theme you're actually using (themes/yourtheme/theme.php). Then edit the menu accordingly (comment the login link out, don't remove it). Another option would be to add a target attribute to the <a href> tag.
Logged

aibonlengket

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: HELP PLEASE on erasing LOGIN/LOGOUT
« Reply #2 on: December 20, 2005, 05:16:53 am »

Thanks GuGu. I got it to work. here's what I did. I copy everything in the /sample/theme.php to my theme /blackbirch/theme.php. edit the  /blackbirch/theme.php

from
   addbutton($sys_menu_buttons,'{LOGIN_LNK}','{LOGIN_TITLE}','{LOGIN_TGT}','login','');
   addbutton($sys_menu_buttons,'{LOGOUT_LNK}','{LOGOUT_TITLE}','{LOGOUT_TGT}','logout','');

to
 addbutton($sys_menu_buttons,'','{LOGIN_TITLE}','{LOGIN_TGT}','login','');
 addbutton($sys_menu_buttons,'','{LOGOUT_TITLE}','{LOGOUT_TGT}','logout','');

is this what you ment by comment it out? and another thing is do you have to copy everything from the /sample/theme.php? because I saw on the other theme.php they just copy what was need. I tried to do that but I failed. I guess I don't understand what needed and whats not. can you give me a clue? Thanks for the fast reply.

oh one more thing. where do you put the <a href> tag? in the theme.php and replace {LOGIN_LNK}?
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Re: HELP PLEASE on erasing LOGIN/LOGOUT
« Reply #3 on: December 20, 2005, 09:00:14 am »

you comment out stuff in php by putting two slashes in front of the code. To get rid of the login link, find
Code: [Select]
addbutton($sys_menu_buttons,'{LOGIN_LNK}','{LOGIN_TITLE}','{LOGIN_TGT}','login','');and replace with
Code: [Select]
// addbutton($sys_menu_buttons,'{LOGIN_LNK}','{LOGIN_TITLE}','{LOGIN_TGT}','login','');You're not meant to copy everything from the sample theme, but only the stuff you want changed.
« Last Edit: December 23, 2005, 11:37:50 am by GauGau »
Logged

tgontz

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 38
How do I remove the Login button from the menu?
« Reply #4 on: December 21, 2005, 08:53:32 pm »

How do I remove the Login button from the menu? I have tried commenting it out, but depending on how I do the commenting out, my gallery will will either not load at all or I get the following error in Internet Explorer:

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

I was successfully able to comment out some of the other menu items, but not the Login.

My gallery is located at is http://www.gontzphotography.com/gallery/index.php

I am using a custom theme I named classic_paypal and copied and pasted the menu code from the sample theme.

Thanks in advance!
Logged

artistsinhawaii

  • VIP
  • Coppermine addict
  • ***
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 856
    • evj art and photography
Re: How do I remove the Login button from the menu?
« Reply #5 on: December 21, 2005, 09:08:38 pm »

comment out what is BETWEEN the BEGIN and END markers.. do not comment out the markers themselves.

Quote
<!-- BEGIN login -->

// (.*?)        <!-- comment out what is here between the two markers -->

<!-- END login -->)


Dennis
Logged
Learn and live ... In January of 2011, after a botched stent attempt, the doctors told me I needed a multiple bypass surgery or I could die.  I told them I needed new doctors.

tgontz

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 38
Re: How do I remove the Login button from the menu?
« Reply #6 on: December 21, 2005, 09:52:16 pm »

I am using 1.4.2 and do not have the markers. Am I looking in the wrong place?

This is what I have:

// HTML template for template sys_menu buttons
    // {HREF_LNK}{HREF_TITLE}{HREF_TGT}{BLOCK_ID}{SPACER}
   
    addbutton($sys_menu_buttons,'{HOME_LNK}','{HOME_TITLE}','{HOME_TGT}','home',$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);
    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,'{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,'{FAQ_LNK}','{FAQ_TITLE}','{FAQ_TGT}','faq',$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.
Logged

artistsinhawaii

  • VIP
  • Coppermine addict
  • ***
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 856
    • evj art and photography
Re: How do I remove the Login button from the menu?
« Reply #7 on: December 21, 2005, 10:16:31 pm »

OOps, sorry, I always do it using the old menu layout.
Don't know if this will work, but try blocking out the login/logout options and add

<!-- BEGIN login -->
<!-- END login -->)
 

just above     // Login and Logout don't have a spacer as only one is shown, and either would be the last option.

Dennis
Logged
Learn and live ... In January of 2011, after a botched stent attempt, the doctors told me I needed a multiple bypass surgery or I could die.  I told them I needed new doctors.

tgontz

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 38
Re: How do I remove the Login button from the menu?
« Reply #8 on: December 21, 2005, 11:43:14 pm »

I got it now. I simply put // in front of the addbutton($sys_menu_buttons,'{LOGIN_LNK}','{LOGIN_TITLE}','{LOGIN_TGT}','login','');

(Which I thought that I tried before and it wasn't working - I must have also been doing something else different!)

Also, by the way, when I tried to use any html comment tags <!-- --> my gallery would not load at all. I would just get a blank white browser window.

Thanks for the suggestions!
Logged

tgontz

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 38
Re: How do I remove the Login button from the menu?
« Reply #9 on: December 22, 2005, 02:42:11 pm »

Well I thought that I had this issue resolved. However, I just went to log in to my gallery and I got the following error:

Template error
Failed to find block 'login'(#(<!-- BEGIN login -->)(.*?)(<!-- END login -->)#s) in :
            <!-- BEGIN home -->
        <a href="{HOME_TGT}" title="{HOME_TITLE}">Gallery Home</a> ::
  <!-- END home -->  <!-- 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 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 faq -->
        <a href="{FAQ_TGT}" title="{FAQ_TITLE}">{FAQ_LNK}</a> ::
  <!-- END faq -->  <!-- BEGIN logout -->
        <a href="{LOGOUT_TGT}" title="{LOGOUT_TITLE}">{LOGOUT_LNK}</a>
  <!-- END logout -->







This is what my theme.php file looks like:



<?php
/*************************
  Coppermine Photo Gallery
  ************************
  Copyright (c) 2003-2005 Coppermine Dev Team
  v1.1 originaly written by Gregory DEMAR

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.
  ********************************************
  Coppermine version: 1.4.2
  $Source: /cvsroot/coppermine/devel/themes/classic/theme.php,v $
  $Revision: 1.71 $
  $Author: gaugau $
  $Date: 2005/10/25 01:16:24 $
**********************************************/

// ------------------------------------------------------------------------- //
// This theme has all CORE items removed                                     //
// ------------------------------------------------------------------------- //
define('THEME_IS_XHTML10_TRANSITIONAL',1);

// Creates an array of tokens to be used with function assemble_template_buttons
// this function is used in this file it needs to be declared before being called.
function addbutton(&$menu,$href_lnk,$href_title,$href_tgt,$block_id,$spacer) {
  $menu[]=array($href_lnk,$href_title,$href_tgt,$block_id,$spacer);
}


// HTML template for sys_menu
$template_sys_menu = <<<EOT
          {BUTTONS}
EOT;

// HTML template for sub_menu
$template_sub_menu = $template_sys_menu;


  // HTML template for template sys_menu spacer
  $template_sys_menu_spacer ="::";

  // HTML template for template sys_menu buttons
  $template_sys_menu_button = <<<EOT
  <!-- BEGIN {BLOCK_ID} -->
        <a href="{HREF_TGT}" title="{HREF_TITLE}">{HREF_LNK}</a> {SPACER}
  <!-- END {BLOCK_ID} -->
EOT;

  // HTML template for template sys_menu buttons
    // {HREF_LNK}{HREF_TITLE}{HREF_TGT}{BLOCK_ID}{SPACER}

   
    addbutton($sys_menu_buttons,'Gallery Home','{HOME_TITLE}','{HOME_TGT}','home',$template_sys_menu_spacer);
    //addbutton($sys_menu_buttons,'{HOME_LNK}','{HOME_TITLE}','{HOME_TGT}','home',$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);
    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,'{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,'{FAQ_LNK}','{FAQ_TITLE}','{FAQ_TGT}','faq',$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.




  // HTML template for template sub_menu spacer
  $template_sub_menu_spacer = $template_sys_menu_spacer;

  // HTML template for template sub_menu buttons
  $template_sub_menu_button= $template_sys_menu_button;

  // HTML template for template sub_menu buttons
    // {HREF_LNK}{HREF_TITLE}{HREF_TGT}{BLOCK_ID}{SPACER}
    addbutton($sub_menu_buttons,'{CUSTOM_LNK_LNK}','{CUSTOM_LNK_TITLE}','{CUSTOM_LNK_TGT}','custom_link',$template_sub_menu_spacer);
    addbutton($sub_menu_buttons,'Album View','{ALB_LIST_TITLE}','{ALB_LIST_TGT}','album_list',$template_sub_menu_spacer);
    //addbutton($sub_menu_buttons,'{ALB_LIST_LNK}','{ALB_LIST_TITLE}','{ALB_LIST_TGT}','album_list',$template_sub_menu_spacer);
/* //Commented out by Trevor
    addbutton($sub_menu_buttons,'{LASTUP_LNK}','{LASTUP_TITLE}','{LASTUP_TGT}','lastup',$template_sub_menu_spacer);
    addbutton($sub_menu_buttons,'{LASTCOM_LNK}','{LASTCOM_TITLE}','{LASTCOM_TGT}','lastcom',$template_sub_menu_spacer);
    addbutton($sub_menu_buttons,'{TOPN_LNK}','{TOPN_TITLE}','{TOPN_TGT}','topn',$template_sub_menu_spacer);
    addbutton($sub_menu_buttons,'{TOPRATED_LNK}','{TOPRATED_TITLE}','{TOPRATED_TGT}','toprated',$template_sub_menu_spacer);
    addbutton($sub_menu_buttons,'{FAV_LNK}','{FAV_TITLE}','{FAV_TGT}','favpics',$template_sub_menu_spacer);
*/

    addbutton($sub_menu_buttons,'{SEARCH_LNK}','{SEARCH_TITLE}','{SEARCH_TGT}','search','');
?>



Any suggestions?
Logged

donnoman

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1615
  • From donovanbray.com
    • Donovan Bray
Re: How do I remove the Login button from the menu?
« Reply #10 on: December 22, 2005, 08:59:14 pm »

re-enable the items in sys_menu so we don't get template errors; we will strip the login and home links with a plugin
Code: [Select]
   addbutton($sys_menu_buttons,'{HOME_LNK}','{HOME_TITLE}','{HOME_TGT}','home',$template_sys_menu_spacer);

   addbutton($sys_menu_buttons,'{LOGIN_LNK}','{LOGIN_TITLE}','{LOGIN_TGT}','login','');


To remove the spacer after the FAQ link edit your buttons and replace the spacer variable.
Code: [Select]
    addbutton($sys_menu_buttons,'{REGISTER_LNK}','{REGISTER_TITLE}','{REGISTER_TGT}','register',$template_sys_menu_spacer);
    addbutton($sys_menu_buttons,'{FAQ_LNK}','{FAQ_TITLE}','{FAQ_TGT}','faq','');
    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.

Upload and enable the final_extract plugin.

final_extract codebase.php
Code: [Select]
$thisplugin->add_filter('page_html','final_extract_page_html');

function final_extract_block(&$template, $block_name, $subst='')
{
        $pattern = "#(<!-- BEGIN $block_name -->)(.*?)(<!-- END $block_name -->)#s";
        if ( preg_match($pattern, $template, $matches)){
            $template = str_replace($matches[1].$matches[2].$matches[3], $subst, $template);
            return $matches[2];
        }
}

function final_extract_page_html($html)
{   
    //repeat the next line for each block you would like removed
    final_extract_block($html, 'login');
    final_extract_block($html, 'home');
return $html;
}
Logged

tgontz

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 38
Re: How do I remove the Login button from the menu?
« Reply #11 on: December 23, 2005, 04:22:14 pm »

I'm not sure exactly what I am supposed to do with the final_extract.zip file. I extracted the this file so that codebase.php and configuration.php are in a final named final_extract on my desktop. I then searched the forum on to install a plugin. I found the following:

"Navigate to the pluginmgr.php page, click browse, locate the plugin you downloaded on your PC and click upload. Once the plugin has beploaded, click on the (i) icon to install it. Follow any setup instructions provided by the plugin's installer."

So I tried this for each file, but I get an error message saying, "The file uploaded is not a plugin package. "

I then tried to upload the zip file and I recieved the following error:"There was an error copying the package to the plugins folder."


What exactly am I to do with the information you posted?

Thank you!
Logged

donnoman

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1615
  • From donovanbray.com
    • Donovan Bray
Re: How do I remove the Login button from the menu?
« Reply #12 on: December 23, 2005, 07:13:37 pm »

just use regular ftp to upload the final_extract folder to the plugins folder.
Logged

aibonlengket

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: How do I remove the Login button from the menu?
« Reply #13 on: December 25, 2005, 12:54:01 am »

thaks man it work like a charm. now I dont have to hack the template
Logged

tgontz

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 38
Re: How do I remove the Login button from the menu?
« Reply #14 on: December 27, 2005, 03:33:14 am »

donnoman,

I want to thank you as well! The plugin works great!
Logged

donnoman

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1615
  • From donovanbray.com
    • Donovan Bray
Re: How do I remove the Login button from the menu?
« Reply #15 on: December 28, 2005, 07:37:41 am »

awesome a twofer!
Logged

Linea

  • Coppermine newbie
  • Offline Offline
  • Posts: 17
Re: How do I remove the Login button from the menu?
« Reply #16 on: January 02, 2006, 12:01:26 am »

I don't want to remove the Login button, but the button "toprated" or "last commented" for example. This should work te same way, shouldn't it? So I copied the section

if (!defined('THEME_HAS_NO_SUB_MENU_BUTTONS')) {

  // HTML template for template sub_menu spacer
  $template_sub_menu_spacer = $template_sys_menu_spacer;

  // HTML template for template sub_menu buttons
  $template_sub_menu_button= $template_sys_menu_button;

  // HTML template for template sub_menu buttons
    // {HREF_LNK}{HREF_TITLE}{HREF_TGT}{BLOCK_ID}{SPACER}
    addbutton($sub_menu_buttons,'{CUSTOM_LNK_LNK}','{CUSTOM_LNK_TITLE}','{CUSTOM_LNK_TGT}','custom_link',$template_sub_menu_spacer);
    addbutton($sub_menu_buttons,'{ALB_LIST_LNK}','{ALB_LIST_TITLE}','{ALB_LIST_TGT}','album_list',$template_sub_menu_spacer);
    //addbutton($sub_menu_buttons,'{LASTUP_LNK}','{LASTUP_TITLE}','{LASTUP_TGT}','lastup',$template_sub_menu_spacer);
    //addbutton($sub_menu_buttons,'{LASTCOM_LNK}','{LASTCOM_TITLE}','{LASTCOM_TGT}','lastcom',$template_sub_menu_spacer);
    addbutton($sub_menu_buttons,'{TOPN_LNK}','{TOPN_TITLE}','{TOPN_TGT}','topn',$template_sub_menu_spacer);
    addbutton($sub_menu_buttons,'{TOPRATED_LNK}','{TOPRATED_TITLE}','{TOPRATED_TGT}','toprated',$template_sub_menu_spacer);
    addbutton($sub_menu_buttons,'{FAV_LNK}','{FAV_TITLE}','{FAV_TGT}','favpics',$template_sub_menu_spacer);
    addbutton($sub_menu_buttons,'{SEARCH_LNK}','{SEARCH_TITLE}','{SEARCH_TGT}','search','');

  $params = array('{BUTTONS}' => assemble_template_buttons($template_sub_menu_button,$sub_menu_buttons));
  $template_sub_menu = template_eval($template_sub_menu,$params);
}

into my theme.php, but I get the following error: Fatal error: Call to undefined function: addbutton() in /var/www/vhosts/lalapanzi.de/httpdocs/fotogalerie/themes/galopprennen/theme.php on line 38

Undefined function? I just copied it from .../sample/theme.php. What's wrong with it?
Logged

TranzNDance

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Female
  • Posts: 6148
    • Take Thu! Gallery
Re: How do I remove the Login button from the menu?
« Reply #17 on: January 02, 2006, 12:08:30 am »

It means you need to copy the function over, too.

Code: [Select]
// Creates an array of tokens to be used with function assemble_template_buttons
// this function is used in this file it needs to be declared before being called.
function addbutton(&$menu,$href_lnk,$href_title,$href_tgt,$block_id,$spacer) {
  $menu[]=array($href_lnk,$href_title,$href_tgt,$block_id,$spacer);
}
Logged

TranzNDance

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Female
  • Posts: 6148
    • Take Thu! Gallery
Re: How do I remove the Login button from the menu?
« Reply #18 on: January 02, 2006, 12:10:37 am »

You also needed to copy over this function:
Code: [Select]
// Creates buttons from a template using an array of tokens
// this function is used in this file it needs to be declared before being called.
function assemble_template_buttons($template_buttons,$buttons) {
    $counter=0;
    $output='';

    foreach ($buttons as $button)  {
      if (isset($button[4])) {
         $spacer=$button[4];
      } else {
      $spacer='';
      }

        $params = array(
            '{SPACER}'     => $spacer,
            '{BLOCK_ID}'   => $button[3],
            '{HREF_TGT}'   => $button[2],
            '{HREF_TITLE}' => $button[1],
            '{HREF_LNK}'   => $button[0]
            );
        $output.=template_eval($template_buttons, $params);
    }
    return $output;
}
Logged

Linea

  • Coppermine newbie
  • Offline Offline
  • Posts: 17
Re: How do I remove the Login button from the menu?
« Reply #19 on: January 02, 2006, 11:48:46 am »

Hey TranzNDance, thank you very much for your answer! Everything is a bit complicated in a foreign language. But this support forum is much better than the german one, so I try to find the solution here. :-) I understand what you say...before using "addbutton" I have to define it. OK! I will try after having finished work today.
Logged
Pages: [1] 2   Go Up
 

Page created in 0.025 seconds with 20 queries.