Discussbot version 4.1 final (released 11-28-05)

Started by chadness, November 29, 2005, 01:32:16 AM

Previous topic - Next topic

jzkiller

#100
Pardon my ignorance but I need some simple advise on exactly where to add the required code to the bottom of my template's index.php

The code I am going to apply is as stated in the config section of my mambot smf.discussbot.4.1final

This is what is currently at the bottom of my template's index.php

</tr>
<tr>
<td colspan="<?php echo $collspan_offset+1; ?>">
<img src="<?php echo $mosConfig_live_site; ?>/templates/rhuk_planetfall/images/top_bar.jpg" width="798" height="9" alt="" />
</td>
</tr>
</table>
<?php include_once( $GLOBALS['mosConfig_absolute_path'] . '/includes/footer.php' ); ?>
</div>
<?php mosLoadModules( 'debug', -1 );?>
</body>
<?php mysql_select_db($GLOBALS['db_name']); ?>
</html>


If I understand correctly I must.....
"Don't forget to add the following code to the bottom of your Mambo/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;
?>


My question is does it mean at the very bottom or should it be before the </body> or maybe before the </html>

Perhaps someone could help me with this?

EDIT: I tried placing it right at the bottom...result=No Good
I tried placing it just before the </html>, result = works fine
Trial and error gets you there eventually.
Joomla! 1.0.5 Stable
SMF 1.1 RC2
Bridge Mambo, Joomla SMF 1.1.2

JustJa

Quote

Which bridge version are you using?  Are the forum and Mambo in different databases?  Do the database users both have access to both databases?

MOS_SMF_BRIDGEv3.19a_SMF1.1b3
different databases but users has access on both databases yes...


lazereth

#102
What would be the proper way to setup the Mambot?

What do I put in the board name section of the Mambot.

Say I want the posts to be created in this board http://hibunderground.com/index.php?option=com_smf&Itemid=2&board=36.0 [nofollow]. How would I go about setting up the Mambot so the articles would automaticly have the discuss button at the bottom of each article that was on the Joomla section and create a post in the board.

I really dont know why it would create the board or the names. I don't fully understand how it works. I am still quite new to php and all that good stuff.

I am using smf bridge 3.20 joomla 1.0.7 and smf 1.1 RC2

This is one of the only things I can not figure out. Sorry that I dont understand how this all works.

HDH

I am having a few problems too - have tried a fair few versions today and have had various problems - mostly with errors when the mambot is loaded (regardless of whether it is published or not).

Ended up using beta 5 which has gotten me the closest to date.  Problems I am still having though:

1. Clicking on the Write Comments link in an article beings an error.  Url format after the JS link is:

index.php?option=com_smf&amp;Itemid=29&amp;topic=6.new#new

SMF error is: The topic or board you are looking for appears to be either missing or off limits to you.

2. Once number one has occured, (0) changes to (1) and the Url format changes to (SEF'ed this time - relevant?) /component/option,com_smf/Itemid,29/topic,6.top#top and we get the same error on SMF - The topic or board you are looking for appears to be either missing or off limits to you.

Forum stats show all these posts accruing somewhere but they do not show up anywhere.

3.  Small fry, but the write comments links only show in the full page articles themselves, whereas the others I have been experimenting with today show them on the Joomla front page after the intros.

I am using Joomla 1.1.0 Alpha, SMF 1.0.6 and MOS_SMF_BRIDGEv3.19a_stable.zip.

Using same database.  One thing I am not sure of and I think a chap above me mentioned this as a question, but in the field for default forum for discussions, do we put the board number like 16?  Or 16.0 or something different completely.

Almost there with a top mambot (thanks) - could I ask for a little more help?  :)

chadness

To everyone asking what you use for default board name: Use exactly that - the name of a board.  For instance, in my use of it, I have a board named "News Discussions".  All of the posts are then created in that board.  This field is only necessary if you want every news article to have a discussion link, without you manually putting one in.

To Grodden and HDH both (for question #1) - are you using SEF URLs?  If so, have you tried it with those off?

You're both using versions (Mambo 4.5.3h and Joomla 1.1) I haven't tested with at all, so if I get some time I'll try to install those and see if it works for me.  Actually, with the Joomla Alpha, I'm surprised the bridge works at all.  Grodden, your issue may be with the separate databases, but I'm still looking in to that.

HDH - for question #3, there is an option labeled: Do you want default discussion links to show on the front page? - is this set to Yes?  And, are you manually putting in the {mos_smf_discuss:Board Name} or are you using the default board setting?  If you are manually putting it in, you need to have it in the Intro section, not in the body of the news article, or it will never be loaded on the front page.

ZowieZ

Hi -

Just installed this (using the latest version and also the latest of SMF and Bridge Mambo, Joomla SMF 1.1.2).  I get the text at the end of each article, but when I click on the link, SMF gives this error message:

"The board you specified doesn't exist"

I've checked the spelling, etc.  The board does exist and I have inserted its name in the "Default discussion board" field.

Can anyone help me get this configured correctly?  Thanks.  BTW:  I also don't get the discussBot image to display with the link.

HDH

#106
Quote from: chadness on February 21, 2006, 06:05:49 PM
To everyone asking what you use for default board name: Use exactly that - the name of a board.  For instance, in my use of it, I have a board named "News Discussions".  All of the posts are then created in that board.  This field is only necessary if you want every news article to have a discussion link, without you manually putting one in.

Thanks - that has solved it.

Quote from: chadness on February 21, 2006, 06:05:49 PM
To Grodden and HDH both (for question #1) - are you using SEF URLs?  If so, have you tried it with those off?
No I have not but the first issue has been solved.

Quote from: chadness on February 21, 2006, 06:05:49 PM
HDH - for question #3, there is an option labeled: Do you want default discussion links to show on the front page? - is this set to Yes?  And, are you manually putting in the {mos_smf_discuss:Board Name} or are you using the default board setting?  If you are manually putting it in, you need to have it in the Intro section, not in the body of the news article, or it will never be loaded on the front page.

I am using the default board setting and I missed that field - thanks!

The only problem now is that I cannot get rid of the orphaned topics/posts.  The SMF backend shows them under a maintainance run, but click Yes to agree to fix the problems returns the site hompepage (likely my 404 catcher).  I'll try it with SEF off.

[edit]SEF off does not help the issue (as SEF doesn't change the backend stuff).  I'll search the board.

Thanks :)

[/edit]

chadness

Try running that maintenance directly from SMF, instead of through the bridge.  If that doesn't work, you might need to access the database directly.

ZowieZ - what version of Mambo or Joomla and SMF are you running?  Are you in seperate databases or shared?  Are you using SEF?

For the missing picture, you need to set the path correctly in the mambot config.  It comes with a default setting, but that's not right for all sites - you need to set it yourself.


Felipe Koch

I cant make it work.

After I insert the code just before </html> at my template´s index.php the page simply wont open. It gives me a blank page. I tryed moving it arround a bit (before BSQ Sitestats, after </html>) and still no good.

I'm using SMF 1.1 RC2, Discussbot 4.1final, Joomla 1.0.7 and Orstios bridge 3.20 a little moded (but thats not the case here).

Here's some sysinfo that may help:
PHP built On:       Linux server 2.6.12-1-686-smp #1 SMP Tue Sep 27 13:10:31 JST 2005 i686
Database Version:    4.0.24_Debian-10-log
PHP Version:    4.3.10-16
Web Server:    Apache/1.3.33 (Debian GNU/Linux) PHP/4.3.10-16 mod_ssl/2.8.24 OpenSSL/0.9.7g mod_perl/1.29
WebServer to PHP interface:    apache
Joomla! Version:    Joomla! 1.0.7 Stable [ Sunburst ] 15-Jan-2006 20:00 UTC

If you need any other info just ask.

HDH

#109
Quote from: chadness on February 22, 2006, 09:46:57 AM
Try running that maintenance directly from SMF, instead of through the bridge.  If that doesn't work, you might need to access the database directly.

I ended up doing it in the db in the end - then refreshing the counts within SMF admin.  From what I have seen it would have done the trick bypassing the bridge.

Only issue I have now is when the bot creates the new threads, the formatting shows up as [ P ] Article intro [ /P ]  Odd one and I am sur I saw an option to stop this happening based on the SMF setting in anotehr bot version but cannot see it in the beta 5 config page.

Thanks :D

chadness

I hadn't coded in to parse the [ p ] tags.  Someone posted how to fix that - I'll see if I can find it.

Felipe - Do you have the other code at the top of index.php?  Have you configured and saved the bot yet?  Do you have access to the server logs so you can see what the error is that makes it fail to load the page?

If all else fails, tries beta 5.

Felipe Koch

Thats what my access log contains for this time:
200.135.242.3 - - [22/Feb/2006:15:12:25 -0300] "GET /administrator/index2.php?option=com_templates&client= HTTP/1.0" 200 5293
200.135.242.3 - - [22/Feb/2006:15:12:28 -0300] "GET / HTTP/1.0" 200 26812
200.135.242.3 - - [22/Feb/2006:15:13:19 -0300] "GET / HTTP/1.0" 200 26746

The first line is when I added the code to the template, the second and third ones are my atempts to reload the page.

This is me removing your code from the template and refreshing the page once:

200.135.242.3 - - [22/Feb/2006:15:14:42 -0300] "GET /templates/madeyourweb/template_thumbnail.png HTTP/1.0" 200 159503
200.135.242.3 - - [22/Feb/2006:15:14:44 -0300] "POST /administrator/index2.php HTTP/1.0" 200 3871
200.135.242.3 - - [22/Feb/2006:15:14:50 -0300] "POST /administrator/index2.php HTTP/1.0" 301 0
200.135.242.3 - - [22/Feb/2006:15:14:50 -0300] "GET /administrator/index2.php?option=com_templates&client= HTTP/1.0" 200 5293
200.135.242.3 - - [22/Feb/2006:15:14:56 -0300] "GET / HTTP/1.0" 200 6097
200.135.242.3 - - [22/Feb/2006:15:14:56 -0300] "GET /includes/js/joomla.javascript.js HTTP/1.0" 304 -
200.135.242.3 - - [22/Feb/2006:15:14:56 -0300] "GET /templates/mbt_simple/css/template_css.css HTTP/1.0" 304 -
200.135.242.3 - - [22/Feb/2006:15:14:56 -0300] "GET /templates/mbt_simple/images/indent1.png HTTP/1.0" 304 -
200.135.242.3 - - [22/Feb/2006:15:14:56 -0300] "GET /components/com_virtuemart/show_image_in_imgtag.php?filename=Scathe_Zombi$
200.135.242.3 - - [22/Feb/2006:15:14:56 -0300] "GET /templates/mbt_simple/images/header.png HTTP/1.0" 304 -
200.135.242.3 - - [22/Feb/2006:15:14:56 -0300] "GET /templates/mbt_simple/images/subhead_bg.png HTTP/1.0" 304 -
200.135.242.3 - - [22/Feb/2006:15:14:56 -0300] "GET /includes/js/overlib_mini.js HTTP/1.0" 304 -
200.135.242.3 - - [22/Feb/2006:15:14:56 -0300] "GET /templates/mbt_simple/images/menu_bg.png HTTP/1.0" 304 -
200.135.242.3 - - [22/Feb/2006:15:14:56 -0300] "GET /templates/mbt_simple/images/arrow.png HTTP/1.0" 304 -
200.135.242.3 - - [22/Feb/2006:15:14:56 -0300] "GET /components/com_virtuemart/show_image_in_imgtag.php?filename=Supreme_Inqu$
200.135.242.3 - - [22/Feb/2006:15:14:56 -0300] "GET /components/com_virtuemart/show_image_in_imgtag.php?filename=Bloodletter_$
200.135.242.3 - - [22/Feb/2006:15:14:56 -0300] "GET /templates/mbt_simple/images/contenthead.png HTTP/1.0" 304 -
200.135.242.3 - - [22/Feb/2006:15:14:56 -0300] "GET /components/com_virtuemart/show_image_in_imgtag.php?filename=Teferis_Puzz$
200.135.242.3 - - [22/Feb/2006:15:14:56 -0300] "GET /components/com_virtuemart/show_image_in_imgtag.php?filename=Fevered_Stre$
200.135.242.3 - - [22/Feb/2006:15:14:56 -0300] "GET /components/com_virtuemart/show_image_in_imgtag.php?filename=Mistform_Sky$
200.135.242.3 - - [22/Feb/2006:15:14:56 -0300] "GET /components/com_virtuemart/show_image_in_imgtag.php?filename=Legacy_Weapo$
200.135.242.3 - - [22/Feb/2006:15:14:56 -0300] "GET /components/com_virtuemart/show_image_in_imgtag.php?filename=Avenging_Ang$
200.135.242.3 - - [22/Feb/2006:15:14:56 -0300] "GET /includes/js/overlib_hideform_mini.js HTTP/1.0" 304 -
200.135.242.3 - - [22/Feb/2006:15:14:56 -0300] "GET /images/M_images/edit.png HTTP/1.0" 304 -
200.135.242.3 - - [22/Feb/2006:15:14:56 -0300] "GET /images/stories/chucknorris.jpg HTTP/1.0" 304 -


This is the top part of my index.php:

<?php
defined
( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
// needed to seperate the ISO number from the language file constant _ISO
$iso = split( '=', _ISO );
// xml prolog
echo '<?xml version="1.0" encoding="'. $iso[1] .'"?' .'>';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php
global $sc, $context, $settings;

if (!
defined('SMF')){
session_write_close();
require (
"administrator/components/com_smf/config.smf.php");
require (
$smf_path."/SSI.php");
}

$sc = &$context['session_id'];

$_SESSION['USER_AGENT'] = $_SERVER['HTTP_USER_AGENT'];

mysql_select_db($mosConfig_db);

echo
'
<script language="JavaScript" type="text/javascript" src="'
, $settings['default_theme_url'], '/script.js?beta4"></script>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var smf_theme_url = "'
, $settings['theme_url'], '";
var smf_images_url = "'
, $settings['images_url'], '";
var smf_scripturl = "'
, $scripturl, '";
var smf_session_id = "'
, $context['session_id'], '";
// ]]></script>'
;

echo
'
<link rel="stylesheet" type="text/css" href="'
, $settings['theme_url'], '/style.css?rc1" />
<link rel="stylesheet" type="text/css" href="'
, $settings['default_theme_url'], '/print.css?beta4" media="print" />
<link rel="help" href="'
, $scripturl, '?action=help" target="_blank" />
<link rel="search" href="'
. $scripturl . '?action=search" />
<link rel="contents" href="'
, $scripturl, '" />';
?>
<?php mosShowHead(); ?>


Theres a little more underneath it, but thats just the usual j! stuff.

And the end part:

<?php mosLoadModules( 'debug', -1 );?>
</body>
<?php mysql_select_db($GLOBALS['db_name']); ?>
<?php
if(file_exists($mosConfig_absolute_path."/components/com_bsq_sitestats/bsqtemplateinc.php"))
{
       require_once(
$mosConfig_absolute_path."/components/com_bsq_sitestats/bsqtemplateinc.php");
}
?>
<?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;
?>
</html>


Any other info, just ask.

Thx for the fast reply...

Felipe Koch


ZowieZ

Quote from: chadness on February 22, 2006, 09:46:57 AM
ZowieZ - what version of Mambo or Joomla and SMF are you running?  Are you in seperate databases or shared?  Are you using SEF?

Using Joomla.  I'm using the most current versions of all.  SMF is in a separate database.  I have the SEF turned on -- using the default SEF mod shipping with Joomla.

Quote from: chadness on February 22, 2006, 09:46:57 AM
For the missing picture, you need to set the path correctly in the mambot config.  It comes with a default setting, but that's not right for all sites - you need to set it yourself.

Thanks.

HDH

Quote from: chadness on February 22, 2006, 12:59:08 PM
I hadn't coded in to parse the [ p ] tags.  Someone posted how to fix that - I'll see if I can find it.

I have been having a look at the code below and have worked out where to replace "", with "[ br ][ br ]", on the 5th line of the replace array.  It seems to already do the required with the replace on the 4th line and modifying the 5th doubles the linebreaks but I am sure I can tweak it.  Images in the first post seem to have issues too.

Cheers! :)


        $search =  array(
                    "/\</",
                    "/\>/",
"/\\\"/",
"/\[p([^\]]*)\]{1}/",
"/\[\/p\]/",
"/\[div([^\]]*)\]{1}/",
"/\[\/div\]/",
"/\[font([^\]]*)\]{1}/",
"/\[\/font\]/",
"/\[img.*src\=http/",
"/\[img.*src\=/",
"/jpg([^\]]*)\]{1}/",
"/gif([^\]]*)\]{1}/",
"/png([^\]]*)\]{1}/",
"/jpeg([^\]]*)\]{1}/",
"/\[a.+?(href=\"?http){1}/",
"/\[a.+?(href=\"?){1}/",
"/target\=([^\]]*)\]{1}/",
"/\[\/a\]/",
"/\[table([^\]]*)\]{1}/",
"/\[tbody\]/",
"/\[\/tbody\]/",
"/\[td([^\]]*)\]{1}/",
"/\[strike\]/",
"/\[em\]/",
"/\[strong\]/",
"/\[ol\]/",
"/\[ul\]/",
"/\[\/em\]/",
"/\[\/strong\]/",
"/{mos_smf_discuss:.+?}/"
                        );
        $replace = array(
                    "[",
"]",
"",
"[br][br]",
"",
"",
"",
"",
"",
($quote_images=="1" ? "[img]http" : ""),
($quote_images=="1" ? "[img]".$mosConfig_live_site."/" : ""),
($quote_images=="1" ? "jpg[/img]" : ""),
($quote_images=="1" ? "gif[/img]" : ""),
($quote_images=="1" ? "png[/img]" : ""),
($quote_images=="1" ? "jpeg[/img]" : ""),
"[url=http",
"[url=".$mosConfig_live_site."/",
"]",
"[/url]",
"[table]",
"",
"",
"[td]",
"[s]",
"[i]",
"[b]",
"[list]",
"[list]",
"[/i]",
"[/b]",
""
);

rastamate

Hi.

Would be a nice thing to use.

Tried to get it work on Joomla 1.07, Orstio Bridge 3.20, SMF in separate DB.

But the bot wont give me a new thread. It says that the topic is missing or I don't have right to it.

Why?

I did fill out everything needed for sure correctly.

Would be glad if somebody could give me a hint.

Greetings
Peter
Es Griessli
hxxp:www.cmsinfo.ch [nonactive]

hxxp:www.helferlein.org [nonactive] / hxxp:www.latinoportal.ch [nonactive] / hxxp:www.joomlaportal.ch [nonactive]

chadness

This must have something to do with multiple databases.  I'm not sure why it's failing.  Is it a problem with beta 5 as well?

rastamate

Didn't try the beta5 if a final exist.

You think should give the beta5 a try? Or beta6?

Why this shouldn't work in your final then?
Es Griessli
hxxp:www.cmsinfo.ch [nonactive]

hxxp:www.helferlein.org [nonactive] / hxxp:www.latinoportal.ch [nonactive] / hxxp:www.joomlaportal.ch [nonactive]

chadness

At the time it was released, the final seemed like it would be a good final.  However, some features added in beta 6 (allowing the parsing of BB code) seem to have problems with some setups, so beta 5 is a good test bed to see if that is causing the problem.

rastamate

OK, thanks!

I will try it and post my experience here....
Es Griessli
hxxp:www.cmsinfo.ch [nonactive]

hxxp:www.helferlein.org [nonactive] / hxxp:www.latinoportal.ch [nonactive] / hxxp:www.joomlaportal.ch [nonactive]

Advertisement: