forum.coppermine-gallery.net

No Support => Feature requests => Topic started by: Chickenkicker on February 10, 2005, 02:37:47 pm

Title: Future mods to coppermine (custom admin settable menu )link
Post by: Chickenkicker on February 10, 2005, 02:37:47 pm
It would be nice if you featured a url link so that when doing configuration of the gallery, you could enter the url back to your homepage for the website the gallery is installed on.. I know this is a minor edit, but for some this is a rough task, if it were included and appeared on the cfg screen, that would be, easy, practical and time saving.. Just a thought!

Thanks
Title: Re: Future mods to coppermine
Post by: Casper on February 10, 2005, 02:52:17 pm
Good idea,

I think I'll look into making this.
Title: Re: Future mods to coppermine (custom admin settable menu )link
Post by: Casper on February 10, 2005, 03:53:45 pm
OK, here's a mod to easily add a custom link into the gallery main menu, by setting it in config.
Whilst it would probably still be easier just to hard code it in the theme.php than applying as a mod, this may well be put in the next version.

Open your lang.php (english.php shown here).

Find;

Code: [Select]
array('Allow ZIP-download of favorites', 'enable_zipdownload', 1),
Add after, in new line;
Code: [Select]
  array('Custom menu link name', 'custom_lnk_name', 0),
  array('Custom menu link URL', 'custom_lnk_url', 0),

 
 
Open sql/update.sql.

Add, at the end;

Code: [Select]
INSERT INTO CPG_config VALUES ('custom_lnk_name', '');
INSERT INTO CPG_config VALUES ('custom_lnk_url', '');

Note, DO NOT change the above, regardless of your table prefixes, this will work correctly.



Open your theme.php.

Find;

Code: [Select]
<span class="topmenu">
Add, in new line immediately after (shown here for classic, other formatting may be required for other themes);

Code: [Select]
<!-- BEGIN custom_link -->
<a href="{CUSTOM_LNK_TGT}" title="{CUSTOM_LNK_TITLE}">{CUSTOM_LNK_LNK}</a> ::
<!-- END custom_link -->


Find;

 
Code: [Select]
$my_gallery_id = FIRST_USER_CAT + USER_ID;
Add, immediately after;


Code: [Select]
if (!$CONFIG['custom_lnk_url'] != '') {
        template_extract_block($template_main_menu, 'custom_link');
    }



Find;

Code: [Select]
'{ALB_LIST_LNK}' => $lang_main_menu['alb_list_lnk'],

Add, in new line, immediately after;

Code: [Select]
'{CUSTOM_LNK_TGT}' => $CONFIG['custom_lnk_url'],
'{CUSTOM_LNK_TITLE}' => $CONFIG['custom_lnk_name'],
'{CUSTOM_LNK_LNK}' => $CONFIG['custom_lnk_name'],
      
      
      
Save all the above files, and upload them to the server, in the relevent folders.

Run update.php, by browsing to your gallery/update.php.
Then go into config, and fill in the details of the link name and url.