Evil Quick Reply

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in the Customisations Database.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTICE: This forum is only for the announcement of new releases and/or updates of MODs. Any MOD support should be obtained through the Customisations Database in the support area designated for each MOD.

A direct link to support for each MOD is in the first post of the respective topic.
Locked
nlhma
Registered User
Posts: 7
Joined: Mon Jan 07, 2008 5:02 am

Re: Evil Quick Reply

Post by nlhma »

I do not know what happened, but I do have the quick reply button on the top of the forum, but not at the bottom. Please suggest me some possible reasons.

Thank you.

P/S: I installed as instructed on page 16 on phpbb gold. And I did check it twice following the instruction.
mvf4s
Registered User
Posts: 187
Joined: Mon Jul 07, 2003 3:00 am
Contact:

Re: Evil Quick Reply

Post by mvf4s »

you rock! I'll give that a whirl and report back.

ElementalWarrior wrote:Ok I found the section of code that is the quickreply, its in (go figure) phpbbroot/includes/functions_quick_reply.php . Now if you open that up you'll see something resembling this

Code: Select all

<?php
/**
 * Evil quick reply
 *
 * @package	phpBB3
 * @version 1.0.0
 * @copyright (c) 2007 eviL3
 * @license	http://opensource.org/licenses/gpl-license.php GNU Public License
 *
 */

// Security check (better be safe than sorry, allthough no code is executed anyway)
if (!defined('IN_PHPBB'))
{
	exit;
}

// Only include once... this will actually work :D
if (function_exists('quick_reply'))
{
	return;
}

/**
 * This function will load everything needed for the evil quick reply
 *
 * @param int $topic_id
 * @param int $forum_id
 * @param array $topic_data
 */
function quick_reply($topic_id, $forum_id, &$topic_data)
{
	global $template, $user, $auth, $db;
	global $phpbb_root_path, $phpEx, $config;

	// Some little config for the quick reply, allows the admin to change these default values through the database.
	$qr_config = array(
		// Disable it easily
		'enabled'			=> isset($config['evil_qr_enabled']) ? $config['evil_quick_reply'] : true,
		// Do you want the subject line to be displayed
		'display_subject'	=> isset($config['evil_qr_display_subject']) ? $config['evil_qr_display_subject'] : true,
		// Shall the box be hidden on pageload?
		'hide_box'			=> isset($config['evil_qr_hide_box']) ? $config['evil_qr_hide_box'] : false,
		// Display the buttons to resize the textarea?
		'resize'			=> isset($config['evil_qr_resize']) ? $config['evil_qr_resize'] : true,
		// Displays BBcode tags
		'bbcodes'			=> isset($config['evil_qr_bbcodes']) ? $config['evil_qr_bbcodes'] : true,
		// Displays Smilies
		'smilies'			=> isset($config['evil_qr_smilies']) ? $config['evil_qr_smilies'] : true,
	);

	// Check if user has reply permissions for this forum or the topic is locked
	if (!$auth->acl_get('f_reply', $forum_id) || ($topic_data['topic_status'] == ITEM_LOCKED && !$auth->acl_get('m_lock', $forum_id)) || !$qr_config['enabled'])
	{
		return;
	}

	// Hidden fields
	$s_hidden_fields = array(
		't'			=> $topic_id,
		'f'			=> $forum_id,
		'mode'		=> 'reply',
		'lastclick'	=> time(),
		'icon'		=> 0,
	);

	// Set preferences such as allow smilies, bbcode, attachsig
	$reply_prefs = array(
		'disable_bbcode'	=> ($config['allow_bbcode'] && $user->optionget('bbcode')) ? false : true,
		'disable_smilies'	=> ($config['allow_smilies'] && $user->optionget('smilies')) ? false : true,
		'disable_magic_url'	=> false,
		'attach_sig'		=> ($config['allow_sig'] && $user->optionget('attachsig')) ? true: false,
		'notify'			=> ($config['allow_topic_notify'] && ($user->data['user_notify'] || isset($topic_data['notify_status']))) ? true : false,
		'lock_topic'		=> ($topic_data['topic_status'] == ITEM_LOCKED && $auth->acl_get('m_lock', $forum_id)) ? true : false,
		// Displays BBcode tags
		'bbcodes'			=> isset($config['evil_qr_bbcodes']) ? $config['evil_qr_bbcodes'] : true,
		// Displays Smilies
		'smilies'			=> isset($config['evil_qr_smilies']) ? $config['evil_qr_smilies'] : true,
	);

	foreach ($reply_prefs as $name => $value)
	{
		if ($value)
		{
			$s_hidden_fields[$name] = 1;
		}
	}

	$subject = ((strpos($topic_data['topic_title'], 'Re: ') !== 0) ? 'Re: ' : '') . censor_text($topic_data['topic_title']);

	if (!$qr_config['display_subject'])
	{
		$s_hidden_fields['subject'] = $subject;
		$subject = '';
	}

	// Confirmation code handling (stolen from posting.php)
	if ($config['enable_post_confirm'] && !$user->data['is_registered'])
	{
		// Show confirm image
		$sql = 'DELETE FROM ' . CONFIRM_TABLE . "
			WHERE session_id = '" . $db->sql_escape($user->session_id) . "'
				AND confirm_type = " . CONFIRM_POST;
		$db->sql_query($sql);

		// Generate code
		$code = gen_rand_string(mt_rand(5, 8));
		$confirm_id = md5(unique_id($user->ip));
		$seed = hexdec(substr(unique_id(), 4, 10));

		// compute $seed % 0x7fffffff
		$seed -= 0x7fffffff * floor($seed / 0x7fffffff);

		$sql = 'INSERT INTO ' . CONFIRM_TABLE . ' ' . $db->sql_build_array('INSERT', array(
			'confirm_id'	=> (string) $confirm_id,
			'session_id'	=> (string) $user->session_id,
			'confirm_type'	=> (int) CONFIRM_POST,
			'code'			=> (string) $code,
			'seed'			=> (int) $seed,
		));

		$db->sql_query($sql);

		$template->assign_vars(array(
			'S_CONFIRM_CODE'	=> true,
			'CONFIRM_ID'		=> $confirm_id,
			'CONFIRM_IMAGE'		=> '<img src="' . append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=confirm&id=' . $confirm_id . '&type=' . CONFIRM_POST) . '" alt="" title="" />',
		));
	}

	// new RC6 stuff
	add_form_key('posting');

	// Page title & action URL, include session_id for security purpose
	$s_action = append_sid("{$phpbb_root_path}posting.$phpEx", false, true, $user->session_id);

	// Assign template variables
	$template->assign_vars(array(
		'QR_SUBJECT'			=> $subject,

		'S_QR_HIDDEN_FIELDS'	=> build_hidden_fields($s_hidden_fields),
		'S_QR_POST_ACTION'		=> $s_action,

		'S_QR_ENABLED'			=> $qr_config['enabled'], // this is true anyway :P
		'S_QR_SUBJECT'			=> $qr_config['display_subject'],
		'S_QR_HIDE_BOX'			=> $qr_config['hide_box'],
		'S_QR_RESIZE'			=> $qr_config['resize'],
		// Displays BBcode tags
		'S_QR_BBCODES'			=> $qr_config['bbcodes'],
		// Displays Smilies
		'S_QR_SMILIES'			=> $qr_config['smilies'],
	));
	if ($qr_config['smilies'] || $qr_config['bbcodes'])
	{
		$user->add_lang('posting');
		
		if ($qr_config['smilies'])
		{
			include($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
			
			generate_smilies('inline', $forum_id);
			$template->assign_var('S_SMILIES_ALLOWED', true);
		}
		
		if ($qr_config['bbcodes'])
		{
			$template->assign_var('S_BBCODE_ALLOWED', true);
		}
	}

}

?>
Now if you scroll down to the section

Code: Select all

$qr_config = array(
		// Disable it easily
		'enabled'			=> isset($config['evil_qr_enabled']) ? $config['evil_quick_reply'] : true,
		// Do you want the subject line to be displayed
		'display_subject'	=> isset($config['evil_qr_display_subject']) ? $config['evil_qr_display_subject'] : true,
		// Shall the box be hidden on pageload?
		'hide_box'			=> isset($config['evil_qr_hide_box']) ? $config['evil_qr_hide_box'] : false,
		// Display the buttons to resize the textarea?
		'resize'			=> isset($config['evil_qr_resize']) ? $config['evil_qr_resize'] : true,
		// Displays BBcode tags
		'bbcodes'			=> isset($config['evil_qr_bbcodes']) ? $config['evil_qr_bbcodes'] : true,
		// Displays Smilies
		'smilies'			=> isset($config['evil_qr_smilies']) ? $config['evil_qr_smilies'] : true,
	);
you can see that tehre is a comment above 'hide_box' that says 'Shall the box be hidden on page load.' In mine it is set to false because I had already changed it to be opened at page load, but when you install the mod it is originally set to true, simply erase 'true' and replace it with 'false' (no quotes).

Now when I was installing QR I ran into a problem with acually getting it to show up in my theme. (AcidTech) which is a subsilver2 based style. The problem was it didn't have a button. So I made one to match my Theme and I set in the imageset.cfg in phpbbroot/styles/acidtech/imageset/en/ . All I had to do was to add img_button_quick_reply = button_quick_reply.gif*20*103 to the bottom. Now if you want to remove the button and make the box permenent all you have to do is remove the img_button_quick_reply = button_quick_reply.gif*20*103 (or whatever the image link is in the file) and refresh the imageset and you should have no button, whether the text stays there I have to check. I'll post either way.
nlhma
Registered User
Posts: 7
Joined: Mon Jan 07, 2008 5:02 am

Re: Evil Quick Reply

Post by nlhma »

Thank you.

I did check the file, and it was set to false already. And my problem is that it shows up at the top but not at the bottom, its not as I suppose in the post that it was completely hidden.

Here is the image of my forum:

Image
ElementalWarrior
Registered User
Posts: 16
Joined: Sun Jan 06, 2008 9:39 am

Re: Evil Quick Reply

Post by ElementalWarrior »

Post me a screenie. Chances are you just placed the edit in the wrong place in one of the files. I'll try to help out 2morrow. I g2g to sleep
nlhma
Registered User
Posts: 7
Joined: Mon Jan 07, 2008 5:02 am

Re: Evil Quick Reply

Post by nlhma »

Thank you. I did post the image (It is a little hard to recognize since it has the same color with the forum). I did check the steps twice, and I did not find out what I did wrong.
danmax
Registered User
Posts: 64
Joined: Thu Nov 25, 2004 12:44 am
Location: Santa Barbara, California

Re: Evil Quick Reply

Post by danmax »

Element - you are most kind with your help. I hope you stick around here for a while and help us out. Thanks!
Cleori
Registered User
Posts: 61
Joined: Tue Jul 03, 2007 10:33 pm

Re: Evil Quick Reply

Post by Cleori »

nlhma wrote:Thank you.

I did check the file, and it was set to false already. And my problem is that it shows up at the top but not at the bottom, its not as I suppose in the post that it was completely hidden.

Here is the image of my forum:

Image
I think it's because you set the mod in viewtopic_body.html searching the FIRST occurrence of {L_POST_REPLY}... instead of the second one.

The add part of this section applies on SECOND occurrence of that, near line 243 of file viewtopic_body.html

NOW, my own question:

I'd like the mod ALWAYS ACTIVE, i.e. the quick reply box ALWAYS SHOWN... I don't need any toggle for my users

Anyone can suggest me what should I have to modify?

I try just to comment the javascript functions... and didn't worked...

Thank you
User avatar
ChriZathens
Registered User
Posts: 1477
Joined: Tue Apr 18, 2006 9:11 pm
Location: Athens, Greece
Name: Chris

Re: Evil Quick Reply

Post by ChriZathens »

Hi guys...
I need my quick reply to be only on 50% of the page, not 100%..
In subsilver I did it with no problems, but in prosilver, no matter where I put width="50%" , the result is null.. :(
Can anyone help???
My mods in MODDB:
Add Homepage link in header - Change user activity post limit - Post number in viewtopic
If you need support click on the support tab there and post your question.
Do not PM me - chances of viewing my PMs are way thinner than viewing the support question in the customization DB...
User avatar
trefex
Registered User
Posts: 112
Joined: Sun Apr 24, 2005 3:08 pm
Name: Christophe Trefois

Re: Evil Quick Reply

Post by trefex »

KellyBean wrote:That's because RC8 changed the way it does buttons

This is what the instructions said to add:

buttons.css:

Code: Select all

.quick-reply-icon, .quick-reply-icon a	{ background: transparent none 0 0 no-repeat; }
Here's how I modified it:

Code: Select all

.quick-reply-icon span	{ background: transparent none 0 0 no-repeat; }
I did the same for colours.css.

Also, on view_topic.html

You need to change this:

Code: Select all

<!-- IF S_QR_ENABLED --><div class="quick-reply-icon"><a href="javascript:toggle_quick_reply();"><span>{L_QUICK_REPLY}</span></a></div><!-- ENDIF -->
To this:

Code: Select all

<!-- IF S_QR_ENABLED --><div class="quick-reply-icon"><a href="javascript:toggle_quick_reply();" title="{L_QUICK_REPLY}"><span></span>{L_QUICK_REPLY}</a></div><!-- ENDIF -->
(thanks to karlsemple for the help and tips! ;) )

This works. Could be updated like this in the instructions....
Trefex
Hotwire
Registered User
Posts: 11
Joined: Fri Jan 02, 2004 7:42 pm

Re: Evil Quick Reply

Post by Hotwire »

Im using theme proBl@ck and I cannot get this to work, the buttons just do not show up,

Im using phpbb3 3.0.0 Gold and Iv followed the updated good_version.zip file and instructions, as well as the ones above, but neither of them get the button to show up.

What am I missing?
deltatsunami
Registered User
Posts: 5
Joined: Mon Jan 07, 2008 4:32 am

Re: Evil Quick Reply

Post by deltatsunami »

how do you refresh all the styles? (sorry)
EDIT: nevermind, i found out, but it still doesn't work. I've done everything corrrectly as stated (purged the cache, uploaded all the files, edited the files, etc.)
nlhma
Registered User
Posts: 7
Joined: Mon Jan 07, 2008 5:02 am

Re: Evil Quick Reply

Post by nlhma »

Cleori wrote:
nlhma wrote:Thank you.

I did check the file, and it was set to false already. And my problem is that it shows up at the top but not at the bottom, its not as I suppose in the post that it was completely hidden.

Here is the image of my forum:

Image
I think it's because you set the mod in viewtopic_body.html searching the FIRST occurrence of {L_POST_REPLY}... instead of the second one.

The add part of this section applies on SECOND occurrence of that, near line 243 of file viewtopic_body.html

NOW, my own question:

I'd like the mod ALWAYS ACTIVE, i.e. the quick reply box ALWAYS SHOWN... I don't need any toggle for my users

Anyone can suggest me what should I have to modify?

I try just to comment the javascript functions... and didn't worked...

Thank you
Thank you so much. I figure out that the first one is for the quick reply on top, and the second one is for it at the bottom.
nlhma
Registered User
Posts: 7
Joined: Mon Jan 07, 2008 5:02 am

Re: Evil Quick Reply

Post by nlhma »

One more question. I do not allow guest posting, so could anyone show me how to disable the quick reply for guest? And also, if possible, could anyone show me how to have smilies and other functions on quick reply?

Thank you!
Cleori
Registered User
Posts: 61
Joined: Tue Jul 03, 2007 10:33 pm

Re: Evil Quick Reply

Post by Cleori »

nlhma wrote:One more question. I do not allow guest posting, so could anyone show me how to disable the quick reply for guest? And also, if possible, could anyone show me how to have smilies and other functions on quick reply?

Thank you!
Smilies add-on is in the same downloaded zip file... "contrib" folder ;)
NoDeity
Registered User
Posts: 150
Joined: Thu Jul 17, 2003 9:43 am
Name: Brad Reddekopp

Re: Evil Quick Reply

Post by NoDeity »

Remor wrote:With this mod quick reply work on my forum gold 3.0.0
Thanks. That worked for me, too.
Locked

Return to “[3.0.x] MOD Database Releases”