WebsiteBaker Community Forum

General Community => Off-Topic => Topic started by: TiGGeR on March 29, 2008, 10:01:59 AM

Title: WebsiteBaker SMF Forum Modul Update
Post by: TiGGeR on March 29, 2008, 10:01:59 AM
Hello,

i was trying to update my SMF Forum Modul, but to say it short it simply doesnt works.
so i have an extremely old version. :(
also i tryed to uninstall it and i keep getting the "is in use" message.
if this is already answered in another threat im sry, i used the search function...
can somebody pls tell me how i can update it ?

Greetings TiGGeR
Title: Re: WebsiteBaker SMF Forum Modul Update
Post by: doc on March 29, 2008, 10:25:47 AM
Hello,

the WB module of the SMF forum was removed due to license issues. The SMF module is no longer supported by WB - sorry.

Regards Christian
Title: Re: WebsiteBaker SMF Forum Modul Update
Post by: BartB on July 24, 2008, 08:01:27 PM
That's a shame... I am currently working WB around my SMF forum, and it works ok, but I can't get the SSI.php functions to work.

Well, to be precise: I can't call the SSI.php from within the template of WB, or WB will go nuts over it. Only when I use SSI.php calls within an IFRAME, I can get it to work.

The InlineFrameWrapper didn't help out either...  :oops:
Title: Re: WebsiteBaker SMF Forum Modul Update
Post by: marathoner on July 25, 2008, 03:28:19 AM
I use the SSI.PHP functions in a code section with no problem. I include a SMF log-in, and the 5 most recent postings as a teaser. What are you trying to do?
Title: Re: WebsiteBaker SMF Forum Modul Update
Post by: Paul_G on October 19, 2008, 04:40:22 PM
I wanted to add a SMF Forum login box to my website baker template.

I read this page, http://docs.simplemachines.org/index.php?topic=789

So I included the SSI.php file at the top of my template, and the WB page crashed.

The problem was in the wb/framework/class.database.php file.  For some reason the $this->db_handle variable was missing from most of the mysql function calls. :)

So I quick fixed the class.database.php file and now the login form will show up and the page doesn't crash, and I can login using the login form, but the SMF $_SESSION['login_url'] thing doesn't work.  and the SMF $context['user']['is_admin'] variables don't work.

Likely what's happening is both the WB and SMF code is confused about what database each one is supposed to be connecting to.

so, I guess one solution is to make my own module to replace SSI.php, just the functions I need, like a login form and getting the member id.  and ensure that my code only connects to the proper db.   or I could try installing both WB and SMF under the same database, and see what happens.
Title: Re: WebsiteBaker SMF Forum Modul Update
Post by: Paul_G on October 21, 2008, 01:55:21 AM
The method of installing SMF and WB in the same database worked.  but the session problem remained.

I think I might have figured out the session problem between WB and SMF.

I was getting this message on the forum page when I tried to logout using the SMF SSI form/link functions that I added to my wb template,

"Session verification failed. Please try logging out and back in again, and then try again."  and it wouldn't redirect back to my wb pages.

In SMF admin Server Settings->Feature Configuration I unchecked "Enable local storage of cookies (SSI won't work well with this on.)" checkbox.
and also unchecked "Use database driven sessions" checkbox.

didn't work.

I made a few standalone test pages to see if my sessions were working and eventually I tried this:

In the main index files of each system:

wb/index.php
smf/index.php

put session_start() at the top like this:

<?php
session_start(); //Paul , I put my name in comments next to anything I change or add, so I know what I did to mess it up :)
Title: Re: WebsiteBaker SMF Forum Modul Update
Post by: marathoner on October 21, 2008, 02:59:09 PM
I include a SMF log-in on a WB page that works just fine. The WB page that contains a code section. The code (among other things) is:
Code: [Select]
require(WB_PATH.'/forum/SSI.php');
echo "\n<P>".ssi_login()."</P>\n";

Here it is if you want to see it in action. It simply displays the log-in form with the Username, Password, and Login button.
http://www.columbusroadrunners.org/pages/message-board.php (http://www.columbusroadrunners.org/pages/message-board.php)
Title: Re: WebsiteBaker SMF Forum Modul Update
Post by: Paul_G on October 22, 2008, 12:10:04 AM
There was a problem with my previous session solution.  The sessions wouldn't work between the main pages and the admin area.

so instead of adding session_start() to the top of wb/index.php ,

I tried commenting out line 76 in wb/framework/initialize.php

//session_name(APP_NAME.'_session_id');

