Python Forum
First impressions on forum software
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
First impressions on forum software
#29
I modified them

Quote:The button reading "quote" will activate only when you hit "reply" below. 
Since i modified them it might be confusing now but...
For the multi-quote button select, you can 
1) go down and click new reply to insert all the quotes into the advanced editor

2) click quote button next to it (the new Quote text button) (which was the old Reply button). This will also do the same thing as if you clicked new rply with having selected multiply quotes 

3) If you go down to the fast quote editor, there is a link at the bottom to add the selected quoted posts to it (if you dont want the advanced editor). You also have the option to deselect them all.

Actually the multi quote button i not even needed. If you check the check boxes for each post and select any one of the (now new) Quote button, it will do the same thing. 

And then the small no text button is a plugin. That is the only one that allows to select text and quote the selected text only instead of the entire post. However if there is no selected text, then the whole post is considered "highlighted". Ideally i am at some point trying to make that only show if there is text selected.

Here is the js for the fast quote button if someone is able
/**
 * This file is part of Fast Quote plugin for MyBB.
 * Copyright (C) Lukasz Tkacz <[email protected]>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */ 
 
/* All code from phpBB3 SEO Premod, based on GPLv2 License */ 
function initInsertions() 
{
	var doc;

	if (document.forms[form_name])
	{
		doc = document;
	}
	else 
	{
		doc = opener.document;
	}

	var textarea = doc.forms[form_name].elements[text_name];
	if (is_ie && typeof(baseHeight) != 'number')
	{	
        setTimeout(function() { textarea.focus(); }, 10);
		baseHeight = doc.selection.createRange().duplicate().boundingHeight;

		if (!document.forms[form_name])
		{
            setTimeout(function() { document.body.focus(); }, 10);
		}
	}
}

/**
* Insert text at position
*/
function insert_text(text, spaces, popup)
{
	var textarea;
	
	if (!popup) 
	{
		textarea = document.forms[form_name].elements[text_name];
	} 
	else 
	{
		textarea = opener.document.forms[form_name].elements[text_name];
	}
	if (spaces) 
	{
		text = ' ' + text + ' ';
	}
	
	if (!isNaN(textarea.selectionStart))
	{
		var sel_start = textarea.selectionStart;
		var sel_end = textarea.selectionEnd;

		mozWrap(textarea, text, '');
		textarea.selectionStart = sel_start + text.length;
		textarea.selectionEnd = sel_end + text.length;
	}	
	
	else if (textarea.createTextRange && textarea.caretPos)
	{
		if (baseHeight != textarea.caretPos.boundingHeight) 
		{
            setTimeout(function() { textarea.focus(); }, 10);
			storeCaret(textarea);
		}		
		var caret_pos = textarea.caretPos;
		caret_pos.text = caret_pos.text.charAt(caret_pos.text.length - 1) == ' ' ? caret_pos.text + text + ' ' : caret_pos.text + text;
		
	}
	else
	{
		textarea.value = textarea.value + text;
	}
	if (!popup) 
	{
        setTimeout(function() { textarea.focus(); }, 10);
	} 	

}



// Startup variables
var imageTag = false;
var theSelection = false;
var bbcodeEnabled = true;

// Check for Browser & Platform for PC & IE specific bits
// More details from: http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html
var clientPC = navigator.userAgent.toLowerCase(); // Get client info
var clientVer = parseInt(navigator.appVersion); // Get browser version

var is_ie = ((clientPC.indexOf('msie') != -1) && (clientPC.indexOf('opera') == -1));
var is_win = ((clientPC.indexOf('win') != -1) || (clientPC.indexOf('16bit') != -1));

function addquote(post_id, post_time, username, l_wrote)
{
	var message_name = 'message_fq' + post_id;
	var theSelection = '';
	var divarea = false;

	if (l_wrote === undefined)
	{
		// Backwards compatibility
		l_wrote = 'wrote';
	}

	if (document.all)
	{
		divarea = document.all[message_name];
	}
	else
	{
		divarea = document.getElementById(message_name);
	}

	// Get text selection - not only the post content :(
	if (window.getSelection)
	{
		theSelection = window.getSelection().toString();
	}
	else if (document.getSelection)
	{
		theSelection = document.getSelection();
	}
	else if (document.selection)
	{
		theSelection = document.selection.createRange().text;
	}

	if (theSelection == '' || typeof theSelection == 'undefined' || theSelection == null)
	{
		if (divarea.innerHTML)
		{
			theSelection = divarea.innerHTML.replace(/<br>/ig, '\n');
			theSelection = theSelection.replace(/<br\/>/ig, '\n');
			theSelection = theSelection.replace(/&lt\;/ig, '<');
			theSelection = theSelection.replace(/&gt\;/ig, '>');
			theSelection = theSelection.replace(/&amp\;/ig, '&');
			theSelection = theSelection.replace(/&nbsp\;/ig, ' ');
		}
		else if (document.all)
		{
			theSelection = divarea.innerText;
		}
		else if (divarea.textContent)
		{
			theSelection = divarea.textContent;
		}
		else if (divarea.firstChild.nodeValue)
		{
			theSelection = divarea.firstChild.nodeValue;
		}
	}

	if (theSelection)
	{
		if (bbcodeEnabled)
		{
			insert_text('[quote="' + username + '" pid="' + post_id + '" dateline="' + post_time + '"]' + theSelection + '[/quote]\n');
		}
		else
		{
			insert_text(username + ' ' + l_wrote + ':' + '\n');
			var lines = split_lines(theSelection);
			for (i = 0; i < lines.length; i++)
			{
				insert_text('> ' + lines[i] + '\n');
			}
		}
	}

	return;
}


/**
* From http://www.massless.org/mozedit/
*/
function mozWrap(txtarea, open, close)
{
	var selLength = (typeof(txtarea.textLength) == 'undefined') ? txtarea.value.length : txtarea.textLength;
	var selStart = txtarea.selectionStart;
	var selEnd = txtarea.selectionEnd;
	var scrollTop = txtarea.scrollTop;

	if (selEnd == 1 || selEnd == 2) 
	{
		selEnd = selLength;
	}

	var s1 = (txtarea.value).substring(0,selStart);
	var s2 = (txtarea.value).substring(selStart, selEnd);
	var s3 = (txtarea.value).substring(selEnd, selLength);

	txtarea.value = s1 + open + s2 + close + s3;
	txtarea.selectionStart = selStart + open.length;
	txtarea.selectionEnd = selEnd + open.length;
    setTimeout(function() { txtarea.focus(); }, 10);
	txtarea.scrollTop = scrollTop;

	return;
}
Recommended Tutorials:
Reply


Messages In This Thread
First impressions on forum software - by Kebap - Sep-13-2016, 02:24 PM
RE: First impressions on forum software - by Kebap - Sep-15-2016, 02:34 PM
RE: First impressions on forum software - by nilamo - Sep-16-2016, 03:12 PM
RE: First impressions on forum software - by nilamo - Sep-16-2016, 04:02 PM
RE: First impressions on forum software - by nilamo - Sep-16-2016, 08:31 PM
RE: First impressions on forum software - by nilamo - Sep-16-2016, 09:04 PM
RE: First impressions on forum software - by nilamo - Sep-17-2016, 04:03 PM
RE: First impressions on forum software - by nilamo - Sep-19-2016, 07:42 PM
RE: First impressions on forum software - by nilamo - Sep-26-2016, 03:03 PM
RE: First impressions on forum software - by nilamo - Sep-26-2016, 03:36 PM
RE: First impressions on forum software - by Kebap - Sep-27-2016, 08:52 AM
RE: First impressions on forum software - by Ofnuts - Sep-26-2016, 04:50 PM
RE: First impressions on forum software - by nilamo - Sep-26-2016, 05:08 PM
RE: First impressions on forum software - by Ofnuts - Sep-27-2016, 01:45 PM
RE: First impressions on forum software - by metulburr - Sep-27-2016, 02:29 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Does the forum need a forum category ? Yoriz 4 6,434 Sep-18-2016, 08:16 PM
Last Post: Kebap

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020