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: Show all album names in a menu on top under admin menu  (Read 4143 times)

0 Members and 1 Guest are viewing this topic.

gorav

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Show all album names in a menu on top under admin menu
« on: September 09, 2010, 08:38:21 am »

Hi,

I would like to show names of all the albums in a menu on top under admin menu and add links. Please help me with this.

Thanks in advance.

Link to my gallery - http://www.milleniumceramics.com/gallery/

Regards
Gorav
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Show all album names in a menu on top under admin menu
« Reply #1 on: September 09, 2010, 08:54:42 am »

I can already see all albums ??? Not sure what you're asking for.
Logged

gorav

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: Show all album names in a menu on top under admin menu
« Reply #2 on: September 09, 2010, 09:29:57 am »

Hi,

Thanks for such quick reply.

The albums are showing correctly on the home page. I want to show names of all the albums in a menu bar under the 'Admin Menu'. For eg. The Admin Menu shows - Home, Login, Album List, Search. Similarly, below this bar, I want to add another bar which will show names of all the albums and the visitor can click on any album name directly to jump to that album while navigating through the site. In my case, it should show - Kitchens, Master Bathroom, Bathroom - Kids... (names of all the albums).

Sorry for not being clear in the first place.

Regards
Gorav
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Show all album names in a menu on top under admin menu
« Reply #3 on: September 09, 2010, 09:56:40 am »

In your case I would suggest to edit your template.html file and add some simple html links.
Logged

gorav

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: Show all album names in a menu on top under admin menu
« Reply #4 on: September 09, 2010, 10:05:35 am »

Hi,

I can do that as of now but the albums will keep adding and it may not be feasible to keep adding html links. Is it possible to dynamically add the links and it will automatically keep getting updated.

Regards
Gorav
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Show all album names in a menu on top under admin menu
« Reply #5 on: September 09, 2010, 10:55:13 am »

Add this function to your theme.php file:
Code: [Select]
function pageheader($section, $meta = '')
{
    global $CONFIG, $THEME_DIR;
    global $template_header, $lang_charset, $lang_text_dir;

    $custom_header = cpg_get_custom_include($CONFIG['custom_header_path']);

    $charset = ($CONFIG['charset'] == 'language file') ? $lang_charset : $CONFIG['charset'];

    header('P3P: CP="CAO DSP COR CURa ADMa DEVa OUR IND PHY ONL UNI COM NAV INT DEM PRE"');
    header("Content-Type: text/html; charset=$charset");
    user_save_profile();

    $album_list = "<br /><br />";
    $result = cpg_db_query("SELECT aid, title FROM {$CONFIG['TABLE_ALBUMS']}");
    while ($row = mysql_fetch_assoc($result)) {
        $album_list .= " <a href=\"thumbnails.php?album={$row['aid']}\">{$row['title']}</a>";
    }

    $template_vars = array(
        '{LANG_DIR}' => $lang_text_dir,
        '{TITLE}' => theme_page_title($section),
        '{CHARSET}' => $charset,
        '{META}' => $meta,
        '{GAL_NAME}' => $CONFIG['gallery_name'],
        '{GAL_DESCRIPTION}' => $CONFIG['gallery_description'],
        '{SYS_MENU}' => theme_main_menu('sys_menu'),
        '{SUB_MENU}' => theme_main_menu('sub_menu'),
        '{ADMIN_MENU}' => theme_admin_mode_menu().$album_list,
        '{CUSTOM_HEADER}' => $custom_header,
        '{JAVASCRIPT}' => theme_javascript_head(),
        '{MESSAGE_BLOCK}' => theme_display_message_block(),
    );
   
    $template_vars = CPGPluginAPI::filter('theme_pageheader_params', $template_vars);
    echo template_eval($template_header, $template_vars);

    // Show various admin messages
    adminmessages();
}
Logged

gorav

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: Show all album names in a menu on top under admin menu
« Reply #6 on: September 09, 2010, 11:42:24 am »

Hi,

Thank you for you prompt replies and working solution.

Being little greedy, is it possible to customize the look and feel in terms of color and font size of this new menu alone?

Regards
Gorav
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Show all album names in a menu on top under admin menu
« Reply #7 on: September 09, 2010, 11:55:41 am »

Adjust this line to your needs:
Code: [Select]
$album_list .= " <a href=\"thumbnails.php?album={$row['aid']}\">{$row['title']}</a>";
Logged

gorav

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: Show all album names in a menu on top under admin menu
« Reply #8 on: September 09, 2010, 12:27:21 pm »

Thanks a ton!!
Logged

gorav

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: Show all album names in a menu on top under admin menu
« Reply #9 on: September 09, 2010, 12:30:14 pm »

How do I resolve this thread?
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Logged
Pages: [1]   Go Up
 

Page created in 0.02 seconds with 20 queries.