1 | <?php |
---|
2 | |
---|
3 | function categorie2couleur($categorie) { |
---|
4 | |
---|
5 | static $couleurs = array('auteur' => '1310b2', |
---|
6 | 'communication' => 'acbd70', |
---|
7 | 'date' => '471bb2', |
---|
8 | 'divers' => '50699b', |
---|
9 | 'edition' => 'b22ba4', |
---|
10 | 'maintenance' => '09b2a3', |
---|
11 | 'multimedia' => 'de175f', |
---|
12 | 'navigation' => 'b26714', |
---|
13 | 'outil' => 'dfb811', |
---|
14 | 'performance' => '11b23c', |
---|
15 | 'statistique' => 'bd87c0', |
---|
16 | 'squelette' => '40dd5d', |
---|
17 | 'theme' => 'b6a71b', |
---|
18 | 'aucune' => '0a63b2'); |
---|
19 | if (!$couleur = $couleurs[$categorie]) |
---|
20 | $couleur = 'b9274d'; |
---|
21 | |
---|
22 | return $couleur; |
---|
23 | } |
---|
24 | |
---|
25 | function extraire_numero($titre) { |
---|
26 | |
---|
27 | if (ereg("^([0-9]+)\.", $titre, $regs)) return $regs[1]; |
---|
28 | |
---|
29 | } |
---|
30 | |
---|
31 | |
---|
32 | function image_titre_article ($titre) { |
---|
33 | include_spip("inc/filtres_images"); |
---|
34 | |
---|
35 | $police = "HelveNeuMedCon.ttf"; |
---|
36 | |
---|
37 | $titre = mb_strtoupper($titre); |
---|
38 | $titre = str_replace("&NBSP;", " ", $titre); |
---|
39 | |
---|
40 | $titre = image_typo($titre, "couleur=888888", "police=$police", "taille=54px", "largeur=1300", "padding=14"); |
---|
41 | $titre = image_reduire_par($titre, 2); |
---|
42 | |
---|
43 | $titre2 = $titre; |
---|
44 | $titre2 = image_gamma($titre2, -125); |
---|
45 | $titre2 = image_flou($titre2, 4); |
---|
46 | $titre2 = image_alpha($titre2, 60); |
---|
47 | $titre2 = image_aplatir($titre2, "png", "666666"); |
---|
48 | |
---|
49 | // $masque = image_sepia("squelettes/masques/masque-titre.png", $couleur); |
---|
50 | |
---|
51 | $titre = image_masque($titre, "masques/masque-titre.png"); |
---|
52 | |
---|
53 | $titre = image_masque($titre2, extraire_attribut($titre,"src"), "mode=normal", "top=1", "left=1"); |
---|
54 | |
---|
55 | $titre = image_aplatir($titre, "gif", "ffffff"); |
---|
56 | //$titre = image_reduire_par($titre, 2); |
---|
57 | |
---|
58 | return $titre; |
---|
59 | |
---|
60 | } |
---|
61 | |
---|
62 | function image_petit_titre_article ($titre, $couleur) { |
---|
63 | include_spip("inc/filtres_images"); |
---|
64 | |
---|
65 | $titre = mb_strtoupper($titre); |
---|
66 | $titre = str_replace("&NBSP;", " ", $titre); |
---|
67 | |
---|
68 | $titre = image_typo($titre, "couleur=888888", "police=HelveNeuHeaConObl.ttf", "taille=54px", "largeur=2000", "padding=14"); |
---|
69 | $titre = image_reduire_par($titre, 5); |
---|
70 | |
---|
71 | $titre2 = $titre; |
---|
72 | $titre2 = image_gamma($titre2, -125); |
---|
73 | $titre2 = image_flou($titre2, 4); |
---|
74 | $titre2 = image_alpha($titre2, 60); |
---|
75 | $titre2 = image_aplatir($titre2, "png", $couleur); |
---|
76 | |
---|
77 | // $masque = image_sepia("squelettes/masques/masque-titre.png", $couleur); |
---|
78 | |
---|
79 | $titre = image_masque($titre, "squelettes/masques/masque-titre.png"); |
---|
80 | |
---|
81 | $titre = image_masque($titre2, extraire_attribut($titre,"src"), "mode=normal", "top=1", "left=1"); |
---|
82 | |
---|
83 | $titre = image_aplatir($titre, "gif", $couleur); |
---|
84 | |
---|
85 | return $titre; |
---|
86 | |
---|
87 | } |
---|
88 | |
---|
89 | ?> |
---|