You are here: PSPad forum > English discussion forum > bbcode

bbcode

Goto Page: Previous1 2 3 Next

#11 Re: bbcode, phpbb-mode

Posted by: petitrot | Date: 2010-11-23 21:13 | IP: IP Logged

Hi

Thank fred_gaou smiling smiley

I taked a copy.

I have another script for BBCode in PSPad
A Plus with the PSPad_bbcode_addon.zip

bbcode_phpbb.js is a small file to place in the installation PSPad: PSPad/Script/JScript/bbcode_phpbb.js

image

Easy to use, to adapt for your use.
It's in french mais very simple to translate in an other language.

Instructions is in the header of the file.

Download: www.mediafire.com

This easy script is a good exemple of Howto for making some others goodies to use in PSPad smiling smiley

Let us know if you make some add or corrections winking smiley

smiling smiley

Edit : typo

Edited 1 time(s). Last edit at 2010-11-23 21:18 by petitrot.

Options: Reply | Quote | Up ^


#12 Re: bbcode, phpbb-mode

Posted by: 007@pathcom.com | Date: 2010-12-29 22:47 | IP: IP Logged

The URLs no longer allow downloading of the zip file.

There is a link on Rapidshare, but I don't want to join.

I am also not sure whether the content of the zip when installed will enable PSPad to run the script and check for syntax errors.

I can of course do what I have always done, which is to run the script in a browser.

But it would be nice to be able to check the syntax in PSPad.

Thanks in advance for any help you can give.

Options: Reply | Quote | Up ^


#13 Re: bbcode, phpbb-mode

Posted by: petitrot | Date: 2011-01-21 21:56 | IP: IP Logged

Mystara:
Awesome! This is exactly what I wanted.

Thank you!

Welcome smiling smiley

Hi 007

You want try it?

PSPad_bbcode_addon.zip, the last version is the same of the link from fred_gaou
www.mediafire.com

And the complement bbcode_phpbb.js, the link is www.mediafire.com

Today I check the 2 links and they are goods.

These scripts run very well from PSPad. Nothing to complain!

Easy to install in PSPad. At the start of PSPad, PSPad will find and analyse these files.

These files are for use in PSPad only, to edit in code bbcode only.

I'm using PSPad to edit the bbcode of this post. (just need to copy and put in the forum editor)

@+ smiling smiley

Options: Reply | Quote | Up ^


#14 Re: bbcode, phpbb-mode

Posted by: R2-D2 | Date: 2013-01-07 01:07 | IP: IP Logged

Many thanks, I'v been looking for this for a long time.
Now I use PSPad for all my activities.
I would like like to note that on version 4.5.6 there is no more PSPad.ini, thus there is no need to edit anything.
Just put the correct files in the correct folders, open PSPad > Settings > Highlighter settings > select a bold one and choose BBCoode.
Then you only need to play a little with colors smiling smiley

This is how mine looks now:

image

Options: Reply | Quote | Up ^


#15 Re: bbcode, phpbb-mode

Posted by: petitrot | Date: 2013-02-22 23:29 | IP: IP Logged

Hi smiling smiley

The link is broke for the complement BBCode in menu Scripts

Put the script in
PSPad\Script\JScript\bbcode_phpbb.js

