DiscussBot - now with BBC and smiley parsing! (4.1 beta 6 released 11-16-05)

Started by chadness, November 16, 2005, 12:32:29 PM

Previous topic - Next topic

chadness

I'm starting a new topic since the old one is getting long. 

I'm releasing a new version of the discussbot, 4.1 beta 6.  The biggest advancement in this is the addition of BBC parsing!  I spent a lot of time manipulating code to get this to work, and ended up tripling the size of the discussbot, until I finally discovered a quick easy way to be able to use SMF's built in parser.  So, it pushes all of the output through the SMF BBC parsing function, which means all of your SMF settings for what to parse and what not to will be used, as well as each user's individual smiley sets.  Other things include HTML, flash, images, etc.

Because of how this is working, I'm really curious to hear how well it works for everyone.

One small problem that I'm having is that in IE 6 the code doesn't get the scroll bars the way it should, even though it seems to pick up on the class tag correctly.  Anyone have any ideas for how to fix it?  Firefox works OK.

Two other changes in this version:
1st, the "long words" fix has been changed, so that it uses the same code that SMF uses (and the function name has been changed to prevent conflicts with akoComment).  Speaking of which, long words will be maniuplated once by the BBC parsing using SMF settings (using the same settings), then again using the discussbot's code  This is for two reasons - so that you can have the long words fix even if you do not have BBC enabled, and so that you can have it set shorter in the mambot, since you may have less space to work with in the content area.

2nd, the discussbot image included with it has been reversed.  It just looks better, IMHO.  :)  I believe Aravot suggested it.

Description details available here.
Download available here.

Install like any normal mambot.

To upgrade from a previous version, the easiest way is to just upload the files in to your /mambots/content directory, overwriting the previous ones.  Then go in to the mambot properties in Administration, and save the settings, even if you don't change any of them.

Orstio

Quote...until I finally discovered a quick easy way to be able to use SMF's built in parser.  So, it pushes all of the output through the SMF BBC parsing function, which means all of your SMF settings for what to parse and what not to will be used, as well as each user's individual smiley sets.  Other things include HTML, flash, images, etc.

Awesome!  I wondered if that would be possible, ever since the topic under the article was introduced.

chadness

Yeah, I had originally copied the parseing functions into the discussbot, and made it call the SMF DB to get the correct settings, and then had to hack away to get it to work right.  Then, I tried including the SSI.php file, and found I could just use the original functions.  Could have saved myself a ton of time!  :)

supastoked

Hi Chadness,
Your discussbot works like a charm on Joomla 1.0.3 and SMF RC2, 319 Orstio bridge :):):)
I am just trying to figure a way to use it along side Mosets Tree? I am busy with Joomla Knowledge Sharing site and using Mosets to handle the listings (tips). I initially had a prob getting XHTML Suite to show up when submitting a new listing, but have that sorted. The only thing i am really stuck on is how to get "Discuss this Tip" working :( Any ideas of how this may be achieved? I have been looking for a way to run a mambot outside of content, but havent been able to find anything as of yet...
Any ideas would be very much welcome  ;D
Cheers
Chris

chadness

This is tricky because the function that calls this sort of mambot is "onPrepareContent", which implies to me it will only work with content.  I'll look in to this.

torkil

Hm. Have you registered this project on joomlaforge? You should! It will get you alot more attention and a very good base for file and release handling :)

torkil

BTW: Smileys are working like a charm! Great job!

But: Even when I enable wordwrap and set it to 10 characters, it does not wrap an excessively large link that has been posted in one of the comments.

torkil

"bug": Having 4 spaces between the name and the date is not neccessary. I at least see four &nbsp;'s in the code there.  Users should be able to make padding for their <span class="createdate"> themselves in my opinion. THat way people can adjust the space size themselves.

torkil

One last "whiiiine" from yours truly:

I dont like the way that a <br/> element, a <hr/> element and lots of &nbsp; elements are in the base code.

Linebreaks are easy to create by using margins on block elements. Horizontal rulers can be created by using borders on block level elements, and space can be made by using padding or margin. Therefore I think that removing these elements and leaving it up to the users CSS code would be the best practice.

Right now I'm doing a display:none to remove the HR, and Im doing a margin:-20px to remove the extra linebreak... :)

chadness

I'll be the first to admit, I'm not the best with HTML and CSS. :)  Heck, or PHP or MySQL for that matter, I'm just sort of blindly hacking here. 

Part of the reason it's coded the way it is, is that the "createdate" and other CSS classes are all based on standard Joomla classes, and I wanted it to look decent "out of the box".  Do you have a suggestion for how we can accomplish decent spacing and make the code cleaner?

I'm not sure why the wordwrap isn't working for you.  I have it wrapping a 150 and 300 character link OK when set to 75 or 80.  I'll play with it more.

Quote from: torkil on November 20, 2005, 05:08:53 AM
Hm. Have you registered this project on joomlaforge? You should! It will get you alot more attention and a very good base for file and release handling :)
I should, I know :)  I've been lazy about setting that up.  Frankly, I didn't expect to be doing as much with this as I have.

torkil

My site isnt online yet, so I can't show it to you :P

Suggestions? Sure!

Wrap the header stuff (post title, poster name, date) inside a div. That way you can set borders to that div to create separators.

I see you have used a table layout too... I would maybe have made the html more like this:


<div id="commentscontainer">
    <div class="comment_1">
        <div class="commentheader">
            <span class="commenttitle">My comment</span>
            <span class="commentauthor">Torkil</span>
            <span class="commenttime">Aug. 12th 2006</span>
        </div>
        <div class="commentbody">My comment goes here</div>
    </div>
    <div class="comment_2">
        <div class="commentheader">
            <span class="commenttitle">My comment</span>
            <span class="commentauthor">Torkil</span>
            <span class="commenttime">Aug. 12th 2006</span>
        </div>
        <div class="commentbody">My comment goes here</div>
    </div>
    <div class="comment_1">
        <div class="commentheader">
            <span class="commenttitle">My comment</span>
            <span class="commentauthor">Torkil</span>
            <span class="commenttime">Aug. 12th 2006</span>
        </div>
        <div class="commentbody">My comment goes here</div>
    </div>
    (... more comments)
</div>


I'd put it in blocks of comment1, comment2, comment1 etc, so that people would be able to give them for instance alternating background colors to seperate them from one another.

supastoked

Quote from: chadness on November 18, 2005, 12:17:19 PM
This is tricky because the function that calls this sort of mambot is "onPrepareContent", which implies to me it will only work with content.  I'll look in to this.

Hi Chad,
Thanks! I will keep an eye on this post for any updates :)
Cheers
Chris

chadness

Thanks for the tips, Torkil!

Yeah, the comments are in a table, so that I could use the Joomla/Mambo sectiontableentry1 and sectiontableentry2 classes for alternating backgrounds.  I'll have to try those with divs and see how they work.

torkil

There are no magic tricks required for giving the same style to
<div class="sectiontableentry1"> and <td class="sectiontableentry1">
Since they are both classes...

The layered layout may be a bit more up to date, but the table layout is still working perfectly. I think you should leave the current layout as is, since it will require alot of re-programming for the users of the DiscussBot if you change it completely.

If you decide to change it completely and go with a structure like I suggested, I think you should start a new version number... Like 4.2 or 5.0 or something.

Thanks for a great application!!!!!!!

chadness


chadness

Quote from: supastoked on November 21, 2005, 09:01:49 AM
Hi Chad,
Thanks! I will keep an eye on this post for any updates :)
Cheers
Chris

It looks like, to get it (or any other content mambot) to work the component you are using needs to be programmed to use the mambots.  You could contact the author about this.  It looks like it would be something along the lines of this part of com_content's content.html.php:
// process the new bots
$_MAMBOTS->loadBotGroup( 'content' );
$results = $_MAMBOTS->trigger( 'onPrepareContent', array( &$row, &$params, $page ), true );

supastoked

Hi Chad,
Thanks again for looking into it! I will contact mosets and hopefully they will be able to help :)
Cheers
Chris

digiSal

Kewl bot!

Although, i cant seem to get the Quick Reply box to show up under the article? I edited the joomla/template /index.php but still no go.

I am using Joomla 1.0.4 and SMF 1.1 RC1, Bridged with v3.19 .

and I am using Discussbot 4.1b6

and my, still fresh, site can be found here www.digisal.com/jl/ [nofollow]

u can use

user: Test
pw: testing

thanks...

digiSal


chadness

Glad you got it working!

New version available here:
http://www.simplemachines.org/community/index.php?topic=58578.0

I recommend everyone upgrade as beta 6 will give you some minor errors (notices, actually) in your log files.

Advertisement: