Accorate BBCode + Smiles insert mit Style "Chronicles&q

Alles zu Styles, Templates, Icons und Smilies für phpBB 2.0, sowie allgemeine Designfragen zur Integration von phpBB in bestehende Websites.
Forumsregeln
phpBB 2.0 hat das Ende seiner Lebenszeit überschritten
phpBB 2.0 wird nicht mehr aktiv unterstützt. Insbesondere werden - auch bei Sicherheitslücken - keine Patches mehr bereitgestellt. Der Einsatz von phpBB 2.0 erfolgt daher auf eigene Gefahr. Wir empfehlen einen Umstieg auf phpBB 3.0, welches aktiv weiterentwickelt wird und für welches regelmäßig Updates zur Verfügung gestellt werden.
Antworten
Cocky
Mitglied
Beiträge: 15
Registriert: 09.08.2006 19:25

Accorate BBCode + Smiles insert mit Style "Chronicles&q

Beitrag von Cocky »

ahoi liebe Community,

ich benutze phpBB v. 2.0.21 sowie das Style "Chronicles" und möchte gerne ....
  • 1. daß Smilies und BBCode an der Stelle des Cursors eingefügt werden
    2. daß um markierten Text BBCode herum gesetzt wird
Im Prinzip kein Problem, denn da gibt es ja den [2.0.11] Accurate BBCode Insertion Mod. Da steht zwar für ver. 2.0.11 - der Code soll aber an und für sich auch mit ver. 2.0.21 funktionieren. Allerdings sieht die posting_body.tpl vom Style "Subsilver" deutlich anders aus als die von "Chronicles" ... und da beginnt die Inkompatibilität :( .

Kurzum:

Weiß jemand, wie ich meine o.a. Zielsetzung mit dem Style "Chronicles" erreichen kannt ???

Vielen Dank vorab !

LG Cocky


------------------------------------------------------------------------------------

akt. [2.0.11] Accurate BBCode Insertion Mod :


Code: Alles auswählen

############################################################## 
## MOD Title: Accurate BBCode Insertion Mod 
## MOD Author: Lord Z < info@znok.tk > (Jelle Aalbers) http://www.znok.tk, improved by Joe Dalton, sph, MarneusCalgarXP, peterpaulw 
## MOD Description: This mod will insert BBCode accuratly into a post, (at the caret position) instead of putting it at the bottom. 
## MOD Version: 1.0.1 
## 
## Installation Level: Easy 
## Installation Time: ~ 2 Minutes 
## Files To Edit: templates/subSilver/posting_body.tpl 
## Included Files: n/a 
############################################################## 
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the 
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code 
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered 
## in our MOD-Database, located at: http://www.phpbb.com/mods/ 
############################################################## 
## Author Notes: 
##    
##   Why I wrote this mod 
##   ------------------------------------------------------ 
##   Usually, when a user wants to insert BBCode at a specific location while typing his post, 
##   he has to type and select the text he wants to apply the BBCode to first, and then apply 
##   the BBCode to the selected text. When you try to just insert a BBCode-tag, it will appear 
##   at the end of the post, and not at the caret position. This can be quite annoying. 
## 
## 
##   What it does 
##   ------------------------------------------------------ 
##   It changes the way BBCode is inserted in a post into a more natural way. When you click 
##   a BBCode-button, the tag will appear at the same place you where typing instead of at the 
##   bottom of the post. If the caret isn't inside the message field, the tag will appear where the 
##   user has lastly placed the caret inside the message field. 
## 
##   It won't alter the way BBCode is applied to selections, this worked well already. 
## 
##   It won't alter the behaviour of the 'Close all tags' button.  All tags are are still closed 
##   at the bottom of the post when a user clicks this button. 
## 
##   If the client's browser doesn't support the technology to insert BBCode accuratly, it will 
##   be placed the old-fashioned way. 
## 
##   The javascript function used to insert the code is (almost) identical to the function 
##   wich is used for emoticons, so it behaves in almost the same way. It won't put any spaces 
##   around your tag though, which does happens with emoticons. 
## 
############################################################## 
## MOD History: 
## 
##   2004-05-18 - Version 1.0.1 
##      - Improvements to make it work in all of Mozilla Firefox 1, Opera 8 and IE 6 
##      - not tested on OS-X Safari 
## 
##   2004-12-16 - Version 1.0.0 
##      - First version 
## 
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
############################################################## 

# 
#-----[ OPEN ]------------------------------------------ 
# 
templates/subSilver/posting_body.tpl 

# 
#-----[ FIND ]------------------------------------------ 
# 
function emoticon(text) { 

# 
#-----[ BEFORE, ADD ]------------------------------------------ 
# 
function bbplace(text) { 
    var txtarea = document.post.message; 
    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(); 
    } 
} 

# 
#-----[ FIND ]------------------------------------------ 
# 
# This is in the function emoticon(text) 
    } else { 
            txtarea.value  += text; 
            txtarea.focus(); 

# 
#-----[ REPLACE WITH ]------------------------------------------ 
# 
    } else { 
            bbplace(text); 
            txtarea.focus(); 
            
# 
#-----[ FIND ]------------------------------------------ 
# 
      while (bbcode[bblast]) { 
            butnumber = arraypop(bbcode) - 1; 
            txtarea.value += bbtags[butnumber + 1]; 

# 
#-----[ REPLACE WITH ]------------------------------------------ 
# 
      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  ]------------------------------------------ 
# 

   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 BY ]------------------------------------------ 