Here it is:
/*******************************************************************************
BBCode PhpBB v1.0 - 14/10/2006
Version v1.0.1 - 10/01/2008
Version v1.0.2 - 2010
wow ataboy ''.phorum_html_encode('d_cuvilier@hotmail.com').'' subject: BBCode PhpBB v1.0.1
Inspired form the code of the Comments v1.0
Special Thanks to him
''.phorum_html_encode('maleval@gawab.com').''
------------------------------------------------------------------------------
2011-01-21
PSPad_bbcode_addon.zip, the last version is the same of the link from fred_gaou
www.mediafire.com

And the complement bbcode_phpbb.js, the link is www.mediafire.com

Today I check the 2 links and they are goods.

These scripts run very well from PSPad. Nothing to complain!

Easy to install in PSPad. At the start of PSPad, PSPad will find and analyse these files.

These files are for use in PSPad only, to edit in code bbcode only.

I'm using PSPad to edit the bbcode of this post. (just need to copy and put in the forum editor)

------------------------------------------------------------------------------
PSPad BBcode Addon
You can read the message at the following page:
forum.pspad.com

Liens vers le fichier
www.mediafire.com

Ce script permet d'insérer les BBCode conformes PhpBB dans tous les types de
fichiers .bbcode, txt, html,... ouverts sous PSPad

Ce script, bbcode_phpbb.js, doit être placer dans le dossier d'installation
PSPad/Script/JScript/bbcode_phpbb.js
Si ces sous dossiers n'existent pas dans votre installation PSPad veillez les créer.

L'usage du script BBCode est disponible dans PSPad, menu Script, BBCode
Dans ce menu BBCode cliquer sur une sélection, insère automatiquement le BBCode
au niveau du curseur dans le fichier ouvert.
Le script BBCode fonctionne sous tous les types de fichiers .bbcode, txt, html,...

Le type de code utilisé pour ces BBCode sont conformes à la majorité des scripts
PhpBB v2. Si, sur votre site, vos BBCode sont différents veillez à adapter ce script.

Insérer BBCode conformes PhpBB
Insèrent des BBCode autour d'une sélection.
S'il n'y pas de sélection, les BBCode sont insérés à l'emplacement du curseur.

Supprimer les BBCode :
Recherche les BBCode dans la sélection.
S'il n'y a pas de sélection, recherche dans la ligne active.

Supprimer tous les BBCode :
Tous les BBCode sont supprimés. Préserve le contenu des BBCode.
Peut subsister quelques erreurs selon les BBCode utilisés!
Vérifier le résultat.

Supprimer tout (BBCode+contenu) :
Grand nettoyage. Supprime tous les BBCode et tout leurs contenus !
Peut être utile pour les forums qui valide l'usage de certains tags html

Pour toutes les actions Supprimer ...
Il peut subsister quelques erreurs selon les BBCode utilisés!
Toujours vérifier le résultat.

Testé avec PSPad 4.5.1 (2207) - Win XP SP2
Testé avec PSPad 4.5.4 (2356) - Win XP SP3

Ajout BBCode PhpBB 10/01/2008
, , , , [u], [/u], [strike], [/strike],[quote], [quote="n"],[/quote],[code],
, [list], [/list], [img], [/img], [url], [url=n], [/url], , , [right], [/right], , , [face=n], [/face], [size=n], [/size]
Ajout BBCode PhpBB 17/05/2008
[email], [/email]
*******************************************************************************/

/* BBCode PhpBB InsertBBCode_Fr */
var module_name = "InsertBBCode";
var module_ver = "1.0.2";
var module_title = "BBCode";

/* [/b] */
function insertB_BBCode(){
var ceDoc = newEditor();
ceDoc.assignActiveEditor();
var s = ceDoc.selText();
s = "[b]"+s+"
";
ceDoc.selText(s);
}

/* [/i] */
function insertI_BBCode(){
var ceDoc = newEditor();
ceDoc.assignActiveEditor();
var s = ceDoc.selText();
s = "[i]"+s+"
";
ceDoc.selText(s);
}

/* [u][/u] */
function insertU_BBCode(){
var ceDoc = newEditor();
ceDoc.assignActiveEditor();
var s = ceDoc.selText();
s = "[u]"+s+"[/u]";
ceDoc.selText(s);
}

/* [strike][/strike] */
function insertSTRIKE_BBCode(){
var ceDoc = newEditor();
ceDoc.assignActiveEditor();
var s = ceDoc.selText();
s = "[strike]"+s+"[/strike]";
ceDoc.selText(s);
}

