Browse Source

small patch to add a background changer for ALCASAR webpages

master
n 4 years ago
parent
commit
1bf173b97a
1 changed files with 73 additions and 0 deletions
  1. 73
    0
      alcasar_logo.patch

+ 73
- 0
alcasar_logo.patch View File

@@ -0,0 +1,73 @@
1
+--- logo.old.php	2015-04-01 21:43:37.293984603 +0200
2
++++ logo.php	2015-04-01 22:10:51.474184548 +0200
3
+@@ -19,16 +19,20 @@
4
+   $Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
5
+   $Language = strtolower(substr(chop($Langue[0]),0,2)); }
6
+ if($Language == 'fr'){
7
+-  $l_title = "Personnalisation du logo d'organisme";
8
++  $l_title = "Personnalisation du logo d'organisme et du fond d'écran";
9
+   $l_current_logo = "Logo actuel";
10
++  $l_current_background = "Fond d'&eacutecran actuel";
11
+   $l_logo_select ="Sélectionnez un nouveau logo";
12
++  $l_background_select ="Sélectionnez un nouveau fond d'écran";
13
+   $l_logo_help1 = "votre logo doit être un fichier au format libre 'PNG'";
14
+   $l_logo_help2 = "la taille de ce fichier doit être inférieure à 100Ko";
15
+   $l_logo_help3 = "rafraîchissez les pages de votre navigateur pour voir le résultat";
16
+ } else {
17
+-  $l_title = "Customizing the agency logo";
18
++  $l_title = "Customizing the agency logo and background image";
19
+   $l_current_logo = "Current logo";
20
++  $l_current_background = "Current background image";
21
+   $l_logo_select ="Select a new logo";
22
++  $l_background_select ="Select a new background image";
23
+   $l_logo_help1 = "your logo must be in open 'PNG' format";
24
+   $l_logo_help2 = "the file size must be less than 100KB";
25
+   $l_logo_help3 = "refresh your browser in order to see the result";
26
+@@ -53,6 +57,26 @@
27
+ 	move_uploaded_file($_FILES['logo']['tmp_name'], $destination);
28
+ 	}
29
+ }
30
++
31
++if(isset($_FILES['background']))
32
++{
33
++unset($result);
34
++$taille_max = 1000000;
35
++$destination = '/var/www/html/images/fond.png';
36
++$extension = strstr($_FILES['background']['name'], '.'); 
37
++if ($extension != '.png')
38
++	{
39
++	$result = 'Veuillez sélectionner un fichier de type png !';
40
++	}
41
++elseif (file_exists($_FILES['background']['tmp_name']) and filesize($_FILES['background']['tmp_name']) > $taille_max)
42
++	{
43
++	$result = 'La taille du fichier doit être inférieur à 1Mo !';
44
++	}
45
++if (!isset($result))
46
++	{
47
++	move_uploaded_file($_FILES['background']['tmp_name'], $destination);
48
++	}
49
++}
50
+ ?>
51
+ <TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
52
+ <tr><th><? echo "$l_title";?></th></tr>
53
+@@ -63,13 +87,19 @@
54
+ 	<tr bgcolor="#666666"><td>
55
+ 	<TABLE width="100%" border=0 cellspacing=0 cellpadding=2>
56
+ 		<tr><td valign="middle" align="left">
57
+-		<CENTER><H3><? echo "$l_current_logo";?> : <img src="/images/organisme.png" width="90"></H3></center><BR>
58
++		<CENTER><H3><? echo "$l_current_logo";?> : <img src="/images/organisme.png" width="90">&nbsp;&nbsp;<? echo "$l_current_background";?> : <img src="/images/fond.png" width="90" height="90"></center><BR>
59
+ <? echo "$l_logo_select";?> :
60
+ 		<FORM action="logo.php" method=POST ENCTYPE="multipart/form-data">
61
+ 			<input type="file" name="logo">
62
+ 			<input type="hidden" name="MAX_FILE_SIZE" value="100000">
63
+ 			<input type="submit" value="Envoyer">
64
+ 		</FORM>
65
++<? echo "$l_background_select";?> :
66
++		<FORM action="logo.php" method=POST ENCTYPE="multipart/form-data">
67
++			<input type="file" name="background">
68
++			<input type="hidden" name="MAX_FILE_SIZE" value="1000000">
69
++			<input type="submit" value="Envoyer">
70
++		</FORM>
71
+ <?php
72
+ if (isset($result))
73
+ {

Loading…
Cancel
Save