Xoops Bridge Beta 2

Started by Orstio, May 27, 2007, 08:39:39 PM

Previous topic - Next topic

ananda

Quote from: Kindred on September 27, 2007, 12:37:39 PM
randomly changing lines of code that redirect things is not going to fix your problem and/or will cause other problems
thank you,, you are right ofcourse,,,
my knowledge is not php and moduls, bridges,,
I have deeply respect for people of orstio and others,
but understand, we are depending of him , you and others who have the knowledge,
I hope that you will find solutions
thank you
deepeest respect,
ananda

Nozema

When i make a block for the log out button I only see it as text, I've tried all the option, html gives text, php blank and auto format also text. I'm not that familiar with Xoops, just trying it out if it fits my needs ;)

Code:

require_once('/home/name/public_html/StandAloneForumDirectory/SSI.php');
global $context, $settings, $scripturl;

if ($context['user']['is_guest'])
{
   ssi_login();

}


else
{
   ssi_logout();
}

$_SESSION['logout_url'] = 'http://www.mywebsite.com' . $_SERVER['PHP_SELF'];

ananda

Quote from: Nozema on September 28, 2007, 04:44:04 AM
When i make a block for the log out button I only see it as text, I've tried all the option, html gives text, php blank and auto format also text. I'm not that familiar with Xoops, just trying it out if it fits my needs ;)

dear nozema
what I have done,, till sofar,
in xoops delet the sfm login block

in xoops smf template I have changed the smf block_login  line ...../modules/smf/index.php?action=login2 to
/modules/smf/index.php   
I have installed a nice theme ApolloBB and have maked some change.
eg delete the inlog link and some others...
So when a user is going to my xoops page,,
http://www.light4all.be/content/modules/smf/ [nofollow]  and nicely give in his id and paswd,,
he is in as member in smf and in xoops,
evenso when he logged out member is evenso logout in smf and,,,, XOOPS
good luck
ananda




Nozema

#143
Thanks, but that is not what I want, my current site has a login just like the smf login block and when you login you're also logged in SMF (it is a Mambo site, also with the bridge from Orstio). I want to keep that, it must be possible to create your one block with some PHP language? The blocks from modules are too.

Edit:

I got is working as following (don't ask me why it works then, but it works...)
I've made a new PHP block and put the code in it. When you press example (I think it says that, I'm using the dutch version) it goes blank. Save it. Then open it again and put <?php on the first line at the bottom you place ?> these are tags that Xoops place automatically but I think it isn't working very well.
Save again and open again, remove the tags from above and now it works, at least it did on my Xoops 2.0.17 site.
Hopefully this is usefull for someone or maybe someone could tell em what I do wrong?

Orstio

I'm assuming you are using the Xoops admin panel to attempt to create a block with this functionality?

I don't  think the Xoops block creation in the admin panel was ever intended for such an extended application.

Nozema

#145
Oh, ok! It works though. I get a login block when not logged in and a logout text when you're logged in. I doesn't work yet but I'll try to figure it out, cant't connect to database it says when trying to log in.

With your bridge Orstio I don't have any problems to log in... Strange...

Is it better though to have SMF and Xoops in one database? I now have two seperate databases, I'll merge them together and see if that works better

edit:
I've been trying some things for a while:
When I publish my "self made" logout/login button my forum doesn't work anymore, It says:
QuoteConnection Problems
Sorry, SMF was unable to connect to the database. This may be caused by the server being busy. Please try again later.
When I unpublish it, my forum works again, can't figure out why this happens, someone any ideas? I'm using the wrapped version.

Orstio

It's because you have SMF and Xoops installed in separate databases, and your block doesn't switch between them.

Nozema

I've already put the SMF dbase in my Xoops dbase, so that couldn't be the problem anymore. And I'm sure that it is one dbase because I've deleted the SMF. Already deleted temp internet files and cookies, also no effect.

Orstio

In your module, you will need to global all the variables used in SSI.php.

Nozema

I've put all the variables in my homemade block, no effect. The login does work, logout doesn't ->session check error, for some reason the text after sesc= is different and thats why I can't logout.

But when I click on the wrapped forum I get the message can't connect to dbase. When I unpublish my homemade block it works again.

Orstio

Oh, I see.  You are using ssi_login and ssi_logout functions.

Those functions won't exist on the forum page.  SSI and SMF can't exist on the same page, so you can't use pure SSI calls on a SMF page.

Nozema

I don't get that, sorry I'm not that familiar with Xoops and certainly not php, only trying things out!

When I call ssi_welcome() it works, it shows My name and my personal messages but I can't ga to the forum anymore, only when I unpublish my selfmade block. Is that because I call SSI?

Because I see how much PM I have, some things do work, I have the idea that there must be a way around this!

Thanks for your help btw Orstio, great work on this bridge! I'm using your other bridge on my Mambo site, works great!

Orstio

QuoteIs that because I call SSI?

Yes.

Nozema

#153
Orstio, got it working by putting the call for SSI in the header.php. And because of your bridge the "selfmade" login/logout works. When i click logout, your logged out of SMF and Xoops!

edit:

I made my block as following (I probalbly put too much in it but I really don't know much php, borrowed most of it from the mambo bridge)

Quoterequire_once('/home/XXXXXX/domains/XXXXXXX.nl/public_html/forum/SSI.php');
global $time_start, $maintenance, $msubject, $mmessage, $mbname, $language, $boardurl, $boarddir, $sourcedir, $webmaster_email, $cookiename, $db_server, $db_name, $db_user, $db_prefix, $db_persist, $db_error_send, $db_last_error, $db_connection, $modSettings, $context, $sc, $user_info, $topic, $board, $txt, $scripturl;

if ($context['user']['is_guest'])
{


}


else
{
echo '
   ', $txt[247], ' <b>', $context['user']['name'], '</b>,';
   echo "<br />\r\n";
   echo "<br />\r\n";
   echo
   ' ', $txt[152], ' <a href="', ($scripturl. '?action=pm'), '">', $context['user']['messages'], ' ', $context['user']['messages'] != 1 ? $txt[153] : $txt[471], '</a>';

echo '
   ', $txt['newmessages4'], ' ', $context['user']['unread_messages'], ' ', $context['user']['unread_messages'] == 1 ? $txt['newmessages0'] : $txt['newmessages1'] . '.';

   echo "<br />\r\n";
   echo "<br />\r\n";
   ssi_logout();
}

$_SESSION['logout_url'] = 'http://www.xxxxxxxxx.nl' . $_SERVER['PHP_SELF'];

It give you, when you login through your bridge Orstio, a welcome and tells you how much PM's you have and a logout button. Because I didn't put a option in this if you are a guest, the block is not vissible. When you login through your brigde it shows.

I also want to put the avatar on top, but that I can't seem to get to work, does anyone have an idea?

rassim

I try to to follow instructions from the 2nd page and in admin. set up for forum URL.... i put URL of xoops smf module, now i can not sign in as admin or any other user (member). Everytime I input my user name and passwored redirect me to this adress hxxp:www.bosnaportland.com/modules/smf/index.php?action=admin [nonactive]
Please can you help me, I don't know how to change this, how to go back.

Nozema

I had that problem also one time, I always make a backup before installing things, in this case it is enough to place your database backup back.

Orstio

Quote from: rassim on October 01, 2007, 09:59:33 AM
I try to to follow instructions from the 2nd page and in admin. set up for forum URL.... i put URL of xoops smf module, now i can not sign in as admin or any other user (member). Everytime I input my user name and passwored redirect me to this adress http://www.bosnaportland.com/modules/smf/index.php?action=admin
Please can you help me, I don't know how to change this, how to go back.

??? I don't see SMF or the bridge installed on your site.

sinoer

This Bridge just for smf 1.1.2 ?

Nic

Using Beta 2 Bridge and SMF 1.1.2.  Two separate databases but users have priveleges in both.  Bridge is definitely putting users from SMF over into Xoops, so that works.  However...

Using the SMF login through Xoops DOES log me into both, but the cookie lengths are not the same.  To test this, I set the cookie length with Xoops to 1 minute (so I didn't have to wait to long!) and, right enough, after the one minute I was logged out of Xoops.  However, I am still logged into the forum, and trying to then use the bridge login via Xoops won't work - it just keeps refreshing me to the index page, still logged out.  I have to physically log out of the forum before I can log back into Xoops again.

Even using the "Always stayed logged in" doesn't work with Xoops and I am still logged out after the specified time (in this case one minute), but left logged into the forum.

Also, logging in via the forum (under the bridge, NOT the standalone) doesn't log me into Xoops, although logging OUT of the forum logs me out of both (I have switched off the log out feature in Xoops).

I have looked through this thread and the one for Beta 1, trying every suggestion I have found, but none of it seems to solve this?

So, can I get it that if I want to be remembered, Xoops will actually do this (as well as the forum), or both cookies to set the same length of time?  And will I need to switch off the log in on the forum and just use the one through the Xoops bridge to be logged in to both?

ananda

Quote from: broham on June 27, 2007, 07:31:06 PM
/userinfo.php         -->  /modules/smf/index.php?action=profile
/user.php             -->  /modules/smf/index.php?action=register
/register.php         -->  /modules/smf/index.php?action=register
/viewpmsg.php         -->  /modules/smf/index.php?action=pm
/StandAloneDirectory  -->  /modules/smf
/StandAloneDirectory/ -->  /modules/smf
Might consider a redirection for /pmlite.php
please your help,
where in wich php to seth this lines,,
where can I find this
thanks
hari

Advertisement: