Questions/Comments on "A guide to the SMF integration hooks"

Started by Orstio, May 26, 2007, 05:19:48 PM

Previous topic - Next topic

kaisifus

With your last solution, it now outputs:

Unknown column 'testmotion' in 'where clause'

Which seems to solve the quotes problem, although now it does not recognise the user_name (definitely correct) where it needs to be changed? I tried removing the braces, which out puts the same, and got a couple of blanks when I experimented with other quotes.

Also, are you sure that $recipient is not an array? because $recipients seems to be a multidimensional array ([to][bcc]) and when I try to echo it it comes up with ArrayArray, but when I echo $recipient[0], it returns the ID. Also, when I removed the
  • , the script sends the message twice, but with no recipientID

Orstio

Alright, what if you try this?

$query = mysql_query("UPDATE member_profile SET `".$field_to_change."` = '".$data."'  WHERE user_name = '".$memberName."'") or die(mysql_error());

kaisifus

Think I may have already tried that combo...

returns:
for the right syntax to use near '0001-01-01'' WHERE user_name = 'testmotion''

same problem with the mis-matched quotation marks as before.

Bloody Hell...

kaisifus

Took a break to work on some other aspects of the site, created a redirect to search the two systems with one form and am creating the layout now. In terms of the integration, however, the integrate_change_member data is the only one that still does not work.

Its doing my head in, I think I have used every combination of quotes that I can think of, but still no joy...

The best solution seemed to be:

$query = mysql_query("UPDATE member_profile SET `".$field_to_change."` = {$data}  WHERE user_name = {$memberName}") or die(mysql_error());

However, this would then not recognise the $memberName variable and returned:

Unknown column 'testmotion($memberName)' in 'where clause'

Where 'testmotion' is very much present in the db system....


kaisifus

I think the problem is with something aside from the query, since at the moment, my integrate_reset_pass function is doing something similar, and it was working fine eariler. It seems to be displaying the same sort of error message, even though it is updating the CMS side (i assume it fails before it updates the SMF password) Plus when I have copied and pasted the query into phpMyAdmin it works fine???

Orstio

Have you tried this instead?

$query = "UPDATE member_profile SET `".$field_to_change."` = {$data}  WHERE user_name = {$memberName}";

echo $query;
exit();


What you need to understand about the error is that it is looking for a table column named "testmotion", not a data entry in the user_name column with a value of "testmotion".

devnul

yes, I've read the f. manual http://www.simplemachines.org/community/index.php?topic=173483.0 and http://www.simplemachines.org/community/index.php?topic=371860.0  :)

Please excuse me for that question, I didn't really understood the workflow of integration by hooks.
Assuming that my existing cms is in  /www/ and SMF installed in  /www/smforum/ on the same machine.
The goal is it no registered user could make an valid login directly to SMF but after login in the existing CMS he/she could seamlessly use the SMF. Theres no need to run it in a frameset, it will open a new browserpage with the default SMF Layout.
So here's what I suggest after reading the whole discussion:
If I want to integrate the SMForum without a second login, I have to provide a link that points to "smforum/index.php", which is calling the several functional-php files in /smforum/sources/.
Now some using of the hooks is possible.
I want a login, so I need the login hooks to tell SMF's Auth-System the necessary values.

- The confusing part is : ------------------------------------
Where I have to place the file with the defined integrate_functions or where I have to reference it?
And which filename it must have? Can I use any_desired.php?
-----------------------------------------------------------------

After providing SMF with all needed login values, it will look if the user is valid and on success it displays a fresh browserwindow with the default forum discussion.

So far.
Could anyone of you wise guys help me please with this very basic skilled problem?

Thank you in advance and thank you for the whole work you've done to build this fine software.
Greets from Germany

(and please excuse my horrible english...)

EDIT: I'm using SMF 1.1.11 and a System similar to but not a known CMS
I believe in the statement, that there's no need to touch any of the SMF Code and there's only one Layer I have  to write and put it between SMF and the single Link in my System, that points to SMF.
Sorry for the missing informations.

devnul

it seems, the topic

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

will solve the problem.
I have to try it ...
Maybe this will help some other to find the solution much easier than me (4 Days searching and reading a foreign language)
Thank you very much Simon_K for picking out one solution from the thousands of possibilities to realize such a bridge and to publish it.

with best regards

nose

Hello,
as I have to integrate mrbs (http://mrbs.sourceforge.net/ [nofollow]) within smf2 I need some help. The goal is a kind of simple integration. That is to give the auth stuff to smf and let mrbs read out
1.) if a user is logged in to smf
2.) what (prime) id_group he has

The memberstructure of mrbs is quite simple: level 0 = readers, 1 = bookers, 2 = admin.
So I greenly think the (mrbs) script has to extract the user and the group compare the rights (ie. groupid9 = 0, ...).

Can this be donne? Any help appreciated.

Advertisement: