From 5ko at 5ko.fr Fri Jul 1 02:47:39 2016 From: 5ko at 5ko.fr (Petko Yotov) Date: Fri, 01 Jul 2016 09:47:39 +0200 Subject: [pmwiki-users] RFC: Future responsive mobile/desktop skin In-Reply-To: References: Message-ID: I added your question to the talk page. Petko On 2016-06-30 23:16, Simon wrote: > Would it be possible to turn the header and footer into fully fledged > wiki > pages (the same as the side bar), thus reducing content in the > template? > On 1 July 2016 at 04:24, Petko Yotov <5ko at 5ko.fr> wrote: >> I started work on a new core candidate skin, adapted for mobile and >> desktop screens. >> >> See, test, review it: >> >> http://www.pmwiki.org/wiki/Skins/2016 >> >> Please report any problems or suggest improvements on the talk page. >> >> Petko From 5ko at 5ko.fr Fri Jul 1 02:48:56 2016 From: 5ko at 5ko.fr (Petko Yotov) Date: Fri, 01 Jul 2016 09:48:56 +0200 Subject: [pmwiki-users] RFC: Future responsive mobile/desktop skin In-Reply-To: <577596A0.6040809@affinity.co.nz> References: <577596A0.6040809@affinity.co.nz> Message-ID: <53e0dc8a0290644381b4c03cacbe0b68@5ko.fr> I added your question to the talk page and replied. http://www.pmwiki.org/wiki/Skins/2016-Talk Petko On 2016-07-01 00:01, John Rankin wrote: > Very good to see this, Petko. > > A question: what consideration has been given to moving to a design > where the page content is styled to use a maximum em width? This would > make pages more readable on wide screens, without the reader having to > adjust the window size. > > See an example at > http://intranet.affinity.co.nz/projects/FITWellington/WorkshopCodeOfConduct > -- making the text bigger or smaller in the browser (zooming in or > out) automatically adjusts the width. > > JR > > On 01/07/16 04:24, Petko Yotov wrote: >> Hello, >> >> I started work on a new core candidate skin, adapted for mobile and >> desktop screens. >> >> See, test, review it: >> >> http://www.pmwiki.org/wiki/Skins/2016 >> >> Please report any problems or suggest improvements on the talk page. >> >> Petko >> From 5ko at 5ko.fr Sat Jul 2 16:28:28 2016 From: 5ko at 5ko.fr (Petko Yotov) Date: Sat, 02 Jul 2016 23:28:28 +0200 Subject: [pmwiki-users] New recipe for skin authors Message-ID: <14b8cf1b73736498b85f59f929cd60be@5ko.fr> I've written a tiny recipe that proves to be very useful to me when testing skins. If you need to test your skin with and without page directives like (:noheader:) and (:noleft:), it may save you a lot of time: http://www.pmwiki.org/wiki/Skins/TestPageDirectives Demo (checkboxes near the top of the page): http://www.pmwiki.org/wiki/Skins/SkinTest-Compact Enjoy, Petko -- Change log : http://www.pmwiki.org/wiki/PmWiki/ChangeLog Release notes : http://www.pmwiki.org/wiki/PmWiki/ReleaseNotes If you upgrade : http://www.pmwiki.org/wiki/PmWiki/Upgrades From pkay42 at gmail.com Mon Jul 4 18:35:44 2016 From: pkay42 at gmail.com (Peter Kay) Date: Mon, 4 Jul 2016 19:35:44 -0400 Subject: [pmwiki-users] parameters to a handler function Message-ID: There appear to be two parameters passed to a handler set up via $HandleActions['...']. The first is the $pagename. The second, which not everyone uses, is $auth. The CustomActions page doesn't make it totally clear what $auth is - is it the authorization level the user already has? Is it $HandleAuth['myaction']? Thanks for clearing that up for me! --Peter -------------- next part -------------- An HTML attachment was scrubbed... URL: From 5ko at 5ko.fr Tue Jul 5 01:49:51 2016 From: 5ko at 5ko.fr (Petko Yotov) Date: Tue, 05 Jul 2016 08:49:51 +0200 Subject: [pmwiki-users] parameters to a handler function In-Reply-To: References: Message-ID: <1813e667cdc7a7ce0e25a7b90dc6f84a@5ko.fr> The second argument is the authorization level the user must have to access your function, but you need to verify this yourself! The argument will be passed to your function: it is taken from the $HandleAuth array, or from the default arguments of the function. Your function must call RetrieveAuthPage() if it requires a certain level of authentication; that second argument can allow wiki admins to override your default level of authentication, if they need to, and if you use it. (If you decide they don't need to change the level, don't use that argument.) I invite you to review some simple core functions like HandleSource() or HandleAttr() or HandlePostAttr() in pmwiki.php. For example: by default ?action=source requires read permissions: function HandleSource($pagename, $auth = 'read') { # ... $page = RetrieveAuthPage($pagename, $auth, true, READPAGE_CURRENT); if (!$page) Abort("?cannot source $pagename"); #... } If an admin sets in config.php $HandleAuth['source'] = 'edit'; then HandleSource() will be called with a second argument 'edit' not 'read'. The key to your page is RetrieveAuthPage() which is documented here: http://www.pmwiki.org/wiki/PmWiki/Functions#RetrieveAuthPage Notably, if the user has no $auth permissions to access the page, the login form will appear to allow her to type her password (if the third argument is true, or is missing). If the third argument is false, and the user has no permissions to $auth the page, the login form will not appear and the $page variable will be false - so you can deal with it. See also the note about READPAGE_CURRENT in the Functions page. * If you don't modify the page AND don't need the page history, use READPAGE_CURRENT, it is faster. Like HandleSource() or HandleAttr() do. * If you do modify the page OR you need the history, you must not use READPAGE_CURRENT or you'll lose all history. Like HandlePostAttr() does. Hope that helps. Petko --- Change log : http://www.pmwiki.org/wiki/PmWiki/ChangeLog Release notes : http://www.pmwiki.org/wiki/PmWiki/ReleaseNotes If you upgrade : http://www.pmwiki.org/wiki/PmWiki/Upgrades On 2016-07-05 01:35, Peter Kay wrote: > There appear to be two parameters passed to a handler set up via > $HandleActions['...']. The first is the $pagename. The second, which > not > everyone uses, is $auth. The CustomActions page doesn't make it > totally > clear what $auth is - is it the authorization level the user already > has? > Is it $HandleAuth['myaction']? From pkay42 at gmail.com Fri Jul 8 20:12:15 2016 From: pkay42 at gmail.com (Peter Kay) Date: Fri, 8 Jul 2016 21:12:15 -0400 Subject: [pmwiki-users] parameters to a handler function Message-ID: So let me check my understanding: If I set HandleAuth['myaction']='edit'; And then do function MyActionCallback($pagename, $auth) { $page=RetrieveAuthPage($pagename, $auth, true, READPAGE_CURRENT); #Abort if no page, etc } Then a user would need to have edit permissions to do 'myaction', unless the wiki admin somehow unset HandleAuth['myaction'], right? Alternately, if you make your callback look like this: function MyActionCallback($pagename) { $page=RetrieveAuthPage($pagename, 'edit', true, READPAGE_CURRENT); #abortetc } then a user has to have 'edit' permissions, right? Thanks a bunch - I've got a much better idea of what's going on now :) --Peter From pkay42 at gmail.com Fri Jul 8 20:44:05 2016 From: pkay42 at gmail.com (Peter Kay) Date: Fri, 8 Jul 2016 21:44:05 -0400 Subject: [pmwiki-users] parameters to a handler function Message-ID: > * If you do modify the page OR you need the history, you must not use > READPAGE_CURRENT or you'll lose all history. Like HandlePostAttr() does. Wait, what? Of course, that makes a lot of sense, when you step back to think about it. I'd probably have figured out (eventually) why I kept losing all of my history... Thanks! --Peter Kay From 5ko at 5ko.fr Sat Jul 9 02:00:52 2016 From: 5ko at 5ko.fr (Petko Yotov) Date: Sat, 09 Jul 2016 09:00:52 +0200 Subject: [pmwiki-users] parameters to a handler function In-Reply-To: References: Message-ID: <4eb17221f1abba0acd3eef15aec093d2@5ko.fr> On 2016-07-09 03:12, Peter Kay wrote: > So let me check my understanding: If I set > > HandleAuth['myaction']='edit'; I'd probably set: SDVA($HandleAuth, array('myaction'=>'edit')); (SDVA() = Set default value in array if unset, don't change other array entries; SDV()=Set default value if unset, see "PmWiki/Functions"). This way, if an admin sets $HandleAuth['myaction']='edit'; before including your recipe, her settings will not be overwritten by your SDVA line. She could set the permissions before or after including the recipe. Same with other configurable values in your recipe. > And then do > > function MyActionCallback($pagename, $auth) { > $page=RetrieveAuthPage($pagename, $auth, true, READPAGE_CURRENT); > #Abort if no page, etc > } > > Then a user would need to have edit permissions to do 'myaction', Yes. The user will see the login prompt until he provides the 'edit' password. > unless the wiki admin somehow unset HandleAuth['myaction'], right? Yes, she may have increased the restriction ('admin'), lowered it ('read'), or disabled it it ('ALWAYS'). > Alternately, if you make your callback look like this: > function MyActionCallback($pagename) { > $page=RetrieveAuthPage($pagename, 'edit', true, READPAGE_CURRENT); > #abortetc > } > > then a user has to have 'edit' permissions, right? Yes, this will not allow the admin to adapt the permissions. If you have reasons to do it this way, you can. If it is not configurable, the admin could anyway modify your script if she needs it. But there is the PmWikiPhilosophy (for the core, but also for many recipes) that an admin should not "need" to modify scripts, as this would make it harder to upgrade to a newer version - she would have to re-apply her changes every time she upgrades. If the setting can be made configurable, she could simply drop the new version and her installation would hopefully continue to work as before. :-) Petko --- Change log : http://www.pmwiki.org/wiki/PmWiki/ChangeLog Release notes : http://www.pmwiki.org/wiki/PmWiki/ReleaseNotes If you upgrade : http://www.pmwiki.org/wiki/PmWiki/Upgrades From 5ko at 5ko.fr Sat Jul 9 02:59:38 2016 From: 5ko at 5ko.fr (Petko Yotov) Date: Sat, 09 Jul 2016 09:59:38 +0200 Subject: [pmwiki-users] parameters to a handler function In-Reply-To: <4eb17221f1abba0acd3eef15aec093d2@5ko.fr> References: <4eb17221f1abba0acd3eef15aec093d2@5ko.fr> Message-ID: <3c318ba00680cfdea52aa5fd7520e505@5ko.fr> On 2016-07-09 09:00, Petko Yotov wrote: > (SDVA() = Set default value in array if unset, don't change other > array entries; SDV()=Set default value if unset, see > "PmWiki/Functions"). Sorry, this is actually at Cookbook:Functions http://www.pmwiki.org/wiki/Cookbook/Functions Petko From pce at accesswave.ca Mon Jul 11 14:21:50 2016 From: pce at accesswave.ca (pce at accesswave.ca) Date: Mon, 11 Jul 2016 16:21:50 -0300 Subject: [pmwiki-users] Blocked loading mixed active content In-Reply-To: <35972a96ae057158463ba19a8dad99a8@5ko.fr> References: <35972a96ae057158463ba19a8dad99a8@5ko.fr> Message-ID: <512bbd27-0263-bf7e-c664-ad995de09b27@accesswave.ca> Hi, all- I've updated the .htaccess file on my site to translate all incoming requests from "http://xxx" to "https://xxx" - or at least I had. When I did this PmWiki stopped working, due to hard-coded "http" requests in various places. The typical error message in the FireFox (and Chrome) console logs was Blocked loading mixed active content "http://xxx.org/wiki/pub/skins/..." There were errors with many files, not just those in the skin. My version is 2.2.28. Short of editing a lot of code (which might get overwritten next time I upgrade) any suggestions on how to get around this? I could add a special RewriteCond rule, just for PmWiki, to my .htaccess file but that seems a bit extreme. Thanks Peter From 5ko at 5ko.fr Mon Jul 11 17:34:49 2016 From: 5ko at 5ko.fr (Petko Yotov) Date: Tue, 12 Jul 2016 00:34:49 +0200 Subject: [pmwiki-users] Blocked loading mixed active content In-Reply-To: <512bbd27-0263-bf7e-c664-ad995de09b27@accesswave.ca> References: <35972a96ae057158463ba19a8dad99a8@5ko.fr> <512bbd27-0263-bf7e-c664-ad995de09b27@accesswave.ca> Message-ID: <4cc7af07490d40f0906bd1028d25536f@5ko.fr> You should never have to make changes that would be overwritten upon upgrade: for the core and for many recipes there are variables and hooks that allow you to have all your changes in your own local files. If there is no variable or hook for what you need, we add one - see PmWiki Philosophy #5. In your case, I suspect in a local configuration file (local/config.php) there is some hardcoded variable among $ScriptUrl, $PubDirUrl, $FarmPubDirUrl. If any of these point to the wrong protocol, your pages may appear without any styles (fonts, colors, scripts, embedded pictures). Start by changing $ScriptUrl to the correct HTTPS location. $(Farm)PubDirUrl could be set to a relative path, eg "/pmwiki/pub", or to the full URL. If this is not enough to fix all errors, review the recipes/modules you use, and other local configuration (directories local and scripts) and fix them. Or tell us and we'll fix them. Petko --- Change log : http://www.pmwiki.org/wiki/PmWiki/ChangeLog Release notes : http://www.pmwiki.org/wiki/PmWiki/ReleaseNotes If you upgrade : http://www.pmwiki.org/wiki/PmWiki/Upgrades On 2016-07-11 21:21, pce at accesswave.ca wrote: > Hi, all- > > I've updated the .htaccess file on my site to translate all incoming > requests from "http://xxx" to "https://xxx" - or at least I had. When > I did this PmWiki stopped working, due to hard-coded "http" requests > in various places. The typical error message in the FireFox (and > Chrome) console logs was > > Blocked loading mixed active content > "http://xxx.org/wiki/pub/skins/..." > > There were errors with many files, not just those in the skin. > > My version is 2.2.28. > > Short of editing a lot of code (which might get overwritten next time > I upgrade) any suggestions on how to get around this? I could add a > special RewriteCond rule, just for PmWiki, to my .htaccess file but > that seems a bit extreme. From 5ko at 5ko.fr Mon Jul 11 17:39:44 2016 From: 5ko at 5ko.fr (Petko Yotov) Date: Tue, 12 Jul 2016 00:39:44 +0200 Subject: [pmwiki-users] Blocked loading mixed active content In-Reply-To: <4cc7af07490d40f0906bd1028d25536f@5ko.fr> References: <35972a96ae057158463ba19a8dad99a8@5ko.fr> <512bbd27-0263-bf7e-c664-ad995de09b27@accesswave.ca> <4cc7af07490d40f0906bd1028d25536f@5ko.fr> Message-ID: On 2016-07-12 00:34, Petko Yotov wrote: > If this is not enough to fix all errors, review the recipes/modules > you use, and other local configuration (directories local and scripts) > and fix them. Or tell us and we'll fix them. Sorry, this should read "directories local and cookbook". Petko From pkay42 at gmail.com Tue Jul 12 00:19:29 2016 From: pkay42 at gmail.com (Peter Kay) Date: Tue, 12 Jul 2016 01:19:29 -0400 Subject: [pmwiki-users] CSS for a cookbook recipe? Message-ID: So I'm writing a cookbook, and I need to put in some CSS. ...What's best practices in terms of managing it, and making it something an admin could change? (Let me add: while being relatively simple for me!) The documentation suggests that adding an entry to $HTMLStylesFmt would be the way to go...is there some convention for naming an entry? And it will just magically show up for me? Sorry if these questions have been answered somewhere >< Hopefully someone can point me in the right direction! Thanks! --Peter Kay From 5ko at 5ko.fr Tue Jul 12 01:54:59 2016 From: 5ko at 5ko.fr (Petko Yotov) Date: Tue, 12 Jul 2016 08:54:59 +0200 Subject: [pmwiki-users] CSS for a cookbook recipe? In-Reply-To: References: Message-ID: <85dca9818564c5b622103bd266d7f030@5ko.fr> On 2016-07-12 07:19, Peter Kay wrote: > So I'm writing a cookbook, and I need to put in some CSS. ...What's > best practices in terms of managing it, and making it something an > admin could change? (Let me add: while being relatively simple for > me!) The thing to keep in mind is that most people will use a different skin and color theme than you, and CSS for one theme may or may not work well with other themes. I'd probably keep it as simple as practical, and use core styles if possible, eg class="frame" should work well in most skins, while "border:1px solid #ccc; background-color:#eee;" may not work well with light text themes. (Most of my recipes assume dark text on light/white background, and the CSS should look acceptable in the default skin, but not many people use the default skin. People need to be able to change or override the CSS that comes with a recipe.) There are at least 3 ways to have CSS for your recipe: PmWiki automatically loads the file pmwiki/pub/css/local.css if it exists. Some recipes with a few lines of CSS simply document what should be added into local.css in the "Install" section of the page. If your recipe has more than one file, eg. CSS+JS+icons, you can have your own directory in pmwiki/pub where to place them all. Then in your recipe you include your CSS with such a line: SDVA($HTMLHeaderFmt, array( 'your-recipe'=>'' )); The third way is with $HTMLStylesFmt below. > The documentation suggests that adding an entry to $HTMLStylesFmt > would be the way to go...is there some convention for naming an entry? You should use a key that is unlikely to collide with a key from another recipe or from the core. The name of your recipe as the key may work well SDVA($HTMLStylesFmt, array('your-recipe'=>'css here')); > And it will just magically show up for me? Yes. Admins will be able to overwrite your CSS by defining the $HTMLStylesFmt['your-recipe'] variable, or by adding entries to local.css. But this may be inconvenient for wikis implementing Content Security Policy, see http://www.pmwiki.org/wiki/PITS/01389 . Petko From pce at accesswave.ca Tue Jul 12 06:30:32 2016 From: pce at accesswave.ca (pce at accesswave.ca) Date: Tue, 12 Jul 2016 08:30:32 -0300 Subject: [pmwiki-users] Blocked loading mixed active content In-Reply-To: <4cc7af07490d40f0906bd1028d25536f@5ko.fr> References: <35972a96ae057158463ba19a8dad99a8@5ko.fr> <512bbd27-0263-bf7e-c664-ad995de09b27@accesswave.ca> <4cc7af07490d40f0906bd1028d25536f@5ko.fr> Message-ID: <8dc25571-8819-86e5-110b-19cd49425938@accesswave.ca> Quite right - I had specified the protocol in two variables in local/config.php. I changed $ScriptUrl and $PubDirUrl to relative URLS and all is now well. Thanks! Peter On 2016-07-11 7:34 PM, Petko Yotov wrote: > You should never have to make changes that would be overwritten upon > upgrade: for the core and for many recipes there are variables and > hooks that allow you to have all your changes in your own local files. > If there is no variable or hook for what you need, we add one - see > PmWiki Philosophy #5. > > In your case, I suspect in a local configuration file > (local/config.php) there is some hardcoded variable among $ScriptUrl, > $PubDirUrl, $FarmPubDirUrl. If any of these point to the wrong > protocol, your pages may appear without any styles (fonts, colors, > scripts, embedded pictures). > > Start by changing $ScriptUrl to the correct HTTPS location. > $(Farm)PubDirUrl could be set to a relative path, eg "/pmwiki/pub", or > to the full URL. > > If this is not enough to fix all errors, review the recipes/modules > you use, and other local configuration (directories local and scripts) > and fix them. Or tell us and we'll fix them. > > Petko > > --- > Change log : http://www.pmwiki.org/wiki/PmWiki/ChangeLog > Release notes : http://www.pmwiki.org/wiki/PmWiki/ReleaseNotes > If you upgrade : http://www.pmwiki.org/wiki/PmWiki/Upgrades > > > On 2016-07-11 21:21, pce at accesswave.ca wrote: >> Hi, all- >> >> I've updated the .htaccess file on my site to translate all incoming >> requests from "http://xxx" to "https://xxx" - or at least I had. When >> I did this PmWiki stopped working, due to hard-coded "http" requests >> in various places. The typical error message in the FireFox (and >> Chrome) console logs was >> >> Blocked loading mixed active content "http://xxx.org/wiki/pub/skins/..." >> >> There were errors with many files, not just those in the skin. >> >> My version is 2.2.28. >> >> Short of editing a lot of code (which might get overwritten next time >> I upgrade) any suggestions on how to get around this? I could add a >> special RewriteCond rule, just for PmWiki, to my .htaccess file but >> that seems a bit extreme. > > _______________________________________________ > pmwiki-users mailing list > pmwiki-users at pmichaud.com > http://www.pmichaud.com/mailman/listinfo/pmwiki-users > From pkay42 at gmail.com Tue Jul 12 10:26:38 2016 From: pkay42 at gmail.com (Peter Kay) Date: Tue, 12 Jul 2016 11:26:38 -0400 Subject: [pmwiki-users] CSS for a cookbook recipe? In-Reply-To: <85dca9818564c5b622103bd266d7f030@5ko.fr> References: <85dca9818564c5b622103bd266d7f030@5ko.fr> Message-ID: It seems like adding a separate file for unavoidable css (and a separate one for javascript) is the best way to go, then, all things being equal? (altho it would require slightly more work for admins) --Peter Kay On Tue, Jul 12, 2016 at 2:54 AM, Petko Yotov <5ko at 5ko.fr> wrote: > On 2016-07-12 07:19, Peter Kay wrote: >> >> So I'm writing a cookbook, and I need to put in some CSS. ...What's >> best practices in terms of managing it, and making it something an >> admin could change? (Let me add: while being relatively simple for >> me!) > > > The thing to keep in mind is that most people will use a different skin and > color theme than you, and CSS for one theme may or may not work well with > other themes. I'd probably keep it as simple as practical, and use core > styles if possible, eg class="frame" should work well in most skins, while > "border:1px solid #ccc; background-color:#eee;" may not work well with light > text themes. > > (Most of my recipes assume dark text on light/white background, and the CSS > should look acceptable in the default skin, but not many people use the > default skin. People need to be able to change or override the CSS that > comes with a recipe.) > > There are at least 3 ways to have CSS for your recipe: > > PmWiki automatically loads the file pmwiki/pub/css/local.css if it exists. > Some recipes with a few lines of CSS simply document what should be added > into local.css in the "Install" section of the page. > > If your recipe has more than one file, eg. CSS+JS+icons, you can have your > own directory in pmwiki/pub where to place them all. Then in your recipe you > include your CSS with such a line: > > SDVA($HTMLHeaderFmt, array( > 'your-recipe'=>' href="$FarmPubDirUrl/recipe/recipe.css" />' > )); > > The third way is with $HTMLStylesFmt below. > >> The documentation suggests that adding an entry to $HTMLStylesFmt >> would be the way to go...is there some convention for naming an entry? > > > You should use a key that is unlikely to collide with a key from another > recipe or from the core. The name of your recipe as the key may work well > > SDVA($HTMLStylesFmt, array('your-recipe'=>'css here')); > >> And it will just magically show up for me? > > > Yes. Admins will be able to overwrite your CSS by defining the > $HTMLStylesFmt['your-recipe'] variable, or by adding entries to local.css. > But this may be inconvenient for wikis implementing Content Security Policy, > see http://www.pmwiki.org/wiki/PITS/01389 . > > Petko > > From pkay42 at gmail.com Fri Jul 15 23:13:32 2016 From: pkay42 at gmail.com (Peter Kay) Date: Sat, 16 Jul 2016 00:13:32 -0400 Subject: [pmwiki-users] CSS for a cookbook recipe? In-Reply-To: <85dca9818564c5b622103bd266d7f030@5ko.fr> References: <85dca9818564c5b622103bd266d7f030@5ko.fr> Message-ID: On Tue, Jul 12, 2016 at 2:54 AM, Petko Yotov <5ko at 5ko.fr> wrote: > If your recipe has more than one file, eg. CSS+JS+icons, you can have your > own directory in pmwiki/pub where to place them all. Then in your recipe you > include your CSS with such a line: > > SDVA($HTMLHeaderFmt, array( > 'your-recipe'=>' href="$FarmPubDirUrl/recipe/recipe.css" />' > )); This brings up two questions I have been pondering, one of them fairly trivial: Is there any difference between: SDVA($HTMLHeaderFmt, array('myrecipe'=>'abcdefg')); and SDV($HTMLHeaderFmt->'myrecipe', 'abcdefg'); ? 2nd question is regarding the whole farm pub vs pub thing. Is there any reason FarmPubDirUrl is preferred over PubDirUrl? Is there some reason to prefer all cookbook recipes/skins/etc to be in the farm's cookbook folder instead of the local one? So one trivial question and one software architecture question! Thanks for the help, btw. --Peter From pkay42 at gmail.com Fri Jul 15 23:24:48 2016 From: pkay42 at gmail.com (Peter Kay) Date: Sat, 16 Jul 2016 00:24:48 -0400 Subject: [pmwiki-users] CSS for a cookbook recipe? In-Reply-To: References: <85dca9818564c5b622103bd266d7f030@5ko.fr> Message-ID: Sorry, stupid (and incorrect) question! I should have been asking: Is there any difference between: SDVA($HTMLHeaderFmt, array('myrecipe'=>'abcdefg')); and SDV($HTMLHeaderFmt['myrecipe'], 'abcdefg'); ? (php is not my first language ;) ) On Sat, Jul 16, 2016 at 12:13 AM, Peter Kay wrote: > On Tue, Jul 12, 2016 at 2:54 AM, Petko Yotov <5ko at 5ko.fr> wrote: >> If your recipe has more than one file, eg. CSS+JS+icons, you can have your >> own directory in pmwiki/pub where to place them all. Then in your recipe you >> include your CSS with such a line: >> >> SDVA($HTMLHeaderFmt, array( >> 'your-recipe'=>'> href="$FarmPubDirUrl/recipe/recipe.css" />' >> )); > > > This brings up two questions I have been pondering, one of them fairly trivial: > > Is there any difference between: > SDVA($HTMLHeaderFmt, array('myrecipe'=>'abcdefg')); > and > SDV($HTMLHeaderFmt->'myrecipe', 'abcdefg'); > ? > > 2nd question is regarding the whole farm pub vs pub thing. Is there > any reason FarmPubDirUrl is preferred over PubDirUrl? Is there some > reason to prefer all cookbook recipes/skins/etc to be in the farm's > cookbook folder instead of the local one? > > So one trivial question and one software architecture question! > > Thanks for the help, btw. > > --Peter From 5ko at 5ko.fr Sat Jul 16 02:51:31 2016 From: 5ko at 5ko.fr (Petko Yotov) Date: Sat, 16 Jul 2016 09:51:31 +0200 Subject: [pmwiki-users] CSS for a cookbook recipe? In-Reply-To: References: <85dca9818564c5b622103bd266d7f030@5ko.fr> Message-ID: <7826bc3cb1f0cef37c691c07ff1a3ed2@5ko.fr> On 2016-07-16 06:24, Peter Kay wrote: > Is there any difference between: > SDVA($HTMLHeaderFmt, array('myrecipe'=>'abcdefg')); > and > SDV($HTMLHeaderFmt['myrecipe'], 'abcdefg'); > ? The result will be the same. If you have more than one entry, the first one can add them at the same time: SDVA($HTMLHeaderFmt, array( 'myrecipe-css'=>'abc', 'myrecipe-js' =>'xyz' )); > 2nd question is regarding the whole farm pub vs pub thing. Is there > any reason FarmPubDirUrl is preferred over PubDirUrl? Is there some > reason to prefer all cookbook recipes/skins/etc to be in the farm's > cookbook folder instead of the local one? The farm's directory is where pmwiki.php is located. If you have a single wiki, the two directories are probably the same. If you have a real farm with 2+ wikis, place in the farm's "pub" and "cookbook" directories the skins and recipes that can be enabled and reused on different wikis. One copy is easier to maintain and upgrade than many copies, in one directory not in many. For this reason, most recipes document how to be included from $FarmD/cookbook. If you have a wikifarm and different wikis need to have modified recipes/skins but with the same filenames (not sure why you would require this), place them in the field's pub directory. If the farm and the field are not on the same domain name, some skin elements and JavaScript recipes may work better from the field's pub directory. (I actually symlink the farm's pub directory into the field and manually set the $FarmPubDirUrl variable to the correct location, so that I don't need to copy them.) Petko --- Change log : http://www.pmwiki.org/wiki/PmWiki/ChangeLog Release notes : http://www.pmwiki.org/wiki/PmWiki/ReleaseNotes If you upgrade : http://www.pmwiki.org/wiki/PmWiki/Upgrades From nzskiwi at gmail.com Sun Jul 17 02:31:25 2016 From: nzskiwi at gmail.com (Simon) Date: Sun, 17 Jul 2016 19:31:25 +1200 Subject: [pmwiki-users] Using Page Text Variables in a pagelist Message-ID: In a page[1 ] I declare the page text variables (:Year:{(substr {$Name} 0 4)}:) (:MonthNum:{(ftime fmt=%m when="{$Namespaced}")}:) Note the page name is in the format yyyymonth. e.g "2016 April" I create a pagelist[2 ][3 ] with an order based on the page text variables (:pagelist group=FixtureCard name=2*,-*Half*,-*ClubNight* fmt=#grouptrail order=$:Year,$:MonthNum :) I'm not getting the order I expect from the pagelist. If anyone can suggest where I could look to get this to work I'd appreciate it tia Simon -------------- next part -------------- An HTML attachment was scrubbed... URL: From 5ko at 5ko.fr Sun Jul 17 03:39:59 2016 From: 5ko at 5ko.fr (Petko Yotov) Date: Sun, 17 Jul 2016 10:39:59 +0200 Subject: [pmwiki-users] Using Page Text Variables in a pagelist In-Reply-To: References: Message-ID: <6befb2f326926da416aac4715f0fbb77@5ko.fr> A misunderstanding about PageTextVariables comes up often. The reality is that the value is always the text that is written in the page. It is only evaluated when the variable is printed/output to HTML. So when you want to sort by that variable, all values in all pages are the not-yet-evaluated text strings, and the order function does what it can with them. It does not process/evaluate the text at this point. With your page names, it will be simpler to use a PageVariable, not a PageTextVariable: $FmtPV['$NameToYearMonth'] = 'strftime("%Y%m", strtotime($name))'; Then use (:pagelist order=$NameToYearMonth:) If this is not possible, writing in the wiki page: (:MonthNum:07:) might be easier for some than: (:MonthNum:{(ftime fmt=%m when="{$Namespaced}")}:) and this would work for ordering. Petko --- Change log : http://www.pmwiki.org/wiki/PmWiki/ChangeLog Release notes : http://www.pmwiki.org/wiki/PmWiki/ReleaseNotes If you upgrade : http://www.pmwiki.org/wiki/PmWiki/Upgrades On 2016-07-17 09:31, Simon wrote: > In a page[1 > ] I > declare the page text variables > > (:Year:{(substr {$Name} 0 4)}:) > (:MonthNum:{(ftime fmt=%m when="{$Namespaced}")}:) > > Note the page name is in the format yyyymonth. e.g "2016 April" > > > I create a pagelist[2 > ][3 > ] with an > order > based on the page text variables > (:pagelist group=FixtureCard name=2*,-*Half*,-*ClubNight* > fmt=#grouptrail > order=$:Year,$:MonthNum :) > > I'm not getting the order I expect from the pagelist. > > If anyone can suggest where I could look to get this to work I'd > appreciate > it From nzskiwi at gmail.com Sun Jul 17 05:06:42 2016 From: nzskiwi at gmail.com (Simon) Date: Sun, 17 Jul 2016 22:06:42 +1200 Subject: [pmwiki-users] Using Page Text Variables in a pagelist In-Reply-To: <6befb2f326926da416aac4715f0fbb77@5ko.fr> References: <6befb2f326926da416aac4715f0fbb77@5ko.fr> Message-ID: Thank you. Indeed the page text variable calculation which includes a markup expression does not embed in the pagelist. Appreciate your very quick reply. Now fixed, [1 ]. ____ http://kiwiwiki.nz On 17 July 2016 at 20:39, Petko Yotov <5ko at 5ko.fr> wrote: > A misunderstanding about PageTextVariables comes up often. > > The reality is that the value is always the text that is written in the > page. It is only evaluated when the variable is printed/output to HTML. So > when you want to sort by that variable, all values in all pages are the > not-yet-evaluated text strings, and the order function does what it can > with them. It does not process/evaluate the text at this point. > > With your page names, it will be simpler to use a PageVariable, not a > PageTextVariable: > > $FmtPV['$NameToYearMonth'] = 'strftime("%Y%m", strtotime($name))'; > > Then use (:pagelist order=$NameToYearMonth:) > > > If this is not possible, writing in the wiki page: > (:MonthNum:07:) > > might be easier for some than: > (:MonthNum:{(ftime fmt=%m when="{$Namespaced}")}:) > > and this would work for ordering. > > Petko > > --- > Change log : http://www.pmwiki.org/wiki/PmWiki/ChangeLog > Release notes : http://www.pmwiki.org/wiki/PmWiki/ReleaseNotes > If you upgrade : http://www.pmwiki.org/wiki/PmWiki/Upgrades > > > On 2016-07-17 09:31, Simon wrote: > >> In a page[1 ] >> I >> declare the page text variables >> >> (:Year:{(substr {$Name} 0 4)}:) >> (:MonthNum:{(ftime fmt=%m when="{$Namespaced}")}:) >> >> Note the page name is in the format yyyymonth. e.g "2016 April" >> >> >> I create a pagelist[2 >> ][3 >> ] with an order >> based on the page text variables >> (:pagelist group=FixtureCard name=2*,-*Half*,-*ClubNight* fmt=#grouptrail >> order=$:Year,$:MonthNum :) >> >> I'm not getting the order I expect from the pagelist. >> >> If anyone can suggest where I could look to get this to work I'd >> appreciate >> it >> > > _______________________________________________ > pmwiki-users mailing list > pmwiki-users at pmichaud.com > http://www.pmichaud.com/mailman/listinfo/pmwiki-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From design1 at softflow.uk Sun Jul 17 10:44:19 2016 From: design1 at softflow.uk (Hans) Date: Sun, 17 Jul 2016 16:44:19 +0100 Subject: [pmwiki-users] alignment styling question Message-ID: <1989243340.20160717164419@softflow.uk> I cannot remember if there is a wiki way to do the following: Have some normal left-aligned text, have a line break, have some text which is right-aligned. The wiki honours line breaks via config.php with $HTMLPNewline = '
'; I do not want an empty line in between the left and right aligned text. How can I do this? Is there a wiki style for this? Example 1: some normal text here, no empty line following. This follows immediately and is right aligned %right% wiki style would be perfect if it does not affect the previous or following lines. Example 2: Normal text line.... %right%right aligned text%% %center%centred text%% %left%left aligned text%% this is currently resolved to HTML:

Normal text line.... right aligned text centred text left aligned text

so the wiki styles are ignored. thanks for any tips! From 5ko at 5ko.fr Sun Jul 17 12:13:20 2016 From: 5ko at 5ko.fr (Petko Yotov) Date: Sun, 17 Jul 2016 19:13:20 +0200 Subject: [pmwiki-users] alignment styling question In-Reply-To: <1989243340.20160717164419@softflow.uk> References: <1989243340.20160717164419@softflow.uk> Message-ID: <9c704718221aa89441bbf3d177b5dbde@5ko.fr> You could use division blocks: >>left<< Left aligned text in div >>right<< Right aligned text in div >>center<< Centered text >><< Petko --- Change log : http://www.pmwiki.org/wiki/PmWiki/ChangeLog Release notes : http://www.pmwiki.org/wiki/PmWiki/ReleaseNotes If you upgrade : http://www.pmwiki.org/wiki/PmWiki/Upgrades On 2016-07-17 17:44, Hans wrote: > I cannot remember if there is a wiki way to do the following: > Have some normal left-aligned text, have a line break, have some text > which is right-aligned. > The wiki honours line breaks via config.php with > > $HTMLPNewline = '
'; > > I do not want an empty line in between the left and right aligned text. > How can I do this? Is there a wiki style for this? > > Example 1: > some normal text here, no empty line following. > This follows immediately and is right aligned > > %right% wiki style would be perfect if it does not affect the previous > or following lines. > > Example 2: > Normal text line.... > %right%right aligned text%% > %center%centred text%% > %left%left aligned text%% > > this is currently resolved to HTML: >

Normal text line.... > right aligned text > centred text > left aligned text >

> > so the wiki styles are ignored. From burggraaferik at gmail.com Thu Jul 21 12:47:02 2016 From: burggraaferik at gmail.com (erik burggraaf) Date: Thu, 21 Jul 2016 10:47:02 -0700 Subject: [pmwiki-users] spreading out my table rows? Message-ID: Hi all, This is probably very simple, but it's visual and I've never learned to do it because it's never come up. I have a table that looks very nice in pmwiki, except that the rows are too close together for visual appeal. I want to space the rows out a bit, but I don't want a visual border or gridlines. I also don't want the columns to change. I looked for a rowspacing tag in the table directives but all I found was cell spacing. I'm afraid this would proportionally adjust my columns and throw them off while making my rows look nice. Am I going to have to take care of this in the CSS? Thanks, Erik From languefrancaise at gmail.com Thu Jul 21 13:20:41 2016 From: languefrancaise at gmail.com (ABClf) Date: Thu, 21 Jul 2016 20:20:41 +0200 Subject: [pmwiki-users] spreading out my table rows? In-Reply-To: References: Message-ID: If it can help, why not adjusting default table with css, in you skin's css or local.css, if you agree to set such behaviour globally (or use a class if you prefer "on request" behaviour) ? td { padding-right: 5px; } Gilles. 2016-07-21 19:47 GMT+02:00 erik burggraaf : > Hi all, This is probably very simple, but it's visual and I've never learned to do it because it's never come up. I have a table that looks very nice in pmwiki, except that the rows are too close together for visual appeal. I want to space the rows out a bit, but I don't want a visual border or gridlines. I also don't want the columns to change. > > I looked for a rowspacing tag in the table directives but all I found was cell spacing. I'm afraid this would proportionally adjust my columns and throw them off while making my rows look nice. Am I going to have to take care of this in the CSS? > > Thanks, > > Erik > _______________________________________________ > pmwiki-users mailing list > pmwiki-users at pmichaud.com > http://www.pmichaud.com/mailman/listinfo/pmwiki-users From ccox at endlessnow.com Thu Jul 21 22:38:50 2016 From: ccox at endlessnow.com (Christopher Cox) Date: Thu, 21 Jul 2016 22:38:50 -0500 Subject: [pmwiki-users] spreading out my table rows? In-Reply-To: References: Message-ID: <5791954A.6090300@endlessnow.com> Consider: Enable wikistyle line-height in your config.php: $WikiStyleCSS[] = 'line-height'; The for a simple table: >>line-height=400pct<< ...your simple table here... >><< I didn't test with table directives, but will probably work there also. 400pct above is just for exaggeration to demonstrate effect. On 07/21/2016 01:20 PM, ABClf wrote: > If it can help, why not adjusting default table with css, in you > skin's css or local.css, if you agree to set such behaviour globally > (or use a class if you prefer "on request" behaviour) ? > > td { > padding-right: 5px; > } > > Gilles. > > 2016-07-21 19:47 GMT+02:00 erik burggraaf : >> Hi all, This is probably very simple, but it's visual and I've never learned to do it because it's never come up. I have a table that looks very nice in pmwiki, except that the rows are too close together for visual appeal. I want to space the rows out a bit, but I don't want a visual border or gridlines. I also don't want the columns to change. >> >> I looked for a rowspacing tag in the table directives but all I found was cell spacing. I'm afraid this would proportionally adjust my columns and throw them off while making my rows look nice. Am I going to have to take care of this in the CSS? >> >> Thanks, >> >> Erik >> _______________________________________________ >> pmwiki-users mailing list >> pmwiki-users at pmichaud.com >> http://www.pmichaud.com/mailman/listinfo/pmwiki-users > > _______________________________________________ > pmwiki-users mailing list > pmwiki-users at pmichaud.com > http://www.pmichaud.com/mailman/listinfo/pmwiki-users > From 5ko at 5ko.fr Fri Jul 22 05:22:57 2016 From: 5ko at 5ko.fr (Petko Yotov) Date: Fri, 22 Jul 2016 12:22:57 +0200 Subject: [pmwiki-users] spreading out my table rows? In-Reply-To: References: Message-ID: <350267c89424df12bc2ba4c928ccba45@5ko.fr> You can use the attributes border, cellpadding, cellspacing, rules, width: || border=1 cellspacing=0 cellpadding=5 rules=all "border=10" will make the outer border of the table 10 pixels thick, and the borders of individual cells 1 pixel thick. "border=0" will make both the outer border and the cell borders disappear. "cellspacing=1" will create 1 pixel empty space between individual cells. "cellspacing=10" will create 10 pixel empty space between individual cells. "cellspacing=0" will remove the empty space between individual cells "cellpadding=3" will create 3 pixels empty space between the cell borders (or limits) and the cell content, text or pictures. "rules=rows" will only show borders between rows, not between columns or cells "rules=cols" will only show borders between columns, not between rows or cells "rules=all" will show all borders between cells Most of the browsers display a table with "rules" attribute different than one without (collapsed borders of neighbor cells instead of separated). Note, while these attributes will work in most browsers, they are valid HTML4 but not HTML5. If you require valid HTML5, you should use CSS: table { border-spacing: 0px; border-collapse: collapse; } td, th { /*cells*/ padding: 4px; padding: 4px 8px 4px 8px; /*top right bottom left*/ } This CSS code can be adapted for your needs and placed in the file pub/css/local.css. It is true that all styling is visual, and thus not essential. Petko On 2016-07-21 19:47, erik burggraaf wrote: > Hi all, This is probably very simple, but it's visual and I've never > learned to do it because it's never come up. I have a table that > looks very nice in pmwiki, except that the rows are too close together > for visual appeal. I want to space the rows out a bit, but I don't > want a visual border or gridlines. I also don't want the columns to > change. > > I looked for a rowspacing tag in the table directives but all I found > was cell spacing. I'm afraid this would proportionally adjust my > columns and throw them off while making my rows look nice. Am I going > to have to take care of this in the CSS? From kirpi at kirpi.it Sun Jul 24 16:03:33 2016 From: kirpi at kirpi.it (kirpi at kirpi.it) Date: Sun, 24 Jul 2016 23:03:33 +0200 Subject: [pmwiki-users] Cross-site variables Message-ID: I have two websites in a cheap, shared hosting service, so most probably running in different servers outside my control. Say one is example.com and the other one is example.org Is there any way to "read" the PTVs of one site and show them on the other one? If I set $:VariableX on www.example.com/Group/Page there is absolutely no way to let someone type www.example.org/Group1/Page1 and have the $:VariableX displayed? As an alternative, no way to "rewrite" the www.example.com/Group/Page url to appear www.example.org/Group1/Page1 ? Thanks! Luigi -------------- next part -------------- An HTML attachment was scrubbed... URL: From languefrancaise at gmail.com Mon Jul 25 08:52:26 2016 From: languefrancaise at gmail.com (ABClf) Date: Mon, 25 Jul 2016 15:52:26 +0200 Subject: [pmwiki-users] Cross-site variables In-Reply-To: References: Message-ID: If that can help, for the alternative way, one quick step might be to evaluate if that old and tiny recipe would get the job done : http://www.pmwiki.org/wiki/Cookbook/IncludeWikiPage (I believe, because it is a sort of include, grabbing to siteA the source from external siteB page, it must have include limitations.) You might also consider of a file transfer/synchronization tool which would automatically copy file from site A to site B. You might also need to set up a farm, then use a specific file sharing recipe. Gilles. 2016-07-24 23:03 GMT+02:00 kirpi at kirpi.it : > I have two websites in a cheap, shared hosting service, so most probably > running in different servers outside my control. > Say one is example.com and the other one is example.org > > Is there any way to "read" the PTVs of one site and show them on the other > one? > If I set $:VariableX on www.example.com/Group/Page there is absolutely no > way to let someone type www.example.org/Group1/Page1 and have the > $:VariableX displayed? > > As an alternative, no way to "rewrite" the www.example.com/Group/Page url to > appear www.example.org/Group1/Page1 ? > > Thanks! > > Luigi > > _______________________________________________ > pmwiki-users mailing list > pmwiki-users at pmichaud.com > http://www.pmichaud.com/mailman/listinfo/pmwiki-users > From 5ko at 5ko.fr Mon Jul 25 16:12:29 2016 From: 5ko at 5ko.fr (Petko Yotov) Date: Mon, 25 Jul 2016 23:12:29 +0200 Subject: [pmwiki-users] Cross-site variables In-Reply-To: References: Message-ID: <078fa703cbb3ee0a2a04530cd22224c1@5ko.fr> On 2016-07-24 23:03, kirpi at kirpi.it wrote: > I have two websites in a cheap, shared hosting service, so most > probably > running in different servers outside my control. > Say one is example.com and the other one is example.org > > Is there any way to "read" the PTVs of one site and show them on the > other > one? > If I set $:VariableX on www.example.com/Group/Page there is absolutely > no > way to let someone type www.example.org/Group1/Page1 and have the > $:VariableX displayed? If the two wikis share the same wiki.d directory (same custom $WorkDir), and if both the group and the page names are the same, then it is possible. If they share the same wiki.d directory, and if the group and/or the page are not the same, you in one you can read the variable from the other: in Group1.Page1: {Group.Page$:VariableX} Or, you can make PmWiki believe the page name is Group.Page in config.php: if(preg_match('/^Group1[.\\/]Page1$/', $pagename)) $pagename = "Group.Page"; but then PmWiki will read from the file Group.Page not from Group1.Page1. > As an alternative, no way to "rewrite" the www.example.com/Group/Page > url > to appear www.example.org/Group1/Page1 ? To send the browsers to the other domain, in the .htaccess of example.com you can add a redirect: Redirect temp /Group/Page http://www.example.org/Group1/Page1 (or "Redirect permanent ..." after you tested it and it works as expected.) If both domains operate from the same document root, as well as share wiki.d, you can also use url rewriting: RewriteEngine On RewriteRule ^Group1/Page1 pmwiki.php?n=Group.Page [L] Petko --- Change log : http://www.pmwiki.org/wiki/PmWiki/ChangeLog Release notes : http://www.pmwiki.org/wiki/PmWiki/ReleaseNotes If you upgrade : http://www.pmwiki.org/wiki/PmWiki/Upgrades From patrice-pelle at bbox.fr Wed Jul 27 07:52:34 2016 From: patrice-pelle at bbox.fr (Patrice PELLE) Date: Wed, 27 Jul 2016 14:52:34 +0200 Subject: [pmwiki-users] How to get the value of a text field form before posting ? Message-ID: Hello, I am a true beginner in PHP and HTML. I am trying to make a form that I hope will someday end up in a cookbook. In the following test form, I would like to get the value of the input text before posting : Test
" method = post > Admin Password : How to get here the value of AdminMdP to make some PHP treatment (suffiscient length, special characters,?), any time the value is changed ?
I looked for some answers in the internet, but examples in jQuery, AJAX, JavaScript are useless for me. They suppose you know what it means, which is quite not my case. I told you, I?m a true beginner :) Thanks for your help Patrice patrice-pelle at bbox.fr -------------- next part -------------- An HTML attachment was scrubbed... URL: From pkay42 at gmail.com Wed Jul 27 11:27:19 2016 From: pkay42 at gmail.com (Peter Kay) Date: Wed, 27 Jul 2016 12:27:19 -0400 Subject: [pmwiki-users] How to get the value of a text field form before posting ? In-Reply-To: References: Message-ID: Let me ask you baseline question: how well do you understand the client/server nature of webpages? Which relates directly to the question: what exactly do you want each one of them to be doing with the form? --Peter On Wed, Jul 27, 2016 at 8:52 AM, Patrice PELLE wrote: > > Hello, > > I am a true beginner in PHP and HTML. I am trying to make a form that I hope > will someday end up in a cookbook. > > In the following test form, I would like to get the value of the input text > before posting : > > > > > > Test > > > > > > >
" method = post > > > Admin Password : > > How to get here the value of AdminMdP to make some PHP treatment > (suffiscient length, special characters,?), any time the value is changed ? > > >
> > > > if (isset($_POST['OkButton'])) > { > $AdminMdP = $_POST["AdminMdP"]; > echo $AdminMdP; > } > ?> > > I looked for some answers in the internet, but examples in jQuery, AJAX, > JavaScript are useless for me. They suppose you know what it means, which is > quite not my case. I told you, I?m a true beginner :) > > > Thanks for your help > > > Patrice > patrice-pelle at bbox.fr > > _______________________________________________ > pmwiki-users mailing list > pmwiki-users at pmichaud.com > http://www.pmichaud.com/mailman/listinfo/pmwiki-users > From patrice-pelle at bbox.fr Wed Jul 27 11:46:41 2016 From: patrice-pelle at bbox.fr (Patrice PELLE) Date: Wed, 27 Jul 2016 18:46:41 +0200 Subject: [pmwiki-users] How to get the value of a text field form before posting ? In-Reply-To: References: Message-ID: <44513C40-4B69-4B64-AAC8-95531E9961BC@bbox.fr> Hi, to answer your question, I can?t assess my knowledge. To put it with my words and my understanding : i would like to display a form to be filled , I think client side I would like to make a first processing of some data, at the input time. The purpose of this treatment is, for example, to give specific information depending on the input, to help the person filling the form to understand what he is doing. A very basic example : display either ? Mr? or "Mrs ? depending on the check of a radio button, to check some input property to be sure that the input is valid. A basic example would be to check the length of a password. In my opinion, it?s no need to send improper data to the server. I think this should still be client side. When the form is filled, the user click the submit button, and the valid data are processed on the server (for example storage in some file server side). Globally, this last part seems to work. I get some difficulties due to typing error, ? (,{? mismatch, ? ; ? forgotten or extra. Just being patient Does it answer your baseline question ? Thanks Patrice > Le 27 juil. 2016 ? 18:27, Peter Kay a ?crit : > > Let me ask you baseline question: how well do you understand the > client/server nature of webpages? > > Which relates directly to the question: what exactly do you want each > one of them to be doing with the form? > > --Peter > > On Wed, Jul 27, 2016 at 8:52 AM, Patrice PELLE wrote: >> >> Hello, >> >> I am a true beginner in PHP and HTML. I am trying to make a form that I hope >> will someday end up in a cookbook. >> >> In the following test form, I would like to get the value of the input text >> before posting : >> >> >> >> >> >> Test >> >> >> >> >> >> >>
" method = post > >> >> Admin Password : >> >> How to get here the value of AdminMdP to make some PHP treatment >> (suffiscient length, special characters,?), any time the value is changed ? >> >> >>
>> >> >> > >> if (isset($_POST['OkButton'])) >> { >> $AdminMdP = $_POST["AdminMdP"]; >> echo $AdminMdP; >> } >> ?> >> >> I looked for some answers in the internet, but examples in jQuery, AJAX, >> JavaScript are useless for me. They suppose you know what it means, which is >> quite not my case. I told you, I?m a true beginner :) >> >> >> Thanks for your help >> >> >> Patrice >> patrice-pelle at bbox.fr >> >> _______________________________________________ >> pmwiki-users mailing list >> pmwiki-users at pmichaud.com >> http://www.pmichaud.com/mailman/listinfo/pmwiki-users >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pkay42 at gmail.com Wed Jul 27 13:34:59 2016 From: pkay42 at gmail.com (Peter Kay) Date: Wed, 27 Jul 2016 14:34:59 -0400 Subject: [pmwiki-users] How to get the value of a text field form before posting ? In-Reply-To: <44513C40-4B69-4B64-AAC8-95531E9961BC@bbox.fr> References: <44513C40-4B69-4B64-AAC8-95531E9961BC@bbox.fr> Message-ID: Yes. A few points: * Any processing done client side is (by default) going to be javascript. * Don't trust client-side processing. Someone WILL screw things up, turn off javascript, have weird settings etc. So by all means do it, but also check server-side (i.e., php after the action handler picks it up) because you can't trust client-side. * You might as well have "No answer" or something like that in addition to "Mr" and "Mrs" * Be aware there is no security on a password field - it's still plain text for the world to see unless you're doing https. Javascript's not impossible to work with, and there are some good beginner sites out there (there are fewer intermediate sites, but that's the way it goes :p ) You can probably get a good idea how people are handling such things by looking at code. Even some of the cookbook recipes would be quite instructional. HTH, --Peter On Wed, Jul 27, 2016 at 12:46 PM, Patrice PELLE wrote: > Hi, > > to answer your question, I can?t assess my knowledge. To put it with my > words and my understanding : > > i would like to display a form to be filled , I think client side > I would like to make a first processing of some data, at the input time. The > purpose of this treatment is, for example, > > to give specific information depending on the input, to help the person > filling the form to understand what he is doing. A very basic example : > display either ? Mr? or "Mrs ? depending on the check of a radio button, > to check some input property to be sure that the input is valid. A basic > example would be to check the length of a password. In my opinion, it?s no > need to send improper data to the server. > > I think this should still be client side. > > When the form is filled, the user click the submit button, and the valid > data are processed on the server (for example storage in some file server > side). Globally, this last part seems to work. I get some difficulties due > to typing error, ? (,{? mismatch, ? ; ? forgotten or extra. Just being > patient > > Does it answer your baseline question ? > > Thanks > > Patrice > > > > Le 27 juil. 2016 ? 18:27, Peter Kay a ?crit : > > Let me ask you baseline question: how well do you understand the > client/server nature of webpages? > > Which relates directly to the question: what exactly do you want each > one of them to be doing with the form? > > --Peter > > > On Wed, Jul 27, 2016 at 8:52 AM, Patrice PELLE > wrote: > > > Hello, > > I am a true beginner in PHP and HTML. I am trying to make a form that I hope > will someday end up in a cookbook. > > In the following test form, I would like to get the value of the input text > before posting : > > > > > > Test > > > > > > >
" method = post > > > Admin Password : > > How to get here the value of AdminMdP to make some PHP treatment > (suffiscient length, special characters,?), any time the value is changed ? > > >
> > > > if (isset($_POST['OkButton'])) > { > $AdminMdP = $_POST["AdminMdP"]; > echo $AdminMdP; > } > ?> > > I looked for some answers in the internet, but examples in jQuery, AJAX, > JavaScript are useless for me. They suppose you know what it means, which is > quite not my case. I told you, I?m a true beginner :) > > > Thanks for your help > > > Patrice > patrice-pelle at bbox.fr > > _______________________________________________ > pmwiki-users mailing list > pmwiki-users at pmichaud.com > http://www.pmichaud.com/mailman/listinfo/pmwiki-users > > > From kirpi at kirpi.it Wed Jul 27 15:04:36 2016 From: kirpi at kirpi.it (kirpi at kirpi.it) Date: Wed, 27 Jul 2016 22:04:36 +0200 Subject: [pmwiki-users] Cross-site variables Message-ID: Dear Gilles and Petko, *really* thank you for your ideas and hints. I'm trying to put them in practice and will report any further advancement. Luigi From 5ko at 5ko.fr Sat Jul 30 11:55:38 2016 From: 5ko at 5ko.fr (Petko Yotov) Date: Sat, 30 Jul 2016 18:55:38 +0200 Subject: [pmwiki-users] PmWiki 2.2.89 released Message-ID: Hello. PmWiki version 2.2.89 was published today, and is available at: http://www.pmwiki.org/pub/pmwiki/pmwiki-2.2.89.tgz http://www.pmwiki.org/pub/pmwiki/pmwiki-2.2.89.zip svn://www.pmwiki.org/pmwiki/tags/latest This version allows to set a default class name for simple tables. The (:searchbox:) directive can now have a "placeholder" attribute, and the input type can be changed from "text" to "search" for HTML5 websites. The edit form elements have now identifier attributes to allow easier styling. All core scripts will now inject CSS into the skin only if it hasn't already been defined. The vardoc.php script now recognizes and links to the documentation for the variables $pagename, $Author and $Skin. The documentation was updated. Thanks, Petko -- Change log : http://www.pmwiki.org/wiki/PmWiki/ChangeLog Release notes : http://www.pmwiki.org/wiki/PmWiki/ReleaseNotes If you upgrade : http://www.pmwiki.org/wiki/PmWiki/Upgrades