• Welcome to Simple Machines Community Forum. Please login or sign up.
January 23, 2022, 11:27:50 AM

News:

SMF 2.0.19 has been released! Please update. Read more.


Discussbot 4.2 beta 3 released 04/19/07

Started by chadness, April 19, 2007, 05:35:59 PM

Previous topic - Next topic

chadness

Not a lot of changes.  The most important is adding Mambo 4.6.1 compatibility!  This has only been lightly tested, so I'll be very interested to hear feedback.

For discussing your Joomla or Mambo content articles on designated SMF boards. These discussions can be displayed in the content article.

Install the same as any mambot, through the Administration mambot installer.

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.

IMPORTANT - If running Joomla version 1.0.11 there is a known bug which prevents you from being able to configure mambots.  Click here for the fix.  Note that you must be logged in to the Joomla forums to be able to download the file.

From this version, beta 3:
  • Added Mambo 4.6 compatibility.
  • Fixed if the quoted message is cut off during a list, it will close the ol or ul.
  • Added additional HTML fixing in the quoted message.
  • Fixed problem with uploaded avatars if attachments directory is protected.  The new method is really the way it should have been done in the first place.
  • Removed attachment directory option. No longer needed.
  • If the first post is being included in the article display, it will attempt to remove the quoted version of the article.

Previous features added by chadness:
From 4.2 beta 2:
  • Overhauled the display of the discussion.  For further tweaking, you should define your own CSS classes in your Joomla template, and list them in the bot configuration.
  • You now have the option to include avatars.  If you have changed your attachments directory from the default, you will need to set that in the bot settings, or it won't be able to find uploaded avatars.
  • Added the ability to link the article to a specific existing topic in SMF.  To do this, enter in to your Joomla article {mos_smf_discuss:topic_id_num:#} where # is the topic number you want to use.  You can find the topic number by looking at the URL for the post - there will be a part of the URL that says "topic=2" or whatever number topic it is.
  • Strips span tag from article to SMF post.
  • Fixed problem with multiple databases.
  • Fixed problem with using board numbers and a default discussion board.
  • Fixed problem with special characters when SMF is in a UTF-8 collated database.
  • Fixed an old problem that caused the register link in the login module to stop working.
  • Fixed a problem with an unclosed link tag.
  • Added a prefix before the subject of quick reply (for example, "Re: ").
  • Tried to make it a little more accurate in guessing the correct board to post to.  In order of precedence:
    1. Use the explicitly written board in a {mos_smf_discuss:} tag.
    2. Use a post with a matching title in the default discussion board.
    3. Use a post with a matching title in another discussion board.
    4. Use the default discussion board.
  • Changed the behavior of whether the bot includes the first post in it's count and when displaying replies. 
    -Before, it always counted the first post in the post count.
    -Now, it only counts the first post in the post count when "Would you like the discussion link to automatically start a reply, instead of viewing the topic?" is set to "1st post only" or "Always".
    -Before, in the discussion display, it wouldn't include the first post if it started with [url and ended with closing a quote or url tag (basically, it was guessing that that meant it was simply a link back to the original article, and possibly a quote from it).
    -Now, in the discussion display, it only includes the first post when "Would you like the discussion link to automatically start a reply, instead of viewing the topic?" is set to "1st post only" or "Always".  This will make it consistent with the post count number.

From 4.2 beta 1:

  • Orstio bridge version 1.1.6 compatibility.
  • Hopefully fixed the display problems when running on certain pages with other SMF modules.
  • Added option for nofollow rel tag so Google's bot (and possibly others) will not follow links.
  • Added option to choose whether or not to display in modules (apparently in Joomla 1.0.10 content mambots started to be able to display in modules).
  • Added option to use SMF board numbers instead of name

So far I've only tested this with Joomla 1.0.11, Mambo 4.6.1, SMF 1.1.2, and Orstio's bridge 1.1.6/7.  I would appreciate feedback from testing any other configurations.  This is an early beta - I wouldn't go throwing it on any important production sites!

Thanks!  And thanks to Skydig and Orstio for various fixes!

Download here:
http://www.technoadvice.com/remository/Download/Joomla-and-Mambo/SMF-Discussbot-version-4.2-beta-3/

The following code may need to go at the end of your Joomla template:
<?php 
ob_start
('output');
$buffer ob_get_contents();
ob_end_clean();
$buffer str_replace('<input type="hidden" name="sc" value="" />'
,'<input type=hidden name="sc" value="'.$sc.'">'$buffer);
echo 
$buffer;
?>

Aravot

Tested discussbot with FireFox 2.0.0.3, IE7 and Opera 9.2.8771 don't know if it is from the templates or the discussbot but in each browser had a different effect.

Have a look http://www.armeniancollegeofcalcutta.com/joomla


chadness

Yeah, it seems to have some problems especially when the article starts with an image.  I think this is going to take some tweaking.  :)

chadness

Quote from: Aravot on April 19, 2007, 08:04:36 PM
Tested discussbot with FireFox 2.0.0.3, IE7 and Opera 9.2.8771 don't know if it is from the templates or the discussbot but in each browser had a different effect.

Have a look http://www.armeniancollegeofcalcutta.com/joomla
I'm sure it's a bit of both.  Depending on the template, it will always look a little different.  I'm not sure if there's an easy all-in-one solution to this.  I might need to experiment with a templating system for the discussbot.

maxigs

April 21, 2007, 05:13:24 AM #5 Last Edit: April 21, 2007, 05:24:37 AM by maxigs
wow and another version out.

i still have the beta2 (well just installed it a day ago - thanks btw the utf8-problem seems to be gone) but my folks already reported a possble bug:

after editing an article in joomla the "thanks for your content" (i hope its the message in the english version, since i only have it in german) the discussion is not connected to a possible existing discussion but always opens a new one.

and one more thing - even if it might be a supid question at this point - but why did you choose to use the title of the article as reference to the smf and not just simply add a reference table so the article and topic id are connected to eachother?
i dont know if this is possible with either joomla or smf but it surely would eliminate all the reference problems for single articles

update:
the problem was not because of the editing but simply because there was a " in the title which seems to cause a cut-off of the title and therefore no possible reference anymore.
the jommla title was fine but in the smf the " (for inch) was missing and the title cut-off at its position. after changing the title (replacing the " with inch) and editing the topic title to match it worked fine.
-> this seems to happen as well with switched on and switched off utf-8 conversation

jorgen

Quote from: chadness on April 20, 2007, 10:13:29 AM
Yeah, it seems to have some problems especially when the article starts with an image.  I think this is going to take some tweaking.  :)

It seems to work perfect when I remove this  from line 599:
Quoteif (strcmp(substr($postmessage, $quotecheck + 7, 20), substr(preg_replace($search, $replace, $row->text),0,20))==0)


-What is that test for anyway? You already tested if the first post contains a quote  ?


Benson

Beta 3 is working fine on my site.

Only problem: filter out {mosimage} - i see it in the search/replate array but i still get something like ://www.mysite.com/joomla/images/stories/key. if i have added an image via the mosimage function....

cheers,
Benson

chadness

Quote from: jorgen on April 21, 2007, 06:06:46 AM
-What is that test for anyway? You already tested if the first post contains a quote  ?
That tests to make sure the quote is the same as the article.  Maybe that's not really necessary - what are the chances the first post in the thread are going to contain a quote that is anything else?

chadness

Quote from: Benson on April 22, 2007, 07:39:38 AM
Beta 3 is working fine on my site.

Only problem: filter out {mosimage} - i see it in the search/replate array but i still get something like ://www.mysite.com/joomla/images/stories/key. if i have added an image via the mosimage function....

cheers,
Benson
It should be giving the whole path to the image.  If you want it to completely filter them out, just turn off the option for including images.

jorgen

Chadness, would you like an additional idea for the bot?

It would be cool if you were able to also show pictures attached to posts when displaying the posts in the article. When the user attaches pictures to posts, they usually support the text, and are needed to show the full meaning of the post.

Here is an example where I'd like to include the picture-attachment from the post:
http://www.inventorforum.net/index.php?option=com_content&task=view&id=202

chadness

That would be cool!  I'm not sure I'll have time any time soon to implement it, but if I'm feeling crazy...  :)

chadness


Aravot


chadness

If you embed a video in content, it would work fine.  Was there something beyond that you were thinking of?

weekendclimber

Chadness,

On the two queries looking for the Itemid in the #__menu tables, you need to add "AND published = 1". That way, if you just happen to have an unpublished SMF menu item ::) like moi, you won't spend all night trying to figure out why the Itemid's don't match. :P

Thanks for the awesome mod  :D
If you do what you have always done, you will get what you have always gotten.

chadness

The reason we don't do it like that is because some people want to have the forum link unpublished in the main menu, for various reasons.  Some times so that they can have a second link somewhere only available to registered users, or because they don't want a link to their forum in the menus at all.  The main menu link needs to be public for login and registration to work correctly, but it doesn't have to be published.

weekendclimber

Okay, got it. Is there a spot in the docs or readme that explains that? Maybe add a little note if not. Again, thanks for the mod :D
If you do what you have always done, you will get what you have always gotten.

chadness

Good idea!  First time I've heard of anyone running in to this problem, so I hadn't thought to mention it.

weekendclimber

Chadness, after looking at this a little further, I realized these menu items were in my trash bin, not just unpublished. So, adding a "AND published = -2" to the query would eliminate those, though a note with emphasis on emptying your trash bin may also do good :)
If you do what you have always done, you will get what you have always gotten.

Advertisement: