Bridge Xoops-SMF 1.1 RC3 Beta 1

Started by Orstio, December 31, 2005, 03:18:57 PM

Previous topic - Next topic

Orstio

On your local machine, you will most likely need to install Xoops and SMF in the same database.

andeon

Yes, but which tool ?

example I used - http://www.easyphp.org/ [nofollow]
==============================
EasyPHP is a complete software package allowing to use all the power and the flexibility that offers the dynamic language PHP and the effecient use of databases under Windows. Package includes an Apache server, a MySQL database, a fully PHP execution, as well as easy development tools for your web site or your applications.
==============================
it would like to test another tool, since with this it did not function bridge (it can be that the problem is easyphp)

thank

Orstio

Your problem is most likely not related at all to EasyPHP. 

You have installed SMF and Xoops in separate databases on your local computer.  That does not work.  EasyPHP or not, that does not work.

Lance_

Hey Orstio,

A request has come on the xoops.org forum to make a module(conjecture:http://www.xoops.org/modules/news/article.php?storyid=3485) that acts as a replacement for the comments system on the xoops core. Right now this module works on the CBB forum only. We have asked Mithrandir to have this available for SMF also.

He requires help to get this done. I hope you are able to provide some info.

QuoteMithrandir:

I will need some help on this.

I have abstracted it out, so that it should be relatively easy to add support for other forums, but someone with more intimate knowledge of SMF will need to help me with this.

I'll have to have self-contained, all-emcompassing code for:

1) Given a topic ID, return an array of posts in that topic
2) Given a forum ID, a topic ID and a parent comment ID, return a form for adding a comment
3) Posting a new comment, following submissal of the form
4) Getting a hierarchical array of all forums, for matching forums with modules

Thank you.  :)

Orstio

#444
Great news.  :D

#1: This assumes the variable $resultid contains the given topic ID.  It will return the array of posts into $posts.

           $post_query=mysql_query("SELECT ID_MEMBER, posterName, subject, body, FROM_UNIXTIME(posterTime, '".$discuss_date_format."') AS msgTime FROM {$db_prefix}messages WHERE ID_TOPIC = '$resultid';");
$posts = mysql_fetch_assoc($post_query);


#2:  This assumes we've queried to get the board ID ($board_id), the topic ID ($resultid, same as in #1), the number of replies to the topic ($replies), and that a valid SMF session exists (will populate $GLOBALS['sc']).  $title and $article_id should be taken from the Xoops article.

<table><tr><td valign="top">
             <form id='.$article_id.' action="'. XOOPS_URL . '/modules/smf/index.php?action=post2"').' method="post" name="postmodify" onsubmit="submitonce(this);">
             <input type="hidden" name="topic" value="' . $resultid . '" />
<input type="hidden" name="board" value="'.$boardid.'" />
             <input type="hidden" name="subject" value="' . $title . '" />
             <input type="hidden" name="icon" value="xx" />
<input type="hidden" name="goback" value="true" />
             <input type="hidden" name="num_replies" value="'. $replies. '" />
             <textarea cols="75" rows="8" class="inputbox" wrap="VIRTUAL" style="width: 75%" name="message" tabindex="1"></textarea><br />
             <input type="submit" name="post" value="Reply" class="button" onclick="return submitThisOnce(this);" accesskey="s" tabindex="2" />
                     <input type="hidden" name="sc" value="' . $GLOBALS['sc'] . '" /></form></td></tr></table>


#3:  The form above will take care of it all automatically if done right.

#4:  I'm not sure what exactly is required here.  Perhaps just query the smf_boards table?

This is exactly the same thing that is done with the discussbot in Mambo and Joomla:

http://www.simplemachines.org/community/index.php?topic=118310.0

The invention of the discussbot, and its subsequent upgrades and forks were a big part of the popularity of the Mambo/Joomla bridge.  This is very good to see for Xoops.   8)
      

Lance_

http://www.xoops.org/modules/newbb/viewtopic.php?topic_id=55185&start=10
QuoteMithrandir:

Thanks for the info, Orstio

#1: check

#2: "valid SMF session" - when we are in another module, how do we ensure that the SMF session exists?

#3: Where will the user be sent afterwards? My intention is to go back to the article/download/etc. but if it goes to the thread, I guess people will live with it.

#4: Something like that, yes. Is there a hierarchy of categories and subforums or will a simple board table query do?

Zxaos

I think I'm probably just an idiot, but I can't seem to make the SMF login block show up at all.  When I go to set it to visible (for anonymous users) it's not listed, and it doesn't show up for Registered Users (because hey, it's a login block. Why should it?)

I'm using SMF 1.1 RC3 and Xoops 2.0.16

Any help would be appreciated.  It's a fairly vanilla install (no mods on SMF, the only modules in XOOPS are news and team)

Orstio

After uploading the folder to your modules folder, you need to install the module in your Xoops admin panel.  Then the login block will appear in the blocks config.

Zxaos

Sorry, let me clarify that.

The block is showing up in the blocks list, but only when viewing the available blocks for registered users.  When I go to activate the block for anonymous users (to allow login), the only available blocks are from the system module.  Activating the block for the Registered Users group doesn't make it show up (presumably because they're already logged in).  If I go to the "SMF Module for Xoops" side menu forum option, it shows the forum wrapped in the Xoops page, but you're not logged in.

Lance_

@ Zxaos

You need to go to Groups and check the smf login block so that it is available to anonymous users first.

Then it will apppear available in the Blocks page and you can set it to visible.

When installing a module, all blocks are off by default to anonymous and on to registered users.

Cheers. :)

Zxaos

Super, thanks very much. I've got the login box showing up and kind of working (I feel like a true newb now).

Ok, next question.  The module works when I'm logging into users who have an account on Xoops alone, or their Xoops account matches their SMF account.

However, new users are having registration problems - the captcha isn't showing up when using the registration link at the bottom of the module (forum wrapped in xoops).  When a user registers on the forum proper, and then tries to log into xoops, I run into the same error that was discussed a few pages back:

8: Undefined index: dateRegistered
File: /home/coldsnap/public_html/kx/modules/smf/index.php
Line: 218

AFAIK, the xoops user has access to the smf database, and vice versa.

Any suggestions? Also, thanks for your help and patience so far!

RAdams

Quote from: Orstio on November 10, 2006, 05:31:34 PM
You have to make the SMF login block visible.

I made it visible; nothing appears. Here is what I see:


No login screen. I turned off the XOOPS login block as the guide said to do.

:\

Lance_

@RAdams

Please have a read on my last post of the previous page to set permissions correctly.

And , in your screenshot, you are logged in, you'll never see a login block when logged in.  :)

RAdams

Ok, I fixed the other problems I had (the login block not showing up), but it just isn't working for me at all. I have my SMF forums already installed in a subdirectory called "forums", and XOOPS is installed into the root of this domain. So in the SMF preferences in XOOPS, I used /forums as the path. The "Forum Administration" link does not work, and when I try to login using the SMF login block, I get an error saying I don't have permission to access this area. I can give any information/screenshots you want, I'm just not sure where the issue is... :\


Orstio

QuoteSo in the SMF preferences in XOOPS, I used /forums as the path.

/foprums would be a RELATIVE path.  You need to put in a full ABSOLUTE path to SMF.

Of you go to your SMF admin panel, Server Settings, you will find your absolute path in the field labelled "SMF Directory".

Zxaos

Still no love for the line 218 problem?


inukablaze

#457
Ok. I'm testing this again. Now I have the xoops and smf in the same database.

My problems:
-The smf login box is not logging them into xoops; just smf
-When someone goes directly to the smf forum link (/forum/index.php), and not through the smf module (/module/smf/) to register, they are not registered in xoops at all.

What do we do when users have the old link bookmarked, and they decide to register through http://www.yoursite.com/forum/index.php [nofollow]
instead of
http://www.yoursite.com/modules/smf [nofollow]

The only way the registrations carry over is only if they register through http://www.yoursite.com/modules/smf [nofollow]

I guess I'm looking for advice about how to forward guests to the SMF module instead.

Orstio

Quote-When someone goes directly to the smf forum link (/forum/index.php), and not through the smf module (/module/smf/) to register, they are not registered in xoops at all.

That is correct.  The bridge does not change anything in SMF.  The bridge is the module.  So if you don't access via the module, you are not using the bridge.

Quote-The smf login box is not logging them into xoops; just smf

I'm getting this problem myself, but only intermittently.  i haven't been able to identify what determines whether or not it works just yet.  What I may end up doing is setting the SMF cookie, and then passing everything over to Xoops.

inukablaze

Quote from: Orstio on December 03, 2006, 10:08:26 PM

That is correct.  The bridge does not change anything in SMF.  The bridge is the module.  So if you don't access via the module, you are not using the bridge.

So there's nothing we can do to automatically forward them to the correct place?
That can be confusing to people.

Advertisement: