From: David M. <dm...@ci...> - 2005-12-12 05:00:46
|
Matthew Williams <mattrwilliams <at> users.sourceforge.net> writes: > > David Mark wrote: > > Cool. I have a request. Can you leave off the header and body tag? Last I > > used this script I noticed it (like most of the cgi scripts) outputs an entire > > page. I hacked mine to just output the content about three versions ago. It > > is more flexible this way (at least for interfaces without frames.) > > > > Well, in general I think that we want a complete HTML page in the frameset > as most people are currently using frames (with the ia5). I know that You have to have one for framesets. You would create an shtml page with the header and body tag. Then the frameset would link to the shtml page rather than directly to the script. It is a moot point at the moment as there is no provision in the current http_server for reading parameters inside an included script. There is in the new version that I put together last summer. One of these months I will get that out to the people who indicated they would like to test my Web interface. > non-frame interfaces are in the works, so it may make sense to somehow pass > along a parameter to the mh cgi-like scripts (most of them aren't true cgis > as they don't generate HTTP headers) that indicates whether or not a Right. I was referring to the HEAD tag. Most generate that, but few add http headers. > complete page or an HTTP snippet (i.e. content only) is desired. The whole problem I ran into was that when you include a script on the server side, it has no way to get to the querystring (or form) parameters. By adding a quick fix to http_server, I was able to expose these to the included script. I converted a lot of the existing scripts by first changing the way they read their parameters (checks the old way and if nothing is there, checks the newly added environment variable.) This was pretty easy as the code is always at the top. Not any more trouble than checking a flag. Secondly, I cut and pasted the head, title, keywords, etc. to an shtml file (which has a directive to include the script.) Lastly, I changed the link in IA5 to point to the shtml file, instead of the PERL script. The end result is that the modules work with frames and without and are modular in a way that they weren't before. I like being able to slap together different content to create a more newspaper-like feel. The IA5 interface seems more like the control panel of a space ship. I think what I need to do is post the one-liner that exposes the parameters and the function I have to retrieve them (which is backwardly compatible with the current method.) Once the former is in http_server.pm, it will be fairly trivial to update the various scripts. I've already done most of them, but of course they are not the latest versions. The biggest bear is the MP3 jukebox and I am hopeful that they have not been heavily modified over the last few months. That one took a while to get working with or without frames. > > The problem is that we would need to change the API between mh and these > scripts. Currently, they are called like this: > > $html = eval $code; > > The scripts are expected to simply return the html desired. > > One thing we could do is to set a global MH variable that tells scripts that > they shouldn't generate headers but this doesn't seem very clean to me. > > Another option would be to create a new mh .shtml directive, say "script" > that runs the script and then automatically rips out the html tags/sections > that only apply when whole pages are being generated, like in framesets. > > This would provide a standard mechanism for non frame based interfaces to > get access to all of the scripts without having to rewrite the scripts > themselves. As well, some of the mh frame bugs could be fixed by > encouraging people to generate complete and valid HTML whenever possible. > > What do people think? > Matt > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log files > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click > ________________________________________________________ > To unsubscribe from this list, go to: http://sourceforge.net/mail/? group_id=1365 > > |