From: Steve W. <sw...@wc...> - 2000-06-07 01:12:33
|
I spent a little time tonight trying to think of a way to make theme changes easier. A good starting place is the horrendous looking WikiToolBar() (what was I thinking when I coded this? Probably that I wouldn't have to be bothered with it again :-) _________________________________________________________ function WikiToolBar() { global $ScriptUrl, $pagename, $pagehash; $enc_name = rawurlencode($pagename); $retval = "<hr>\n" . "<a href=\"$ScriptUrl?edit=$enc_name\">EditText</a>\n" . " of this page\n"; if (is_array($pagehash)) { $retval .= " (last edited " . $pagehash["date"] . ")\n"; } $retval .= "<br>\n" . "<a href=\"$ScriptUrl?FindPage\">" . "FindPage</a> by browsing or searching\n"; return $retval; } ---------------------------------------------------------- PHP definitely has its limitations in this department. My solution tonight, through the haze of NyQuil and aspirin and orange juice and tea, was to move all this into a new file in a new directory, "elements/wiki_toolbar.inc". After some cleanup I got this: ___________________________________________________________ <? // set up variables for display $enc_name = rawurlencode($pagename); if (is_array($pagehash)) { $last_edit = " (last edited " . $pagehash["date"] . ")\n"; } ?> <hr> <a href="<? echo "$ScriptUrl?edit=$enc_name"; ?>">EditText</a> of this page <? echo "$last_edit"; ?> <br> <a href="<? echo "$ScriptUrl"; ?>?FindPage">FindPage</a> by browsing or searching ------------------------------------------------------------ This isn't much better. When it comes to fine-grained mixing of PHP and HTML, the end result is uglier than a modern strip mall. I don't feel like commiting this. Any suggestions? If I go this route, the three functions WikiHeader, WikiToolBar, and WikiFooter will be replaced by .inc files. The other thing I don't like is having file names hardcoded all over the place, so all three would have to be defined in wiki_config.php3 as well. sw ...............................ooo0000ooo................................. Hear FM quality freeform radio through the Internet: http://wcsb.org/ home page: www.wcsb.org/~swain |
From: Arno H. <aho...@in...> - 2000-06-07 08:25:08
|
Steve, I guess you are too fixed on the functions themselves. Themes are usually done by using templates, i.e. files which have placeholders for the dynamic content. In the current version of phpwiki following templates are needed: browsing, edittext, editlinks, thanks-for-editing, search-results Placeholders needed are: %SCRIPT% ... URL of phpwiki script %TOPIC% ... page title %ENCTOPIC% ... URL-encoded page title %TEXT% ... page content (HTML, wiki markup, search results, ...) %LASTMODIFIED% ... 7 June, 2000 (or whatever) %REFERENCEx% ... for editlinks a simple template for e.g. browsing could look like: ----- browsing.html ----- <html><head><title>phpwiki: %TOPIC%</title></head> <body><h1><A HREF="%SCRIPT%?full=%ENCTOPIC%">%TOPIC%</A></h1> %TEXT% <hr> <A HREF="%SCRIPT%?edit=%ENCTOPIC%">Edit this page</A> (last edited %LASTMODIFIED%) <A HREF="%SCRIPT%?FindPage">FindPage</A> by browsing or searching </body></html> ----- end of browsing.html ----- You then have one function (the one that prints the final HTML) that reads in the template and replaces everything. If you are fancy, you can even provide a hook that allows knowledgeable admins to add their own placeholders. (Actually that should be quite easy.) How about that? I could cook up something like that in the next days, as I have some time due to illness too :( > I don't feel like commiting this. That brings up a question I'd like to ask: is there a clean way to share "experimental" code through the CVS? The only way I can think of is creating branches, but I don't know if this is a good solution. On a side note: how about releasing a 1.1.5 version? (before the template stuff) 1.1.4 is just too buggy to keep around. /Arno |
From: Nicholas R. <nic...@sy...> - 2000-06-07 08:33:02
|
PhpWiki is basically HTML embedded in PHP code, very often its the other way around (especially in websites built by design-agencies ie ColdFusion, JSP etc). As Arno has pointed-out the template should be HTML with PHP embedded in it... whats this a global flu? Steve's in NYC, Arno (?) I'm in Sydney and was attacked last week... I found half a doxen double vodkas and orange, a stupid movie like MI-2 (Sydney stupididty) and an early night killed my virus... -N ----- Original Message ----- From: Arno Hollosi <aho...@in...> To: <php...@li...> Sent: Wednesday, June 07, 2000 6:25 PM Subject: Re: [Phpwiki-talk] themes > > Steve, > > I guess you are too fixed on the functions themselves. > Themes are usually done by using templates, i.e. files which > have placeholders for the dynamic content. > > In the current version of phpwiki following templates are needed: > browsing, edittext, editlinks, thanks-for-editing, search-results > > Placeholders needed are: > %SCRIPT% ... URL of phpwiki script > %TOPIC% ... page title > %ENCTOPIC% ... URL-encoded page title > %TEXT% ... page content (HTML, wiki markup, search results, ...) > %LASTMODIFIED% ... 7 June, 2000 (or whatever) > %REFERENCEx% ... for editlinks > > a simple template for e.g. browsing could look like: > > ----- browsing.html ----- > > <html><head><title>phpwiki: %TOPIC%</title></head> > <body><h1><A HREF="%SCRIPT%?full=%ENCTOPIC%">%TOPIC%</A></h1> > %TEXT% > <hr> > <A HREF="%SCRIPT%?edit=%ENCTOPIC%">Edit this page</A> > (last edited %LASTMODIFIED%) > <A HREF="%SCRIPT%?FindPage">FindPage</A> by browsing or searching > </body></html> > > ----- end of browsing.html ----- > > You then have one function (the one that prints the final HTML) > that reads in the template and replaces everything. > If you are fancy, you can even provide a hook that allows > knowledgeable admins to add their own placeholders. (Actually that > should be quite easy.) > > How about that? > > I could cook up something like that in the next days, as I have some > time due to illness too :( > > > > I don't feel like commiting this. > > That brings up a question I'd like to ask: is there a clean way to > share "experimental" code through the CVS? The only way I can think of > is creating branches, but I don't know if this is a good solution. > > On a side note: how about releasing a 1.1.5 version? > (before the template stuff) 1.1.4 is just too buggy to keep around. > > /Arno > > _______________________________________________ > Phpwiki-talk mailing list > Php...@li... > http://lists.sourceforge.net/mailman/listinfo/phpwiki-talk > |
From: Nicholas R. <nic...@sy...> - 2000-06-07 08:40:56
|
we should look at the new features of PHP4, it may have some solutions to our problems... http://www.zend.com/zend/whats-new.php |
From: Nicholas R. <nic...@sy...> - 2000-06-07 10:46:33
|
useful, will send a digest soon http://www.zend.com/zend/art/free-energy.php |
From: Nicholas R. <nic...@sy...> - 2000-06-07 12:08:01
|
it might be useful to see how these folks are solving the category problem etc http://www.working-dogs.com/freeassociation/ |
From: Steve W. <sw...@wc...> - 2000-06-08 04:35:18
|
Yes, I think we can mine something from this. If there are drop-in PHP templating systems out there (must be GPL though) I'd like to consider it. On Wed, 7 Jun 2000, Nicholas Roberts wrote: > useful, will send a digest soon > http://www.zend.com/zend/art/free-energy.php > > > _______________________________________________ > Phpwiki-talk mailing list > Php...@li... > http://lists.sourceforge.net/mailman/listinfo/phpwiki-talk > ...............................ooo0000ooo................................. Hear FM quality freeform radio through the Internet: http://wcsb.org/ home page: www.wcsb.org/~swain |
From: Nicholas R. <nic...@sy...> - 2000-06-08 04:43:01
|
the source is here, the folks at http://Working-Dogs.com use it a lot it seems 'My experience with FreeEnergy has resulted in a substantial increase in productivity. If you wish to experiment with this model, I've provided a minimal set of files with this article, fe.tar.gz. I can also recommend a project I lead called FreeTrade, which uses FreeEnergy as the basis of an ecomm toolkit. This project shows the difficulty we faced with PHP 3's include functionality. In its next incarnation, we plan to move to a PHP 4-only code base that will take full advantage of the new include behavior.' download GPL source here http://www.leonatkinson.com/downloads/fe.tar.gz Leon Atkinson seems to be something of a PHP Guru ----- Original Message ----- From: Steve Wainstead <sw...@wc...> To: Nicholas Roberts <nic...@sy...> Cc: Arno Hollosi <aho...@in...>; <php...@li...> Sent: Thursday, June 08, 2000 2:32 PM Subject: Re: [Phpwiki-talk] themes > > Yes, I think we can mine something from this. If there are drop-in PHP > templating systems out there (must be GPL though) I'd like to consider it. > > > > > On Wed, 7 Jun 2000, Nicholas Roberts wrote: > > > useful, will send a digest soon > > http://www.zend.com/zend/art/free-energy.php > > > > > > _______________________________________________ > > Phpwiki-talk mailing list > > Php...@li... > > http://lists.sourceforge.net/mailman/listinfo/phpwiki-talk > > > > ...............................ooo0000ooo................................. > Hear FM quality freeform radio through the Internet: http://wcsb.org/ > home page: www.wcsb.org/~swain > > |