Firefox PHP

System for embedding Phorum in other applications (early preview)

Posted by Maurice Makaay 
Re: System for embedding Phorum in other applications (early preview)
February 24, 2006 12:20PM
>The database layer does not have (and should not have) hooks for intercepting things like retrieving the list of buddies,

no.. i wasn't imagining the database layer.
why would i do that? that would be silly. i want to create a module that doesn't involve hacking the other files anymore.

i was imaging whatever point in the application code that comes immediately before whatever calls the "get buddy list."

what i mean by core core code was.. Currently the core code says "load buddy list" in order to get the buddy list right?
What it really should be told is "load buddy list if it is not already loaded" this is a pretty standard approach i think that would allow as much flexibility of where the buddylist comes from as were the user data comes from. Buddylist is really just another attribute of the user like the signature.

That would leave me free to load it up in your module before it is loading in the applicatin and not worry about it being overwritten by the embedded phorum.

I would leave all "add buddy" and "remove buddy" up to my sistem and remove any links to do that from the phorum templates.

Maybe it doesn't need an adjustment to the core code. I haven't looked too closely into it yet.

Would it currently be possible to load the buddy list in the module and not have it overwritten by the phorum application?



Edited 3 time(s). Last edit at 02/24/2006 12:28PM by rheo.
Re: System for embedding Phorum in other applications (early preview)
February 24, 2006 04:06PM
There's not really a place in the core where you can override the place where the buddies come frome. They come from the database layer through the API functions in there (phorum_db_pm_*). The place to override that particular function would be the database layer, even though you don't seem to agree on that :-)

What the embed_phorum module currently does is only preventing certain user data fields from being edited by Phorum. Separate from that, a mechanism to feed Phorum with the user data must be implemented. The module does not override phorum_user_get() or anything. The synchronizing of user data makes sure that when Phorum calls that function, the user data is available within the Phorum tables. This is an important difference with the system that you seem to have in mind.

Like I said earlier, groups and buddies might be added for easy synchronization in later releases. Up to then you can also settle for writing the correct code for feeding that data to the Phorum tables from your master application and simply remove the functionality from the templates.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: System for embedding Phorum in other applications (early preview)
February 24, 2006 06:26PM
something must call phorum_db_pm_* though right?
and then handle the results of that call?

all i am saying is make the core not call those functions if the data structure is already loaded by a module like yours.

as you say your module prevents certain user data fields from being editing by Phorum why can't it also keep the user buddylist from being editted in the same way?
Re: System for embedding Phorum in other applications (early preview)
February 24, 2006 07:23PM
"make the core" = changing Phorum code and not creating a mod
"my project" = create a mod that makes Phorum run embedded smoothly
"module prevents certain data changes" != module inferes with data loading
"You really are on the wrong track here" = true
"You do not seem to understand the philosophy of the project I'm working on" = true
"Keeping pushing solutions that don't fit the project will make me start coding" = false

I'd appreciate it if you would first try to fully grasp the ideas and code of this project, before spawning and pushing features and ideas that would suit your needs. There's also no need to provide me with pseudo code, because I really think that I have a good understanding about the internals of both Phorum and my module.

The wish for buddy synchronization is noted. Maybe it will be implemented in the future by me or another developer who needs that kind of functionality.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: System for embedding Phorum in other applications (early preview)
February 24, 2006 07:33PM
right. ok.

look i can see your module would be very good for alot of needs.

i don't mind adding this functionality to your module to suit my needs if i have to but actually my own solution has been working so far for over a year and seems to work ok..

i like where you are heading with this idea but feel it falls a little short in this one area. that's all.

but lots of CMS also already have their own buddy system. I know Joomla does for instance. It would be easier for those systems to use this module in order to integrate phorum if it had this functionality. If you already had a buddylist in your own system before Phorum decided to make it a feature I'm sure you would also be pointing this out as a good idea.

I was just hoping you might see that a buddylist is just as much an attribute of the user who's information you are carrying from the master system as his Name and signature.

anyway, i realize probably nobody else already has their own buddylists outside of the phorum system.

Is it really too much to ask though that the core code might accommodate skipping loading the buddylist if it is already loaded?

seems like a small thing to ask.

To be clear I am not asking for buddy synchronization as that would imply actually keeping buddies in both system.

What I am aking for is a "buddy override" the same way your module provides a "signature override" among the other things .. it doesn't actually update the forum user tables with the user's signature from the CMS does it?



Edited 1 time(s). Last edit at 02/24/2006 07:36PM by rheo.
Re: System for embedding Phorum in other applications (early preview)
February 24, 2006 07:43PM
> Is it really too much to ask though the the core code might
> accommodate skipping loading the buddylist if it is already loaded?

Yes. That's not a good way of handling things. You'd need that kind of functionality in lots of places in the end, to provide ways to get your data from other sources than Phorum's tables. But if you need that, you should change the database layer implmentation. Simply because you want data to come from a different source. Really, trust me on this one... it's a completely different project you're talking about here.

> it doesn't actually update the forum user tables with the user's
> signature from the CMS does it?

Like I said... You don't get the idea of my system at all. This proves it, beyond all doubt :) All user data is stored in both Phorum and the master application. The module only takes care of not letting Phorum modify fields that are in control of the master application. Using the connector class, you specify exactly which fields are controlled by Phorum and which by the master application.

There's no need to explain why buddy synchronization would be a cool thing to have, so stop convincing me. Stop explaining me how to implement. No need to. It's already noted. Halt. Please!


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: System for embedding Phorum in other applications (early preview)
February 24, 2006 07:52PM
you mean if a user changed his signature in the CMS then the signatue also changes in the phorum tables. you are right.. i misunderstood. i wonder why do that?

Quote

But if you need that, you should change the database layer implmentation. Simply because you want data to come from a different source. Really, trust me on this one...

why wouldn't i instead call a module in a hook that came before the database layer buddy call so that the user's buddy list is loaded from the module instead of from the database layer?

seems it would easier to upgrade phorum this way without having to worry about trying to carry hacks over version to version.

in my system that i wrote last year.. (which was the first thread added to this forum when i requested it to be made)

I simply override the user object with all my own login system which loads up the user data in common. i found to do this effectively tho i had to create my own hook where i needed it.

Do you know what the main difference is between yours and mine?

you can see mine in action with 5.1 here.. [dev.tribalharmonix.org]



Edited 4 time(s). Last edit at 02/24/2006 08:04PM by rheo.
Re: System for embedding Phorum in other applications (early preview)
February 24, 2006 08:03PM
> i wonder why do that?

Because after lots of experimenting that turned out to be the very best way of handling integration. I wonder why no to do that. I don't see the drawbacks that you obviously see. There's no need to discuss that any further. If you want to elaborate, please create a new thread in the integration forum.

> Do you know what the main difference is between yours and mine?

Yes. My system will automatically let all Phorum features like settings, buddies, posting, personal files, etc. etc. work. When overriding the user, Phorum misses some data for certain actions where it expects a user in the phorum tables. I started out writing an override system too at first, but that way there were corners of the Phorum software that I could not get to work. For simply posting forum messages it's okay though, because the author info is stored in the message too and no user has to be retrieved for reading postings.

Simply put: I think that my system is better when you want all Phorum features to work.

Now would be a good time for you to download the module and actually read the code, so you can see what the module actually does.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: System for embedding Phorum in other applications (early preview)
February 24, 2006 08:11PM
in my system the user data is also stored in both systems.

i'm sorry if i didn't explain that clearly. I store the login name and the email there. that seemed to be all that was really needed.

Quote

My system will automatically let all Phorum features like settings, buddies, posting, personal files, etc. etc. work.

with my system phorum buddies obviously still work. so do personaly files, posting, etc but it just doesn't makes sense for implementation to have 2 buddy lists. one should obviously be the master.

i will read your code now.. i wonder, have you read mine?
Re: System for embedding Phorum in other applications (early preview)
February 24, 2006 08:19PM
> i wonder, have you read mine?

Yes.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Sorry, only registered users may post in this forum.

Click here to login