breadcrumbs-script

Gesponsorde koppelingen

PHP script bestanden

  1. breadcrumbs-script

« Lees de omschrijving en reacties

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
<?php

if ( $_GET['test'] == 1 )
{

    $data = array(
        './'    => 'Homepage'
    );
}

elseif ( $_GET['test'] == 2 )
{

    $data = array(
        './'                => 'Homepage',
        './add.php'            => 'Add'
    );
}

elseif ( $_GET['test'] == 3 )
{

    $data = array(
        './'                => 'Homepage',
        './add.php'            => 'Add',
        './add.php?do=news'    => 'Add News'
    );
}

else
{
    $data = array(
        './'                            => 'Homepage',
        './add.php'                        => 'Add',
        './add.php?do=news'                => 'Add News',
        './add.php?id=3531&fix=poll'    => 'Add poll',
    );
}


$site_name = 'Wesdesignz';

$html = array(
    0    => array('<img src="./img/folder_start.png" alt="" />&nbsp;<strong>','</strong>'),
    1    => array('<a href="{URL}">','</a>'),
    2    => array('<div><img src="./img/folder_current.png" alt="" class="current" /><h1 class="clr">','</h1></div>'),
    3    => array('<img src="./img/folder_start.png" alt="" />&nbsp;<a href="{URL}">','</a>'),
);


$divider = ' &raquo; ';

function
create_location_str( $data, $site_name, $html = array(), $divider = ' &raquo; ')
{

    $dhtml = array(
        0    => array('<img src="./img/folder_start.png" alt="" />&nbsp;<strong>','</strong>'),
        1    => array('<a href="{URL}">','</a>'),
        2    => array('<div><img src="./img/folder_current.png" alt="" class="current" /><h1 class="clr">','</h1></div>'),
        3    => array('<img src="./img/folder_start.png" alt="" />&nbsp;<a href="{URL}">','</a>'),
    );

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

        if ( $html[$i] == '' && $html[$i] == NULL )
        {

            $html[$i] = $dhtml[$i];
        }
    }

    
    if ( is_array( $data ) )
    {

        $count = count( $data );
        if ( $count == 1 )
        {

            return $html[0][0] . $site_name . $html[0][1];
        }

        else
        {
            $return = null;
            $i = 1;
            foreach( $data as $href => $name )
            {

                if ( $i == 1 )
                {

                    $return .= str_replace('{URL}', $href, $html[3][0] ) . $site_name . $html[3][1];
                }

                elseif ( $i == $count )
                {

                    $return .= str_replace('{URL}', $href, $html[2][0] ) . $name . $html[2][1];
                }

                else
                {
                    $return .= str_replace('{URL}', $href, $html[1][0] ) . $name . $html[1][1];
                }

                
                if ( $i < $count )
                {

                    $return .= $divider;
                }

                
                $i++;
            }

            return $return;
        }
    }

    else
    {
        return '$data wasn\'t an array.';
    }
}


$clr = create_location_str( $data, $site_name, $html, $divider );

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="nl">
<head>
    <!-- no cache headers -->
    <meta http-equiv="Pragma" content="no-cache" />
    <meta http-equiv="Expires" content="-1" />
    <meta http-equiv="Cache-Control" content="no-cache" />
    <!-- end no cache headers -->
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta name="keywords" content="Wesdesignz" />

    <meta name="description" content="Wesdesignz" />
    <!-- CSS Stylesheet -->
    <style type="text/css">
    * {
        margin: 0;
        padding: 0;
        font-family: Trebuchet MS, Verdana, Arial, Sans;
        font-size: 10pt;
    }
    
    body {
        background-color: #AAAAAA;
        padding: 25px;
    }
    
    #clr {
        border: solid #c1c1c1 4px;
        padding: 4px;
        background-color: #FFFFFF;
    }
    
    h1.clr {
        position: relative;
        font-size: 23px;
    }
    
    img.current {
        position: relative;
        float: left;
        margin-top: 5px;
        padding-right: 4px;
        padding-left: 15px;
    }
    
    a,a:visited,a:hover,a:active {
        color: #666666;
        text-decoration: none;
    }
    
    a:hover,a:active {
        color: #888888;
        text-decoration: underline;
    }
    </style>
    <title>Wesdesignz - Rescripting your website!</title>
</head>
<body>
    <div id="clr">
        <?php print $clr; ?>
    </div>
</body>
</html>

 
 

Om de gebruiksvriendelijkheid van onze website en diensten te optimaliseren maken wij gebruik van cookies. Deze cookies gebruiken wij voor functionaliteiten, analytische gegevens en marketing doeleinden. U vindt meer informatie in onze privacy statement.