System for embedding Phorum in other applications (early preview)

Posted by Maurice Makaay 
Re: System for embedding Phorum in other applications (early preview)
February 05, 2006 10:16PM
What I meant was to disable the mod and then try to access the normal Phorum page (so not through an embedding script that is using the phorum_block.php or the more recent run_phorum.php script). So if you go to the admin.php at [your.site.com], then disabled embed_phorum and go to [your.site.com]


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: System for embedding Phorum in other applications (early preview)
February 05, 2006 10:18PM
Quote
mmakaay
@wendy: That folder is correct, so Phorum should be able to find the templates. If you have the embed_phorum module disabled in the control panel, can you then set that template for a forum and see if the template is applied when you visit that forum?

@all interested in (Mambo) integration:

I hacked up a quick first component (My First Mambo Component ;-) to check if I could embed Phorum with the code that I have created so far. A first, very rought implementation is now running at [mambo.gitaar.net]

What will be changed to the current connector code, based on my first experiences with Mambo, is that the PhorumConnector object will be created very early on in the run_phorum.php script. That way, I can also let the connector determine the behaviour for the rewriting and parsing of URL's. I quite soon found out that the rewrite options that are in run_phorum.php are not sufficient for Mambo (because Mambo puts a lot of info in the URL too).

So far so good. I hope to have a first release on a mambo connector by tomorrow.

That's good news! I click on the link and got this

Duplicate entry '' for key 2: insert into phorum_users set user_id=0, username='', email='dummy@address.com', password='d41d8cd98f00b204e9800998ecf8427e', active=1, password_temp='d41d8cd98f00b204e9800998ecf8427e', date_added=1139199356, date_last_active=1139199356

[opensourceCMS.com]
[ongetc.com]
Chanh Ong
Re: System for embedding Phorum in other applications (early preview)
February 05, 2006 10:21PM
Quote
mmakaay
That execution time problem has nothing to do with the embedding software IMO. If you could track (down by putting some print statements in the templates.php or so) what your templates.php script is doing when you get that error, it would be most helpful. I have never been able to reproduce that error, but I have seen more reports about it. My best guess is that the software is getting into a loop somewhere.

Could you also give me information about your system? Like OS, Server type + version, PHP version.

I use WXP sp2, with WAMP5

PHP Version 5.1.1

I will be happy to debug the template but I am not sure which file in the template folder to do the print state. Would you give me some hint?

Thanks

[opensourceCMS.com]
[ongetc.com]
Chanh Ong



Edited 1 time(s). Last edit at 02/06/2006 08:47AM by chanh.
Re: System for embedding Phorum in other applications (early preview)
February 05, 2006 10:29PM
There's no need to put print statements in the template folder. You'll have to debug include/templates.php, because that's the script that is taking up lots of time somehow.

The duplicate key is because I didn't yet have time enough to understand Mambo ;) I just created a quick hack to test syncing of users from Mambo to Phorum. Now users that are not logged in are synchronized too, using user_id 0. Apparently Mambo set the user's id to 0 if no user is available. I'll figure that out tomorrow. If you register for an account, then using that account you can login into the forums. But it's shaky at least, because it's a very crude connector for now. It'll become better, I promise! :)


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: System for embedding Phorum in other applications (early preview)
February 05, 2006 10:38PM
Sound good! If you need any information about Mambo please let me know and I will try to help out.

I put in some print in template.php and here is what I got:

Welcome to main page of embeded phorum
debug fp:Resource id #19
debug content: $mymtime ); if ($need_update) { @unlink("C:\\Windows\\Temp/tpl-embed_phorum-settings-toplevel-ac7990fc8051be1d7b43a936607e052a.php"); $tplfile = phorum_get_template("settings"); include($tplfile); return; } else { include("C:\\Windows\\Temp/tpl-embed_phorum-settings-toplevel_stage2-ac7990fc8051be1d7b43a936607e052a.php"); } ?>
debug fp:Resource id #21
debug content: '; ?>
debug fp:Resource id #26
debug content: $mymtime ); if ($need_update) { @unlink("C:\\Windows\\Temp/tpl-embed_phorum-settings-toplevel-ac7990fc8051be1d7b43a936607e052a.php"); $tplfile = phorum_get_template("settings"); include($tplfile); return; } else { include("C:\\Windows\\Temp/tpl-embed_phorum-settings-toplevel_stage2-ac7990fc8051be1d7b43a936607e052a.php"); } ?>

debug fp:Resource id #3598
debug content: '; ?>
debug fp:Resource id #3603
debug content: $mymtime ); if ($need_update) { @unlink("C:\\Windows\\Temp/tpl-embed_phorum-settings-toplevel-ac7990fc8051be1d7b43a936607e052a.php"); $tplfile = phorum_get_template("settings"); include($tplfile); return; } else { include("C:\\Windows\\Temp/tpl-embed_phorum-settings-toplevel_stage2-ac7990fc8051be1d7b43a936607e052a.php"); } ?>
debug fp:Resource id #3605
debug content: '; ?>
debug fp:Resource id #3610
debug content: $mymtime ); if ($need_update) { @unlink("C:\\Windows\\Temp/tpl-embed_phorum-settings-toplevel-ac7990fc8051be1d7b43a936607e052a.php"); $tplfile = phorum_get_template("settings"); include($tplfile); return; } else { include("C:\\Windows\\Temp/tpl-embed_phorum-settings-toplevel_stage2-ac7990fc8051be1d7b43a936607e052a.php"); } ?>
debug fp:Resource id #3612
debug content: '; ?>

Fatal error: Maximum execution time of 30 seconds exceeded in f:\wamp\www\phorum\include\templates.php on line 342

Is that what you need?

PS: it does not let me put in the whole debug code so I cut down most of the code.

[opensourceCMS.com]
[ongetc.com]
Chanh Ong
Re: System for embedding Phorum in other applications (early preview)
February 05, 2006 10:43PM
Quote
mmakaay
There's no need to put print statements in the template folder. You'll have to debug include/templates.php, because that's the script that is taking up lots of time somehow.

The duplicate key is because I didn't yet have time enough to understand Mambo ;) I just created a quick hack to test syncing of users from Mambo to Phorum. Now users that are not logged in are synchronized too, using user_id 0. Apparently Mambo set the user's id to 0 if no user is available. I'll figure that out tomorrow. If you register for an account, then using that account you can login into the forums. But it's shaky at least, because it's a very crude connector for now. It'll become better, I promise! :)

I created an account and try to access the phorum and got this:

[mambo.gitaar.net] (look like there is an extra mambo in there)

and this:

syncuser error: usernames cannot be changed, but for user_id 65 the username was changed from to chanh

[opensourceCMS.com]
[ongetc.com]
Chanh Ong
Re: System for embedding Phorum in other applications (early preview)
February 06, 2006 02:23AM
Same problem there. I'll try to fix those today. And the right Itemid for Phorum in that testsite is 39. Not all links in the menu will work. The link "Forums" on top of the page is okay though. It all comes down to me and Mambo only having met each other a day ago. We still need to get used to each other ;-)

Thanks for the debugging output. I'll see if I can get anything out of that. It look like the settings.tpl is being unlinked there over and over again, so it could be an issue with file mtime not working correctly on Windows. Is it true that if I see @unlink in your output, that indeed that code was executed?


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: System for embedding Phorum in other applications (early preview)
February 06, 2006 08:46AM
Yes, I was wondering why it was doing unlink in Window box.

[opensourceCMS.com]
[ongetc.com]
Chanh Ong
Re: System for embedding Phorum in other applications (early preview)
February 06, 2006 09:09AM
heh, that unlink itself is fine. its the php-function for deleting files on any OS.


Thomas Seifert
Re: System for embedding Phorum in other applications (early preview)
February 06, 2006 10:46AM
Well, then why is it keep on going until it runs out of resources?

[opensourceCMS.com]
[ongetc.com]
Chanh Ong
Your IP address, domain or ISP has been blocked. Please contact the forum administrators.
Sorry, only registered users may post in this forum.

Click here to login