General Community > Off-Topic
WebsiteBaker SMF Forum Modul Update
Paul_G:
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 :)
marathoner:
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: ---require(WB_PATH.'/forum/SSI.php');
echo "\n<P>".ssi_login()."</P>\n";
--- End code ---
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
Paul_G:
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.
VCRulez:
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: ---<?php
require("/path/forum/SSI.php");
ssi_recentTopics();
?>
--- End code ---
It doesn't work. Is it because of the missing bridge between WB and SMF or is there a problem with my code?
marathoner:
@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: ---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";
--- End code ---
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version