Change breadcrumb for albumlist with current album highlighted Change breadcrumb for albumlist with current album highlighted
 

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

Change breadcrumb for albumlist with current album highlighted

Started by frans01, September 30, 2005, 05:04:22 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

frans01

Does anybody know how I can replace the breadcrumbs with an albumlist and highlight the current album?
I don't use categories and want to be able to navigate directly to an other album wherever I am. I only use album names and don't use the thumbnails with the albums.

I did find the following code but I know this isn't where I shouls actualy change it:

From theme.php

Breadcrumb:

<!-- BEGIN breadcrumb -->
        <tr>
                <td colspan="3" align="center" class="tableh1"><span class="statlink"><b>{BREADCRUMB}</b></span></td>
        </tr>
<!-- END breadcrumb -->


Albums:

<!-- BEGIN album_cell -->

        <td width="{COL_WIDTH}%" height="100%" align="center" valign="top">
   <a href="{ALB_LINK_TGT}" class="alblink"><b>{ALBUM_TITLE}</b></a> {ADMIN_MENU}
        </td>

<!-- END album_cell -->


Can anybody help me out plz?  ;D ;D  ;D  I'm working on this for days....  :-\\ :-\\


Stramm

theme.php
function theme_display_breadcrumb

here you start...

frans01

Ok, thank you

But still I don't know what to change here or how to...

Can you please give me some more pointers?


function theme_display_breadcrumb($breadcrumb, &$cat_data)
{
    /**
     * ** added breadcrumb as a seperate element
     */
    global $template_breadcrumb, $lang_breadcrumb;

    starttable('100%');
    if ($breadcrumb) {
        $template = template_extract_block($template_breadcrumb, 'breadcrumb');
        $params = array('{BREADCRUMB}' => $breadcrumb
            );
        echo template_eval($template, $params);
    }
    endtable();
}

Stramm

just do some try and fail.. eg. replace this

    if ($breadcrumb) {
        $template = template_extract_block($template_breadcrumb, 'breadcrumb');
        $params = array('{BREADCRUMB}' => $breadcrumb
            );
        echo template_eval($template, $params);
    }

with that and check the changes

    if ($breadcrumb) {
echo "Album 1&nbsp;&nbsp;-&nbsp;&nbsp;Album 2&nbsp;&nbsp;-&nbsp;&nbsp;Album 3<br>";
echo "No I just need to code eg. a dropdown box with a list of all my albums";
    }


frans01

So when I want to make it dynamicly I have to find and put the code of the album list in it.

Stramm

yes, you have to put code in here that generates what you want to display

frans01

I've tryed lots of diffrent things bunt can't find the solution. I'm not really familiar with php.

I tryed to change theme_display_breadcrumb function with theme_display_album_list function but that gave some errors.


function theme_display_album_list(&$alb_list, $nbAlb, $cat, $page, $total_pages)
{
    global $CONFIG, $STATS_IN_ALB_LIST, $statistics, $template_tab_display, $template_album_list, $lang_album_list;

    $theme_alb_list_tab_tmpl = $template_tab_display;

    $theme_alb_list_tab_tmpl['left_text'] = strtr($theme_alb_list_tab_tmpl['left_text'], array('{LEFT_TEXT}' => $lang_album_list['album_on_page']));
    $theme_alb_list_tab_tmpl['inactive_tab'] = strtr($theme_alb_list_tab_tmpl['inactive_tab'], array('{LINK}' => 'index.php?cat=' . $cat . '&page=%d'));

    $tabs = create_tabs($nbAlb, $page, $total_pages, $theme_alb_list_tab_tmpl);

    $album_cell = template_extract_block($template_album_list, 'album_cell');
    $empty_cell = template_extract_block($template_album_list, 'empty_cell');
    $tabs_row = template_extract_block($template_album_list, 'tabs');
    $stat_row = template_extract_block($template_album_list, 'stat_row');
    $spacer = template_extract_block($template_album_list, 'spacer');
    $header = template_extract_block($template_album_list, 'header');
    $footer = template_extract_block($template_album_list, 'footer');
    $rows_separator = template_extract_block($template_album_list, 'row_separator');

    $count = 0;

    $columns = $CONFIG['album_list_cols'];
    $column_width = ceil(100 / $columns);
    $thumb_cell_width = $CONFIG['alb_list_thumb_size'] + 2;

    starttable('100%');

    if ($STATS_IN_ALB_LIST) {
        $params = array('{STATISTICS}' => $statistics,
            '{COLUMNS}' => $columns,
            );
        echo template_eval($stat_row, $params);
    }

    echo $header;
    if (is_array($alb_list)) {
        foreach($alb_list as $album) {
                $count ++;

                $params = array('{COL_WIDTH}' => $column_width,
                '{ALBUM_TITLE}' => $album['album_title'],
                '{THUMB_CELL_WIDTH}' => $thumb_cell_width,
                '{ALB_LINK_TGT}' => "thumbnails.php?album={$album['aid']}",
                '{ALB_LINK_PIC}' => $album['thumb_pic'],
                '{ADMIN_MENU}' => $album['album_adm_menu'],
                '{ALB_DESC}' => $album['album_desc'],
                '{ALB_INFOS}' => $album['album_info'],
                );

                echo template_eval($album_cell, $params);

                if ($count % $columns == 0 && $count < count($alb_list)) {
                echo $rows_separator;
                }
        }
    }

    $params = array('{COL_WIDTH}' => $column_width);
    $empty_cell = template_eval($empty_cell, $params);

    while ($count++ % $columns != 0) {
        echo $empty_cell;
    }

    echo $footer;
    // Tab display
    $params = array('{COLUMNS}' => $columns,
        '{TABS}' => $tabs,
        );
    echo template_eval($tabs_row, $params);

    endtable();

    echo $spacer;
}




Can someone help me out plz!!!