Advertisement
Tibers

PhpBB Emoji ScrollBar

Dec 19th, 2024
12
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.48 KB | Source Code | 0 0
  1. // add your code here
  2. ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  3. Hello 👽
  4.  
  5. In this video, I will show you how to install Emojis in phpBB.
  6.  
  7. Why Emoji in phpBB?
  8.  
  9. Emojis, like on any other platform, bring an extra touch of joy, expressiveness, and friendliness, contributing to a more pleasant and interactive experience.
  10.  
  11. To install emojis in phpBB, search for and download the desired files, select the emojis you want to use, and then install them directly into the platform.
  12.  
  13. Notes:
  14.  
  15. Emojis can be in .GIF format (animated or static) or .PNG format (static only).
  16. Upon installing phpBB, you will find 24 default emojis provided by phpBB in the folder phpBB/images/smilies/. These are in .GIF format, animated, and have a size of 15px width and 17px height.
  17. After installing a large number of emojis in phpBB, I noticed that the platform does not include a scroll bar for the emoji section by default, which can make navigation difficult when the list is extended.
  18. I made modifications to add a scroll bar, useful in cases where a large number of emojis are installed, such as over 50.
  19. I selected and installed a small emoji package in .PNG format, with a size of 160px x 160px. After installation, I set the emoji size to 40px x 40px directly from the ACP (Admin Control Panel).
  20. In phpBB, I installed a total of 260 emojis, but more can be installed. I recommend installing 30 emojis at a time, in alphabetical order, to fit correctly into the smiley-box without requiring additional adjustments in the ACP.
  21.  
  22. Manual and Automatic Installation
  23.  
  24. In phpBB, there are two options for installing emojis:
  25. Install smilies package (smilies.pak) – Provides an automatic method for adding multiple emojis at once.
  26. Add multiple smilies – Allows manual installation, emoji by emoji, or a selected set.
  27. In this video, I used the manual method, with the "Add multiple smilies" option, to demonstrate the process in detail.
  28.  
  29. Additional Info:
  30. In the description of this video, I included a package of 3300 emojis in .PNG format, each with a size of 160px x 160px. The emojis are inspired by Apple Emojis, having a similar design to those used on Apple devices. In addition to the emoji package, I added:
  31. A .txt file with the necessary modifications for the scroll bar mentioned earlier.
  32. A folder with 260 emojis and 260 .txt files, each containing a custom Short Code (e.g., :alien:) for each emoji in the 260-pack.
  33. Organization and Installation of Emojis in phpBB
  34.  
  35. Emoji Organization:
  36. Place all the emojis in a main folder. Organize them into subfolders of 30 emojis each, naming the folders alphabetically as follows:
  37.  
  38. z - 30 - 1
  39. z - 30 - 2
  40. z - 30 - 3
  41. Continue in this manner, creating a subfolder for each set of 30 emojis. Copy 30 emojis into each subfolder, alphabetically. This helps with an organized and efficient installation.
  42.  
  43. Installing Emojis in phpBB:
  44.  
  45. Upload 30 emojis at a time from a folder to the host in the path: phpBB/images/smilies/
  46. Access the Admin Control Panel (ACP), Smilies section.
  47. Select the "Add multiple smilies" option to add emojis from the uploaded folder.
  48. After installing 30 emojis, upload the next set of 30 and repeat the process.
  49. After installation, you can set the size of the emojis in the ACP, under the POSTING - Smilies section. For example, set the .PNG emojis (160px x 160px) to 40px x 40px.
  50.  
  51. Admin Control Panel (ACP)
  52. In phpBB, to manage emojis, you have the following options:
  53.  
  54. Post settings
  55. Allow smilies: Yes/No
  56. Smilies per page: Defines the number of emojis displayed per page.
  57. Maximum smilies per post: The maximum number of emojis allowed in a post. Set to 0 for unlimited.
  58. Note: The modifications presented in this video were made on the default prosilver style in phpBB.
  59.  
  60. Emoji-list with emojis, names, shortcodes, unicode and html entities [massive list] - emojis.json.
  61. https://gist.github.com/oliveratgithub/0bf11a9aff0d6da7b46f1490f86a71eb
  62. ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  63. Default files from phpBB (as shown in the video)
  64. The following are the default files from phpBB that were modified or focused on in the video:
  65.  
  66. HTML Files
  67. /template/
  68. posting_editor.html
  69.  
  70. CSS Files
  71. /theme/
  72. common.css
  73. forms.css
  74. responsive.css
  75. stylesheet.css
  76.  
  77. - Custom
  78. /theme/custom.css
  79.  
  80. - Edit
  81. /theme/stylesheet.css: @import url("custom.css?hash=c9d32cbx");
  82. ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  83. ---> In the code below, I extracted the styles from the /theme/common.css , /theme/forms.css , /theme/responsive.css files and added them to custom.css to avoid overlapping with the default styles. I made a few minor modifications to the CSS, and for this video, I preferred to centralize them in custom.css
  84.  
  85. .emoji {
  86. min-height: 18px;
  87. min-width: 18px;
  88. height: 1em;
  89. width: 1em;
  90. }
  91.  
  92. .smilies {
  93. vertical-align: text-bottom;
  94. }
  95.  
  96. .smiley-box strong {
  97. display: inline-block;
  98. margin-left: 5px; /* Adjust the value as needed */
  99. }
  100.  
  101. /* Hides only <hr> in .smiley-box and .bbcode-status */
  102. .smiley-box hr, .bbcode-status hr {
  103. display: none; /* Hides the <hr> */
  104. }
  105.  
  106. /* Additional styles for .smiley-box */
  107. .smiley-box {
  108. height: 350px; /* Total height of the container */
  109. width: 19%; /* Container width */
  110. float: right;
  111. }
  112.  
  113. /* Area containing emojis with scroll enabled */
  114. .smiley-container {
  115. height: 250px; /* Height of the emoji area */
  116. overflow-y: auto; /* Enable vertical scrolling only for emojis */
  117. border: 1px solid #B4BAC0; /* Border for the emoji area */
  118. }
  119.  
  120. /* Scrollbar styling for WebKit (Chrome, Edge, Opera) */
  121. .smiley-container::-webkit-scrollbar {
  122. width: 8px; /* Scrollbar width */
  123. }
  124.  
  125. .smiley-container::-webkit-scrollbar-thumb {
  126. background: gray; /* Scrollbar thumb color */
  127. border-radius: 4px; /* Rounded corners for scrollbar thumb */
  128. }
  129.  
  130. .smiley-container img {
  131. margin: 3px; /* Margin around images */
  132. }
  133.  
  134. /* Styles for .bbcode-status */
  135. .bbcode-status {
  136. border: 1px dashed #B4BAC0; /* Adds a dashed border with color #B4BAC0 */
  137. padding: 7px; /* Optional: Adds padding to create space between the border and content */
  138. }
  139.  
  140. @media (max-width: 700px) {
  141. .smiley-box, .message-box {
  142. float: none; /* Removes float for smaller screens */
  143. width: auto; /* Makes width adaptive */
  144. }
  145.  
  146. .smiley-box {
  147. height: auto; /* Adjust height automatically */
  148. margin-top: 5px;
  149. }
  150.  
  151. .smiley-container {
  152. height: 150px; /* Reduces height of the emoji area */
  153. }
  154.  
  155. .bbcode-status {
  156. display: none; /* Hides .bbcode-status on smaller screens */
  157. }
  158. }
  159. ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  160. ---> Code from /template/posting_editor.html // The code can be found at lines 50-82 in the text editor.
  161. // Default code:
  162. <div id="smiley-box" class="smiley-box">
  163. <!-- EVENT posting_editor_smilies_before -->
  164. <!-- IF S_SMILIES_ALLOWED and .smiley -->
  165. <strong>{L_SMILIES}</strong><br />
  166. <!-- BEGIN smiley -->
  167. <a href="#" onclick="insert_text('{smiley.A_SMILEY_CODE}', true); return false;"><img src="{smiley.SMILEY_IMG}" width="{smiley.SMILEY_WIDTH}" height="{smiley.SMILEY_HEIGHT}" alt="{smiley.SMILEY_CODE}" title="{smiley.SMILEY_DESC}" /></a>
  168. <!-- END smiley -->
  169. <!-- ENDIF -->
  170. <!-- IF S_SHOW_SMILEY_LINK and S_SMILIES_ALLOWED -->
  171. <br /><a href="{U_MORE_SMILIES}" onclick="popup(this.href, 750, 350, '_phpbbsmilies'); return false;">{L_MORE_SMILIES}</a>
  172. <!-- ENDIF -->
  173. <!-- EVENT posting_editor_smilies_after -->
  174. <!-- IF BBCODE_STATUS -->
  175. <div class="bbcode-status">
  176. <!-- IF .smiley --><hr /><!-- ENDIF -->
  177. {BBCODE_STATUS}<br />
  178. <!-- IF S_BBCODE_ALLOWED -->
  179. {IMG_STATUS}<br />
  180. <!-- IF S_BBCODE_FLASH -->
  181. {FLASH_STATUS}<br />
  182. <!-- ENDIF -->
  183. {URL_STATUS}<br />
  184. <!-- ENDIF -->
  185. {SMILIES_STATUS}
  186. </div>
  187. <!-- ENDIF -->
  188. <!-- EVENT posting_editor_bbcode_status_after -->
  189. <!-- IF S_EDIT_DRAFT || S_DISPLAY_REVIEW -->
  190. <!-- IF S_DISPLAY_REVIEW --><hr /><!-- ENDIF -->
  191. <!-- IF S_EDIT_DRAFT --><strong><a href="{S_UCP_ACTION}">{L_BACK_TO_DRAFTS}</a></strong><!-- ENDIF -->
  192. <!-- IF S_DISPLAY_REVIEW --><strong><a href="#review">{L_TOPIC_REVIEW}</a></strong><!-- ENDIF -->
  193. <!-- ENDIF -->
  194. </div>
  195. // Custom code:
  196. <div id="smiley-box" class="smiley-box">
  197. <div class="smiley-container">
  198. <!-- EVENT posting_editor_smilies_before -->
  199. <!-- IF S_SMILIES_ALLOWED and .smiley -->
  200. <strong>{L_SMILIES}</strong><br />
  201. <!-- BEGIN smiley -->
  202. <a href="#" onclick="insert_text('{smiley.A_SMILEY_CODE}', true); return false;">
  203. <img src="{smiley.SMILEY_IMG}" width="{smiley.SMILEY_WIDTH}" height="{smiley.SMILEY_HEIGHT}" alt="{smiley.SMILEY_CODE}" title="{smiley.SMILEY_DESC}" />
  204. </a>
  205. <!-- END smiley -->
  206. <!-- ENDIF -->
  207. <!-- IF S_SHOW_SMILEY_LINK and S_SMILIES_ALLOWED -->
  208. <br /><a href="{U_MORE_SMILIES}" onclick="popup(this.href, 750, 350, '_phpbbsmilies'); return false;">{L_MORE_SMILIES}</a>
  209. <!-- ENDIF -->
  210. <!-- EVENT posting_editor_smilies_after -->
  211. </div> <!-- Closing tag for .smiley-container -->
  212.  
  213. <!-- IF BBCODE_STATUS -->
  214. <div class="bbcode-status">
  215. <!-- IF .smiley --><hr /><!-- ENDIF -->
  216. {BBCODE_STATUS}<br />
  217. <!-- IF S_BBCODE_ALLOWED -->
  218. {IMG_STATUS}<br />
  219. <!-- IF S_BBCODE_FLASH -->
  220. {FLASH_STATUS}<br />
  221. <!-- ENDIF -->
  222. {URL_STATUS}<br />
  223. <!-- ENDIF -->
  224. {SMILIES_STATUS}
  225. </div>
  226. <!-- ENDIF -->
  227. <!-- EVENT posting_editor_bbcode_status_after -->
  228. <!-- IF S_EDIT_DRAFT || S_DISPLAY_REVIEW -->
  229. <!-- IF S_DISPLAY_REVIEW --><hr /><!-- ENDIF -->
  230. <!-- IF S_EDIT_DRAFT --><strong><a href="{S_UCP_ACTION}">{L_BACK_TO_DRAFTS}</a></strong><!-- ENDIF -->
  231. <!-- IF S_DISPLAY_REVIEW --><strong><a href="#review">{L_TOPIC_REVIEW}</a></strong><!-- ENDIF -->
  232. <!-- ENDIF -->
  233. </div>
  234. ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  235. ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  236. ---> Watch the video to see what I modify/remove from /theme/common.css , /theme/forms.css , /theme/responsive.css
  237. ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  238. ---> Default code from /theme/common.css The code can be found at lines 1064-1073 in the text editor.
  239.  
  240. .emoji {
  241. min-height: 18px;
  242. min-width: 18px;
  243. height: 1em;
  244. width: 1em;
  245. }
  246.  
  247. .smilies {
  248. vertical-align: text-bottom;
  249. }
  250. ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  251. ---> Default code from /theme/forms.css The code can be found at lines 280-288 in the text editor.
  252.  
  253. /* Emoticons panel */
  254. .smiley-box {
  255. width: 18%;
  256. float: right;
  257. }
  258.  
  259. .smiley-box img {
  260. margin: 3px;
  261. }
  262. ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  263. ---> Default code from /theme/responsive.css The code can be found at lines 358-369 in the text editor. @media (max-width: 700px) {}
  264.  
  265. .smiley-box, .message-box {
  266. float: none;
  267. width: auto;
  268. }
  269.  
  270. .smiley-box {
  271. margin-top: 5px;
  272. }
  273.  
  274. .bbcode-status {
  275. display: none;
  276. }
  277. ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement