From 94a91530da9f952a8b6e729ff187932706282f5a Mon Sep 17 00:00:00 2001
From: Meik Sievertsen
Date: Thu, 17 May 2007 11:59:06 +0000
Subject: [PATCH] adjust smilies. Also allow adding more codes to existing
smilies... no one noticed this before. :/
git-svn-id: file:///svn/phpbb/trunk@7614 89ea8834-ac86-4346-8a33-228a782c2dd0
---
phpBB/adm/style/acp_icons.html | 60 +++++++++++++
phpBB/adm/style/editor.js | 27 +++---
phpBB/images/smilies/icon_biggrin.gif | Bin 172 -> 0 bytes
phpBB/images/smilies/icon_confused.gif | Bin 171 -> 0 bytes
phpBB/images/smilies/icon_e_biggrin.gif | Bin 0 -> 413 bytes
phpBB/images/smilies/icon_e_confused.gif | Bin 0 -> 410 bytes
phpBB/images/smilies/icon_e_geek.gif | Bin 0 -> 410 bytes
phpBB/images/smilies/icon_e_sad.gif | Bin 0 -> 420 bytes
phpBB/images/smilies/icon_e_smile.gif | Bin 0 -> 416 bytes
phpBB/images/smilies/icon_e_surprised.gif | Bin 0 -> 427 bytes
phpBB/images/smilies/icon_e_ugeek.gif | Bin 0 -> 422 bytes
phpBB/images/smilies/icon_e_wink.gif | Bin 0 -> 413 bytes
phpBB/images/smilies/icon_frown.gif | Bin 171 -> 0 bytes
phpBB/images/smilies/icon_sad.gif | Bin 171 -> 0 bytes
phpBB/images/smilies/icon_smile.gif | Bin 174 -> 0 bytes
phpBB/images/smilies/icon_surprised.gif | Bin 174 -> 0 bytes
phpBB/images/smilies/icon_wink.gif | Bin 170 -> 0 bytes
phpBB/includes/acp/acp_icons.php | 103 ++++++++++++++++++++--
phpBB/includes/functions_posting.php | 14 ++-
phpBB/install/schemas/schema_data.sql | 66 +++++++++-----
phpBB/language/en/acp/posting.php | 5 ++
21 files changed, 229 insertions(+), 46 deletions(-)
delete mode 100644 phpBB/images/smilies/icon_biggrin.gif
delete mode 100644 phpBB/images/smilies/icon_confused.gif
create mode 100644 phpBB/images/smilies/icon_e_biggrin.gif
create mode 100644 phpBB/images/smilies/icon_e_confused.gif
create mode 100644 phpBB/images/smilies/icon_e_geek.gif
create mode 100644 phpBB/images/smilies/icon_e_sad.gif
create mode 100644 phpBB/images/smilies/icon_e_smile.gif
create mode 100644 phpBB/images/smilies/icon_e_surprised.gif
create mode 100644 phpBB/images/smilies/icon_e_ugeek.gif
create mode 100644 phpBB/images/smilies/icon_e_wink.gif
delete mode 100644 phpBB/images/smilies/icon_frown.gif
delete mode 100644 phpBB/images/smilies/icon_sad.gif
delete mode 100644 phpBB/images/smilies/icon_smile.gif
delete mode 100644 phpBB/images/smilies/icon_surprised.gif
delete mode 100644 phpBB/images/smilies/icon_wink.gif
diff --git a/phpBB/adm/style/acp_icons.html b/phpBB/adm/style/acp_icons.html
index 40a2cd166e..81f56cc299 100644
--- a/phpBB/adm/style/acp_icons.html
+++ b/phpBB/adm/style/acp_icons.html
@@ -4,6 +4,43 @@
+
+
+
+
« {L_BACK}
{L_TITLE}
@@ -20,6 +57,7 @@
{L_CONFIG} |
+
{L_URL} |
{L_LOCATION} |
@@ -64,6 +102,27 @@
+
+
+ {L_ADD_SMILEY_CODE} |
+
+
+ |
+ ![]({IMG_SRC}) |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+
+
+
+
+ {L_NO_ICONS} |
+
+
@@ -71,6 +130,7 @@
+
diff --git a/phpBB/adm/style/editor.js b/phpBB/adm/style/editor.js
index c7632633d9..e82b9d5d62 100644
--- a/phpBB/adm/style/editor.js
+++ b/phpBB/adm/style/editor.js
@@ -55,12 +55,12 @@ function initInsertions()
* bbstyle
*/
function bbstyle(bbnumber)
-{
+{
if (bbnumber != -1)
{
bbfontstyle(bbtags[bbnumber], bbtags[bbnumber+1]);
- }
- else
+ }
+ else
{
insert_text('[*]');
document.forms[form_name].elements[text_name].focus();
@@ -117,7 +117,6 @@ function bbfontstyle(bbopen, bbclose)
// IE
else if (document.selection)
{
-
var range = textarea.createTextRange();
range.move("character", new_pos);
range.select();
@@ -135,19 +134,20 @@ function insert_text(text, spaces, popup)
{
var textarea;
- if (!popup)
+ if (!popup)
{
textarea = document.forms[form_name].elements[text_name];
- }
- else
+ }
+ else
{
textarea = opener.document.forms[form_name].elements[text_name];
}
- if (spaces)
+
+ if (spaces)
{
text = ' ' + text + ' ';
}
-
+
if (!isNaN(textarea.selectionStart))
{
var sel_start = textarea.selectionStart;
@@ -164,7 +164,7 @@ function insert_text(text, spaces, popup)
{
textarea.focus();
storeCaret(textarea);
- }
+ }
var caret_pos = textarea.caretPos;
caret_pos.text = caret_pos.text.charAt(caret_pos.text.length - 1) == ' ' ? caret_pos.text + text + ' ' : caret_pos.text + text;
@@ -366,15 +366,14 @@ function getCaretPosition(txtarea)
var caretPos = new caretPosition();
// simple Gecko/Opera way
- if(txtarea.selectionStart || txtarea.selectionStart == 0)
+ if (txtarea.selectionStart || txtarea.selectionStart == 0)
{
caretPos.start = txtarea.selectionStart;
caretPos.end = txtarea.selectionEnd;
}
// dirty and slow IE way
- else if(document.selection)
+ else if (document.selection)
{
-
// get current selection
var range = document.selection.createRange();
@@ -385,7 +384,7 @@ function getCaretPosition(txtarea)
// calculate selection start point by moving beginning of range_all to beginning of range
var sel_start;
for (sel_start = 0; range_all.compareEndPoints('StartToStart', range) < 0; sel_start++)
- {
+ {
range_all.moveStart('character', 1);
}
diff --git a/phpBB/images/smilies/icon_biggrin.gif b/phpBB/images/smilies/icon_biggrin.gif
deleted file mode 100644
index d3527723c6d8a0ddfa7ca0bfe1ab8fce0055918c..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 172
zcmZ?wbhEHbgxLc6$23b2ZD19|4%af-@@>3F2nzSlmGt}{{R2@|NpQ5
zKLsg(0L7myj0_CC3_2h#$P5OS$PJ#HS#x(>T`Hg?&Q{P6{IT@*|fe
Qt&nb$oR(_V$-rO@0AZ~_>i_@%
diff --git a/phpBB/images/smilies/icon_confused.gif b/phpBB/images/smilies/icon_confused.gif
deleted file mode 100644
index 0c49e06983f1fff4bc0834b4d86ce39b8a36a914..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 171
zcmZ?wbhEHbZXiyV-#U
P9L#x)b-Z(h7#XYqI2k)k
diff --git a/phpBB/images/smilies/icon_e_biggrin.gif b/phpBB/images/smilies/icon_e_biggrin.gif
new file mode 100644
index 0000000000000000000000000000000000000000..0d5cd010d7668e997fdb0be4a9a240d431b89a54
GIT binary patch
literal 413
zcmV;O0b>3~Nk%w1VGjTi0M$PL{<{zV@*Mx<7*s+ja&BcrIVRVT5&o+U{>TtkOf&wZ
z3}aV7{@fPmzZU+r4(po_{?Zfn_V)ki8UEQ7l8kt9V>nwT>9UfD-S$611K!_u(A-?H};)@7&wiT}Ubb00960
z|N8p+A^8LW002J#EC2ui01p5W000KMz@ISEx_m017$qWXmM*SLz#@U&I;AFOB@Ij^
zr%7YO`RNiluU8^qKoGV9Y38y7dOhk1kI;x_9XJws76bwWZ#@7iFB>NU0upR)eEJ06e`s3LYUsBn2#_JSaTW4{}W-1qKHP3h4#~BTYgh3n?`QH7FhJ?oAjnF)|qW
HK>z?d=UbxV
literal 0
HcmV?d00001
diff --git a/phpBB/images/smilies/icon_e_confused.gif b/phpBB/images/smilies/icon_e_confused.gif
new file mode 100644
index 0000000000000000000000000000000000000000..ed8327080430360adc47e7f60ab58a247b70f333
GIT binary patch
literal 410
zcmV;L0cHM2Nk%w1VGjTi0M$PLns6KbqzwMs760-a*NhSV$`Jms4vmL)RZBDetqo&W
zK>nx=?7b6PNG$7{4@EjB_V)JvwhsQn50Z>{abr6Ey$^M0MY_1M{<#kS=o$az82-f&
z{?Zfw?Hl>;BV$%GUsO72Tsw$>ZhUfHo0yI2>FDn6?bX!L{NWhxtr3`mL)_cgesf^$
z)g9*4IhBxnZed1wZdtpC71@{)!haHhTqS;9Cs9N$@bK@no-X_CAJ)b&|Nr_+J}CeI
z0Q&m+A^8LW002J#EC2ui01p5W000KJz@HHEvV2Fk(#4suN;4>JkY1P>)mLL~||Gz2s?AnWW+7b7q+7xzH`
EI}UTG3;+NC
literal 0
HcmV?d00001
diff --git a/phpBB/images/smilies/icon_e_geek.gif b/phpBB/images/smilies/icon_e_geek.gif
new file mode 100644
index 0000000000000000000000000000000000000000..c1947cc03bfd3778327558128b56d1ca5f81da4c
GIT binary patch
literal 410
zcmV;L0cHM2Nk%w1VG#fk0M$PLyXqbOs}2A19AsBE{-q55vktrC9GY?**NhRn?N?k)
zG`sOw{@NA(yANxrE&j|AkkDUdT0Zvn_K}NtMLH*SXhpiXvj6BA|K%9|)fBt(Aph+f
z`R^mU>sNeoUYnSW>gnk2?(Nmo(bmQ=?wJmGZdtbHSMAjue^dtSz7+8A@0f!_+}qfG
zUMGHYV7u=h!haI};1{%>E^c8)=F~avst|KzJ-~qyvfdrpm=b|pCHw6k{=*M5Gcy1H
z0Q&m+A^8LW002J#EC2ui01*HY000KJz@P9ZnN%XS$ZR4RIz<&4N3gk^WCM}&_gPH^
zR7{MK8hnN-#SRRKQ4iV_k|MjLi@{NV8p6GA?NggzLBgg-tGFB*=HJ`0iwln{fA
zFE2hX0FetmlnIuL0HrAMAbXy=4ImpTc2oxY&LLd<>HwZ8~3hV4c79KMt7VJR)
EJGc6-RR910
literal 0
HcmV?d00001
diff --git a/phpBB/images/smilies/icon_e_sad.gif b/phpBB/images/smilies/icon_e_sad.gif
new file mode 100644
index 0000000000000000000000000000000000000000..57f00ba6019b7498683195900d48cf19a0978e9b
GIT binary patch
literal 420
zcmV;V0bBk@Nk%w1VGjTi0M$PLV^%Z&@*LNU5&qN@{;duErVUn1GybRzV^=`_#}Meh
z7XRrPQbjN8n-4`gC;r?P_V)Jvu@3&e50Z>{abr4lXhpiXvj626|Lq(8wGR32BL2e<
zUsO7qX&C;w4v2tmd~#lzcO9FUjq2&>@9*yZqYV1``Tzg`{NWjxgF|j%Mzo$T?yV7i
zUMJa@5`J@F-pw`K+t|T?67Rhd?bRKMgmaaUe6@}kd2U&OTqXbi`dvsWXj?he)X_^m
zDf;^QA^8LW002J#EC2ui01p5W000KTz@HFetMDj1)dV7J_9`$<0JEU2IK8GQrQz`c
zi-lJK5dBDoZeYE*JO;d(gH(fI*3$)Q@JMVzH5@1lK80-$g+3B23;-xTJ&`_$kv%>c
z3>1huJ|;c`oj#lqI|iUSC!7hQsXh@73^NI{8ygZH84&~o4GbSQwGy|v1P8_)A3XrV
z9y`v?1<^Y(KOiB^y2S-MB^@t9Bn~VQx(5X%B@J^;BMvUw=mHKSO+q6GEiwW!IUMx$
OO)P*=fx`m8AOJf__pFKl
literal 0
HcmV?d00001
diff --git a/phpBB/images/smilies/icon_e_smile.gif b/phpBB/images/smilies/icon_e_smile.gif
new file mode 100644
index 0000000000000000000000000000000000000000..6bb8d04b72ab226d31e23512669648cadc0419c3
GIT binary patch
literal 416
zcmV;R0bl+{Nk%w1VGjTi0M$PLns6Kb(i8s55dNeL|MDDiZe`bu5&z^ERZBDf=^0~J
zK>o1~=)V?QNG$7{4@NpC{;Uo5_V)hV7XG;o{@E4&!Vi*+c>c8xabr6F?HhGyMY_1M
z{>2dfs15$T5BcsQV^%X?R61!~JBWa8eR5u#n2qY`=H
zGy3}aA^8LW002J#EC2ui01p5W000KPz@IQu(}*x4m?a`?qA2CKutOcyc$@0pur(ud<#{tYjDPS2?2ND4s6&@=&ASnk2JUoQ~kscEh
zIT#cY5^EFzdpi>s3k?VXsHg&n9;6Ek4+ty*1strS3k47k2qQEcKEcAm0{|l^AQK)w
zJ+9;`pAi4@98^Usab`-ndlX_<
zIGL4-{=yIbsSWYC5&otPK{zJ*?;zyk;ag2FUQ#yx#}NM16w!+j{;dt&+}i%x760iO
z{=N_X-4_4t8~(WtYEmr!!1&vheGq84eZn%Wm`dq
zer)x~6Xn-9vYIZ<%g0SbFHuD?#KOImbRXBsFxI3Ld2U&KbYH-l7ytkIOFk+8|Nj60
z0Q&m+A^8LW002J#EC2ui01p5Y000Kaz@M-rK#)WVgh0srok*{U!LwPxSQ+LbB{fV#
zBh7%a_z@^w?fCQ#safIJ~QfIB<`GJb?UhIl57JRb)l9gBt<
zmOKCl6dIVGZWRn4ngBd9E&-|mqN4x+7$`G2Iu*7I3AwNh4GAqYA`HSDJ;fNj4Nk%w1VG{rn0M$PL{<{y4%7L|(BmUSF{;Ca+(t>7LHvY2?{-g}y^WFdQ
z9D8+bnr#|IIw#wd5k#GqQ%EvaMlJUC_K)3!{>c%K;f6Vpk#%TAy126c=o$az82RoZ
z|Lq(8!4HqvgNT4`K0Z5}n2k$7F5&p!>gnk2?(Nmo(Qjiz?bRLbnGW3B*kV^c?y3-&
zgG1=Q7JYMH{@@qz@bAmy<4Hw3=F~Y{P&w)8=arCrl8t+FWIcXfCxKig-tgY=yb=Ha
z0Q&m+A^8LW002J#EC2ui022Tb000KVz@Jbkxm^r7!wDxDI)$bSZKL31P=b}|DGar!
zifRTna2Y~F-!E1Jhcg;7rPnC^)V{plXNB$cLOwDhgoHjCJ_(8mJQiwq4-*xWlRh2=
z1p%6lfsqq=6Q7uQn~ye@9;qHa6h4}-J~2ZOe;oh-e-KU|0v*1$2L}Yh2n-)iCI+_v
z!NSA{5h_nF49o|52-yrTTqO-G!OsXObzDC-4Gshm>@?gJ2mn0Ll_`4
QATaRbvH-*ac|iaGJ3}Y7Jpcdz
literal 0
HcmV?d00001
diff --git a/phpBB/images/smilies/icon_e_wink.gif b/phpBB/images/smilies/icon_e_wink.gif
new file mode 100644
index 0000000000000000000000000000000000000000..1957f24eac3eb079076791d68f52a558b4cad76b
GIT binary patch
literal 413
zcmV;O0b>3~Nk%w1VGjTi0M$PLwU#63zZPX!G@5W5{?ZfvqzwMb5dZQV*NhSWO3}&n+79no;onlfz#*#9;YTLCOsS)
z4OJ!}ApK?wX{q#0LE0xAg!D=UURJ`NBN
z6dM^45o;N6i4YSC6bl5Wr+kT{3JMnsHGF-c6DbS~78EG}5{Z_h3_c$P10p8^4!^Cz
zAHx(fKO+O8DU`wm#3Mo|7dXq!*cNk5CKoIW-~|X5CQU*n4>mgpE<7Ra?oA#eH#r{p
HK>z?d2m+=N
literal 0
HcmV?d00001
diff --git a/phpBB/images/smilies/icon_frown.gif b/phpBB/images/smilies/icon_frown.gif
deleted file mode 100644
index d2ac78c04bd1f50059ce9c1fa9534dcee2195579..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 171
zcmZ?wbhEHbaoDCD!-THXQ
zaD}Q`!Ef~@t%4VS^H`jpHe@qRnmW&T1rN_M_11z^Th4v=m-`t@{9)jl*%hj`aoDCD!-THXQ
zaD}Q`!Ef~@t%4VS^H`jpHe@qRnmW&T1rN_M_11z^Th4v=m-`t@{9)jl*%hj`3F2nzSlmGt}{tp7jjg5`}
z|9}1eDNqRrDE?$&WMJT9&;fBkW-zcsU+|R7ntLO3**QsZu>uaJIn9DTj_MrhAC|2y
zn^DM@#l<(@zDcWq`B+oyDaGR~0+SdoFXD`_(PqAxy<2o0Q>0^(jhH~$tb+>(~Mkip?iSJVUa9D@n#Zhbsv
zutHU>;J1F0R>6zE2`tV}8xE^#?@bGklrZsUYAp!;dbG*vY{CM88Jk-qvwbqQUtQFY
Pm?x1IA$CiJiNP8Goi0B(
diff --git a/phpBB/includes/acp/acp_icons.php b/phpBB/includes/acp/acp_icons.php
index 801b61112f..66bc377490 100644
--- a/phpBB/includes/acp/acp_icons.php
+++ b/phpBB/includes/acp/acp_icons.php
@@ -101,7 +101,49 @@ class acp_icons
case 'add':
- $order_list = '';
+ $smilies = $default_row = array();
+ $smiley_options = $order_list = $add_order_list = '';
+
+ if ($action == 'add' && $mode == 'smilies')
+ {
+ $sql = 'SELECT *
+ FROM ' . SMILIES_TABLE . '
+ ORDER BY smiley_order';
+ $result = $db->sql_query($sql);
+
+ while ($row = $db->sql_fetchrow($result))
+ {
+ if (empty($smilies[$row['smiley_url']]))
+ {
+ $smilies[$row['smiley_url']] = $row;
+ }
+ }
+ $db->sql_freeresult($result);
+
+ if (sizeof($smilies))
+ {
+ foreach ($smilies as $row)
+ {
+ $selected = false;
+
+ if (!$smiley_options)
+ {
+ $selected = true;
+ $default_row = $row;
+ }
+ $smiley_options .= '';
+
+ $template->assign_block_vars('smile', array(
+ 'SMILEY_URL' => addslashes($row['smiley_url']),
+ 'CODE' => addslashes($row['code']),
+ 'EMOTION' => addslashes($row['emotion']),
+ 'WIDTH' => $row['smiley_width'],
+ 'HEIGHT' => $row['smiley_height'],
+ 'ORDER' => $row['smiley_order'] + 1,
+ ));
+ }
+ }
+ }
$sql = "SELECT *
FROM $table
@@ -137,6 +179,11 @@ class acp_icons
$after_txt = ($mode == 'smilies') ? $row['code'] : $row['icons_url'];
$order_list = '' . $order_list;
+
+ if (!empty($default_row))
+ {
+ $add_order_list = '' . $add_order_list;
+ }
}
}
$db->sql_freeresult($result);
@@ -166,14 +213,14 @@ class acp_icons
'L_WIDTH' => $user->lang[$lang . '_WIDTH'],
'L_HEIGHT' => $user->lang[$lang . '_HEIGHT'],
'L_ORDER' => $user->lang[$lang . '_ORDER'],
+ 'L_NO_ICONS' => $user->lang['NO_' . $lang . '_' . strtoupper($action)],
'COLSPAN' => $colspan,
'ID' => $icon_id,
'U_BACK' => $this->u_action,
'U_ACTION' => $this->u_action . '&action=' . (($action == 'add') ? 'create' : 'modify'),
- )
- );
+ ));
foreach ($data as $img => $img_row)
{
@@ -188,8 +235,28 @@ class acp_icons
'ID' => (isset($img_row[$fields . '_id'])) ? $img_row[$fields . '_id'] : 0,
'WIDTH' => (!empty($img_row[$fields .'_width'])) ? $img_row[$fields .'_width'] : $img_row['width'],
'HEIGHT' => (!empty($img_row[$fields .'_height'])) ? $img_row[$fields .'_height'] : $img_row['height'],
- 'POSTING_CHECKED' => (!empty($img_row['display_on_posting']) || $action == 'add') ? ' checked="checked"' : '')
- );
+ 'POSTING_CHECKED' => (!empty($img_row['display_on_posting']) || $action == 'add') ? ' checked="checked"' : '',
+ ));
+ }
+
+ // Ok, another row for adding an addition code for a pre-existing image...
+ if ($action == 'add' && $mode == 'smilies' && sizeof($smilies))
+ {
+ $template->assign_vars(array(
+ 'S_ADD_CODE' => true,
+
+ 'S_IMG_OPTIONS' => $smiley_options,
+ 'S_ADD_ORDER_LIST' => $add_order_list,
+ 'IMG_SRC' => $phpbb_root_path . $img_path . '/' . $default_row['smiley_url'],
+ 'IMG_PATH' => $img_path,
+ 'PHPBB_ROOT_PATH' => $phpbb_root_path,
+
+ 'CODE' => $default_row['code'],
+ 'EMOTION' => $default_row['emotion'],
+
+ 'WIDTH' => $default_row['smiley_width'],
+ 'HEIGHT' => $default_row['smiley_height'],
+ ));
}
return;
@@ -212,6 +279,32 @@ class acp_icons
$image_code = request_var('code', array('' => ''));
$image_display_on_posting = (isset($_POST['display_on_posting'])) ? request_var('display_on_posting', array('' => 0)) : array();
+ // Ok, add the relevant bits if we are adding new codes to existing emoticons...
+ if (!empty($_POST['add_additional_code']))
+ {
+ $add_image = request_var('add_image', '');
+ $add_code = request_var('add_code', '');
+ $add_emotion = request_var('add_emotion', '', true);
+
+ if ($add_image && $add_emotion && $add_code)
+ {
+ $images[] = $add_image;
+ $image_add[$add_image] = true;
+
+ $image_code[$add_image] = $add_code;
+ $image_emotion[$add_image] = $add_emotion;
+ $image_width[$add_image] = request_var('add_width', 0);
+ $image_height[$add_image] = request_var('add_height', 0);
+
+ if (!empty($_POST['add_display_on_posting']))
+ {
+ $image_display_on_posting[$add_image] = 1;
+ }
+
+ $image_order[$add_image] = request_var('add_order', 0);
+ }
+ }
+
foreach ($images as $image)
{
if (($mode == 'smilies' && ($image_emotion[$image] == '' || $image_code[$image] == '')) ||
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php
index becd792388..bea1c7397b 100644
--- a/phpBB/includes/functions_posting.php
+++ b/phpBB/includes/functions_posting.php
@@ -64,9 +64,19 @@ function generate_smilies($mode, $forum_id)
ORDER BY smiley_order';
$result = $db->sql_query($sql, 3600);
+ $smilies = array();
while ($row = $db->sql_fetchrow($result))
{
- if ($row['smiley_url'] !== $last_url)
+ if (empty($smilies[$row['smiley_url']]))
+ {
+ $smilies[$row['smiley_url']] = $row;
+ }
+ }
+ $db->sql_freeresult($result);
+
+ if (sizeof($smilies))
+ {
+ foreach ($smilies as $row)
{
$template->assign_block_vars('smiley', array(
'SMILEY_CODE' => $row['code'],
@@ -77,9 +87,7 @@ function generate_smilies($mode, $forum_id)
'SMILEY_DESC' => $row['emotion'])
);
}
- $last_url = $row['smiley_url'];
}
- $db->sql_freeresult($result);
if ($mode == 'inline' && $display_link)
{
diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql
index 7268145932..b59288a1b8 100644
--- a/phpBB/install/schemas/schema_data.sql
+++ b/phpBB/install/schemas/schema_data.sql
@@ -622,30 +622,48 @@ INSERT INTO phpbb_posts (topic_id, forum_id, poster_id, icon_id, post_time, post
INSERT INTO phpbb_topics_posted (user_id, topic_id, topic_posted) VALUES (2, 1, 1);
# -- Smilies
-INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':D', 'icon_biggrin.gif', 'Very Happy', 15, 15, 1);
-INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':)', 'icon_smile.gif', 'Smile', 15, 15, 2);
-INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':(', 'icon_sad.gif', 'Sad', 15, 15, 3);
-INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':o', 'icon_surprised.gif', 'Surprised', 15, 15, 4);
-INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':eek:', 'icon_surprised.gif', 'Surprised', 15, 15, 4);
-INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES ('8O', 'icon_eek.gif', 'Shocked', 15, 15, 5);
-INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':?', 'icon_confused.gif', 'Confused', 15, 15, 6);
-INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES ('8)', 'icon_cool.gif', 'Cool', 15, 15, 7);
-INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':lol:', 'icon_lol.gif', 'Laughing', 15, 15, 8);
-INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':x', 'icon_mad.gif', 'Mad', 15, 15, 9);
-INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':P', 'icon_razz.gif', 'Razz', 15, 15, 10);
-INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':oops:', 'icon_redface.gif', 'Embarassed', 15, 15, 11);
-INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':cry:', 'icon_cry.gif', 'Crying or Very sad', 15, 15, 12);
-INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':evil:', 'icon_evil.gif', 'Evil or Very Mad', 15, 15, 13);
-INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':twisted:', 'icon_twisted.gif', 'Twisted Evil', 15, 15, 14);
-INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':roll:', 'icon_rolleyes.gif', 'Rolling Eyes', 15, 15, 15);
-INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (';)', 'icon_wink.gif', 'Wink', 15, 15, 16);
-INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':!:', 'icon_exclaim.gif', 'Exclamation', 15, 15, 17);
-INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':?:', 'icon_question.gif', 'Question', 15, 15, 18);
-INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':idea:', 'icon_idea.gif', 'Idea', 15, 15, 19);
-INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':arrow:', 'icon_arrow.gif', 'Arrow', 15, 15, 20);
-INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':|', 'icon_neutral.gif', 'Neutral', 15, 15, 21);
-INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':mrgreen:', 'icon_mrgreen.gif', 'Mr. Green', 15, 15, 22);
-
+INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':D', 'icon_e_biggrin.gif', 'Very Happy', 15, 17, 1);
+INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':-D', 'icon_e_biggrin.gif', 'Very Happy', 15, 17, 2);
+INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':grin:', 'icon_e_biggrin.gif', 'Very Happy', 15, 17, 3);
+INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':)', 'icon_e_smile.gif', 'Smile', 15, 17, 4);
+INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':-)', 'icon_e_smile.gif', 'Smile', 15, 17, 5);
+INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':smile:', 'icon_e_smile.gif', 'Smile', 15, 17, 6);
+INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (';)', 'icon_e_wink.gif', 'Wink', 15, 17, 7);
+INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (';-)', 'icon_e_wink.gif', 'Wink', 15, 17, 8);
+INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':wink:', 'icon_e_wink.gif', 'Wink', 15, 17, 9);
+INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':(', 'icon_e_sad.gif', 'Sad', 15, 17, 10);
+INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':-(', 'icon_e_sad.gif', 'Sad', 15, 17, 11);
+INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':sad:', 'icon_e_sad.gif', 'Sad', 15, 17, 12);
+INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':o', 'icon_e_surprised.gif', 'Surprised', 15, 17, 13);
+INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':-o', 'icon_e_surprised.gif', 'Surprised', 15, 17, 14);
+INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':eek:', 'icon_e_surprised.gif', 'Surprised', 15, 17, 15);
+INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':shock:', 'icon_eek.gif', 'Shocked', 15, 15, 16);
+INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':?', 'icon_e_confused.gif', 'Confused', 15, 17, 17);
+INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':-?', 'icon_e_confused.gif', 'Confused', 15, 17, 18);
+INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':???:', 'icon_e_confused.gif', 'Confused', 15, 17, 19);
+INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES ('8-)', 'icon_cool.gif', 'Cool', 15, 15, 20);
+INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':cool:', 'icon_cool.gif', 'Cool', 15, 15, 21);
+INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':lol:', 'icon_lol.gif', 'Laughing', 15, 15, 22);
+INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':x', 'icon_mad.gif', 'Mad', 15, 15, 23);
+INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':-x', 'icon_mad.gif', 'Mad', 15, 15, 24);
+INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':mad:', 'icon_mad.gif', 'Mad', 15, 15, 25);
+INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':P', 'icon_razz.gif', 'Razz', 15, 15, 26);
+INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':-P', 'icon_razz.gif', 'Razz', 15, 15, 27);
+INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':razz:', 'icon_razz.gif', 'Razz', 15, 15, 28);
+INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':oops:', 'icon_redface.gif', 'Embarassed', 15, 15, 29);
+INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':cry:', 'icon_cry.gif', 'Crying or Very sad', 15, 15, 30);
+INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':evil:', 'icon_evil.gif', 'Evil or Very Mad', 15, 15, 31);
+INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':twisted:', 'icon_twisted.gif', 'Twisted Evil', 15, 15, 32);
+INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':roll:', 'icon_rolleyes.gif', 'Rolling Eyes', 15, 15, 33);
+INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':!:', 'icon_exclaim.gif', 'Exclamation', 15, 15, 34);
+INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':?:', 'icon_question.gif', 'Question', 15, 15, 35);
+INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':idea:', 'icon_idea.gif', 'Idea', 15, 15, 36);
+INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':arrow:', 'icon_arrow.gif', 'Arrow', 15, 15, 37);
+INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':|', 'icon_neutral.gif', 'Neutral', 15, 15, 38);
+INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':-|', 'icon_neutral.gif', 'Neutral', 15, 15, 39);
+INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':mrgreen:', 'icon_mrgreen.gif', 'Mr. Green', 15, 15, 40);
+INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':geek:', 'icon_e_geek.gif', 'Geek', 15, 17, 41);
+INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':ugeek:', 'icon_e_ugeek.gif', 'Uber Geek', 15, 17, 42);
# -- icons
INSERT INTO phpbb_icons (icons_url, icons_width, icons_height, icons_order, display_on_posting) VALUES ('misc/fire.gif', 16, 16, 1, 1);
diff --git a/phpBB/language/en/acp/posting.php b/phpBB/language/en/acp/posting.php
index 9dc6281a1e..aa319ddb94 100644
--- a/phpBB/language/en/acp/posting.php
+++ b/phpBB/language/en/acp/posting.php
@@ -79,6 +79,7 @@ $lang = array_merge($lang, array(
'ACP_ICONS_EXPLAIN' => 'From this page you can add, remove and edit the icons users may add to their topics or posts. These icons are generally displayed next to topic titles on the forum listing, or the post subjects in topic listings. You can also install and create new packages of icons.',
'ACP_SMILIES_EXPLAIN' => 'Smilies or emoticons are typically small, sometimes animated images used to convey an emotion or feeling. From this page you can add, remove and edit the emoticons users can use in their posts and private messages. You can also install and create new packages of smilies.',
'ADD_SMILIES' => 'Add multiple smilies',
+ 'ADD_SMILEY_CODE' => 'Add additional smiley code',
'ADD_ICONS' => 'Add multiple icons',
'AFTER_ICONS' => 'After %s',
'AFTER_SMILIES' => 'After %s',
@@ -123,8 +124,12 @@ $lang = array_merge($lang, array(
'MASS_ADD_SMILIES' => 'Add multiple smilies',
+ 'NO_ICONS_ADD' => 'There are no icons available for adding.',
+ 'NO_ICONS_EDIT' => 'There are no icons available for modifying.',
'NO_ICONS_EXPORT' => 'You have no icons with which to create a package.',
'NO_ICONS_PAK' => 'No icon packages found.',
+ 'NO_SMILIES_ADD' => 'There are no smilies available for adding.',
+ 'NO_SMILIES_EDIT' => 'There are no smilies available for modifying.',
'NO_SMILIES_EXPORT' => 'You have no smilies with which to create a package.',
'NO_SMILIES_PAK' => 'No smiley packages found.',