Myke623
Well-known member
Does this include an ignore feature? That is, not displaying messages from users on one's ignore list?All the commonly requested features are still in the pipeline
Does this include an ignore feature? That is, not displaying messages from users on one's ignore list?All the commonly requested features are still in the pipeline
Does this include an ignore feature? That is, not displaying messages from users on one's ignore list?
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?
<span class="itemCount {xen:if {$session.reportCounts.total}, 'alert'}">{$session.reportCounts.total}</span>
</a>
<a href="tools/chat_prune.php" class="acp adminLink"><span class="itemLabel">Chatbox Prune</span></a>
XenForo.activate(
#document
) xenforo.js:191
Unable to find menu for Popup
[<div>, context: <div>]
0: <div>
context: <div>
length: 1
__proto__: Object[0]
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
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.
I'm curious, what will be the Widget framework?
Speaking of which, progress update
We use essential cookies to make this site work, and optional cookies to enhance your experience.