-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions.php
258 lines (183 loc) · 6.82 KB
/
functions.php
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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
<?php
function c12_albums( ) {
/*
* Takes and array with Key -> Value pairs.
$key is used for URL and image URL.
$value is used for title tag.
Images are stored in : /img/covers-small/
*/
$albums = array(
// 'album-darling' => 'Darling',
// 'album-pateras-baxter-brown' => 'Pateras/Baxter/Brown - Live at l’Usine',
// 'album-multitude' => 'Diatribes & Barry Guy - multitude',
'albums' => 'Albums',
// 'album-dust' => 'Antoine Chessex - Dust',
// 'francisco-meirino-upic' => 'Francisco Meirino - Untitled Phenomenas In Concrete',
// 'norbert-moeslang' => 'Norbert Möslang - killer_kipper',
'ddk-floating-piece-of-space' => 'DDK - floating piece of space',
'vlan-voila' => 'Norbert Möslang - vlan_voilà',
'francisco-meirino-la-plainte' => 'Francisco Meirino - La Plainte',
'uruk' => 'Uruk',
'mika-vainio-last-live' => 'Mika Vainio - Last Live',
);
return $albums;
}
/**
* Generate header
@param title
*/
function c12_head( $title, $description ) {
$head = '<!doctype html>
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js ie7 oldie" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js ie8 oldie" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
';
$head .= '<title>'.$title.' - Label Cave12</title>';
$head .= '<meta name="description" content="'.$description.'">';
$head .= '
<meta name="author" content="Manuel Schmalstieg - ms-studio.net">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" href="/css/style-v5.css">
<link href="//fonts.googleapis.com/css?family=Droid+Sans+Mono|Merriweather:400,400italic,700" rel="stylesheet" type="text/css">
<link rel="icon" type="image/png" sizes="149x149" href="/icon.png">
<link rel="apple-touch-icon" href="/icon.png">
<script src="/js/libs/modernizr-2.0.6.min.js"></script>
<script src="/js/pourriel.js"></script>
</head>
';
return $head;
}
/*
*/
function c12_header( $active ) {
$header = '<header class="header" id="top" role="navigation">
<div id="logo" class="logo" role="banner">
<a href="/"><img src="/img/label180.png" width="180" height="74" alt="Label cave12, Genève" /></a>
</div>
<nav class="nav nav-albums">
<ul>';
$items = c12_albums();
foreach ($items as $key => $value) {
$header .= '<li><a href="/'.$key.'/" title="'.$value.'" ';
if ( $key == $active ) {
$header .= 'class="active"';
}
$header .= '><img src="/img/covers-small/'.$key.'.png" alt="'.$value.'" /></a></li>';
}
$header .= '</ul></nav>';
$header .= '<nav class="nav nav-head mono">
<ul>
<li><a href="/presentation/">présentation</a></li>
<li><a href="/contact/">contact</a></li>
<li><a href="http://cave12.org">cave12</a></li>
</ul>
</nav>
</header>';
return $header;
}
/**
* Generate internal nav
*
* @param array $items
* @param string $active
*/
function c12_page_nav_global( $items, $active ) {
// à partir des éléments fournis, créer une navigation
// marquer l'élément actif
$nav = '<nav role="navigation" class="nav nav-article mono">
<ul>
';
foreach ($items as $key => $value) {
$nav .= '<li><a href="#'.$key.'" ';
if ( $key == $active ) {
$nav .= 'class="active"';
}
$nav .= '>'.$value.'</a></li>';
}
$nav .= '<li><a href="#body">↑</a></li>';
$nav .= '</ul></nav>';
return $nav;
}
function c12_footer( ) {
$footer = '</div><!-- end of .main-inside -->
</article><!-- end of #main -->
<footer class="footer hidden">
-
</footer>
</div> <!-- end of #container -->
';
// JavaScript
$footer .= '
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script>window.jQuery || document.write(\'<script src="/js/libs/jquery-1.6.2.min.js"><\/script>\')</script>
<script defer src="/js/jquery.easing.1.3.min.js"></script>
<!-- scripts for audio player -->
<script src="/js/mylibs/sound.js"></script>
<script>
soundManager.url = \'/lib/soundmanagerv2/swf/\';
soundManager.onready(function() {
});
</script>
<!-- end scripts-->
<!--[if lt IE 7 ]>
<script src="//ajax.googleapis.com/ajax/libs/chrome-frame/1.0.3/CFInstall.min.js"></script>
<script>window.attachEvent(\'onload\',function(){CFInstall.check({mode:\'overlay\'})})</script>
<![endif]-->
<script type="text/javascript">
$(function() {
$(\'.nav-article a\').bind(\'click\',function(event){
var $anchor = $(this);
$(\'html, body\').stop().animate({
scrollTop: $($anchor.attr(\'href\')).offset().top
}, 500);
event.preventDefault();
});
});
</script>
';
// Piwik analytics
// $footer .= '
// <script type="text/javascript">
// var pkBaseURL = (("https:" == document.location.protocol) ? "https://www.cave12.org/piwik/" : "http://www.cave12.org/piwik/");
// document.write(unescape("%3Cscript src=\'" + pkBaseURL + "piwik.js\' type=\'text/javascript\'%3E%3C/script%3E"));
// </script><script type="text/javascript">
// try {
// var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 5);
// piwikTracker.trackPageView();
// piwikTracker.enableLinkTracking();
// } catch( err ) {}
// </script><noscript><p><img src="http://www.cave12.org/piwik/piwik.php?idsite=5" style="border:0" alt="" /></p></noscript>
// ';
// end Piwik analytics
$footer .= '
</body>
</html>';
return $footer;
}
/**
* Generate paypal button
* Pour info, comment les générer?
* Lien: https://www.paypal.com/us/cgi-bin/customerprofileweb?cmd=_button-management
*
* @param string $code
* @param string $currency = CHF or EUR
* @param string $text
*/
function c12_paypal( $text, $currency, $code ) {
$button = '<form class="form-paypal cl" target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="'.$code.'">';
if ( $currency == 'CHF' ) {
$button .= '<input type="image" src="/img/bouton1.png" name="submit" alt="PayPal - commander pour la Suisse">';
} else if ( $currency == 'EUR' ) {
$button .= '<input type="image" src="/img/bouton2.png" name="submit" alt="PayPal - commander pour l’Europe">';
}
$button .= '<img alt="" src="https://www.paypalobjects.com/de_DE/i/scr/pixel.gif" width="1" height="1">
</form>';
$button .= '<p class="label-prix">'.$text.'</p>';
return $button;
}