TaigaChat - AJAX Shoutbox [Deleted]

Is there a way for us admins to one-click ban someone on our system through taigachat? I used to have a different website with embed chattango box. Us admins could simply check mark a name and select ban or ban ip.
 
How do I remove the Shoutbox link in the navigation?

Edit: Figured it out. If anyone is wondering, this'll do.

Code:
.navTabs .navTab.taigachat.PopupClosed
{
    display: none;
}
 
Okay, I found a few threads on how to prune the chatbox, but I didn't like how they were designed. So, this is what I've created to prune the box.


note: I did use a few resources from the forum to create this.

I created a folder named tools, then named the prune file chat_prune.php

PHP:
<?php
require ('./intergration.php');
header('Location: ' . $_SERVER['HTTP_REFERER']);
$moderator = $user['is_admin'] OR $user['is_moderator'];
$nonmod = '0';
if ($moderator == $nonmod) {
die("You are not allowed to do this!"); }
else {
$user = "---dbuser---";
$pwd = "---dbpassword--";
$host = "localhost";
$dbname = "---dbname---";
$conn = mysql_connect($host,$user,$pwd) or ("error connecting to database");
$sql = "DELETE FROM `$dbname`.`dark_taigachat` ";
if(mysql_query($sql,$conn)){
echo "ShoutBox Cleared";
}
if(mysql_select_db($dbname,$conn))
mysql_query ("INSERT INTO dark_taigachat (id, user_id, username, date, message)
VALUES ('1', $user_id, '', $now,  'has pruned the shoubox!')");
mysql_close($conn);
}
?>

The I created a file named intergration.php in the same folder with chat_prune.php with the following:


PHP:
<?php
$fileDir = '..';
require ($fileDir . '/library/XenForo/Autoloader.php');
XenForo_Autoloader::getInstance()->setupAutoloader($fileDir . '/library');
XenForo_Application::initialize($fileDir . '/library/', $fileDir);
$request = new Zend_Controller_Request_Http();
$session = XenForo_Session::startPublicSession($request);
$userModel = XenForo_Model::create('XenForo_Model_User');
$user = $userModel->getUserById($session->get('user_id'));
$visitor = XenForo_Visitor::getInstance();
$user_id = $visitor->getUserId();
$now = XenForo_Application::$time;
?>


then go into your admin panel and find the moderator_bar template

find:
Code:
<a href="admin.php" class="acp adminLink"><span class="itemLabel">{xen:phrase admin_control_panel}</span></a>

add after:
Code:
<a href="tools/chat_prune.php" class="acp adminLink"><span class="itemLabel">Chatbox Prune</span></a>





Hopefully i'll come up with a better way to do it, but for now this works.

Works well, question though, only admin group on my forum see the link to prune,

I see this line of code:
$moderator = $user['is_admin'] OR $user['is_moderator'];

Moderator group seems to have perms, something I need to change here?
 
Works well, question though, only admin group on my forum see the link to prune,

I see this line of code:
$moderator = $user['is_admin'] OR $user['is_moderator'];

Moderator group seems to have perms, something I need to change here?

Ahh, I did forget that the moderator uses a different bar.

do this, go to the moderator_bar template and find

HTML:
<span class="itemCount {xen:if {$session.reportCounts.total}, 'alert'}">{$session.reportCounts.total}</span>
                </a>


and add this after


HTML:
<a href="tools/chat_prune.php" class="acp adminLink"><span class="itemLabel">Chatbox Prune</span></a>


this should fix it.
 
There we go, yep works, I remove the admin code, because as admin you will see the moderator link as well, thanks, mods are happy, lol,
 
On my forum list view the chat works 100% but if i click on the full view, the chat page is empty & the messages do not show up for any users.
It worked ok a few days ago.

Any ideas?

Here is a screenshot of the empty full view:
empty full view.webp
 
I've got a strange error on the Chrome Javascript Console (I don't have it on Firefox)

First (when connect to the page):

Code:
XenForo.activate(
 
    #document
 
) xenforo.js:191
Unable to find menu for Popup
[<div>, context: <div>]
 
    0: <div>
    context: <div>
    length: 1
    __proto__: Object[0]

Then (on auto-refresh I think):
Code:
Uncaught Syntax error, unrecognized expression:
jquery-1.5.2.min.js:16
k.error jquery-1.5.2.min.js:16
k.filter jquery-1.5.2.min.js:16
k jquery-1.5.2.min.js:16
c.querySelectorAll.k jquery-1.5.2.min.js:16
d.fn.extend.find jquery-1.5.2.min.js:16
d.fn.d.init jquery-1.5.2.min.js:16
d jquery-1.5.2.min.js:16
handleListResponse taigachat.js:336
XenForo.ajax.global taigachat.js:280
f xenforo.js:193
f.resolveWith jquery-1.5.2.min.js:16
v jquery-1.5.2.min.js:16
c jquery-1.5.2.min.js:16

If I disable the chatbox, the error is gone.


It seems the error has already been reported here.
 

Attachments

  • console.webp
    console.webp
    20.8 KB · Views: 19
I've got a strange error on the Chrome Javascript Console (I don't have it on Firefox)

First (when connect to the page):

Code:
XenForo.activate(
 
    #document
 
) xenforo.js:191
Unable to find menu for Popup
[<div>, context: <div>]
 
    0: <div>
    context: <div>
    length: 1
    __proto__: Object[0]

Then (on auto-refresh I think):
Code:
Uncaught Syntax error, unrecognized expression:
jquery-1.5.2.min.js:16
k.error jquery-1.5.2.min.js:16
k.filter jquery-1.5.2.min.js:16
k jquery-1.5.2.min.js:16
c.querySelectorAll.k jquery-1.5.2.min.js:16
d.fn.extend.find jquery-1.5.2.min.js:16
d.fn.d.init jquery-1.5.2.min.js:16
d jquery-1.5.2.min.js:16
handleListResponse taigachat.js:336
XenForo.ajax.global taigachat.js:280
f xenforo.js:193
f.resolveWith jquery-1.5.2.min.js:16
v jquery-1.5.2.min.js:16
c jquery-1.5.2.min.js:16

If I disable the chatbox, the error is gone.


It seems the error has already been reported here.

Will look into fixing the warning, error is already fixed (or at least can't reproduce) for pro



Speaking of which, progress update :)

Done:
  • Stupidly fast and light static file refresh system
  • /me
  • /prune
  • Persistent message colours (akin to VSa ChatBox)
  • Moderator shoutbox ban ability
  • New threads/replies displayed in shoutbox
  • Various layout improvements
  • Shorter timestamps
  • Fixed bugs such as minor browser freezes when refreshing the chat
To-do:
  • Widget framework
  • Realtime 'who's in chat'
  • Announcements/MOTD
  • Move to template hook system
  • Numerous other bugfixes and minor features
 
Top Bottom