3.2 Allow guests chat with no message (updated)

All edits in this section have been tested on 3.2.x
Forum rules
To add a post here you need to click on the topic attribute by doing this you aggree that you have tested the snippet your adding on 3.2.x
User avatar
Martin
Founder
Founder
Posts: 832
Joined: Sun May 24, 2015 3:14 pm
Status: Offline
Screen Resolution: 1366x768
  • Ubuntu Chrome

Allow guests chat with no message (updated)

Dec 2017 30 18:51

Post by Martin » Sat Dec 30, 2017 6:51 pm

Post by Martin by Martin Dec 2017 30 18:51

Allow guests chat with no message phpbb 3.2.x and mchat 2.0.2

This will block all messages to guests in chat until they login.

Open ext/dmzx/mchat/styles/prosilver/template/mchat_messages.html
Find This may be a partial find and not the whole line (spaces may differ)

Code: Select all

		<div class="mchat-text">
			{% EVENT dmzx_mchat_messages_text_before %}
			{{ mchatrow.MCHAT_MESSAGE }}
			{% EVENT dmzx_mchat_messages_text_after %}
		</div>
Replace with Replace the preceding lines with the following

Code: Select all

<div class="mchat-text">
			{% EVENT dmzx_mchat_messages_text_before %}
                        {% if MCHAT_ALLOW_PM %}{{ mchatrow.MCHAT_MESSAGE }}{% else %}
 {{ lang('YOU_MUST') }} {% if S_REGISTER_ENABLED and not (S_SHOW_COPPA or S_REGISTRATION) %}<a href="{{ U_REGISTER }}">{{ lang('REGISTER') }}</a> {{ lang('OR') }} {% endif %}<a href="{{ U_LOGIN_LOGOUT }}" title="{{ lang('LOGIN_LOGOUT') }}" accesskey="x">{{ lang('LOGIN_LOGOUT') }}</a> {{ lang('TO_READ_THIS_POST') }}{% endif %}
			{% EVENT dmzx_mchat_messages_text_after %}
		</div>
Open ext/dmzx/mchat/language/en/mchat.php
Find This may be a partial find and not the whole line

Code: Select all

));
Replace with Replace the preceding lines with the following

Code: Select all

// Login to read this froum
                'YOU_MUST'           => 'Sorry No Chat For Guests You Must',
                'OR'                          => 'Or',
                'TO_READ_THIS_POST'   => 'To Read This Chat.',
                	'LOGIN_LOGOUT'        => 'Register or Login',
));
Now set chat permissions for guests to view chat only.
Selection_006.png
This is the result
Selection_007.png
Demo: logout.

Cant be assed with edits ? then just upload these files edits are in there.
dmzx.zip
You do not have the required permissions to view the files attached to this post.
Image

Save page loads and make pages shorter find it here. Show user sig once in a page
Use this to install an ext on your board no more ftp or path making.
Path too install this ext is ext/boardtools/upload https://www.phpbb.com/community/viewtop ... #p13700571

User avatar
killfrenzy
Member
Member
Posts: 8
Joined: Sat Dec 30, 2017 11:08 am
Status: Offline
Screen Resolution: 1366x768
  • Windows 10 Chrome

Re: Allow guests chat with no message (updated)

Dec 2017 30 19:44

Post by killfrenzy » Sat Dec 30, 2017 7:06 pm

Post by killfrenzy by killfrenzy Dec 2017 30 19:44

Nice thanks for this. Keep up the good work. :cool:

Double posted the time between posts was 37 minutes 34 seconds:
Got error in my ACP show's invalid character? using board 3.2 and updated mchat 2.02

Can u check my common.php

Code: Select all

<?php

/**
 *
 * @package phpBB Extension - mChat
 * @copyright (c) 2016 dmzx - http://www.dmzx-web.net
 * @copyright (c) 2016 kasimi - https://kasimi.net
 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
 *
 */

if (!defined('IN_PHPBB'))
{
	exit;
}

if (empty($lang) || !is_array($lang))
{
	$lang = array();
}

// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct
//
// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
// equally where a string contains only two placeholders which are used to wrap text
// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
//
// Some characters for use
// ’ » “ ” …

$lang = array_merge($lang, array(
	'MCHAT_TITLE'					=> 'mChat',
	'MCHAT_TITLE_COUNT'				=> 'mChat [<strong>%1$d</strong>]',

	// Who is chatting
	'MCHAT_WHO_IS_CHATTING'			=> 'Who is chatting',
	'MCHAT_ONLINE_USERS_TOTAL'		=> array(
		0 => 'No one is chatting',
		1 => '<strong>%1$d</strong> user is chatting',
		2 => '<strong>%1$d</strong> users are chatting',
	),
	'MCHAT_ONLINE_EXPLAIN'			=> 'based on users active over the past %1$s',
	'MCHAT_HOURS'					=> array(
		1 => '%1$d hour',
		2 => '%1$d hours',
	),
	'MCHAT_MINUTES'					=> array(
		1 => '%1$d minute',
		2 => '%1$d minutes',
	),
	'MCHAT_SECONDS'					=> array(
		1 => '%1$d second',
		2 => '%1$d seconds',
	),
     
	// Post notification messages (%1$s is replaced with a link to the new/edited post, %2$s is replaced with a link to the forum)
	'MCHAT_NEW_POST'				=> 'posted a new topic: %1$s in %2$s',
	'MCHAT_NEW_POST_DELETED'		=> 'posted a new topic that was deleted',
	'MCHAT_NEW_REPLY'				=> 'posted a reply: %1$s in %2$s',
	'MCHAT_NEW_REPLY_DELETED'		=> 'posted a reply that was deleted',
	'MCHAT_NEW_QUOTE'				=> 'replied with a quote: %1$s in %2$s',
	'MCHAT_NEW_QUOTE_DELETED'		=> 'posted a reply that was deleted',
	'MCHAT_NEW_EDIT'				=> 'edited a post: %1$s in %2$s',
	'MCHAT_NEW_EDIT_DELETED'		=> 'edited a post that was deleted',
	'MCHAT_NEW_LOGIN'				=> 'just logged in',
         // Login to read this froum
                'YOU_MUST'           => 'Sorry No Chat For Guests You Must',
                'OR'                       => 'Or',
                'TO_READ_THIS_POST'   => 'To Read This Chat.',
                'LOGIN_LOGOUT'        => 'Login or Register',
));

User avatar
Martin
Founder
Founder
Posts: 832
Joined: Sun May 24, 2015 3:14 pm
Status: Offline
Screen Resolution: 1366x768
  • Ubuntu Chrome

Re: Allow guests chat with no message (updated)

Dec 2017 30 20:23

Post by Martin » Sat Dec 30, 2017 8:23 pm

Post by Martin by Martin Dec 2017 30 20:23

Yes sorry my fault remove the edits from lang common they go into lang/en/mchat.php file i filxed the first post.

User avatar
killfrenzy
Member
Member
Posts: 8
Joined: Sat Dec 30, 2017 11:08 am
Status: Offline
Screen Resolution: 1366x768
  • Windows 10 Chrome

Re: Allow guests chat with no message (updated)

Dec 2017 31 03:03

Post by killfrenzy » Sun Dec 31, 2017 3:03 am

Post by killfrenzy by killfrenzy Dec 2017 31 03:03

martin wrote:
Sat Dec 30, 2017 8:23 pm
Yes sorry my fault remove the edits from lang common they go into lang/en/mchat.php file i filxed the first post.
Not working on me. I dunno

User avatar
Martin
Founder
Founder
Posts: 832
Joined: Sun May 24, 2015 3:14 pm
Status: Offline
Screen Resolution: 1366x768
  • Ubuntu Chrome

Re: Allow guests chat with no message (updated)

Dec 2017 31 11:44

Post by Martin » Sun Dec 31, 2017 11:44 am

Post by Martin by Martin Dec 2017 31 11:44

You must set guests chat permissions to view chat not read chat.

Files in the first post have the edits in and is a fresh mchat 2.0.2 and here is the files in action http://www.martins-phpbb.com/testing/3.2.1/index.php