Support » Plugins » BCT Light , Simple Question ??

  • Helloo

    i’m done and satisfied with BCT Light !

    code :

    <?php
    /*
    Plugin Name: Bread Crumb Trail Generator (Light Only)
    Version: 1.0 Alpha 1
    Plugin URI: http://jp.jixor.com/archives/2005/01/01/bread-crumb-trail-light/
    Author: Stephen Ingram
    Author URI: http://jp.jixor.com/
    Description: Generate a bread crumb trail. The light version is basically a preview version. The full has a lot more functionality and error handeling, it will be released soon. However this version should sufice in most situations, and generally you should not encounter any problems when using it. To use execute jp_bctl(). Options are ‘root’, ‘caption’, ‘divider’ and ‘wrapper’ (all optional). ‘root’ sets the site root, defaults to ‘/’ (top level of URI). ‘caption’ sets the preceding caption, defaults to “You’re Browsing”. ‘divider’ is inserted after every link, defaults to ‘ / ‘. ‘wrapper’ is used to style each crumb, defaults to ‘%link%’. ‘%link%’ Is replaced with a crumb, you may for example style wrapper to ‘

  • %link%
  • ‘ to make the bct into a list (Of course in this case youll want to set the caption and divider to null.).
    */

    if (!function_exists(‘jp_bctl’)) {

    function jp_bctl($root=’/’, $caption=’أنت الآن تتصÙ?Ø­ : ‘, $divider=’ » ‘, $wrapper=’%link%’) {

    $elements = explode(‘/’,substr($_SERVER[‘REQUEST_URI’],strlen($root)));

    $output = $caption.str_replace(‘%link%’,’الرئيسية‘.$divider,$wrapper);

    // The last element is empty becuse WP always has a trailing /, so don’t process the last element.
    $counter = count($elements);

    for ($i=0; $i<$counter; $i++)
    {

    $link = $elements[$i];
    $linktext = ucfirst($link);

    if ($i == ($counter-1)) {

    //$crumb = str_replace(‘%link%’,$linktext,$wrapper);
    $crumb = ”;
    // empty providing trailing / present.
    // This will be fixed in next ver.

    } else {

    $linkurl = $linkurl . “/” . $link;
    $crumb = str_replace(‘%link%’,’‘.$linktext.’‘.$divider,$wrapper);

    }

    $output .= $crumb;

    }

    echo $output . “\n”;

    return;

    }

    }
    ?>

    It shows Home > Diectory

    How could I add the Category also?

    regards

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘BCT Light , Simple Question ??’ is closed to new replies.