/* [img][/img] */
function insertIMG_BBCode(){
var ceDoc = newEditor();
ceDoc.assignActiveEditor();
var s = ceDoc.selText();
s = "[img]"+s+"[/img]";
ceDoc.selText(s);
}

/* [url][/url] */
function insertURL_BBCode(){
var ceDoc = newEditor();
ceDoc.assignActiveEditor();
var s = ceDoc.selText();
s = "[url]"+s+"[/url]";
ceDoc.selText(s);
}

/* [url=][/url] */
function insertURLN_BBCode(){
var ceDoc = newEditor();
ceDoc.assignActiveEditor();
var s = ceDoc.selText();
s = "[url="+s+"][/url]";
ceDoc.selText(s);
}

/*[quote][/quote]*/
function insertQUOTE_BBCode(){
var ceDoc = newEditor();
ceDoc.assignActiveEditor();
var s = ceDoc.selText();
s = "[quote]"+s+"[/quote]";
ceDoc.selText(s);
}

/* [quote=""][/quote]*/
function insertQUOTEN_BBCode(){
var ceDoc = newEditor();
ceDoc.assignActiveEditor();
var s = ceDoc.selText();
s = '[quote="'+s+'"][/quote]';
ceDoc.selText(s);
}

/*[/code]*/
function insertCODE_BBCode(){
var ceDoc = newEditor();
ceDoc.assignActiveEditor();
var s = ceDoc.selText();
s = "[code]"+s+"
";
ceDoc.selText(s);
}

/* [left][/left] */
function insertLEFT_BBCode(){
var ceDoc = newEditor();
ceDoc.assignActiveEditor();
var s = ceDoc.selText();
s = "[left]"+s+"[/left]";
ceDoc.selText(s);
}

/* [/center] */
function insertCENTER_BBCode(){
var ceDoc = newEditor();
ceDoc.assignActiveEditor();
var s = ceDoc.selText();
s = "[center]"+s+"
";
ceDoc.selText(s);
}

/* [right][/right] */
function insertRIGHT_BBCode(){
var ceDoc = newEditor();
ceDoc.assignActiveEditor();
var s = ceDoc.selText();
s = "[right]"+s+"[/right]";
ceDoc.selText(s);
}

/* [color=][/color] */
function insertCOLOR_BBCode(){
var ceDoc = newEditor();
ceDoc.assignActiveEditor();
var s = ceDoc.selText();
s = "[color="+s+"][/color]";
ceDoc.selText(s);
}

/* [size=][/size] */
function insertSIZE_BBCode(){
var ceDoc = newEditor();
ceDoc.assignActiveEditor();
var s = ceDoc.selText();
s = "[size="+s+"][/size]";
ceDoc.selText(s);
}

/* [face=][/face] */
function insertFACE_BBCode(){
var ceDoc = newEditor();
ceDoc.assignActiveEditor();
var s = ceDoc.selText();
s = "[face="+s+"][/face]";
ceDoc.selText(s);
}

/* [list][/list] */
function insertLIST_BBCode(){
var ceDoc = newEditor();
ceDoc.assignActiveEditor();
var s = ceDoc.selText();
s = "[list]"+s+"[/list]";
ceDoc.selText(s);
}

/* [email][/email] */
function insertEMAIL_BBCode(){
var ceDoc = newEditor();
ceDoc.assignActiveEditor();
var s = ceDoc.selText();
s = "[email]"+s+"[/email]";
ceDoc.selText(s);
}

/* [*] */
function insertSTAR_BBCode(){
var ceDoc = newEditor();
ceDoc.assignActiveEditor();
var s = ceDoc.selText();
s = "[*] "+s;
ceDoc.selText(s);
}

/* [mode hors sujet][fin hors sujet] */
function insertHORSSUJET_BBCode(){
var ceDoc = newEditor();
ceDoc.assignActiveEditor();
var s = ceDoc.selText();
s = "[mode hors sujet]"+s+"[fin hors sujet]";
ceDoc.selText(s);
}

