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: How I can change the separator breadcrumb a picture?  (Read 4673 times)

0 Members and 1 Guest are viewing this topic.

cherokee

  • Coppermine newbie
  • Offline Offline
  • Posts: 13
How I can change the separator breadcrumb a picture?
« on: February 22, 2014, 10:57:11 am »

How I can change the separator breadcrumb a picture?
In includes / function.inc found in this code, but I can not replace the symbol with a picture.
Code: [Select]
//Add Link for album if aid is set
    if (isset($CURRENT_ALBUM_DATA['aid'])) {
        $breadcrumb_links[$cat_order] = "<a href=\"thumbnails.php?album=".$CURRENT_ALBUM_DATA['aid']."\">".$CURRENT_ALBUM_DATA['title']."</a>";
        $BREADCRUMB_TEXTS[$cat_order] = $CURRENT_ALBUM_DATA['title'];
    }
Site tests:http://www.rutasytravesias.com/galeria
Thanks
Regards
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: How I can change the separator breadcrumb a picture?
« Reply #1 on: February 27, 2014, 02:57:38 pm »

The code for breadcumb is in theme.php not in include (all coppermine function are in themes/sample/theme.php.If you want to edit something find the right function in the sample theme,paste it in your theme and edit it)

This is the function theme_breadcrumb for breadcumb:

Code: [Select]
/******************************************************************************
** Section <<<theme_breadcrumb>>> - START
******************************************************************************/
// Function for building the breadcrumb
// Inputs:  $breadcrumb_links, $BREADCRUMB_TEXTS
// Outputs: $breadcrumb, $BREADCRUMB_TEXT
function theme_breadcrumb($breadcrumb_links, $BREADCRUMB_TEXTS, &$breadcrumb, &$BREADCRUMB_TEXT)
{
    $breadcrumb = '';
    $BREADCRUMB_TEXT = '';
    foreach ($breadcrumb_links as $breadcrumb_link) {
        $breadcrumb .= ' > ' . $breadcrumb_link;
    }
    foreach ($BREADCRUMB_TEXTS as $BREADCRUMB_TEXT_elt) {
        $BREADCRUMB_TEXT .= ' > ' . $BREADCRUMB_TEXT_elt;
    }
    // We remove the first ' > '
    $breadcrumb = substr_replace($breadcrumb,'', 0, 3);
    $BREADCRUMB_TEXT = substr_replace($BREADCRUMB_TEXT,'', 0, 3);
}
/******************************************************************************
** Section <<<theme_breadcrumb>>> - END
******************************************************************************/


or this code for function breadcumb made by Andre that changes the breadcumb structure:

 http://forum.coppermine-gallery.net/index.php/topic,76955.0.html
« Last Edit: February 28, 2014, 01:01:53 pm by allvip »
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: How I can change the separator breadcrumb a picture?
« Reply #2 on: February 27, 2014, 03:23:14 pm »

How to edit function breadcumb:

the line $breadcrumb .= ' > ' . $breadcrumb_link; has the > that shows in the breadcumb

 $BREADCRUMB_TEXT .= ' > ' . $BREADCRUMB_TEXT_elt; has the > that shows up in the browser tab

 $breadcrumb = substr_replace($breadcrumb,'', 0, 3); is to hide > that shows before the word Home (3 is the number of characters to hide. ' > ' has 3 characters.)


I REMOVED ALL MY POSTS with code because Andre posted the right way to do this.
I only let this post for users that need to understand the code.

« Last Edit: February 28, 2014, 01:02:26 pm by allvip »
Logged

cherokee

  • Coppermine newbie
  • Offline Offline
  • Posts: 13
Re: How I can change the separator breadcrumb a picture?
« Reply #3 on: February 27, 2014, 06:49:54 pm »

hello.
Thanks for your interest. I will make the changes.
regards
Logged

cherokee

  • Coppermine newbie
  • Offline Offline
  • Posts: 13
Re: How I can change the separator breadcrumb a picture?
« Reply #4 on: February 27, 2014, 06:52:19 pm »

Sorry.
We were writing about the same time.
I'll try the change you propose.
Thank you again.
Sorry for my english
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: How I can change the separator breadcrumb a picture?
« Reply #5 on: February 28, 2014, 12:22:02 pm »

I suggest to store the image's HTML code in a variable like
Code: [Select]
$separator = '<img src="themes/panzajoteros/images/navbit-arrow-right.png"/>';and then use
Code: [Select]
strlen($separator)to let PHP count the number of characters for you.

Note that allvip's code still contains some custom modifications, so it's maybe not exactly what you're looking for. That's why I suggest to add this code to your theme's theme.php file:
Code: [Select]
/******************************************************************************
** Section <<<theme_breadcrumb>>> - START
******************************************************************************/
// Function for building the breadcrumb
// Inputs:  $breadcrumb_links, $BREADCRUMB_TEXTS
// Outputs: $breadcrumb, $BREADCRUMB_TEXT
function theme_breadcrumb($breadcrumb_links, $BREADCRUMB_TEXTS, &$breadcrumb, &$BREADCRUMB_TEXT)
{
    $breadcrumb = '';
    $BREADCRUMB_TEXT = '';
    $separator = '<img src="themes/panzajoteros/images/navbit-arrow-right.png" />';
    foreach ($breadcrumb_links as $breadcrumb_link) {
        $breadcrumb .= $separator . $breadcrumb_link;
    }
    foreach ($BREADCRUMB_TEXTS as $BREADCRUMB_TEXT_elt) {
        $BREADCRUMB_TEXT .= $separator . $BREADCRUMB_TEXT_elt;
    }
    // We remove the first $separator
    $breadcrumb = substr_replace($breadcrumb,'', 0, strlen($separator));
    $BREADCRUMB_TEXT = substr_replace($BREADCRUMB_TEXT,'', 0, strlen($separator));
}
/******************************************************************************
** Section <<<theme_breadcrumb>>> - END
******************************************************************************/
Logged
Pages: [1]   Go Up
 

Page created in 0.021 seconds with 20 queries.