From: Loyd G. <lo...@bl...> - 2002-11-19 03:21:14
|
I just installed PHPWiki v1.3.3, and am very pleased with it so far. I = tried searching the archives, but they appear to be down at the moment. I'm trying to write a simple plugin for MOTD. I was under the impression = that HTML code I used in the plugin was not translated. For instance, if I use= this sample code in my plugin: function run($dbi, $argstr, $request) { // No arguments at this time // extract($this->getArgs($argstr, $request)); $html =3D "One moon shows in every pool;\nIn every pool, the one moon."; $html =3D ereg_replace("\n","<br />",$html); return $html; } I expected to see the following in the wiki: One moon shows in every pool; In every pool, the one moon. However, I get this: One moon shows in every pool;<br />In every pool, the one moon. The source for which looks like this: One moon shows in every pool;<br />In every pool, the one moon. Even replacing the HTML breaks with wiki line breaks (%%%) did not work. = (I thought wiki html transformation might still occur.) The note from the HelloWorld plugin states // Any text that is returned will not be further transformed, // so use html where necessary. This does not appear to be true. Is there a way to get line breaks from a plugin's text? Thanks, Loyd --=20 "Why, you can even hear yourself think." --Hobbes "This is making me nervous. Let's go in." --Calvin lo...@bl... ICQ#504581 http://www.blackrobes.net/ |
From: Carsten K. <car...@us...> - 2002-11-19 05:41:52
|
Hi Loyd, Yes the HelloWorld plugin comments are a little vague and out of date, the returned value should now use the HTML class functions not raw strings. Try something like this: $MOTD = "One moon shows in every pool;\nIn every pool, the one moon."; $MOTD = explode("\n", htmlentities($MOTD)); // make an array to walk through later $html = HTML(); // new HTML object foreach ($MOTD as $line) $html->pushContent($line, HTML::br()); // add each line to the html object $html->unshiftContent(HTML::h2(_("Message of the Day"))); return $html; Carsten On Monday, November 18, 2002, at 10:21 pm, Loyd Goodbar wrote: > I just installed PHPWiki v1.3.3, and am very pleased with it so far. I > tried > searching the archives, but they appear to be down at the moment. > > I'm trying to write a simple plugin for MOTD. I was under the > impression that > HTML code I used in the plugin was not translated. For instance, if I > use this > sample code in my plugin: > > function run($dbi, $argstr, $request) { > // No arguments at this time > // extract($this->getArgs($argstr, $request)); > $html = "One moon shows in every pool;\nIn every pool, the one moon."; > $html = ereg_replace("\n","<br />",$html); > return $html; > } > > I expected to see the following in the wiki: > > One moon shows in every pool; > In every pool, the one moon. > > However, I get this: > > One moon shows in every pool;<br />In every pool, the one moon. > > The source for which looks like this: > > One moon shows in every pool;<br />In every pool, the one moon. > > Even replacing the HTML breaks with wiki line breaks (%%%) did not > work. (I > thought wiki html transformation might still occur.) > > The note from the HelloWorld plugin states > // Any text that is returned will not be further transformed, > // so use html where necessary. > > This does not appear to be true. > Is there a way to get line breaks from a plugin's text? > > Thanks, > Loyd |
From: Loyd G. <lo...@bl...> - 2002-11-20 01:38:11
|
Thanks, that worked nicely. Is the html object part of PHP now, or is it = part of PEAR? Where can I find more? Thanks, Loyd On Tue, 19 Nov 2002 00:41:39 -0500, Carsten Klapp <car...@us...> wrote: >Hi Loyd, > >Yes the HelloWorld plugin comments are a little vague and out of date,=20 >the returned value should now use the HTML class functions not raw=20 >strings. Try something like this: > > $MOTD =3D "One moon shows in every pool;\nIn every pool, the one=20 >moon."; > $MOTD =3D explode("\n", htmlentities($MOTD)); // make an array to=20 >walk through later > > $html =3D HTML(); // new HTML object > foreach ($MOTD as $line) > $html->pushContent($line, HTML::br()); // add each line to the=20 >html object > > $html->unshiftContent(HTML::h2(_("Message of the Day"))); > > return $html; > >Carsten --=20 "Why, you can even hear yourself think." --Hobbes "This is making me nervous. Let's go in." --Calvin lo...@bl... ICQ#504581 http://www.blackrobes.net/ |
From: Carsten K. <car...@us...> - 2002-11-20 17:08:41
|
I believe the HTML object is Jeff's own creation so it is really part of PhpWiki. It is fantastic to work with, I would like to see it become part of PHP! The code is in lib/XmlElement.php and lib/HtmlElement.php and is used throughout PhpWiki. The other plugins make good examples, they are a good place to start to learn a little more how it works. Carsten p.s. oops, probably you already noticed a mistake in my code: - $MOTD = explode("\n", htmlentities($MOTD)); // make an array to + $MOTD = explode("\n", $MOTD); // make an array to On Tuesday, November 19, 2002, at 08:37 pm, Loyd Goodbar wrote: > Thanks, that worked nicely. Is the html object part of PHP now, or is > it part > of PEAR? Where can I find more? > > Thanks, > Loyd > > On Tue, 19 Nov 2002 00:41:39 -0500, Carsten Klapp > <car...@us...> wrote: > >> Hi Loyd, >> >> Yes the HelloWorld plugin comments are a little vague and out of date, >> the returned value should now use the HTML class functions not raw >> strings. Try something like this: >> >> $MOTD = "One moon shows in every pool;\nIn every pool, the one >> moon."; >> $MOTD = explode("\n", htmlentities($MOTD)); // make an array to >> walk through later >> >> $html = HTML(); // new HTML object >> foreach ($MOTD as $line) >> $html->pushContent($line, HTML::br()); // add each line to the >> html object >> >> $html->unshiftContent(HTML::h2(_("Message of the Day"))); >> >> return $html; >> >> Carsten |
From: Jeff D. <da...@da...> - 2002-11-20 19:15:58
|
> I believe the HTML object is Jeff's own creation so it is really part > of PhpWiki. It is fantastic to work with, I would like to see it become > part of PHP! Thanks! I use the Xml/HtmlElement is a couple other personal projects, but I think PhpWiki is the only public release... To give proper credit, most of the ideas come from Perl's HTML::Element module (by Gisle Aas.) |
From: Reini U. <ru...@x-...> - 2002-11-24 12:57:03
|
Jeff Dairiki schrieb: >>I believe the HTML object is Jeff's own creation so it is really part >>of PhpWiki. It is fantastic to work with, I would like to see it become >>part of PHP! > > Thanks! > > I use the Xml/HtmlElement is a couple other personal projects, > but I think PhpWiki is the only public release... BTW, I'd love to see this in PEAR. > To give proper credit, most of the ideas come from Perl's > HTML::Element module (by Gisle Aas.) -- Reini Urban http://xarch.tu-graz.ac.at/home/rurban/ |
From: Oliver Z. P. <web...@ps...> - 2002-11-24 14:53:51
|
Sorry If this has been talked before, I dont read all messages and could not search in sourceforge website. I wonder if a WYSIWYG module has been ported to phpwiki. Even if its easy to most of us to write with wiki code, some people find it hard. I've used phpwiki in an online course and the wiki code prevent some student's to write their assignments. Also, with WYSIWYG you can copy and paste formated text that you already have in HTML or even in .doc. I know a great WYSIWYG package for IE called richtext: http://richtext.sourceforge.net/ The Richtext Editor project is an Open Source project hosted by SourceForge.net. The editor is an Internet Explorer based WYSIWYG HTML Text Editor which can be hosted in a web page or form. It requires no additional components as it is written entirely in DHTML and JavaScript. For those who love Mozilla I've found a WYSIWYG editor also: http://wysiwyg.skybuilders.com/ (they have one for IE too) Dont know about the licence of this. Also I think here has another editor: http://composite.mozdev.org/ (I cant check it out because I dont have mozilla) I want so much to have my personal web site made with phpwiki, but the huge amount of text that I have , prevent me to write everything again. Is there a way to import pre formated data to phpwiki? Thanks Oliver |
From: Reini U. <ru...@x-...> - 2002-11-24 15:25:26
|
Oliver Zancul Prado schrieb: > Sorry If this has been talked before, I dont read all messages and could not > search in sourceforge website. > > I wonder if a WYSIWYG module has been ported to phpwiki. > > Even if its easy to most of us to write with wiki code, some people find it > hard. I've used phpwiki in an online course and the wiki code prevent some > student's to write their assignments. > > Also, with WYSIWYG you can copy and paste formated text that you already > have in HTML or even in .doc. > > I know a great WYSIWYG package for IE called richtext: > http://richtext.sourceforge.net/ > The Richtext Editor project is an Open Source project hosted by > SourceForge.net. The editor is an Internet Explorer based WYSIWYG HTML Text > Editor which can be hosted in a web page or form. It requires no additional > components as it is written entirely in DHTML and JavaScript. > > For those who love Mozilla I've found a WYSIWYG editor also: > http://wysiwyg.skybuilders.com/ (they have one for IE too) > Dont know about the licence of this. > Also I think here has another editor: http://composite.mozdev.org/ (I cant > check it out because I dont have mozilla) > > I want so much to have my personal web site made with phpwiki, but the huge > amount of text that I have , prevent me to write everything again. > > Is there a way to import pre formated data to phpwiki? Interesting project since I want to include richtext / wysiwyg.skybuilders into squirrelmail also. I used it successfully with ariadne http://ariadne.muze.nl/ and I liked it a lot. phpBB also has a nice formatted input textarea with some bold/italic/... buttons. Maybe an optional preference to use this editor (or something else) and convert the generated HTML code to new markup. (a converter plugin?) Users can then just paste some html code also. The converter should check some malicious html code and remove it. I started with some perl HTML::Parser/HTML::TreeBuilder once, but never finished it, since it was easy enough to convert my html pages manually. But I have to finish my squirrelmail work first. This needs only html output. -- Reini Urban http://e-mail.inode.at/newwebmail/ |
From: aphid <me...@ap...> - 2002-11-21 17:24:15
|
I can't think of anything I may have changed that could cause this, but alas it happens: when I enter a url either as http://www.somewhere.com/~user] or [http://www.somewhere.com/~user] or [a link | http://www.somewhere.com/~user] the tilde is gettting doubled.. ie converted to: http://www.somewhere.com/~~user however, if I just use a ~ outside of a link, it isn't being doubled. anyone got a clue on how this is happening? cheers a |
From: Jeff D. <da...@da...> - 2002-11-21 18:15:29
|
> anyone got a clue on how this is happening? Yes. (And I just fixed it.) (It's only an issue in the CVS code: this should be happening in 1.3.3 or earlier releases...) The patch is: http://cvs.sf.net/cgi-bin/viewcvs.cgi/phpwiki/phpwiki/lib/InlineParser.php.diff?r1=1.16&r2=1.17 The cause of the trouble was: A few weeks ago, I got rid of the old markup engine --- instead old markup is run through a filter to convert it to new markup, which is fed to the new-markup engine. As part of the conversion, '~' is (correctly) converted to '~~'. (In the new markup '~' is a magic escape character which causes the following character to be treated literally, no matter what context.) The new markup code was not properly de-escaping the magic ~ escapes within links... that's now fixed. NOTICE: This is going to break any existing new markup pages with ~'s in links. Thanks for the report! Jeff |