-
Notifications
You must be signed in to change notification settings - Fork 1
/
emoticons_helper.php
138 lines (104 loc) · 2.48 KB
/
emoticons_helper.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
<?php defined('BASEPATH') OR exit('No direct script access allowed');
/*
This helper class is using the unicode emoji icons standards in order to display a large variety of emoticons.
https://github.com/amarok2/codeigniter_emojis/
Made by Nicolas PERE for the community.
*/
function _initialize() {
// '(shortcut)' => 'xxxxx',
$emoticons = array(
";-)" => '1F609',
"^^" => '1F60A',
":-)" => '1F60A',
":)" => '1F60A',
":D" => '1F604',
":-D" => '1F604',
":p" => '1F61C',
":-p" => '1F61C',
":*" => '1F618',
":-*" => '1F618',
"/!\\" => '26A0',
":-)" => '1F609',
":)" => '1F609',
":-D" => '1F609',
":d" => '1F609',
":-O" => '1F609',
":o" => '1F609',
":-P" => '1F609',
":p" => '1F609',
";-)" => '1F609',
";)" => '1F609',
":-(" => '1F609',
":(" => '1F609',
":-S" => '1F609',
":s" => '1F609',
":-l" => '1F609',
":l" => '1F609',
":'(" => '1F609',
":-$" => '1F609',
":$" => '1F609',
"(H)" => '1F609',
"(h)" => '1F609',
":-@" => '1F609',
":@" => '1F609',
"(A)" => '1F609',
"(a)" => '1F609',
"(6)" => '1F609',
":-#" => '1F609',
"8ol" => '1F609',
"8-l" => '1F609',
"^o)" => '1F609',
":-*" => '1F609',
"+o(" => '1F609',
":^)" => '1F609',
"*-)" => '1F609',
"<:o)" => '1F609',
"8-)" => '1F609',
"l-)" => '1F609',
"(c)" => '1F609',
"(C)" => '1F609',
"(Y)" => '1F609',
"(y)" => '1F609',
"(N)" => '1F609',
"(n)" => '1F609',
"(B)" => '1F609',
"(b)" => '1F609',
"(D)" => '1F609',
"(d)" => '1F609',
"(L)" => '1F609',
"(l)" => '1F609',
"(U)" => '1F609',
"(u)" => '1F609',
"(K)" => '1F609',
"(k)" => '1F609',
"(G)" => '1F609',
"(g)" => '1F609',
"(F)" => '1F609',
"(f)" => '1F609',
"(*)" => '1F609',
"(sn)" => '1F40C',
"(co)" => '1F609',
"(yn)" => '1F609'
);
return $emoticons;
} // end of _initialize
if ( ! function_exists('parse_emoticons')) {
/**
* Parse Emoticons
*
* Takes a string as input and swaps any contained emoticons for the actual image
*
* @param string the text to be parsed
* @return string
*/
function parse_emoticons($str, $size = '16pt') {
$emoticons = _initialize();
$size = ($size) ? 'style="font-size:'.$size.'"' : '';
foreach ($emoticons as $key => $val) {
$str = str_replace($key, '<span '.$size.'>&#x'.$val.';</span>', $str);
}
return $str;
}
} // end of parse_emoticons
/* End of file emoticons_helper.php */
/* Location: ./application/helpers/emoticons_helper.php */