mirror of
https://github.com/e107inc/e107.git
synced 2025-08-03 21:27:25 +02:00
Issue #213 - Chatbox template BC issue.
This commit is contained in:
@@ -15,7 +15,12 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
if (!defined('e107_INIT')) { exit; }
|
if (!defined('e107_INIT')) { exit; }
|
||||||
if (!defined("USER_WIDTH")){ define("USER_WIDTH", "width:auto"); }
|
if (!defined("USER_WIDTH"))
|
||||||
|
{
|
||||||
|
$uw = (deftrue('e_BOOTSTRAP')) ? "" : "width:97%";
|
||||||
|
define("USER_WIDTH", $uw);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// global $usersettings_shortcodes, $pref;
|
// global $usersettings_shortcodes, $pref;
|
||||||
|
|
||||||
|
@@ -64,72 +64,76 @@ $emessage='';
|
|||||||
|
|
||||||
|
|
||||||
// FIX - using generic sc names is affecting old installs/templates and global wrappers (e.g. sc_style[USERNAME])
|
// FIX - using generic sc names is affecting old installs/templates and global wrappers (e.g. sc_style[USERNAME])
|
||||||
class chatbox_shortcodes extends e_shortcode
|
if(!class_exists('chatbox_shortcodes'))
|
||||||
{
|
{
|
||||||
function sc_cb_username($parm='')
|
class chatbox_shortcodes extends e_shortcode
|
||||||
{
|
{
|
||||||
list($cb_uid, $cb_nick) = explode(".", $this->var['cb_nick'], 2);
|
|
||||||
if($this->var['user_name'])
|
function sc_username($parm='')
|
||||||
{
|
{
|
||||||
$cb_nick = "<a href='".e_HTTP."user.php?id.{$cb_uid}'>".$this->var['user_name']."</a>";
|
list($cb_uid, $cb_nick) = explode(".", $this->var['cb_nick'], 2);
|
||||||
}
|
if($this->var['user_name'])
|
||||||
else
|
{
|
||||||
{
|
$cb_nick = "<a href='".e_HTTP."user.php?id.{$cb_uid}'>".$this->var['user_name']."</a>";
|
||||||
$cb_nick = $tp -> toHTML($cb_nick,FALSE,'USER_TITLE, emotes_off, no_make_clickable');
|
}
|
||||||
$cb_nick = str_replace("Anonymous", LAN_ANONYMOUS, $cb_nick);
|
else
|
||||||
}
|
{
|
||||||
|
$cb_nick = $tp -> toHTML($cb_nick,FALSE,'USER_TITLE, emotes_off, no_make_clickable');
|
||||||
return $cb_nick;
|
$cb_nick = str_replace("Anonymous", LAN_ANONYMOUS, $cb_nick);
|
||||||
}
|
}
|
||||||
|
|
||||||
function sc_cb_timedate($parm='')
|
return $cb_nick;
|
||||||
{
|
|
||||||
return e107::getDate()->convert_date($this->var['cb_datestamp'], "relative");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function sc_cb_message($parm = '')
|
|
||||||
{
|
|
||||||
if($this->var['cb_blocked'])
|
|
||||||
{
|
|
||||||
return CHATBOX_L6;
|
|
||||||
}
|
|
||||||
|
|
||||||
$pref = e107::getPref();
|
|
||||||
$emotes_active = $pref['cb_emote'] ? 'USER_BODY, emotes_on' : 'USER_BODY, emotes_off';
|
|
||||||
|
|
||||||
list($cb_uid, $cb_nick) = explode(".", $this->var['cb_nick'], 2);
|
|
||||||
|
|
||||||
$cb_message = e107::getParser()->toHTML($this->var['cb_message'], false, $emotes_active, $cb_uid, $pref['menu_wordwrap']);
|
|
||||||
|
|
||||||
return $cb_message;
|
|
||||||
|
|
||||||
$replace[0] = "["; $replace[1] = "]";
|
|
||||||
$search[0] = "["; $search[1] = "]";
|
|
||||||
$cb_message = str_replace($search, $replace, $cb_message);
|
|
||||||
}
|
|
||||||
|
|
||||||
function sc_cb_avatar($parm='')
|
|
||||||
{
|
|
||||||
return e107::getParser()->parseTemplate("{USER_AVATAR=".vartrue($this->var['user_image'])."}");
|
|
||||||
}
|
|
||||||
|
|
||||||
function sc_cb_bullet($parm = '')
|
|
||||||
{
|
|
||||||
$bullet = "";
|
|
||||||
|
|
||||||
if(defined('BULLET'))
|
|
||||||
{
|
|
||||||
$bullet = '<img src="'.THEME_ABS.'images/'.BULLET.'" alt="" class="icon" />';
|
|
||||||
}
|
|
||||||
elseif(file_exists(THEME.'images/bullet2.gif'))
|
|
||||||
{
|
|
||||||
$bullet = '<img src="'.THEME_ABS.'images/bullet2.gif" alt="" class="icon" />';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $bullet;
|
function sc_timedate($parm='')
|
||||||
|
{
|
||||||
|
return e107::getDate()->convert_date($this->var['cb_datestamp'], "relative");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function sc_message($parm = '')
|
||||||
|
{
|
||||||
|
if($this->var['cb_blocked'])
|
||||||
|
{
|
||||||
|
return CHATBOX_L6;
|
||||||
|
}
|
||||||
|
|
||||||
|
$pref = e107::getPref();
|
||||||
|
$emotes_active = $pref['cb_emote'] ? 'USER_BODY, emotes_on' : 'USER_BODY, emotes_off';
|
||||||
|
|
||||||
|
list($cb_uid, $cb_nick) = explode(".", $this->var['cb_nick'], 2);
|
||||||
|
|
||||||
|
$cb_message = e107::getParser()->toHTML($this->var['cb_message'], false, $emotes_active, $cb_uid, $pref['menu_wordwrap']);
|
||||||
|
|
||||||
|
return $cb_message;
|
||||||
|
|
||||||
|
$replace[0] = "["; $replace[1] = "]";
|
||||||
|
$search[0] = "["; $search[1] = "]";
|
||||||
|
$cb_message = str_replace($search, $replace, $cb_message);
|
||||||
|
}
|
||||||
|
|
||||||
|
function sc_cb_avatar($parm='')
|
||||||
|
{
|
||||||
|
return e107::getParser()->parseTemplate("{USER_AVATAR=".vartrue($this->var['user_image'])."}");
|
||||||
|
}
|
||||||
|
|
||||||
|
function sc_cb_bullet($parm = '')
|
||||||
|
{
|
||||||
|
$bullet = "";
|
||||||
|
|
||||||
|
if(defined('BULLET'))
|
||||||
|
{
|
||||||
|
$bullet = '<img src="'.THEME_ABS.'images/'.BULLET.'" alt="" class="icon" />';
|
||||||
|
}
|
||||||
|
elseif(file_exists(THEME.'images/bullet2.gif'))
|
||||||
|
{
|
||||||
|
$bullet = '<img src="'.THEME_ABS.'images/bullet2.gif" alt="" class="icon" />';
|
||||||
|
}
|
||||||
|
|
||||||
|
return $bullet;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -146,7 +150,6 @@ class chatbox_shortcodes extends e_shortcode
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if((isset($_POST['chat_submit']) || e_AJAX_REQUEST) && $_POST['cmessage'] != '')
|
if((isset($_POST['chat_submit']) || e_AJAX_REQUEST) && $_POST['cmessage'] != '')
|
||||||
{
|
{
|
||||||
if(!USER && !$pref['anon_post'])
|
if(!USER && !$pref['anon_post'])
|
||||||
@@ -289,7 +292,6 @@ if(!$text = $e107cache->retrieve("nq_chatbox"))
|
|||||||
ORDER BY c.cb_datestamp DESC LIMIT 0, ".intval($chatbox_posts);
|
ORDER BY c.cb_datestamp DESC LIMIT 0, ".intval($chatbox_posts);
|
||||||
|
|
||||||
global $CHATBOXSTYLE;
|
global $CHATBOXSTYLE;
|
||||||
|
|
||||||
|
|
||||||
if($CHATBOXSTYLE)
|
if($CHATBOXSTYLE)
|
||||||
{
|
{
|
||||||
@@ -303,9 +305,9 @@ if(!$text = $e107cache->retrieve("nq_chatbox"))
|
|||||||
// FIXME - move to template
|
// FIXME - move to template
|
||||||
$CHATBOX_TEMPLATE['start'] = "<ul class='unstyled'>";
|
$CHATBOX_TEMPLATE['start'] = "<ul class='unstyled'>";
|
||||||
$CHATBOX_TEMPLATE['item'] = "<li>
|
$CHATBOX_TEMPLATE['item'] = "<li>
|
||||||
{CB_AVATAR} <b>{CB_USERNAME}</b>
|
{CB_AVATAR} <b>{USERNAME}</b>
|
||||||
<small class='muted smalltext'>{CB_TIMEDATE}</small><br />
|
<small class='muted smalltext'>{TIMEDATE}</small><br />
|
||||||
<p style='margin-left:50px'>{CB_MESSAGE}</p>
|
<p style='margin-left:50px'>{MESSAGE}</p>
|
||||||
</li>\n";
|
</li>\n";
|
||||||
|
|
||||||
$CHATBOX_TEMPLATE['end'] = "</ul>";
|
$CHATBOX_TEMPLATE['end'] = "</ul>";
|
||||||
|
Reference in New Issue
Block a user