<?php 

$title = ""; $link = FUSION_SELF.$aidlink;

if(FUSION_SELF != "index.php" && !preg_match("#\/infusions#Uis", $_SERVER['SCRIPT_NAME'])) {
    $fusion_self = str_replace(" ", "_", strtolower(substr(FUSION_SELF, 0, strrpos(FUSION_SELF, "."))));
    
    if(isset($_GET['action']) && $_GET['action'] == "edit" || 
       isset($_GET['edit']) && $fusion_self == "administrators" ||
       isset($_GET['page']) && $_GET['page'] == "2" && $fusion_self == "bbcodes" ||
       isset($_GET['error_id']) && $fusion_self == "errors" ||
       isset($_GET['rank_id']) && $fusion_self == "forum_ranks" ||
       isset($_GET['view']) && $fusion_self == "images" ||
       isset($_GET['step']) && $_GET['step'] == "edit" && $fusion_self == "members" ||
       isset($_GET['panel_id']) && $fusion_self == "panel_editor" ||
       isset($_GET['action']) && $_GET['action'] == 2 && $fusion_self == "submissions" ||
       isset($_GET['enable']) && $fusion_self == "user_fields") 
    {
        if($fusion_self == "faq" || $fusion_self == "forums") {
            if(isset($_GET['t']) && $_GET['t'] == "cat") {
                $title = array($locale['ac_'.$fusion_self], $locale['ac_'.$fusion_self.'_02']);    
            } else {
                $title = array($locale['ac_'.$fusion_self], $locale['ac_'.$fusion_self.'_03']);
            }            
        } elseif ($fusion_self == "photos" && isset($_GET['album_id'])) {
            $title = array($locale['ac_'.$fusion_self.'_03'], $locale['ac_'.$fusion_self.'_02']);
        } else {
            $title = array($locale['ac_'.$fusion_self], $locale['ac_'.$fusion_self.'_02']);    
        }                        
        if($fusion_self == "comments") {
            $link  = array(FUSION_SELF.$aidlink."&amp;ctype=".$_GET['ctype']."&amp;cid=".$_GET['cid'], FUSION_SELF.$aidlink);    
        } elseif ($fusion_self == "panel_editor") {
            $link  = array(ADMIN."panels.php".$aidlink, ADMIN."panels.php".$aidlink);
        } elseif ($fusion_self == "photos") {
            $link  = array(ADMIN."photoalbums.php".$aidlink, FUSION_SELF.$aidlink);             
        } else {
            $link  = array(FUSION_SELF.$aidlink, FUSION_SELF.$aidlink);    
        }                    
    } elseif ($fusion_self == "photos") {
        if(isset($_GET['album_id'])) {
            $title = array($locale['ac_'.$fusion_self.'_03'], $locale['ac_'.$fusion_self.'_01']);
            $link  = array(ADMIN."photoalbums.php".$aidlink, FUSION_SELF.$aidlink);
        }    
    } elseif ($fusion_self == "phpinfo" && isset($_GET['page']) && isnum($_GET['page'])) {
        $title = $locale['ac_'.$fusion_self."_01_".$_GET['page']];            
    } elseif ($fusion_self == "members") {
        $title = $locale['ac_'.$fusion_self."_01"];                     
        
        if(isset($_GET['step']) && $_GET['step'] == "add") {
            $title = array($locale['ac_'.$fusion_self], $locale['ac_'.$fusion_self.'_03']); 
            $link  = array(FUSION_SELF.$aidlink, FUSION_SELF.$aidlink);   
        } elseif (isset($_GET['action']) && $_GET['action'] == 3) {
            $title = array($locale['ac_'.$fusion_self], $locale['ac_'.$fusion_self.'_04']);
            $link  = array(FUSION_SELF.$aidlink, FUSION_SELF.$aidlink);            
        } elseif (isset($_GET['status']) && isnum($_GET['status']) && $_GET['status'] != 0) {
            $title = $locale['ac_'.$fusion_self."_07"].$locale['ac_members_06'].$locale['ac_members_08_'.$_GET['status']];                                    
        }        
        if (isset($_GET['sortby']) && $_GET['sortby'] != "all") {
            $title .= $locale['ac_members_08'].$_GET['sortby'];            
        }                                                            
    } else {
        if(preg_match("#settings_#Uis", $fusion_self)) {
            $title = $locale['ac_'.$fusion_self];    
        } else {
            $title = $locale['ac_'.$fusion_self."_01"];   
        }        
    }
            
    if(is_array($title)) {
        $breadcrumb_titles = ($title); 
        $breadcrumb_links = ($link);   
    } else {
        $breadcrumb_titles = (array($title));
        $breadcrumb_links = (array($link));
    }        
} elseif (preg_match("#\/infusions#Uis", $_SERVER['SCRIPT_NAME'])) {
        $breadcrumb_titles = (array("Infusions", "Infusion"));
        $breadcrumb_links = (array(ADMIN."index.php".$aidlink."&amp;pagenum=5", $link));    
}
?>