now the sessions will work between the WB pages, the SMF pages and the WB Admin area.

hope this helps someone.
Title: Re: WebsiteBaker SMF Forum Modul Update
Post by: VCRulez on October 30, 2008, 02:48:15 PM
I'm a bit confused now. WB module of the SMF forum was removed due to license issues, but SSI functions are still possible?
I tried to insert the following code into a code form:
Code: [Select]
<?php 
require("/path/forum/SSI.php"); 
ssi_recentTopics();
?>

It doesn't work. Is it because of the missing bridge between WB and SMF or is there a problem with my code?
Title: Re: WebsiteBaker SMF Forum Modul Update
Post by: marathoner on October 31, 2008, 02:42:21 PM
@VCRulez
You need to use the full path...the easiest way to do that is with WB_PATH constant.

Have you looked at the documentation for SMF functions? If so, you'll see that ssi_recentTopics() returns an array. Assuming that your required path is correct then your code worked fine...you just didn't do anything with the array.

Here's a working snippet that I use to display the SMF login followed by the 5 most recent posts. Be aware that I'm also using some JS to 'hide' and 'show' each posting that you can ignore.
Code: [Select]
require(WB_PATH.'/forum/SSI.php');
echo "\n<P>".ssi_login()."</P>\n";

echo "\n<div class=\"red_box\">\n<h3>Five most recent forum posts</h3>\n";

$posts = ssi_recentPosts(5, array(), 'array');
$i = 10;
foreach ($posts as $post) {
    $item = "item$i";
    $i++;
    $subject = $post['subject'];
    $body = $post['body'];
    $href = $post['href'];
    $timestamp= "Posted ".date("F j, Y", $post['timestamp']);

if (strlen($body) > 160) {
$body = snippet($body, 160) . " <a href=\"$href\">(...Continued: read full posting here)</a>";
} else {
$body = $body . " <a href=\"$href\">(Read full posting here)</a>";
}

echo <<<EOT
<div id="$item" class="news_expand">
<a href="javascript:showHideItems('$item');">$subject</a>
<p>$timestamp</p>
<p>$body</p>
</div>
EOT;

}
echo "</div>\n";
Title: Re: WebsiteBaker SMF Forum Modul Update
Post by: VCRulez on November 01, 2008, 12:34:44 AM
@VCRulez
You need to use the full path...the easiest way to do that is with WB_PATH constant.
Yeah my path is correct.

Have you looked at the documentation for SMF functions? If so, you'll see that ssi_recentTopics() returns an array. Assuming that your required path is correct then your code worked fine...you just didn't do anything with the array.
Well, I read some basic SSI FAQs and there's nothing said about arrays.
I inserted the code I posted above into a simple php file and uploaded it to my webspace. It runs fine! But if I use the same code with a page created by WebsiteBaker nothing happens (even with the code you've posted).

https://forum.WebsiteBaker.org/index.php/topic,6721.msg41873.html#msg41873
In this thread beeblebrox got the same thing working what I would like to do. It seems really simple (no words about arrays) but I can't get it working. :(
Title: Re: WebsiteBaker SMF Forum Modul Update
Post by: VCRulez on November 14, 2008, 01:29:04 AM
Ok, I got it a step further. :)
I found this posting (https://forum.WebsiteBaker.org/index.php/topic,10353.msg60931.html#msg60931):
Quote
Allways after creating an external database connection re-open the WB database connection otherwise WB doesn't know where to look for it's data, simple as that

Indeed the best way to do so is :
$database = new database();

use that at the end of your code!

This has nothing to do with chCounter,
wb starts building the page, it opens the database connection, code is executed, when in code another connection is made wb looses his.

So I added the following code to a code form:
Code: [Select]
require("/users/soo/www/forum/SSI.php");
ssi_recentTopics();
$database = new database();

The output is this:
(http://img361.imageshack.us/img361/5240/smfssiik7.png)

So at least it is working now!
But two more questions:
1. Why does it put out "test116test119"? How can I get rid of this?
2. How can I modify the output so that it shows german umlauts ö,ä,ü?
Title: Re: WebsiteBaker SMF Forum Modul Update
Post by: ruebenwurzel on November 14, 2008, 08:15:44 AM
Hello,

looks like the two databaseshave different charsets. (one seems to be UTF8 and the other ISO-8859-1) So you have to "convert" what you wanna have displayed.

Matthias
Title: Re: WebsiteBaker SMF Forum Modul Update
Post by: VCRulez on November 15, 2008, 12:44:17 AM
Thank you, finally all working like a charm here! :D