Embedding phorum in a web site
Posted by icaki
|
Re: Embedding phorum in a web site March 27, 2005 04:42PM |
Admin Registered: 24 years ago Posts: 9,240 |
ob_start / ob_get_contents could help you here (check the php-manual for these).
But ... you need to start output buffering already in the pages where you want to include phorum as there shouldn't be any direct output before phorum itself (output-buffering solves this) as phorum needs to do some redirecting with header-redirects and stuff.
so I guess the output buffering for getting phorum-content and the output buffering in the page itself will collide.
btw. phplib was written for php3 and as far as I know there hasn't been any development in it for years.
hence I guess its outdated like hell ... you should better go with a recent templating-system.
Thomas Seifert
But ... you need to start output buffering already in the pages where you want to include phorum as there shouldn't be any direct output before phorum itself (output-buffering solves this) as phorum needs to do some redirecting with header-redirects and stuff.
so I guess the output buffering for getting phorum-content and the output buffering in the page itself will collide.
btw. phplib was written for php3 and as far as I know there hasn't been any development in it for years.
hence I guess its outdated like hell ... you should better go with a recent templating-system.
Thomas Seifert
|
Re: Embedding phorum in a web site March 28, 2005 01:52AM |
Registered: 21 years ago Posts: 15 |
Offtopic: No, no. PhpLib is quite a good choice for lightweight applications. Its a thousand liner OOP class and that is all. And it is not php3 dependant but sadly also not php5 optimized. On the other side Smarty with all its fancy features, most of them, IMHO, completely useless. Smarty looks like a cannon for shooting birds in my app. :)
I was digging the buffering stuff yesterday but I don't think buffering my app and then including yours is a good idea. It should be more or less the opposite. Your app should be exportable to a string so that it could be utilized by simply editing its headers and footers.
I was digging the buffering stuff yesterday but I don't think buffering my app and then including yours is a good idea. It should be more or less the opposite. Your app should be exportable to a string so that it could be utilized by simply editing its headers and footers.
|
Re: Embedding phorum in a web site March 28, 2005 12:50PM |
Registered: 21 years ago Posts: 15 |
Ok, some hints for the people who will ask the same questions again.
Peculiarities of embedding Phorum in a site:
- if your site is using some other language than English - there are places in the code which do a htmlentities on some texts. This results into an unreadable site TITLE for example. A compromise is to exchange the call to htmlentities with htmlspecialchars. This will of course corrupt HTML tags but the places where the function is called are not stuffed with HTML. A good starting point is $PHORUM["DATA"]["HTML_TITLE"] in list.php, read.php, common.php etc.
- the images are no longer reachable due to inconsistency with their path. The only solution is to edit it manually everywhere.
- includes/admin or controlcenter (sorry don't remember) also contain php files with hardcoded image paths. Quite strange as the accustomed practice is to keep them in the templates.
- perhaps more to come.
- and yes search is your friend!
Peculiarities of embedding Phorum in a site:
- if your site is using some other language than English - there are places in the code which do a htmlentities on some texts. This results into an unreadable site TITLE for example. A compromise is to exchange the call to htmlentities with htmlspecialchars. This will of course corrupt HTML tags but the places where the function is called are not stuffed with HTML. A good starting point is $PHORUM["DATA"]["HTML_TITLE"] in list.php, read.php, common.php etc.
- the images are no longer reachable due to inconsistency with their path. The only solution is to edit it manually everywhere.
- includes/admin or controlcenter (sorry don't remember) also contain php files with hardcoded image paths. Quite strange as the accustomed practice is to keep them in the templates.
- perhaps more to come.
- and yes search is your friend!
|
Re: Embedding phorum in a web site March 28, 2005 12:54PM |
Admin Registered: 24 years ago Posts: 9,240 |
|
Re: Embedding phorum in a web site March 28, 2005 01:53PM |
Registered: 25 years ago Posts: 1,076 |
icaki Wrote:
-------------------------------------------------------
> the other side Smarty with all its fancy features,
> most of them, IMHO, completely useless. Smarty
You don't have to use all of the features, the class have been broken/rearranged into pieces so the huge class is even quite fast. It's even faster to load if you remove all the comments...
So if you need a feature that your template class doesn't have then you either need another class or need another way to achieve your goal. With smarty (or many other current, modern template engines) you can do almost whatever you want (embed php...) in your template.
> looks like a cannon for shooting birds in my app.
> :)
Well I don't use much of the features myself, but you anologue is not perfect, it shoots the little birds as accurately as a smaller gun.
---
-=[ Panu ]=-
-------------------------------------------------------
> the other side Smarty with all its fancy features,
> most of them, IMHO, completely useless. Smarty
You don't have to use all of the features, the class have been broken/rearranged into pieces so the huge class is even quite fast. It's even faster to load if you remove all the comments...
So if you need a feature that your template class doesn't have then you either need another class or need another way to achieve your goal. With smarty (or many other current, modern template engines) you can do almost whatever you want (embed php...) in your template.
> looks like a cannon for shooting birds in my app.
> :)
Well I don't use much of the features myself, but you anologue is not perfect, it shoots the little birds as accurately as a smaller gun.
---
-=[ Panu ]=-
|
template-engines March 28, 2005 02:24PM |
Registered: 22 years ago Posts: 683 |
|
Re: Embedding phorum in a web site March 28, 2005 03:10PM |
Registered: 21 years ago Posts: 15 |
Offtopic: If I am going to use a "modern" template engine I will simply pick up Smarty. It has become something like an unofficial industry standard.
@Panu: PHPLib has survived so many years that I will not question it. Smarty is usually the template engine of choice and I don't have anything against that. And honestly I don't think it would be a big problem to embed the forum through its template engine w/o throwing my site structure an template lib. But I have limited time to accomplish my task and can't afford a lot of effort on doing this.
So to have some tribute to the overall effort, just finished the translation of a Bulgaian language pack. I will attach it in the appropriate forum.
@Panu: PHPLib has survived so many years that I will not question it. Smarty is usually the template engine of choice and I don't have anything against that. And honestly I don't think it would be a big problem to embed the forum through its template engine w/o throwing my site structure an template lib. But I have limited time to accomplish my task and can't afford a lot of effort on doing this.
So to have some tribute to the overall effort, just finished the translation of a Bulgaian language pack. I will attach it in the appropriate forum.
|
Re: Embedding phorum in a web site March 28, 2005 03:29PM |
Registered: 25 years ago Posts: 1,076 |
|
Re: Embedding phorum in a web site March 30, 2005 08:58AM |
Registered: 21 years ago Posts: 15 |
Do you know why I get these errors?
PHP Warning: Cannot modify header information - headers already sent by (output started at VIRT_SRV/forum/include/lang/bulgarian.php:1) in VIRT_SRV/forum/login.php on line 132
[30-Mar-2005 16:47:35] PHP Warning: Cannot modify header information - headers already sent by (output started at VIRT_SRV/forum/include/lang/bulgarian.php:1) in VIRT_SRV/forum/common.php on line 626
My site is under VIRT_ROOT/site and uses the portable code.
PHP Warning: Cannot modify header information - headers already sent by (output started at VIRT_SRV/forum/include/lang/bulgarian.php:1) in VIRT_SRV/forum/login.php on line 132
[30-Mar-2005 16:47:35] PHP Warning: Cannot modify header information - headers already sent by (output started at VIRT_SRV/forum/include/lang/bulgarian.php:1) in VIRT_SRV/forum/common.php on line 626
My site is under VIRT_ROOT/site and uses the portable code.
|
Re: Embedding phorum in a web site March 30, 2005 09:01AM |
Admin Registered: 25 years ago Posts: 4,506 |
PHP Warning: Cannot modify header information - headers already sent by (output started at VIRT_SRV/forum/include/lang/bulgarian.php:1) in VIRT_SRV/forum/login.php on line 132
That says it all. Something is wrong with the first line of that file. It should be just a <?php and nothing else.
Brian - Personal Blog
Sorry, only registered users may post in this forum.

