1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-24 15:13:04 +02:00

Add chatbox_menu_template.php and chatbox_menu_shortcodes.php,

Introduce shortcode/template combination to render avatars in chat.php

Changes:
- Add chatbox_menu_template.php and chatbox_menu_shortcodes.php files.
- Add bootstrap3 styling for some elements in chat.php list view markup.
- Cleanup chat.php and chatbox_menu.php code generally and to replace legacy database calls with current standard.
- Add logic to search and replace legacy chat icon source path with current icon path in $CHATBOXSTYLE
- Refactor retrieveUserDataByNick() method to use e107::user() method to retireve extended user data.

Succeeded Tests:
- Load chatbox_menu_template.php in {e_PLUGIN}/chatbox_menu/templates/chatbox_menu_template.php
- Load chatbox_menu_template.php in {THEME}/templates/chatbox_menu/chatbox_menu_template.php
This commit is contained in:
Arun S. Sekher
2019-01-19 15:27:24 +04:00
parent b19463b259
commit b76c83aeba
4 changed files with 654 additions and 475 deletions

View File

@@ -0,0 +1,60 @@
<?php
/*
* e107 website system
*
* Copyright (C) 2008-2013 e107 Inc (e107.org)
* Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
*
* e107 chatbox_menu Plugin
*
*/
if ( ! defined('e107_INIT')) {
exit;
}
//---------------------------------MENU-----------------------------------------
$CHATBOX_MENU_TEMPLATE['menu']['start'] =
'<ul class="media-list unstyled list-unstyled">' . PHP_EOL;
$CHATBOX_MENU_TEMPLATE['menu']['item'] = '
<li class="media">
<div class="media-left">
<span class="media-object">{CB_AVATAR}</span>
</div>
<div class="media-body">
<b>{CB_USERNAME}</b>&nbsp;
<small class="muted smalltext">{CB_TIMEDATE}</small><br />
<p>{CB_MESSAGE}</p>
</div>
</li>' . PHP_EOL;
$CHATBOX_MENU_TEMPLATE['menu']['end'] = '</ul>'. PHP_EOL;
//---------------------------------LIST-----------------------------------------
$CHATBOX_MENU_TEMPLATE['list']['start'] =
'<ul class="media-list list-group">' . PHP_EOL;
$CHATBOX_MENU_TEMPLATE['list']['item'] = '
<li class="media list-group-item" >
<div class="media-left">
<span class="media-object">{CB_AVATAR:size=60}</span>
</div>
<div class="media-body">
<h4 class="media-heading" style="display: inline !important;">{CB_USERNAME}</h4>
<small class="label label-default pull-right">{CB_TIMEDATE}</small><br>
<p>{CB_MESSAGE}</p>
<div>
<div class="pull-left">{CB_BLOCKED}</div>
<div class="pull-right">{CB_MOD}</div>
</div>
</div>
</li>'. PHP_EOL;
$CHATBOX_MENU_TEMPLATE['list']['end'] = '</ul>'. PHP_EOL;