Re: new "print this page" functionality

From: Date: Fri, 07 Jun 2002 15:38:50 +0000
Subject: Re: new "print this page" functionality
References: 1  Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-10722@lists.php.net to get a copy of this message
> Why not process the non-print version (which is processed anyway), and > leave the printable version in HTML, as it is now, so it doesn't need to > be PHP processed - this provides for less load on servers. It could be > achieved with something like: > > <!--<? man_top(...); if ($print) { ?>--> > print-only stuff > <!--<? } ?>--> > stuff common to both > <!--<? if (!$hidenotes) { ?>--> > notes > <!--<? } manualFooter(...); ?>--> This is quite similar in fashion to the current style. Between the top and bottom functions, the content is _exactly_ the same in PHP files, as in the files in the html subdir. > Notably, as the things are right now, this would require a lot of PHP in > the "HTML" version, but it can be helped by removing the function lists > from function pages and leaving only the bare minimum needed to function > (e.g., for strstr): > > <!--<?man_top('strings', 'strspn', 'strtok', > array('ref.strings.php', 'Strings')); if (0) { ?>--> > > is all that's really needed: > - the home link is the same on all the pages, so it > doesn't need to be specified > - first parameter specifies which of the indexes to show > on the left (e.g. they can be in index.param.html) > - the next 3 parameters are the "prev", "next" and "up" > links. if they are arrays, they function the same as > now, if not, a link to function.param.html is made. Left side indexes are quite similar on all pages belonging to the same section. The Up link is the same two, so putting out the index contents to individual files by index may be a solution to make the PHP files even more smaller. Though it is not a trivial task to generate those index files, and I even cannot do it in DSSSL (which we use currently for manual file generations). I have created a port of the DSSSL scripts to XSL, and those are too available from phpdoc CVS, just noone had time to experiment with it. I tried some sample manual pages, dropped the generated files onto hu.php.net, in place of the correcponding DSSSL generated files, and it looked excatly the same (although the HTML code was nicer and smaller ;). > if the up link and the section are always the same (I'm not > sure about this), even the last parameter could be > eliminated, making the whole thing just one line. Since > the source is publicly available, this would not be > a serious issue, as nothing new is revealed, and the > additional bandwidth required would be negligible. These are logical things here. It's not probable, that anybody will do these modifications in the DSSSL sheets, so we need to first experiment with the XSL sheet, and if they are OK, we can start implementing this stuff. > Then, error.php would only need to do this: > - extract the language and send headers > - include() manual functions (man_top, etc.) > - include() the required file > > Any thoughts? BTW it would be nice to put this up as a "php.net website problem" to bugs.php.net. Just to make sure, that we won't forget about it. Goba

« previous php.mirrors (#10722) next »