[MODDB] WYSIWYM Markdown editor

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment!
Ideas Centre
User avatar
leviatan21
Registered User
Posts: 2663
Joined: Fri Aug 10, 2007 7:22 am
Location: Buenos Aires, Argentina
Name: Gabriel

Re: [DEV] WYSIWYM Markdown editor

Post by leviatan21 » Fri Jun 04, 2010 9:50 pm

eman80 wrote:Hello

when I tried to test it I got this error:
Sorry for that, I was testing with another mod :roll: . It's fixed now in SVN and the download link.

in the root/includes/functions_display.php
Find :

Code: Select all

	$sql = 'SELECT bbcode_tag, bbcode_match, bbcode_tpl
		FROM ' . BBCODES_TABLE . '
		WHERE abbcode = 0 
		ORDER BY bbcode_tag';
	$result = $db->sql_query($sql);
Replace with :

Code: Select all

	$sql = 'SELECT bbcode_tag, bbcode_match, bbcode_tpl
		FROM ' . BBCODES_TABLE . '
		ORDER BY bbcode_tag';
	$result = $db->sql_query($sql);
Excuse me for my poor English, I speak Spanish. | Image phpBB en Español

User avatar
eman80
Registered User
Posts: 327
Joined: Tue Aug 19, 2008 1:49 pm

Re: [DEV] WYSIWYM Markdown editor

Post by eman80 » Fri Jun 04, 2010 10:22 pm

Great work :)
all the reported bugs was fixed ..


but we have another problem appears when we put same tag twice, there is a difference between default preview and WYSIWYM preview

for example see this picture:

Image
welcome to my forum:
http://www.elibrary4arab.com

User avatar
VSE
Extensions Development Coordinator
Extensions Development Coordinator
Posts: 4993
Joined: Sat Jan 17, 2009 9:37 am
Location: Los Angeles, CA
Name: Matt Friedman
Contact:

Re: [DEV] WYSIWYM Markdown editor

Post by VSE » Sat Jun 05, 2010 12:19 am

I came across a problem in 0.0.4 in the code changes for functions_display.php

Code: Select all

$config['max_quote_depth'],
$config is not defined in the function we are adding the new code to, so we need to define $config as a global.

I just added this line to the start of your new code, to keep the fix simple:

Code: Select all

global $config;
So it looks like:

Code: Select all

// MOD : WYSIWYG editor - Start
    /**
    * Set custom bbcodes to the live preview
    *    We run a similar query here, 
    *     but just load all custom bbcodes
    *     not only for those bbcodes that my be displayed as buttons
    * Alse force to load MOD files and the MOD itself
    **/
    global $config;
    $template->assign_vars(array(
        'S_LIVE_REVIEW'        => true,
        'W_MAX_QUOTE_DEEP'    => (int) $config['max_quote_depth'],
        'W_VIEW_IMAGES'        => (int) $user->optionget('viewimg'),
        'W_VIEW_FLASH'        => (int) $user->optionget('viewflash'),
        'W_VIEW_SMILIES'    => (int) $user->optionget('viewsmilies'),
    ));

    $sql = 'SELECT bbcode_tag, bbcode_match, bbcode_tpl
        FROM ' . BBCODES_TABLE . '
        ORDER BY bbcode_tag';
    $result = $db->sql_query($sql);

    while ($row = $db->sql_fetchrow($result))
    {
        $template->assign_block_vars('wysiwim_custom_tags', array(
            'WBBCODE_NAME'        => strtolower($row['bbcode_tag']),
            'WBBCODE_TAG'        => preg_replace('(=(.*?)?)', '', strtolower($row['bbcode_tag'])),
            'WBBCODE_MATCH'        => strtolower($row['bbcode_match']),
            'WBBCODE_REPLACE'    => strtolower($row['bbcode_tpl']),
        ));
    }
    $db->sql_freeresult($result);
// MOD : WYSIWYG editor - End
 
Dictated but not read.
Official phpBB Extensions My Extensions & MODs
Please do not PM me for support.

User avatar
leviatan21
Registered User
Posts: 2663
Joined: Fri Aug 10, 2007 7:22 am
Location: Buenos Aires, Argentina
Name: Gabriel