# 

   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]); 

# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 

# EoM 
Benutzeravatar
rabbit
Ehemaliger Übersetzer
Beiträge: 4199
Registriert: 14.06.2003 22:09
Wohnort: Hildesheim
Kontaktdaten:

Beitrag von rabbit »

du solltest dein template auf die version 2.0.21 updaten, denn imho gab es beim letzten oder vorletzten update auch änderungen an der posting_body.tpl...
Offizieller Übersetzer des Categories Hierarchy MOD 2.1.x
Deutscher UserGuide für den Categories Hierarchy MOD v2.1.4
Empfohlener Hoster: All-Inkl.com
darot
Mitglied
Beiträge: 492
Registriert: 15.01.2005 00:26
Kontaktdaten:

Beitrag von darot »

Ich habe diesen Mod eingebaut und es funktioniert einwandfrei. Wenn man aber auf weitere Smilies klickt und von dort ein Smilie einfügen möchte, geht es nicht und werden am Schluss eingefügt.
Was muss geändert werden das es auch da funktioniert?
darot
Mitglied
Beiträge: 492
Registriert: 15.01.2005 00:26
Kontaktdaten:

Beitrag von darot »

Hat keiner eine Lösung :-? ?
darot
Mitglied
Beiträge: 492
Registriert: 15.01.2005 00:26
Kontaktdaten:

Beitrag von darot »

Immer noch keiner eine Lösung?
Muss doch irgenwie möglich sein wenn es auch bei den anderen Smilies geht.
Benutzeravatar
miccom
Mitglied
Beiträge: 5620
Registriert: 30.03.2003 23:53
Wohnort: Hamburg
Kontaktdaten:

Beitrag von miccom »

Das liegt wohl daran, dass das javascript nur in der postibg_body.tpl seinen Dienst verrichtet, nicht aber im popup-fenster der Smilies. Imho müsste der Code auch in die simple_header.tpl eingebaut werden.
darot
Mitglied
Beiträge: 492
Registriert: 15.01.2005 00:26
Kontaktdaten:

Beitrag von darot »

Die Frage ist nur wo muss ich was einfügen?

Hier die simple_header.tpl:

Code: Alles auswählen

<!-- DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" -->
<!-- <html xmlns="http://www.w3.org/1999/xhtml"> -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html dir="{S_CONTENT_DIRECTION}">
<script language="JavaScript" type="text/javascript" src="acid.js"></script>
<head>
<meta http-equiv="Content-Type" content="text/html; charset={S_CONTENT_ENCODING}"  />
<meta http-equiv="Content-Style-Type" content="text/css" />
<style type="text/css">
<!--
-->
</style>
{META}
<title>{SITENAME} :: {PAGE_TITLE}</title>
<link rel="stylesheet" href="templates/Acid/{T_HEAD_STYLESHEET}" type="text/css">
</head>

<body bgcolor="{T_BODY_BGCOLOR}" text="{T_BODY_TEXT}" link="{T_BODY_LINK}" vlink="{T_BODY_VLINK}">
<span class="gen"><a name="top"></a></span>
Benutzeravatar
miccom
Mitglied
Beiträge: 5620
Registriert: 30.03.2003 23:53
Wohnort: Hamburg
Kontaktdaten:

Beitrag von miccom »

Das modifizierte JS in den Bereich zw. <head> und </head>
darot
Mitglied
Beiträge: 492
Registriert: 15.01.2005 00:26
Kontaktdaten:

Beitrag von darot »

Welches ist der modifizierte JS Bereich :oops: ? Ich kenne mich da zuwenig aus.
Antworten

Zurück zu „phpBB 2.0: Styles, Templates und Grafiken“