@@ -50,14 +50,14 @@ discard block |
||
50 | 50 | public function __construct(config $config, request $request, helper $helper, template $template, language $language, $root_path, $php_ext) |
51 | 51 | { |
52 | 52 | $this->config = $config; |
53 | - $this->request = $request; |
|
53 | + $this->request = $request; |
|
54 | 54 | $this->helper = $helper; |
55 | 55 | $this->template = $template; |
56 | 56 | $this->language = $language; |
57 | 57 | $this->root_path = $root_path; |
58 | - $this->php_ext = $php_ext; |
|
58 | + $this->php_ext = $php_ext; |
|
59 | 59 | $this->ext_path = $root_path . 'ext/sylver35/smilecreator/'; |
60 | - $this->ext_path_web = generate_board_url() . '/ext/sylver35/smilecreator/'; |
|
60 | + $this->ext_path_web = generate_board_url() . '/ext/sylver35/smilecreator/'; |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | public function create_smiley() |
@@ -120,11 +120,11 @@ discard block |
||
120 | 120 | |
121 | 121 | public function display_smiley() |
122 | 122 | { |
123 | - $text = $this->request->variable('text', '', true); |
|
124 | - $smiley = $this->request->variable('smiley', 0); |
|
123 | + $text = $this->request->variable('text', '', true); |
|
124 | + $smiley = $this->request->variable('smiley', 0); |
|
125 | 125 | $fontcolor = $this->request->variable('fontcolor', ''); |
126 | 126 | $shadowcolor = $this->request->variable('shadowcolor', ''); |
127 | - $shieldshadow = $this->request->variable('shieldshadow', 0); |
|
127 | + $shieldshadow = $this->request->variable('shieldshadow', 0); |
|
128 | 128 | $fontwidth = 6; |
129 | 129 | $fontheight = 11; |
130 | 130 | |
@@ -166,17 +166,17 @@ discard block |
||
166 | 166 | |
167 | 167 | // Maybe we have to tweak here a bit. Depends on the font... |
168 | 168 | $width = ($char_count * $fontwidth) + 14; |
169 | - $width = ($width < 60) ? 60 : $width;// min width is 60 pixels |
|
169 | + $width = ($width < 60) ? 60 : $width; // min width is 60 pixels |
|
170 | 170 | $height = (sizeof($output) * $fontheight) + 35; |
171 | 171 | |
172 | 172 | // Main work here |
173 | 173 | $smiley = imagecreatefrompng($this->ext_path . 'images/smilie' . $smiley . '.png'); |
174 | 174 | $schild = imagecreatefrompng($this->ext_path . 'images/schild.png'); |
175 | - $img = imagecreate($width, $height); |
|
175 | + $img = imagecreate($width, $height); |
|
176 | 176 | |
177 | 177 | $bgcolor = imagecolorallocate($img, 111, 252, 134); |
178 | 178 | $txtcolor = imagecolorallocate($img, hexdec(substr($fontcolor, 0, 2)), hexdec(substr($fontcolor, 2, 2)), hexdec(substr($fontcolor, 4, 2))); |
179 | - $txt2color = imagecolorallocate($img, hexdec(substr($shadowcolor, 0, 2)), hexdec(substr($shadowcolor, 2, 2)), hexdec(substr($shadowcolor, 4, 2))); |
|
179 | + $txt2color = imagecolorallocate($img, hexdec(substr($shadowcolor, 0, 2)), hexdec(substr($shadowcolor, 2, 2)), hexdec(substr($shadowcolor, 4, 2))); |
|
180 | 180 | $bocolor = imagecolorallocate($img, 0, 0, 0); |
181 | 181 | $schcolor = imagecolorallocate($img, 255, 255, 255); |
182 | 182 | $shadow1color = imagecolorallocate($img, 235, 235, 235); |
@@ -195,9 +195,9 @@ discard block |
||
195 | 195 | imagesetpixel($schild, 5, 15, imagecolorallocate($schild, ($smileycolor["red"] + 52), ($smileycolor["green"] + 59), ($smileycolor["blue"] + 11))); |
196 | 196 | imagesetpixel($schild, 6, 15, imagecolorallocate($schild, ($smileycolor["red"] + 50), ($smileycolor["green"] + 52), ($smileycolor["blue"] + 50))); |
197 | 197 | |
198 | - imagecopy($img, $schild, ($width / 2 - 3), 0, 0, 0, 6, 4);// Copy image tile |
|
199 | - imagecopy($img, $schild, ($width / 2 - 3), ($height - 24), 0, 5, 9, 17);// Copy image tile |
|
200 | - imagecopy($img, $smiley, ($width / 2 + 6), ($height - 24), 0, 0, 23, 23);// Copy image tile |
|
198 | + imagecopy($img, $schild, ($width / 2 - 3), 0, 0, 0, 6, 4); // Copy image tile |
|
199 | + imagecopy($img, $schild, ($width / 2 - 3), ($height - 24), 0, 5, 9, 17); // Copy image tile |
|
200 | + imagecopy($img, $smiley, ($width / 2 + 6), ($height - 24), 0, 0, 23, 23); // Copy image tile |
|
201 | 201 | |
202 | 202 | imagefilledrectangle($img, 0, 4, $width, ($height - 25), $bocolor); |
203 | 203 | imagefilledrectangle($img, 1, 5, ($width - 2), ($height - 26), $schcolor); |
@@ -283,8 +283,8 @@ discard block |
||
283 | 283 | { |
284 | 284 | $code = array("'", '"', ',', ';', ':', '!', 'ย', 'ง', '@', '€', '$', '#', '?', '=', '~', '¤', '%', '*', '$', '£', '<', '>', '"', '&', '<', '>', '&'); |
285 | 285 | $text = str_replace($code, '', $text); |
286 | - $code2 = array(' ', 'é', 'ê', 'è', 'ë', 'É', 'Ê', 'È', 'Ë','à', 'â', 'ä', 'ã','À', 'Â', 'Ä', 'Ã', 'î', 'ï', 'Î', 'Ï', 'ó', 'ò', 'ô', 'ö', 'õ', 'Ó', 'Ò', 'Ô', 'Ö', 'Õ', 'ù', 'û', 'ü', 'Ù', 'Û', 'Ü', 'ç', 'Ç', 'ñ', 'Ñ'); |
|
287 | - $replace = array(' ', 'e', 'e', 'e', 'e', 'E', 'E', 'E', 'E','a', 'a', 'a', 'a','A', 'A', 'A', 'A', 'i', 'i', 'I', 'I', 'o', 'o', 'o', 'o', 'o', 'O', 'O', 'O', 'O', 'O', 'u', 'u', 'u', 'U', 'U', 'U', 'c', 'c', 'n', 'n'); |
|
286 | + $code2 = array(' ', 'é', 'ê', 'è', 'ë', 'É', 'Ê', 'È', 'Ë', 'à', 'â', 'ä', 'ã', 'À', 'Â', 'Ä', 'Ã', 'î', 'ï', 'Î', 'Ï', 'ó', 'ò', 'ô', 'ö', 'õ', 'Ó', 'Ò', 'Ô', 'Ö', 'Õ', 'ù', 'û', 'ü', 'Ù', 'Û', 'Ü', 'ç', 'Ç', 'ñ', 'Ñ'); |
|
287 | + $replace = array(' ', 'e', 'e', 'e', 'e', 'E', 'E', 'E', 'E', 'a', 'a', 'a', 'a', 'A', 'A', 'A', 'A', 'i', 'i', 'I', 'I', 'o', 'o', 'o', 'o', 'o', 'O', 'O', 'O', 'O', 'O', 'u', 'u', 'u', 'U', 'U', 'U', 'c', 'c', 'n', 'n'); |
|
288 | 288 | $text = str_replace($code2, $replace, $text); |
289 | 289 | |
290 | 290 | return $text; |
@@ -146,19 +146,16 @@ |
||
146 | 146 | { |
147 | 147 | $output[1] = substr($text, 40, 40); |
148 | 148 | $output[2] = substr($text, 80, 37) . '…'; |
149 | - } |
|
150 | - else if ($nb > 80) |
|
149 | + } else if ($nb > 80) |
|
151 | 150 | { |
152 | 151 | $output[1] = substr($text, 40, 40); |
153 | 152 | $output[2] = substr($text, 80, 40); |
154 | - } |
|
155 | - else |
|
153 | + } else |
|
156 | 154 | { |
157 | 155 | $output[1] = substr($text, 40, 40); |
158 | 156 | } |
159 | 157 | $char_count = 40; |
160 | - } |
|
161 | - else |
|
158 | + } else |
|
162 | 159 | { |
163 | 160 | $char_count = $nb; |
164 | 161 | $output[0] = $text; |
@@ -41,7 +41,7 @@ |
||
41 | 41 | $this->helper = $helper; |
42 | 42 | $this->template = $template; |
43 | 43 | $this->language = $language; |
44 | - $this->php_ext = $php_ext; |
|
44 | + $this->php_ext = $php_ext; |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | /** |
@@ -82,8 +82,7 @@ |
||
82 | 82 | if ($this->config['enable_mod_rewrite']) |
83 | 83 | { |
84 | 84 | $event['text'] = str_replace('%7CS_CREATOR_BBCODE%7Capp.php', generate_board_url(), $event['text']); |
85 | - } |
|
86 | - else |
|
85 | + } else |
|
87 | 86 | { |
88 | 87 | $event['text'] = str_replace('%7CS_CREATOR_BBCODE%7Capp.php', generate_board_url() . '/app.' . $this->php_ext, $event['text']); |
89 | 88 | } |
@@ -49,8 +49,7 @@ |
||
49 | 49 | { |
50 | 50 | $bbcode_id = NUM_CORE_BBCODES + 1; |
51 | 51 | } |
52 | - } |
|
53 | - else |
|
52 | + } else |
|
54 | 53 | { |
55 | 54 | $bbcode_id = NUM_CORE_BBCODES + 1; |
56 | 55 | } |