Custom Link Custom Link
 

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

Main Menu

Custom Link

Started by jonners99, May 22, 2006, 04:14:30 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jonners99

Ok I am making my own template and basically cleared all of the rubbish out of the file. This however included the custom link and now it doesn't work because of this bit of code which is doing nothing anyway. I have put it back in and it still doesn't work. Can someone tell me the place where it checks whether this code is present?

Nibbler

No clearing of the file is required, you can start with a blank theme.php and add in the bits you want to change. The only code that'll complain about a missing custom link is here in theme_main_menu()


    if (!$CONFIG['custom_lnk_url']) {
        template_extract_block($template_sub_menu, 'custom_link');
    }

docgonzo

Is there any way to move the custom link?
Now, it sits before the rest of the CPG links, if I enable it.
I'd like to choose my own place for it...

Sami

it's depend on your theme , look on your theme.php and check if "define('THEME_HAS_NO_SUB_MENU_BUTTONS')" is there or not
if you have it then you can change the "$template_sub_menu" variable and if it's not defined then you should add this
    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','');
to your theme.php and change the oredr of
addbutton($sub_menu_buttons,'{CUSTOM_LNK_LNK}','{CUSTOM_LNK_TITLE}','{CUSTOM_LNK_TGT}','custom_link',$template_sub_menu_spacer);
to fit for your self
‍I don't answer to PM with support question
Please post your issue to related board

docgonzo


<?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.1
  $Source:
  $Revision: 1.10 $
  $Author:
  $Date: 2005/04/30 07:13:16 $
**********************************************/

define('THEME_HAS_RATING_GRAPHICS'1);
define('THEME_IS_XHTML10_TRANSITIONAL',1); // Remove this if you edit this template until
                                           // you have validated it. See docs/theme.htm.


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

?>


Haven't got a clue where i should begin with this...
I'm running a slightly modded BlackBirch.
But i see this in a lot of themes, that the theme.php is almost empty...

OT : weird, now edit/modifying posts works? is there a time-out or something on edit-ability?

Sami

#5
You can add that code before ?>
after $template_sys_menu_spacer ='::';

Update: please use this code instead of that:


// 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;
 

    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,'{CUSTOM_LNK_LNK}','{CUSTOM_LNK_TITLE}','{CUSTOM_LNK_TGT}','custom_link',$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','');
‍I don't answer to PM with support question
Please post your issue to related board

docgonzo

I replaced the code with yours, but then :
Fatal error: Call to undefined function: addbutton() in /home/websites/docgonzo/galleries.docgonzo.com/themes/blackbirch/theme.php on line 32
happened  :o

Sami

oops my bad ;)
you can find addbutton() function by searching on sample/theme.php
it's realy simple and small function
please add it before // HTML template for template sub_menu spacer
  $template_sub_menu_spacer = $template_sys_menu_spacer;
‍I don't answer to PM with support question
Please post your issue to related board