Oprava umiestnenia bbcode tagu v phpbb2

Ak potrebujete pomoc alebo poradiť, píšte sem (len PC, elektronika atď.)...
Sphinx
Addict
Addict
Používateľov profilový obrázok
Príspevky: 3031
Registrovaný: 29 nov 2006, 12:21
Bydlisko: dod_Banska Bystrica
Kontaktovať používateľa:

Oprava umiestnenia bbcode tagu v phpbb2

Príspevok od používateľa Sphinx »

zdravim nevie niekto poradit kto sa zaobera phpbb ako by mal byt nastaveny skript tak aby ked dam link do code(teda vsetky bbcode tags) nehodilo ma na zaciatok prispevku? vzdy mi to vyscrooluje hore v okne kde mam prispevok.
audiotrack
VIP
VIP
Používateľov profilový obrázok
Príspevky: 25958
Registrovaný: 09 sep 2005, 18:39
Kontaktovať používateľa:

Re: bbcode tag

Príspevok od používateľa audiotrack »

sa mi zdá že takto to bolo v phpbb2. V trojke to je opravené. Na dvojku existuje fix, ktorý ale nie je nejak extra zložitý a každý s troškou znalostí javascriptu ho spraví aj bez návodu. Skús trošku prebehnúť google, ja nemám dvojku momentálne na localhoste nahodenú tak to nemám ako pozreť
Sphinx
Addict
Addict
Používateľov profilový obrázok
Príspevky: 3031
Registrovaný: 29 nov 2006, 12:21
Bydlisko: dod_Banska Bystrica
Kontaktovať používateľa:

Re: bbcode tag

Príspevok od používateľa Sphinx »

ano jedna sa o phpbb2 je to chyba na lamkach pisal som tam ppt.emu ale nevedel ako na to preto sa obraciam tu na forum o pomoc lebo myslim ze mate medzi sebou dobre vztahy a fakt ma to stve ked to roluje navrch .. na google som hladal len neviem ako mam formulovat "vyhladavacie slovicko" aby som sa dostal k tomu co potrebujem
goten
VIP
VIP
Používateľov profilový obrázok
Príspevky: 3239
Registrovaný: 11 júl 2006, 17:54

Re: bbcode tag

Príspevok od používateľa goten »

Našiel som niečo. Malo by to byť ono. Vyskúšaj.

Kód: Vybrať všetko

################################################################################
##
## Mod Title:		Fix BBCode and Emoticon insertion
## Mod Author:		AmigaLink < [email protected] > (Markus Schmidt) http://www.EssenMitFreude.info & http://www.AmigaLink.de
##
## Mod Description:	Insert BBCode and Emoticons, into a post, at the caret position instead of putting it at the bottom.
##
## Mod Version:		1.0.1
##
##
## Compatibility:	2.0.8 - 2.0.22
## Installation Level:	Easy
## Installation Time:	2 Minutes
##
## Files To Edit:	2
##			templates/subSilver/posting_body.tpl
##			templates/subSilver/posting_smilies.tpl
##
## Included Files:	0
##
##
## Author Notes:	This MOD based on works from Lord Z (Jelle Aalbers) http://www.znok.tk (Accurate BBCode Insertion MOD)
##			and Joe Dalton http://www.jawe.net which can be found under http://www.phpbb.com/community/viewtopic.php?t=247629
##			I only extended the code to insert correctly the font size, the font color and the emoticons.
##			In addition I corrected the emoticon insert from the popup window.
##
## Copyright:		©2007 AmigaLink
##
################################################################################
##
##  The following sites also contain the latest version of this MOD:
## 
##  http://www.AmigaLink.de
##  http://www.phpBBhacks.com
## 
##  Full support for this MOD can be obtained at:
##
##  http://www.AmigaLink.de
##
################################################################################
##
##  This MOD is released under the GPL License v2. 
##  This MOD can be freely used, but not distributed, without permission.
##  Intellectual Property Rights are retained by the hack author(s) 
##  listed above.
##
################################################################################
##
## MOD History:
##
##   2007-06-01 - Version 1.0.1
##	- Fix the jump to top of large texts problem
##
##   2007-05-31 - Version 1.0.0
##	- First release
##
################################################################################
##
##  Before adding this hack to your forum, you should back up all files related to this MOD.
##
################################################################################
#
#-----[ OPEN ]----------------------------------------------------------------
#

templates/subSilver/posing_body.tpl

#
#-----[ FIND ]----------------------------------------------------------------
#

function emoticon(text) {
	var txtarea = document.post.message;
	text = ' ' + text + ' ';
	if (txtarea.createTextRange && txtarea.caretPos) {
		var caretPos = txtarea.caretPos;
		caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text;
		txtarea.focus();
	} else {
		txtarea.value  += text;
		txtarea.focus();
	}
}

#
#-----[ REPLACE WITH ]--------------------------------------------------------
#

function bbplace(text) {
	var txtarea = document.post.message;
	var scrollTop = (typeof(txtarea.scrollTop) == 'number' ? txtarea.scrollTop : -1);
	if (txtarea.createTextRange && txtarea.caretPos) {
		var caretPos = txtarea.caretPos;
		caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text;
		txtarea.focus();
	} else if (txtarea.selectionStart || txtarea.selectionStart == '0') {
		var startPos = txtarea.selectionStart;
		var endPos = txtarea.selectionEnd;
		txtarea.value = txtarea.value.substring(0, startPos)
			+ text
			+ txtarea.value.substring(endPos, txtarea.value.length);
		txtarea.focus();
		txtarea.selectionStart = startPos + text.length;
		txtarea.selectionEnd = startPos + text.length;
	} else {
		txtarea.value  += text;
		txtarea.focus();
	}
	if(scrollTop >= 0 ) { txtarea.scrollTop = scrollTop;}
}