/* Supprimer les Crochets [] vides */
function removeEmptyTags_BBCode(){
var r, s, flag = false;;
var ceDoc = newEditor();
ceDoc.assignActiveEditor();
s = ceDoc.selText();
if (!s) {
flag = true;
s = ceDoc.lineText();
}
r = /\[\]|\[\/]|\[ \]|\[ \/]| \/]|\[ \/|/g;
var res = s.search(r);
if (res != -1) {
s = s.replace(r, "");
if (!flag) {
ceDoc.selText(s);
}
else {
ceDoc.lineText(s);
}
}
}

/* Supprimer tous les BBCode
selectionnes */
function removeTags_BBCode(){
var r, s, flag = false;;
var ceDoc = newEditor();
ceDoc.assignActiveEditor();
s = ceDoc.selText();
if (!s) {
flag = true;
s = ceDoc.lineText();
}

r = /\[\*\]|\[b\]|\[\/b\]|\[i\]|\[\/i\]|\[u\]|\[\/u\]|\[quote\]|\[quote=["\w\s]*|\]|\[\/quote\]|\[code\]|\[\/code\]|\[list\]|\[list=\]|\[list=a\]|\[list=A\]|\[list=1\]|\[\/list\]|\[img\]|\[\/img\]|\[url\]|\[url=|\[\/url\]|\[center\]|\[\/center\]|\[left\]|\[\/left\]|\[right\]|\[\/right\]|\[strike\]|\[\/strike\]|\[email\]|\[\/email\]|\[color=[\w\0-9#\s]*|\[\/color\]|\[size=[\0-9\s]*|\[\/size\]|\[face=[\w\s]*|\[\/face\]|\[\]|\[\/]|\[ \]|\[ \/]|/g;
var res = s.search(r);
if (res != -1) {
s = s.replace(r, "");
if (!flag) {
ceDoc.selText(s);
}
else {
ceDoc.lineText(s);
}
}
}

/*
BBCode PhpBB InsertBBCode_Fr
var module_name = "InsertBBCode";
var module_ver = "1.0.2";
var module_title = "BBCode";
*/
/* menu - sous-menu - script */
function Init(){
addMenuItem("-", "BBCode", "", ""); // Menu divider
addMenuItem("Insérer BBCode ", "BBCode", "insertB_BBCode", "");
addMenuItem("Insérer BBCode ", "BBCode", "insertI_BBCode", "");
addMenuItem("Insérer BBCode [u] [/u]", "BBCode", "insertU_BBCode", "");
addMenuItem("Insérer BBCode [strike] [/strike]", "BBCode", "insertSTRIKE_BBCode", "");
addMenuItem("Insérer BBCode ", "BBCode", "insertCOLOR_BBCode", "");
addMenuItem("Insérer BBCode [size=n] [/size]", "BBCode", "insertSIZE_BBCode", "");
addMenuItem("Insérer BBCode [img] [/img]", "BBCode", "insertIMG_BBCode", "");
addMenuItem("Insérer BBCode [url] [/url]", "BBCode", "insertURL_BBCode", "");
addMenuItem("Insérer BBCode [url=n] [/url]", "BBCode", "insertURLN_BBCode", "");
addMenuItem("Insérer BBCode[quote][/quote]", "BBCode", "insertQUOTE_BBCode", "");
addMenuItem("Insérer BBCode [quote=” “][/quote]", "BBCode", "insertQUOTEN_BBCode", "");
addMenuItem("Insérer BBCode[/code]", "BBCode", "insertCODE_BBCode", "");
addMenuItem("Insérer BBCode [face=n] [/face]", "BBCode", "insertFACE_BBCode", "");
addMenuItem("Insérer BBCode ", "BBCode", "insertCENTER_BBCode", "");
addMenuItem("Insérer BBCode [right] [/right]", "BBCode", "insertRIGHT_BBCode", "");
addMenuItem("Insérer BBCode [left] [/left]", "BBCode", "insertLEFT_BBCode", "");
addMenuItem("Insérer BBCode [list] [/list]", "BBCode", "insertLIST_BBCode", "");
addMenuItem("Insérer BBCode [email] [/email]", "BBCode", "insertEMAIL_BBCode", "");
addMenuItem("Insérer BBCode [*]", "BBCode", "insertSTAR_BBCode", "");
addMenuItem("Insérer BBCode [mode hors sujet]", "BBCode", "insertHORSSUJET_BBCode", "");
addMenuItem("-", "BBCode", "", ""); // Menu divider
addMenuItem("Supprimer les crochets [] vides", "BBCode", "removeEmptyTags_BBCode", "");
addMenuItem("Supprimer tous les BBCode", "BBCode", "removeTags_BBCode", "");
addMenuItem("Utilisations", "BBCode", "infos", "");
addMenuItem("-", "BBCode", "", ""); // Menu divider
addMenuItem("Editer ce script", "BBCode", "editMe", ""); // Edit this script in PSPad
addMenuItem("A propos", "BBCode", "about", ""); // About this extension
}

/* code emprunté du script ingkcpos
FILE: ingkcpos.js
VERSION: 0.5
WEB: www.sf.net/projects/ingkcpos

*/

function infos()
{
/* Extension description, how to use, license,
open source project web address, and developer
credits.
*/

echo(
"\n" + module_name + " " + module_ver + "\n\n" +
"_________________\n" +
"DESCRIPTION\n\n" +
" PSPad Editor extension\n" +
"_________________\n" +
"USE\n\n" +
" Edit empty BBCode\n" +
" \n" +
" Edit BBCode around the \n" +
" text or lines selected.\n" +
"_________________\n" +
" \n\n" +
" wow, ataboy\n"
);
return;
}

/* Editer ce script */
function editMe()
{
oEdit = newEditor();
oEdit.openFile(moduleFileName(module_name));
}

/* A propos */
function about()
{
/* Extension description, how to use, license,
open source project web address, and developer
credits.
*/

echo(
"\n" + module_name + " " + module_ver + "\n\n" +
"_________________\n" +
"DESCRIPTION\n\n" +
" PSPad Editor extension to enhance the use\n" +
" of bbcode.\n\n" +
" Cette extention ajoute à l'éditeur PSPad l'édition \n" +
" de bbcode.\n" +
"_________________\n" +
"EMPLOI\n\n" +
" Ajoute et/ou entoure de BBCode tout mot ou\n" +
" lignes sélectionnées dans un document.\n\n" +
" S'il n'y pas de sélection,\n" +
" le BBCode est inséré à l'emplacement du curseur.\n" +
"_________________\n" +
"OPTION\n\n" +
" BBCodesHTML\n" +
" Nécessite l'emploi d'un module additionnel.\n\n" +
" Conversion bbcode vers html, Phil\n" +
" Convertir le document en source\n" +
" de page html complète.\n" +
" Pour visionner la page HTML dans PSPad,\n" +
" Menu HTML Prévisualiser page HTML.\n" +
"_________________\n" +

"CREDITS\n\n" +
" minemule.free.fr\n\n" +
" MIT License\n" +
" Copyright (c) 2007 wow, Phil\n" +
" minemule.free.fr\n" +
" www.opensource.org/licenses/mit-license.php\t\t\n\n" +
" Developers: wow, Phil, La Mine Minemule Team\n"
);
return;
}

smiling smiley

Options: Reply | Quote | Up ^


#16 Re: bbcode, phpbb-mode

Posted by: carbonize | Date: 2013-02-23 12:26 | IP: IP Logged

Any particular reason the bold and italic bbcode do not have closing tags and no indication as to what they are in the menu?

--
Carbonize

Options: Reply | Quote | Up ^


#17 Re: bbcode, phpbb-mode

Posted by: petitrot | Date: 2013-03-02 19:38 | IP: IP Logged

Thanks carbonize smiling smiley

I compared the posted script with the real script and find few others errors too. sad smiley

I dont know where the bad lines from ? The parser of the forum ?

I retry to copy/paste the code from the real script.

I find it!! The problem is apparent in the Preview window of the post editor.
The code in the Preview part is not the code in the Reply part.

Ok! I will use bbcode trick/hack to gain a good code translate. The editor unlike the sequence []

Find and replace these lines :
/* [b][/b] */
function insertB_BBCode(){
var ceDoc = newEditor();
ceDoc.assignActiveEditor();
var s = ceDoc.selText();
s = "[b]"+s+"[/b]";
ceDoc.selText(s);
}

/* [i][/i] */
function insertI_BBCode(){
var ceDoc = newEditor();
ceDoc.assignActiveEditor();
var s = ceDoc.selText();
s = "[i]"+s+"[/i]";
ceDoc.selText(s);
}

/* [code][/code] */
function insertCODE_BBCode(){
var ceDoc = newEditor();
ceDoc.assignActiveEditor();
var s = ceDoc.selText();
s = "[code]"+s+"[/code]";
ceDoc.selText(s);
}

/* [center][/center] */
function insertCENTER_BBCode(){
var ceDoc = newEditor();
ceDoc.assignActiveEditor();
var s = ceDoc.selText();
s = "[center]"+s+"[/center]";
ceDoc.selText(s);
}

And in the menu items, find and replace these others lines too :
addMenuItem("Insérer BBCode [b] [/b]", "BBCode", "insertB_BBCode", "");
addMenuItem("Insérer BBCode [i] [/i]", "BBCode", "insertI_BBCode", "");

addMenuItem("Insérer BBCode [color=n] [/color]", "BBCode", "insertCOLOR_BBCode", "");

addMenuItem("Insérer BBCode [code] [/code]", "BBCode", "insertCODE_BBCode", "");

addMenuItem("Insérer BBCode [center] [/center]", "BBCode", "insertCENTER_BBCode", "");

I will double check my inserts in the future...

smiling smiley

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

Edit :
@carbonize smiling smiley The real code is intact in the source of the previous post.
forum.pspad.com Date: 02/23/2013 00:29

Not in the source html but in the source of the post = in the sql base.

I find a way to copy the exact code posted in the previous post.
Dont direct copy the script from the window, this is a modified version from the forum parser.
Click the Option: Reply and you will see the exact code posted whitout a modification from the parser.

@pspad That was good to know...

smiling smiley

Edited 1 time(s). Last edit at 2013-03-02 20:02 by petitrot.

Options: Reply | Quote | Up ^


#18 Re: bbcode, phpbb-mode

Posted by: carbonize | Date: 2013-03-03 10:37 | IP: IP Logged

You could always upload it to somewhere like Pastebin

--
Carbonize

Options: Reply | Quote | Up ^


#19 Discussion about this forum

Posted by: Anderson85 | Date: 2021-04-05 05:42 | IP: IP Logged

What type of topics can be posted here, what things we can post in off-topic boards?

Options: Reply | Quote | Up ^


#20 Re: Discussion about this forum

Posted by: pspad | Date: 2021-04-05 06:00 | IP: IP Logged

I don't understand your question. What exactly do you want to post as offtopic?
To be honest, I am not PHP programmer and any changes in this forum takes me very much time. I am glad it works in current way.

Edited 1 time(s). Last edit at 2021-04-05 06:01 by pspad.

Options: Reply | Quote | Up ^


Goto Page: Previous1 2 3 Next





Editor PSPad - freeware editor, © 2001 - 2024 Jan Fiala, Hosted by Webhosting TOJEONO.CZ, design by WebDesign PAY & SOFT, code Petr Dvořák, Privacy policy and GDPR