Firefox PHP

Few questions about Phorum

Posted by srikondoji 
Few questions about Phorum
November 25, 2007 02:25PM
Hi,
I am planning to use forums for one of my application. However, i need limited feature set of forum and want to use that from within our application.

1) Do you have an API, which we can use to automatically make a call to create Forum, threads/topics? We even want to use API to create Posts and add replies to it.

2) Our application has users who have account with us and many more who will be one time visitors only. So there should a feature/hack to allow to add replies to forum threads without logging in. Something like Guest visitors, but we need a way to add alias/email_ids for such users along with their replies.

3) Also, we need to retain Registration/Login feature within our application and not use the Phorum's registration/Login.

4) Do you have a java script feature, where such forums/threads to be displayed from within the profile page of the users who are our website users?

Thanks
Sri
Re: Few questions about Phorum
November 25, 2007 05:49PM
Quote

1) Do you have an API, which we can use to automatically make a call to create Forum, threads/topics? We even want to use API to create Posts and add replies to it.

5.1 does not have APIs. For 5.2, we started to transform the core functionalities into a well defined API. But we do not yet have API code for forums/threads/topics. If you want to know what part of Phorum has been API-fied to far, check out the new API documentation.

Quote

2) Our application has users who have account with us and many more who will be one time visitors only. So there should a feature/hack to allow to add replies to forum threads without logging in. Something like Guest visitors, but we need a way to add alias/email_ids for such users along with their replies.

Anonymous access is a standard feature of Phorum. Nothing special needed for that. Anonymous users can choose whether or not they add their email address to the posts.

Quote

3) Also, we need to retain Registration/Login feature within our application and not use the Phorum's registration/Login.

The new User API in Phorum 5.2 has all the hooks that you need for that. You could also make use of my Phorum embedding module (not yet released for 5.2) which makes Phorum a full slave of a master application. So this is certainly possible.

Quote

4) Do you have a java script feature, where such forums/threads to be displayed from within the profile page of the users who are our website users?

You mean some Ajax request to retrieve threads that are started by a certain user or so? There is no such thing currently. I am using Ajax technology for my own website to retrieve things like recent messages and threads and present them dynamically on my front page, but the module for that is really preliminary. The target for me is to first put all core functionality is the API layer and then stack a clean Ajax layer on top of that. From that point on, you can talk to Phorum using Ajax technology and cook up anything that is possible withing the core API.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Few questions about Phorum
November 26, 2007 01:18AM
mmakaay,
Thanks for your response. This is certainly encouraging. I have been trying to find an API for forum and many more requests specific to our application.

1) When do you think your team can complete the API for phorum?
2) Yes, we need to store the forum, Thread ids started by each user each user in our database. Using that info, we need to be able to retrieve those posts and display them on our website under the profile of that user. I believe, we may try to do this on our own, but if you or your API can provide this feature that would be great.
3) Anonymous users: Can we store additional fields for such anonymous users like Name, alias, email ids etc.
4) Is there a feature to hide/blur email_ids of logged in and anonymous users? We certainly love to do this using API.
I will go through the API doc and get some information.
5) API support for Poll creation, voting and extracting results will be great. Don't know, if I am asking too much.

Thanks again
--Sri



Edited 1 time(s). Last edit at 11/26/2007 01:51AM by srikondoji.
Re: Few questions about Phorum
November 26, 2007 03:38AM
Quote
srikondoji
1) When do you think your team can complete the API for phorum?

It's an ongoing project. For 5.2, some parts were done and I am now working in the trunk ("5.3") on extra API's. We might backport the API's to the 5.2 tree, but the first goal that we have in mind to push forward on development in 5.3, focusing on the API's, making this "the API release". A time frame is always hard to give, since this is a spare time project and at least my amount of spare time fluctuates a lot.

Quote

2) Yes, we need to store the forum, Thread ids started by each user each user in our database. Using that info, we need to be able to retrieve those posts and display them on our website under the profile of that user. I believe, we may try to do this on our own, but if you or your API can provide this feature that would be great.

Currently, we have a feature in the db layer for search posts by a certain user. It should be easy enough to extend that to only include threads by a certain user and it's a feature that I have been thinking about lately too. So changes are high that this feature will hit Phorum one of these days.

Quote

3) Anonymous users: Can we store additional fields for such anonymous users like Name, alias, email ids etc.

Anything is possible. It is not a core feature. You could however add these fields to the posting editor form and write a module that checks the data and stores it in the message's meta data or some dedicated table/fields for this info. So while this is not a default feature, Phorum's flexability is high enough to accommodate for an implementation that handles this in a clean way.

Quote

4) Is there a feature to hide/blur email_ids of logged in and anonymous users? We certainly love to do this using API.
I will go through the API doc and get some information.

I don't know what email_ids are exactly and what blurring would do with them. Sorry =)

Quote

5) API support for Poll creation, voting and extracting results will be great. Don't know, if I am asking too much.

Poll creation is not something that would make it to the API, since polls is typically a feature that should be implemented as a module. The target for the Phorum core is to have a clean and fast forum engine. It is perfectly possible to have polls though. I already wrote a module for adding posts to messages. The poll module has no API, but once we have a message posting API, it should be easy enough to setup some poll data in a PHP array, put that in a new message's meta data and then post that message through the API.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce



Edited 1 time(s). Last edit at 11/26/2007 11:00AM by mmakaay.
Re: Few questions about Phorum
November 26, 2007 04:32AM
Maurice sells the current code short. Forums can be created with an array and one function call. I am not sure what the proper definition of an API is, but IMO, that is pretty easy. Messages take a little more care, but are still able to be added with a few function calls. Now, docs are a bit slimmer, but you don't have to wait for all these new fancy wrappers to simple Phorum function calls.

Brian - Cowboy Ninja Coder - Personal Blog - Twitter
Re: Few questions about Phorum
November 26, 2007 04:58AM
Brian is right. You can already do a lot of things done by calling the direct db functions to get your stuff in the database.

A proper definition of an API isn't easy. It's whatever you label as an API. One could argue that the db calls are a database storage API. However, it's only partly usable for what I want to have in an API:

* Documentation
* Did I already mention.. ah yes, I did
* Having logical reusable chunks of code not in the front end scripts but in API calls

For example, take the functionality of moving forums / folders up and down in the admin main page (recently converted to a call in the forums API). The database layer code allows for saving the settings for a forum, including the display order setting. So by using the db layer call alone, one can program some code to move a forum do a different screen position. The admin code contained this kind of logic. For this functionlity however, there is now a single call in the API, which can be used to move forums around in the list in various ways. The admin interface now uses this new code, but any other code (drag and drop Ajax based display order reorganisation, you name it) can use the same call as well, without having to directly use the db backend and without having to copy all the logic for rebuilding the display ordering for the involved forums.

Anyway, for handling things that are not available in the API code, you can revert to reading the Phorum scripts that handle the kind of task that you want to perform and copy the useful bits of code to get your thing done.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Few questions about Phorum
November 26, 2007 01:56PM
Thanks Brian and Mmakaay.
Using DB layer make sense instead of waiting for API functionality.


Mmakaay: I sent you a PM.
Thanks
Sri
Re: Few questions about Phorum
August 18, 2008 11:15AM
Has anyone managed to create a new topic via a script? I want the end-user to fill out one web-form and then then new topic is created.

Can anyone tell me how to do this?

Many thanks,
Ben
Re: Few questions about Phorum
August 18, 2008 11:53AM
you should check how its done in posting.php ... you could run similar functions do post a new topic.


Thomas Seifert
Phorum Development Team / Mysnip-Solutions.de
Custom Phorum and general software development
worry-free Phorum Hosting
Re: Few questions about Phorum
August 18, 2008 06:45PM
Quote
bensayers
Has anyone managed to create a new topic via a script?

Yeah, we did and we call that script Phorum ;-)

Like Thomas said, in posting.php and the various includes from include/posting/*

The file include/posting/action_post.php is probably the most interesting one. The rest of the related scripts is mainly for implementing the work flow.

You could also take a peek at include/admin/install.php. In that script, we post a test message to the test forum. That might give you some hints as well.


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

Click here to login