function emoticon(text) {
	text = ' ' + text + ' ';
	bbplace(text);
}

#
#-----[ FIND ]----------------------------------------------------------------
#

		if (!theSelection) {
			txtarea.value += bbopen + bbclose;
			txtarea.focus();

#
#-----[ REPLACE WITH ]--------------------------------------------------------
#

		if (!theSelection) {
			bbplace(bbopen + bbclose);

#
#-----[ FIND ]----------------------------------------------------------------
#

	else
	{
		txtarea.value += bbopen + bbclose;
		txtarea.focus();

#
#-----[ REPLACE WITH ]--------------------------------------------------------
#

	else
	{
		bbplace(bbopen + bbclose);

#
#-----[ FIND ]----------------------------------------------------------------
#

	if (donotinsert) {      // Close all open tags up to the one just clicked & default button names
		 while (bbcode[bblast]) {
				butnumber = arraypop(bbcode) - 1;
				txtarea.value += bbtags[butnumber + 1];

#
#-----[ REPLACE WITH ]--------------------------------------------------------
#

	if (donotinsert) {      // Close all open tags up to the one just clicked & default button names
		 while (bbcode[bblast]) {
				butnumber = arraypop(bbcode) - 1;
				bbplace(bbtags[butnumber + 1]);

#
#-----[ FIND ]----------------------------------------------------------------
#

		if (imageTag && (bbnumber != 14)) {		// Close image tag before adding another
			txtarea.value += bbtags[15];

#
#-----[ REPLACE WITH ]--------------------------------------------------------
#

		if (imageTag && (bbnumber != 14)) {		// Close image tag before adding another
			bbplace(bbtags[15]);

#
#-----[ FIND ]----------------------------------------------------------------
#

		// Open tag
		txtarea.value += bbtags[bbnumber];

#
#-----[ REPLACE WITH ]--------------------------------------------------------
#

		// Open tag
		bbplace(bbtags[bbnumber]);

#
#-----[ FIND ]----------------------------------------------------------------
#

// From http://www.massless.org/mozedit/
function mozWrap(txtarea, open, close)
{
	var selLength = txtarea.textLength;
	var selStart = txtarea.selectionStart;
	var selEnd = txtarea.selectionEnd;
	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;
	return;
}

#
#-----[ REPLACE WITH ]--------------------------------------------------------
#

// From http://www.massless.org/mozedit/
function mozWrap(txtarea, open, close)
{
	if (txtarea.selectionEnd > txtarea.value.length) { txtarea.selectionEnd = txtarea.value.length; }

	var oldPos = txtarea.scrollTop;
	var oldHght = txtarea.scrollHeight;

	var selStart = txtarea.selectionStart;
	var selEnd = txtarea.selectionEnd+open.length;

	txtarea.value = txtarea.value.slice(0,selStart)+open+txtarea.value.slice(selStart); 
	txtarea.value = txtarea.value.slice(0,selEnd)+close+txtarea.value.slice(selEnd);

	txtarea.selectionStart = selStart+open.length;
	txtarea.selectionEnd = selEnd;

	var newHght = txtarea.scrollHeight - oldHght;
	txtarea.scrollTop = oldPos + newHght;

	txtarea.focus();
}

#
#-----[ OPEN ]----------------------------------------------------------------
#

templates/subSilver/posting_smilies.tpl

#
#-----[ FIND ]----------------------------------------------------------------
#

function emoticon(text) {
	text = ' ' + text + ' ';
	if (opener.document.forms['post'].message.createTextRange && opener.document.forms['post'].message.caretPos) {
		var caretPos = opener.document.forms['post'].message.caretPos;
		caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text;
		opener.document.forms['post'].message.focus();
	} else {
	opener.document.forms['post'].message.value  += text;
	opener.document.forms['post'].message.focus();
	}
}

#
#-----[ REPLACE WITH ]--------------------------------------------------------
#

function emoticon(text) {
	text = ' ' + text + ' ';
	var txtarea = opener.document.forms['post'].message;
	var scrollTop = (typeof(txtarea.scrollTop) == 'number' ? txtarea.scrollTop : -1);
	if (txtarea.createTextRange && txtarea.caretPos) {
		var caretPos = txtarea.caretPos;
		caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text;
		txtarea.focus();
	} else if (txtarea.selectionStart || txtarea.selectionStart == '0') {
		var startPos = txtarea.selectionStart;
		var endPos = txtarea.selectionEnd;
		txtarea.value = txtarea.value.substring(0, startPos)
			+ text
			+ txtarea.value.substring(endPos, txtarea.value.length);
	txtarea.focus();
	txtarea.selectionStart = startPos + text.length;
	txtarea.selectionEnd = startPos + text.length;
	} else {
		opener.document.forms['post'].message.value  += text;
		opener.document.forms['post'].message.focus();
	}
	if(scrollTop >= 0 ) { txtarea.scrollTop = scrollTop;}
}

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------------
#
# EoM
Sphinx
Addict
Addict
Používateľov profilový obrázok
Príspevky: 3031
Registrovaný: 29 nov 2006, 12:21
Bydlisko: dod_Banska Bystrica
Kontaktovať používateľa:

Re: Oprava umiestnenia bbcode tagu v phpbb2

Príspevok od používateľa Sphinx »

no posunul som to dalej tak uvidim co mi na to povedia ..
Napísať odpoveď