Re: [DEV] WYSIWYM Markdown editor

Post by leviatan21 » Sat Jun 05, 2010 3:17 am

eman80 wrote:Great work :)
all the reported bugs was fixed ..


but we have another problem appears when we put same tag twice, there is a difference between default preview and WYSIWYM preview
I'm not sure who is wrong, me or phpbb, :roll:
VSE wrote:I came across a problem in 0.0.4 in the code changes for functions_display.php

Code: Select all

$config['max_quote_depth'],
$config is not defined in the function we are adding the new code to, so we need to define $config as a global.
Noted :ugeek:
Excuse me for my poor English, I speak Spanish. | Image phpBB en Español

kida7
Registered User
Posts: 64
Joined: Fri Sep 26, 2008 2:54 pm
Location: Vietnam
Contact:

Re: [DEV] WYSIWYM Markdown editor

Post by kida7 » Sat Jun 05, 2010 3:44 am

leviatan21 wrote:I'm not sure who is wrong, me or phpbb, :roll:
Please try this addon:
[RC][Addon] Parse bbcode for WYSIWYG editor
Enjoy ^^~!

User avatar
VSE
Extensions Development Coordinator
Extensions Development Coordinator
Posts: 4993
Joined: Sat Jan 17, 2009 9:37 am
Location: Los Angeles, CA
Name: Matt Friedman
Contact:

Re: [DEV] WYSIWYM Markdown editor

Post by VSE » Sat Jun 05, 2010 4:29 am

eman80 wrote:but we have another problem appears when we put same tag twice
what would be the purpose of doing this??? ;)
Dictated but not read.
Official phpBB Extensions My Extensions & MODs
Please do not PM me for support.

User avatar
eman80
Registered User
Posts: 327
Joined: Tue Aug 19, 2008 1:49 pm

Re: [DEV] WYSIWYM Markdown editor

Post by eman80 » Sat Jun 05, 2010 5:06 am

VSE wrote:
eman80 wrote:but we have another problem appears when we put same tag twice
what would be the purpose of doing this??? ;)
sometime happens maybe by mistake :lol:

it is just a note I said in my mind maybe this will help author in tracking bugs :oops:
welcome to my forum:
http://www.elibrary4arab.com

User avatar
Asef
Translator
Posts: 46
Joined: Wed Dec 17, 2008 5:50 pm

Re: [DEV] WYSIWYM Markdown editor

Post by Asef » Sat Jun 05, 2010 11:30 am

I wonder why this MOD only writes for ProSilver Style ?!!
Many of phpBB users,uses SubSilver2 licensed style

User avatar
leviatan21
Registered User
Posts: 2663
Joined: Fri Aug 10, 2007 7:22 am
Location: Buenos Aires, Argentina
Name: Gabriel

Re: [DEV] WYSIWYM Markdown editor

Post by leviatan21 » Sat Jun 05, 2010 3:24 pm

Asef wrote:I wonder why this MOD only writes for ProSilver Style ?!!
Many of phpBB users,uses SubSilver2 licensed style
First of all, no one is obliged to support both styles, then because it's on Developer stage, may be when I finish it or it's on a RC stage I will do it, ut not at this moment ;)
Excuse me for my poor English, I speak Spanish. | Image phpBB en Español

User avatar
4_seven
I've Been Banned!
Posts: 5155
Joined: Wed Apr 30, 2008 1:41 am

Re: [DEV] WYSIWYM Markdown editor

Post by 4_seven » Sat Jun 05, 2010 5:53 pm

leviatan21 wrote:
4_seven wrote:congrats. i've have the same project on the run. so i can lay it down now.
best wishes and good look (main-problem > quote / multiple quotes)
Why not share your code with me ? or better join me on this ;)
i start my project yet, why lay down!? so it makes more fun :D
Current Mods | Mod Base | php(BB) programming | No help via PM

User avatar
VSE
Extensions Development Coordinator
Extensions Development Coordinator
Posts: 4993
Joined: Sat Jan 17, 2009 9:37 am
Location: Los Angeles, CA
Name: Matt Friedman
Contact:

Re: [DEV] WYSIWYM Markdown editor

Post by VSE » Wed Jun 09, 2010 8:11 pm

I noticed Smileys do not work until you apply some BBcodes to your post too...
Dictated but not read.
Official phpBB Extensions My Extensions & MODs
Please do not PM me for support.

User avatar
leviatan21
Registered User
Posts: 2663
Joined: Fri Aug 10, 2007 7:22 am
Location: Buenos Aires, Argentina
Name: Gabriel

Re: [DEV] WYSIWYM Markdown editor

Post by leviatan21 » Wed Jun 09, 2010 9:17 pm

VSE wrote:I noticed Smileys do not work until you apply some BBcodes to your post too...
Will be fixed in the next "extended" version ;)
Excuse me for my poor English, I speak Spanish. | Image phpBB en Español

User avatar
leviatan21
Registered User
Posts: 2663
Joined: Fri Aug 10, 2007 7:22 am
Location: Buenos Aires, Argentina
Name: Gabriel

Re: [DEV] WYSIWYM Markdown editor

Post by leviatan21 » Sat Jun 12, 2010 9:05 pm

MOD version [DEV] 0.0.5 :o
See first post for Download Link
Excuse me for my poor English, I speak Spanish. | Image phpBB en Español

User avatar
eman80
Registered User
Posts: 327
Joined: Tue Aug 19, 2008 1:49 pm

Re: [DEV] WYSIWYM Markdown editor

Post by eman80 » Sat Jun 12, 2010 11:24 pm

great work :)

but I noticed that: when we put a url without http:// I mean put it like this

Image

the WYSIWYM does not parse it until we make default preview.


by the way .. I got this error again and I did the same fix in the previous post.

Code: Select all

خطأ عام
SQL ERROR [ mysqli ]

Unknown column 'abbcode' in 'where clause' [1054]

SQL

SELECT bbcode_tag, bbcode_match, bbcode_tpl FROM phpbb_bbcodes WHERE abbcode = 0 ORDER BY bbcode_tag

BACKTRACE

FILE: includes/db/mysqli.php
LINE: 163
CALL: dbal->sql_error()

FILE: includes/functions_display.php
LINE: 1022
CALL: dbal_mysqli->sql_query()

FILE: includes/functions_display.php
LINE: 957
CALL: setup_wysiwim_editor()

FILE: posting.php
LINE: 1511
CALL: display_custom_bbcodes()
welcome to my forum:
http://www.elibrary4arab.com

User avatar
VSE
Extensions Development Coordinator
Extensions Development Coordinator
Posts: 4993
Joined: Sat Jan 17, 2009 9:37 am
Location: Los Angeles, CA
Name: Matt Friedman
Contact:

Re: [DEV] WYSIWYM Markdown editor

Post by VSE » Sat Jun 12, 2010 11:46 pm

eman80 wrote:great work :)
by the way .. I got this error again and I did the same fix in the previous post.

Code: Select all

خطأ عام
SQL ERROR [ mysqli ]

Unknown column 'abbcode' in 'where clause' [1054]

SQL

SELECT bbcode_tag, bbcode_match, bbcode_tpl FROM phpbb_bbcodes WHERE abbcode = 0 ORDER BY bbcode_tag

BACKTRACE

FILE: includes/db/mysqli.php
LINE: 163
CALL: dbal->sql_error()

FILE: includes/functions_display.php
LINE: 1022
CALL: dbal_mysqli->sql_query()

FILE: includes/functions_display.php
LINE: 957
CALL: setup_wysiwim_editor()

FILE: posting.php
LINE: 1511
CALL: display_custom_bbcodes()
Remove this line in functions_display.php:

Code: Select all

WHERE abbcode = 0
Also, I can confirm it does not parse any urls without http://
That means raw (magic) urls, [ url= ] and [ url ]
Image
Last edited by VSE on Sat Jun 12, 2010 11:52 pm, edited 1 time in total.
Dictated but not read.
Official phpBB Extensions My Extensions & MODs
Please do not PM me for support.

Locked

Return to “[3.0.x] MODs in Development”