new "print this page" functionality
| From: | Gabor Hojtsy | Date: | Fri, 07 Jun 2002 13:41:07 +0000 |
| Subject: | new "print this page" functionality | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-10718@lists.php.net to get a copy of this message | ||
Hi!
I managed to implement one of my ideas regarding PHP.net.
There were so many problems with printeable files (extra
size to update the mirror, and to host it), so I decided
to implement this simple thing first to show how do I think
it would be easy to solve this problem.
http://www.php.net/manual/en/print/function.echo.php
The solution here is to introduce a new virtual "print"
directory under the manual directories (much like
how the html directories are phisically there now).
This can be handled with our error redirection tool,
pointing the request to
http://www.php.net/manual/en/function.echo.php
But two thing need to be preserved:
1) It's a page with "print design" on it.
2) If the user clicks on a link, it should bring
him to the next page in "printed design"
For the first thing, I have introduced the $PRINT_PAGE
variable. If it is set, the manual page shows up
in the "printed design". To retain the design the error
handling is not performed with a redirect, but with an
include, so relative links are still relative to the
virtual print directory.
Note that this is in a testing phase, but it would
definitely be available to replace the html directories,
speeding up mirror updates significantly.
Possible options:
1) show navigation
2) show user notes (printable form)
3) collect links and print them in a list at the bottom
The first two are relatively easy to implement. They
are not implemented, because this is not the choosen
method to provide printed pages right now, and so I
decided not to invest too much work into it ;)
The third can be achieved with an output buffer, and then
a preg collecting all links from the text and printing
it out as a list at the bottom... I would like to ask you
guys if you think, that this would bog down the servers
(too much memory usage because of output buffers), or if
it's ok, and so can be implemented.
These may all be added to the print dir, but as this method
is quite flexible, we can invent any new names for new methods,
like "/manual/en/printwn/function.echo.php" for
"print with notes", etc.
Goba