Main menu
Home
News
News from Alphaplug
Download
Forum
Support us
Search
Links
Demo site
Contact
Invite a friend
Sign-up





Lost Password?
No account yet? Register

If you find my free stuff useful, why not leave me a little something with PayPal.

Donations are greatly appreciated, and help with the costs of providing FREE Joomla! addons.




Welcome, Guest
Please Login or Register.    Lost Password?

Better BBCode Support
(1 viewing) (1) Guest
Go to bottomPage: 1
TOPIC: Better BBCode Support
#3130
Better BBCode Support 2 Years, 8 Months ago Karma: 1
I have an issue with using the BBCode toolbar on my site because the prototype library conflicts with the MooTools library being used for another extension on my site. Even so, the prototype library is pretty heavy just for handling BBCode. I'd like to see one of two things:

(1) Port the BBCode bar to a lite, compatible JS library.

(2) Allow BBCode to be manually entered and still rendered. This could probably just be done by adding another option to the admin screen like (a) Render BBCode in comments and (b) Include BBCode toolbar. On this same note, when the BBCode toolbar is disabled, but BBCode rendering is still enabled, you could output some more text to the screen that lets users know standard BBCode is still supported.

It looks like the prototype library is just being used for the BBCode bar and not for the rendering. I haven't looked at the code, but I assume there is some php that is rendering the BBcode. In this case just add an extra parameter to the admin side, then use that as I noted above.<br /><br />Post edited by: joshua.lyon, at: 2008/01/09 20:31
joshua.lyon
Senior Boarder
Posts: 49
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
boshdirect.com - my personal site. I often blog about technology so you might be able to find some good tips there.
 
#3146
Re:Better BBCode Support 2 Years, 8 Months ago Karma: 1
joshua.lyon wrote:
(2) Allow BBCode to be manually entered and still rendered. This could probably just be done by adding another option to the admin screen like (a) Render BBCode in comments and (b) Include BBCode toolbar. On this same note, when the BBCode toolbar is disabled, but BBCode rendering is still enabled, you could output some more text to the screen that lets users know standard BBCode is still supported.

It looks like the prototype library is just being used for the BBCode bar and not for the rendering. I haven't looked at the code, but I assume there is some php that is rendering the BBcode. In this case just add an extra parameter to the admin side, then use that as I noted above.


I'm going through the code and making the changes I noted in (2) above. I'm hoping that once I'm done with them, if I submit them to you you will be able to include them in future versions.

There's nothing worse than having to go back and redo something everytime you upgrade!

The only thing I'll need help with is the translation for the language files.
joshua.lyon
Senior Boarder
Posts: 49
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
boshdirect.com - my personal site. I often blog about technology so you might be able to find some good tips there.
 
#3147
Re:Better BBCode Support 2 Years, 8 Months ago Karma: 1
Written below are the changes I made to MaxComment to give users an option to allow BBCode rendering even when the BBCode toolbar is disabled.

/administrator/components/com_maxcomment/admin.maxcomment.html.php -- add in the extra option for rendering
Code:

        &lt;tr align=&quot;center&quot; valign=&quot;middle&quot;&gt;
          &lt;td align=&quot;left&quot; valign=&quot;top&quot;&gt;&lt;?php echo _MXC_BBCODERENDER; ?&gt;&lt;/td&gt;
          &lt;td align=&quot;left&quot; valign=&quot;top&quot;&gt;
          &lt;?php
            echo mosHTML::yesnoRadioList( 'mxc_bbcoderender', 'class=&quot;inputbox&quot;', $mxc_bbcoderender );
          ?&gt;
          &lt;/td&gt;
          &lt;td align=&quot;left&quot; valign=&quot;top&quot; width=&quot;56%&quot;&gt;&lt;?php echo _MXC_EXPL_BBCODERENDER; ?&gt;&lt;/td&gt;
        &lt;/tr&gt;



/administrator/components/com_maxcomment/maxcomment_config.php -- add in the extra rendering variable - line 76
Code:

$mxc_bbcoderender = &quot;1&quot;;


/administrator/components/com_maxcomment/languages/english.php -- add in the rendering language variable for admin and edit existing variables to make sense
Code:

DEFINE(&quot;_MXC_BBCODESUPPORT&quot;,&quot;BB Code Toolbar&quot;«»); //changed
DEFINE(&quot;_MXC_EXPL_BBCODESUPPORT&quot;,&quot;Add BB Code toolbar ?&quot;«»); //changed
DEFINE(&quot;_MXC_BBCODERENDER&quot;,&quot;Parse BB Code&quot;«»);
DEFINE(&quot;_MXC_BBCODERENDER_MAN&quot;,&quot;Note: Standard BBCode can be manually entered. Eg. [B],[I],[img]...&quot;«»);
DEFINE(&quot;_MXC_EXPL_BBCODERENDER&quot;,&quot;Parse BB Codes in comments ?&quot;«»);



/components/com_maxcomment/includes/common/maxcomment.parser.php -- change logic statement from original BBcode variable to new render variable - line 13
Code:

if ($mxc_bbcoderender) {


/components/com_maxcomment/maxcomment.html.php - add logic that shows a note to users that they can use BBCode - line 478
Code:

                  &lt;?php if ( !$mxc_bbcodesupport &amp;&amp; $mxc_bbcoderender ) { ?&gt;
                  &lt;tr&gt;
                    &lt;td valign=&quot;top&quot; align=&quot;right&quot;&gt; &lt;/td&gt;
                    &lt;td&gt;
                    &lt;?php echo _MXC_BBCODERENDER_MAN; ?&gt;
                    &lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;?php } ?&gt;

joshua.lyon
Senior Boarder
Posts: 49
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
boshdirect.com - my personal site. I often blog about technology so you might be able to find some good tips there.
 
#3162
Re:Better BBCode Support 2 Years, 8 Months ago Karma: 28
Good work and new option.
admin
Admin
Posts: 1095
graph
User Offline Click here to see the profile of this user
Gender: Male Location: Corbeil-Essonnes Birthday: 02/28
The administrator has disabled public write access.
All components are free but...
Ever thought about giving something back?
Please make a donation if you want to support its continued development. Your donations help by hardware, hosting services and other expenses.
 
#3174
Re:Better BBCode Support 2 Years, 8 Months ago Karma: 1
The following articles seemed like they would be helpful in converting the BBCode editor from Prototype to a smaller, less conflicting JS:
Iceteks
CodingForums

I think it's at least worth looking into. Also, my first search for &quot;bbcode toolbar&quot; in google had this page as the top item! Congrats.<br /><br />Post edited by: joshua.lyon, at: 2008/01/11 16:55
joshua.lyon
Senior Boarder
Posts: 49
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
boshdirect.com - my personal site. I often blog about technology so you might be able to find some good tips there.
 
#4301
Re:Better BBCode Support 2 Years, 2 Months ago Karma: 1
Sadly, the next versions did not include my code, so I had to go through and re-add it all. It would be really great if this was included in future releases so other people can enjoy it (and so I dont have to keep changing it everytime I update my mxcomment).<br /><br />Post edited by: joshua.lyon, at: 2008/06/30 06:41
joshua.lyon
Senior Boarder
Posts: 49
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
boshdirect.com - my personal site. I often blog about technology so you might be able to find some good tips there.
 
Go to topPage: 1