Show all album names in a menu on top under admin menu Show all album names in a menu on top under admin menu
 

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

Show all album names in a menu on top under admin menu

Started by gorav, September 09, 2010, 08:38:21 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

gorav

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

Αndré

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

gorav

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

Αndré

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

gorav

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

Αndré

Add this function to your theme.php file:
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();
}

gorav

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

Αndré

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


gorav