Future mods to coppermine (custom admin settable menu )link Future mods to coppermine (custom admin settable menu )link
 

News:

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.
[more]

Main Menu

Future mods to coppermine (custom admin settable menu )link

Started by Chickenkicker, February 10, 2005, 02:37:47 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Chickenkicker

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

Casper

Good idea,

I think I'll look into making this.
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

Casper

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;

array('Allow ZIP-download of favorites', 'enable_zipdownload', 1),

Add after, in new line;

  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;

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;

<span class="topmenu">

Add, in new line immediately after (shown here for classic, other formatting may be required for other themes);

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



Find;

$my_gallery_id = FIRST_USER_CAT + USER_ID;

Add, immediately after;


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




Find;

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


Add, in new line, immediately after;

'{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.

It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here