|
Cookbook /
Fox-CommentsBack to Fox Please leave latest comment or question at the top of this section:Hans, As always, thanks for your quick fixes. I'm probably asking a very simplistic question. As of now, this is what is in my config file for fox security: $group = PageVar($pagename, '$Group'); if ($group=='Main') if ($group=='Custom') { $FoxAuth = 'read'; $FoxPagePermissions['Main.*'] = 'add'; $FoxPagePermissions['Custom.*'] = 'add'; } #allow all foxactions on all pages for admin #(Site and SiteAdmin groups remain excluded) if (CondAuth($pagename,'admin')) { $EnableFoxUrlInput = 'true'; $FoxPagePermissions['*.*'] = 'all'; }
include_once(" Basically, the issue is that I would like to have more than one group that has Fox permissions. Normally I had the Main group and that worked fine. Now I need to add more groups (such as the Custom group), so I added them as above (which of course I'm not a programmer so you can see my lack of understanding...although I try). Now Fox doesn't work at all. How should I proceed? Thanks, Real Chris November 03, 2008, at 04:33 AM
if ($group=='Main' OR $group=='Custom') $FoxAuth = 'read'; $FoxPagePermissions['Main.*'] = 'add'; $FoxPagePermissions['Custom.*'] = 'add'; Ha! I tried that one before, although not like this Hi, Hans It appears that foxcopy does in fact not copy everything. If a template includes a title, then the title is not copied even if the markup exists. The reason is that 'title' is a key of its own in the template page together with time, diff, author etc. and it is incorrectly left out from the target (see PageFileFormat). The copied file does not work properly in pagelists sorting on title for instance. Could this be fixed in the next release? JHJ November 1, 2008 at 15:15 pm Sorry to remind you, but could you please react to this issue. It seems to be a bug in the current fox.php. Pages that include a title markup Sorry, I have no fix for this yet. You are right, foxcopy ignores any page attributes including a title, and copies simply the template content unaltered, with no variable substitutions etc performed. So it is no real page copy, but a template copy. If your template contains a The problem is simply that the keyword 'title' is missing from the created file, even if it existed in the template-file. Template 'content' is indeed unaltered but the result is not in valid format for pmwiki. Keywords in pmwiki-files are generated by pmwiki so loading for editing and saving (without changes) will fix this type of problem in general. It may be enough to just save using an appropriate pmwiki-function? JHJ November 11, 2008 at 19:35. I updated fox.php and hope this works now, with no bad side-effects. I added 'SaveAttributes' to the EditFunctions array used by foxcopy. Quite a simple change really. Sorry for being so slow on this! - HansB November 11, 2008, at 05:11 PM Hans, I'm using a Cookbook file called Tracetrail http://www.pmwiki.org/wiki/Cookbook/TraceTrail (which you are familiar with since you authored tracetrail3.php and is the version I chose to use). I have installed that php file in my wiki which is currently running on the Triad skin. Also, I just recently installed Fox because I wanted to have some of its functionalities and the shoutbox possibility (http://www.pmwiki.org/wiki/Cookbook/FoxShoutboxAlternative). Anyway, somehow whenever I leave Fox commented in my config.php somehow Trace Trail instead of giving me the sites I've been to only gives me a "+" on my wikisite. Whenever I uncomment Fox, and leave Trace Trail commented, Trace Trail works again and I can see the names of the links I've been to. Is there a work around for this issue? I'm also using PMWiki pmwiki-2.2.0-beta65, which of course is fairly recent. Real Chris October 20, 2008, at 11:58 AM Edit: Forgot to mention that I have uncommented the security settings in Fox for the time being to see how I can fix this issue.
$TraceLinkFmt = '* [[{$PageName}]]';
I do not see the connection with fox.php though. i though t the Hans, You're a genius! Yes, the markup I've been playing with this shoutbox markup, but the look of the shoutbox is pretty generic. I'm not sure if I want to keep it. On a side note, I just used the example you gave: # allow comment posting for all visitors in group 'Public'
$group = PageVar($pagename, '$Group');
if ($group=='Main') {
$FoxAuth = 'read';
$FoxPagePermissions['Public.*'] = 'add';
}
#allow all foxactions on all pages for admin
# (Site and SiteAdmin groups remain excluded)
if (CondAuth($pagename,'admin')) {
$EnableFoxUrlInput = 'true';
$FoxPagePermissions['*.*'] = 'all';
}
I did change the Main variable, but I still need to play with these security settings. One thing I don't like from the shoutbox is that when I click on "Submit" it has to reload the wikipage, which is beside the point of having a shoutbox (should be done without having to keep resubmitting the wikipage). It seems to be more of a blog... ;-) Thanks again! Real Chris October 20, 2008, at 12:28 PM I am using the following foxform with no problem.
(:fox testform target=Eop.Test2 ptvtarget=Test2 template=#test :)
(:foxmessage:)
Just some text:(:input text $:text :)
(:input submit post "Submit":)
(:foxend testform:)
(:if false:)
[#test]
{$$text}
[#testend]
(:ifend:)
However using the same form and replacing line 1 with (:fox testform target=Test2 ptvtarget=Test2 template=#test :) or replacing line 1 with (:fox testform target=Eop.Test2 ptvtarget=Eop.Test2 template=#test3 :) both gives the following error: no target specified. I cannot reproduce this error. Do you use the latest fox.php? There was a correction in version 2008-09-10 to fix "no target" errors. - HansB September 25, 2008, at 04:56 AM PS: the template parameter in your example is irrelevant (not used), nor is the target parameter, because you use Indeed upgrading to latest fox.php resolved this issue. I was using 2008-09-09. Sorry I should have spotted that earlier - my oversight. Foxedit and Radio / Select InputsThanks for the tip below - this works fine. I would like the user to only be able to select from a range of colours in the editform. However I am finding that when I use either a Radio or Select Input type in the foxedit form, even though the page displays the input types correctly before the editable ptv's are loaded, after they are loaded the form always replaces these input types with a text input. Writing Red/Yellow/Green etc creates the correct behaviour so the form is working correctly, but I want to control what can be entered for this ptv. Can this be done? Are you saying that when editing using a custom foxedit form the form shows a text fields, even though you have radio input buttons in this form? Then please check your custom foxedit form and make sure it gets called with the foxedit link. - HansB September 23, 2008, at 03:51 AM Yes - And this is where my error was. Thanks for pointing me toward it. Graham? Changing a Cell Background Colour, using Fox and Foxedit.Using Fox I can set a cell background colour, ie.. Form:
Red: (:input radio status "Red":) Yellow: (:input radio status "Yellow":) Green: (:input radio status "Green":) White: (:input radio status "White":) Template Page:
Now I would like to edit - using Foxedit - this cell colour. To do this my input Form looks like: Red: (:input radio status "Red":)
Yellow: (:input radio status "Yellow":)
Green: (:input radio status "Green":)
White: (:input radio status "White":)
(:input hidden name=$:row '{$$(add {$:row} 1)}':)
And my template page looks like this:
But in doing it this way I find I can set the colour using the input form, but the Edit function doesn't update the ptv. Example: Using the input form to initially set the colour the page, after the input is made, looks like this:
However after clicking edit and changing the colour to "Yellow" the page looks like this:
I can't figure out why this is so. if you edit the PTV named Statusrowid then you need to post initially this as background value, i.e. your form template should have Another question for you =). Got the last issue working well in the end, although the variable image size caused me some problems. No problem to put Now I am making a flash map to insert into the wiki, and different locations in the map should (if this is possible) show text based on variables from the pages generated by the Fox form. Is there a way to export to xml, or otherwise make the variables readable for my flash movie? MikeD? 2008-09-18. I really have no idea, sorry! HansB Hi! I have two questions regarding the Fox recipe. I would not use FoxPostCount, but use a dedicated hidden PTV, like A suggestion what this would look like:
#foxbegin#
(:cellnr:){$$number}
(:cell valign=center:){$$name}
(:cell valign=center:){$:Born{$$number}}
(:cell valign=center:)[-({[foxedit section={$$number} form=Site.FoxTemplates#famform]})-]
(:cell align=center valign=center:)({[foxdelrange]})
(:Age{$$number}: {(sub {$Year} {$:Born{$$number}})}:)
(:Name{$$number}:{$$name}:)
(:Born{$$number}:{$$born}:)
#foxend#
Form:
(:foxmessages:) %comment For debugging with no redirect=1 set in form%%
(:table:)
(:fox unitlist redirect=1:)
(:foxadd put=aboveform template=FamilyTemplate target={*$FullName}:)
(:foxptv target={*$FullName} ptvfields=number :)
(:cellnr valign=center:)[+'''+'''+]
(:cell valign=center:)Name:(:input text name size=25 class=inputtext:)
(:cell valign=center:)Born: (:input text born size=5 class=inputtext:)
(:cell align=center valign=center:)(:input hidden number '{$$(add {$:number} 1)}':)(:input submit post " Add " class=inputbutton:)
(:foxend unitlist:)
(:tableend:)
(:number: 0:)
Thanks. Definitely better than my previous solution =). About the images: even if the age is 0, the width should not be 0px. So I should add another PTV, or a formula, that - as an example - can give the height as Calculations will not work as part of the template. You can do a calculation with the appropiate markup expression as part of the form submission process, usually by using something like Below are two lines from the form, the first one to calculate age works fins, while the second one to calculate height is not working at all. What could be the season for this? Whether I put $$ in front or not, it inevitably gets the value 21.MikeD?
(:Age{$$number}: {(sub {$Year} {$:Born{$$number}})}:)
(:Height{$$number}: {(add (mul (sub {$Year} {$:Born{$$number}}) 2) 19)}:)
what do you mean by "from the form"? In the template? Use a hidden input control to calculate the value of a variable, then use the var in your template. - HansB September 13, 2008, at 10:56 AM 2. I want to use a PTV to decide the size of a picture. Maybe I should ask this somewhere else, but it is the outcome of the abovementioned form, so I thought you might be able to help. The input variable {$$dateofbirth} is used to calculate the PTV {$:Age{$$number}}. The age should then decide the size of an image, but I have not been able to make this work. Not sure where your problem is. Can you calculate the age, and set it as a PTV? Can you use such PTV for an image width or height css property? This latter may well not be possible, i.e Hope you have some ideas, MikeD?, 2008-09-10 Ok, so I'm very impressed with the entire Fox recipe. It adds a lot of functionality to PMWiki. My question is, I'm looking for a PIM that would include the functionalities of Fox, but specifically I need something that would add a calendar function. I would like the people on my wiki to have a "personal" page that would include a calendar. Could Fox do something like this? Basically, their calendars would be included on their personal pages and would not be joined with each other. Thanks, Chris 8-25-08 You could combine PmCal with Fox, by using Fox forms to create PmCal pages. But you would need to create a new calendar group for every User. Or use a Fox form to add a line to the personal page, which includes a date and perhaps a delete link. A simple list can be created that way. I am not sure what you mean by a calendar on a user page. HansB August 27, 2008, at 12:31 PM Hans, what I mean is that users will be creating a page for their families (in a sense similar to myspace). I would like them to have some tool where they could edit their own calendar where, for example, they could remind another of anniversaries, birthdays and other important events. This is super beneficial because they would also password protect their family pages so that only people that should see them, could. I need it, however, where people would have their individual calendars, instead of a community calendar. So, for example, I wouldn't want Family A to put a doctor appointment (which could be personal) on a calendar that would be seen by every other family. Thanks, Chris 8-28-08 Could you not have a group of wiki pages per user? That would make things a lot simpler. And each group can be password protected. At present there is no "calendar on one page" recipe. HansB August 28, 2008, at 06:34 AM Thanks so much Hans. Got it all working perfectly!!! THanks for the explanation Hans. Unfortunately it still is not posting the form information into the page bellow the header. It isnt going anywhere at all, just disapearing from the form. http://www.botanybaywatch.com.au/pmwiki/pmwiki.php?n=Sighting.Marine-WeedySeaDragon If you type info into the fields then process it, the info just goes away to no where. The main reason for me wanting the form to be in the header is so that it self populates when people make a new species page. therefor allowing them to report about the species straight away, and makeing less work for the site administrators. Thanks again Hans. :) I did a few changes, but discovered that you need to set FoxPagePermissions to allow Fox to add content in the group. Try Dear Hans, Thank you again for your help. I have tried to use Correct me if I am wrong, but am I supposed to correct it with the relevant information from my site? i.e. I am using it in this header: http://www.botanybaywatch.com.au/pmwiki/pmwiki.php?n=Sighting.GroupHeader Which is then used as a header for this group of pages: http://www.botanybaywatch.com.au/pmwiki/pmwiki.php?n=Sighting.Marine-WeedySeaDragon Will it just not work with the format that I am using for self generating pages? Cheers... Carl :) use Thank you so much HansB. The form works great! Do you know if you can set a fox form into a common header for a group of pages and still have it post the entered text under the header? I have been able to post it into the header, but havent been able to get it to post the entered information into the main page (under the header). It seems that when a fox form is posted into a header it no longer works. Is there any code to tell the form to post the information into the main section of the page? Try the fox form with this To whomb it may concern: I am developing a wiki based Volunteer Marine Monitoring Program website for my local area, Botany Bay. I am trying to write the code for a survey form in wiki and am having no luck getting it to work. Can someone look at the code and see where I am going wrong? Thanks in advanced. Here is your form fixed! - HansB July 06, 2008, at 09:41 AM
(:fox form1:)
|| class=firstrow border=0 cellspacing=0 width=50%
|| || || ||
||Volunteer Diver (First Last Name)||(:input text Volunteer size=20:)|| ||
||Date (dd/mm/yy)||(:input text Date size=20:)|| ||
||Time of Day (24 hour time)||(:input text Time size=20:)|| ||
||Location Name (Dive Site)||(:input select Location Bare_Island_East :)
(:input select Location Bare_Island_West :)
(:input select Location Monument :)
(:input select Location Sutherland_Point :)
(:input select Location Steps :)
(:input select Location Leap :)
(:input select Location Other :)|| ||
||Length of Dive (Minutes)||(:input text Duration size=20:)|| ||
||Depth of Sightings (Meters)||(:input text Depth size=20:)|| ||
||Water Temperature (Celcius)||(:input text Temp size=20:)|| ||
||Number of Individuals||(:input select Individuals Nil:)
(:input select Individuals One:)
(:input select Individuals Few :)
(:input select Individuals Abundant :)|| ||
||Approximate size of Individuals (cm's)||(:input text Size size=20:)|| ||
||Other Notes||(:input text Notes size=22:)|| ||
|| ||(:input submit post "Enter":) ||
(:foxtemplate "||{$$Volunteer} ||{$$Date} ||{$$Time} ||{$$Location} ||{$$Duration} ||{$$Depth} ||{$$Temp} ||{$$Individuals} ||{$$Size} ||{$$Notes} || ||":)
(:foxend form1:)
[[#Report]]
!!!!Reports
----
||width=100%
||!Volunteer ||!Date ||!Time of Day ||!Dive Site ||!Length of Dive ||!Depth of Sightings ||!Water Temp ||!Number of Individuals ||!Approx Size (cm) ||!Other Notes || ||
(:foxprepend form1 :)
In fox.php the page number text used in multi-page output is hardcoded as 'Page' in two places. This means that one cannot translate fox-output to other languages using the normal $[Page] convention without changing the code. Could this be fixed for consistency? 18.06.2008, JHJ I cannot find it. Can you give me version and line numbers, or in which error message? Thanks! - HansB June 18, 2008, at 12:02 PM Sorry, in foxforum.php actually, lines 160 and 224. version 2008-03-30. - 19.8.2008, JHJ okay, thanks! I updated foxforum.php to use Hans, I am trying to create a search form for a (flat) database (a bib file using bibtexref, but this may not be important). I hand the parameter to the function as a page text variable. Since these are updated only after the page is written I have to hit the Submit button twice, which works but is not nice. I suppose I am doing this all wrong but couldn't think of something else. My problem would go away if ptvs were updated first. Is there a way to do this? Here is my code: (:fox bib ptvtarget=Test/Test ptvfields=myyear:)
(:input text myyear {$:myyear} size=4:)
(:input submit post "Submit":)
(:foxend bib:)
bibtexquery:[all.bib][$this->get('YEAR') == ''][!$this->get('PUBDATE')][5] bibtexquery is a function provided by the bibtexref recipe. Thanks in advance for any help. Rudi, May 17, 2008 Try adding redirect=1 to the This works. Thank you so much! Hans, I never did get my version of Fox ToDo all the way where I want it. I haven't really kept up with all your updates, but I was wondering whether you can tell me if there is now a way to accomplish the last step: deleting and posting with a single submit. Here is what I have so far:
What I still want to do is to delete the selected pending items at the same time that they are posted. If that is not possible, can you see another way to approach this so that I don't have to do two steps to move an item from one area to another? Here is the markup I am using right now:
!To Do
(:fox todo:)
(:foxtemplate (:input checkbox todocb[] '{$$todo}':) {$$todo} {[foxdelline]} [[<<]]:)
* (:input text todo size=65%:)(:input submit post Add:)
(:foxend todo:)
!!Pending Tasks
(:fox done:)
(:foxtemplate *{$$todocb[]}:)
(:foxprepend todo:)
(:input submit post "Completed":)
(:foxend done:)
!!Completed Tasks
(:foxprepend done:)
Pico May 17, 2008, at 01:39 PM Alternative: I really should be just using PTVs with a replace to toggle values between pending/complete, on/off, etc., and then doing some type of a list (pagelist based on an array PTVs in the current page filtered by the value (pending/complete, or on/off).
Alternative Recipe: Here is some inspired (hopefully not unwelcome) musing on a recipe I have been imagining for a long time: Create another type of PTV definition that holds a binary logic value (on/off, or true/false) where you could iterate (an array?) to generate a listing of all true, or false, values. The markup for that recipe could use something really minimal, such as a pair of brackets, "[]", at the start of a line, like list markup, to generate input check boxes and PTV containing a binary value. The names of those binary PTVs could be determined by text immediately following the "[]" markup. Or, following the list markup definition, the names of the PTV could be based on a value assigned in a list in which it appears. For example, the first order (parent) level of a list could identify a PTV array consisting of the values that appear in the next order (child) items of that list.
So that an array variable called "VarableName[]" could have three pairs of values (logic, string) like this: False,First; False,Second; False,Third. A conditional testing for VariableName[]=False would return all three values, or pairs. The list could be hidden in a conditional to define posted values that get posted after (or before) a given (parent) item level. Default values could be set by markup arguments in the parent item, or by a three character markup string, e.g. "[+] / [-]" or "[_] / [X]", like this:
So that a conditional testing for VariableName[]=True would return only the last two items. Pico May 17, 2008, at 06:43 PM Pico. I have not answered because I have no clever ideas for this problem of moving a line of text. Of course Fox can do several steps in one go: insert a line somewhere, and overwrite the original. Problem is how to identify it. Foxdelete works because it just replaces the line it is in with nothing. Some sort of foxmove link would be nice, but i don't know yet how to make the code for this. HansB May 19, 2008, at 06:26 AM Hi, I'm getting this when trying to use ptvfields=something Fatal error: [] operator not supported for strings in /home/....../cookbook/fox.php on line 1243 what have I messed up now? thanks, Perhaps you are using illegal ptv names? If not I need to know more details about the form and the ptvs. HansB table from fox inputHi, I'm trying to give input to a table, where the headings are fixed and the form is placed in the bottom row. The submit function is then supposed to create a new row between the form and the header, including an edit and delete link. I though I had set up something that could work, but apparently I have done someting wrong. The template looks roughly like this: #foxbegin#
(:cellnr:){$$number}
(:cell:){$$name}
(:cell:){$$date}
(:cell:)({[foxedit form=Site.FoxTemplates#unitlist]})
(:cell:){[foxdelrange ]}
#foxend#
...and the form is placed inside the same number of coloumns with Mike, you don't say what exactly is not working. Note that with your template you need to set in config.php To add a row number automatically:
I have set EnablePostDirectives, but when I submit, there is a processing period, but no content is added to the page. The form is placed like this: (:cell:)"last cell of heading" (:fox list put=aboveform template=(as above):) (:cellnr:)(:input text number size=5:) (:cell:)(:input text name size=25:) (:cell:)(:input select date ...:) (:cell colspan=2:)(:input submit post Add:) (:foxend list:) (:tableend:) MikeG? May 13, 2008, at 04:38 AM Perhaps page permissions are not set correctly? Add a Thanks a lot for your help. Got most of this working now, apart from the row numbers. When I add the first entry, I get RowNumber=1, but if I try to add a second entry the number stays the same. Unless I leave the page or reload, in which case it works all right. Reload also adds a new entry identical to the last one. How can this be avoided? MikeG? reload should never add a new entry! (:foxmessages:)
(:table border=1:)
(:fox frm put=aboveform template=#tablerow ptvfields=number ptvtarget={$FullName}:)
(:input hidden number '{$$(inc {$:number})}':)
(:cellnr:)
(:cell:)(:input text name:)
(:cell:)(:input text date '{$Now}':)
(:cell:)(:input submit post 'Add Row':)
(:foxend frm:)
(:tableend:)
(:number: 0:)
last row number = {$:number}
(:if false:)
[[#tablerow]]
#foxbegin#
(:cellnr:){$$number}
(:cell:){$$name}
(:cell:){$$date}
(:cell:)({[foxedit form=Site.FoxTemplates#unitlist]})
(:cell:){[foxdelrange]}
#foxend#
[[#tablerowend]]
(:ifend:)
In config.php I added a definition for markup expression $MarkupExpr['inc'] = 'MxInc($args[0])';
function MxInc ($arg) {
if(!is_numeric($arg)) return $arg;
return $arg + 1;
}
I might add this in future to fox.php for conveniance. But using The form adds a new row with the increased number. Note that I use here 'number' as input field name, which value is added by template The So what stopped it posting in the first place? - HansB Not sure. Could it have been the missing Will start inserting Also not sure how the edit template will look as I haven't put that together yet, but each line in the table produces a set of pvt's (also with incremental numbers) which I then plan to base the edit form on. MikeG? Good, that should be not too difficult then. Just add Decided to use One problem using FoxPostCount for generating post numbers is, that if you use foxedelete as well, posts can be deleted and the next new post will get a number which may be used already. - To post comments to a different page use for instance a target parameter like So the form creates a separate comment page, displayed on the main page by What happens when you click a delete link from the main page? Do you have a foxmessage markup to see error messages? - HansB
In config.php you need to have $EnableRelativePageVars = 1; - HansB javascript formcheck not working (i want to require an authorname)?hi - formcheck doesn't seem to work for me with the following fox form: (:fox cbox put=bottom template=Site.FoxCommentTemplate target={*$FullName}
formcheck=author redirect={*$Group}/MainPage cancelredirect={*$Group}/MainPage :)
... and later on, comes the author box: currently, neither Fixed now. Note formcheck=1 is not valid. You need to specify form field names, separated by commas. If you don't want this simple javascript check, but proper php validation, with custom messages, use markupo thanks. both seem to work alright now - however there seems to be a problem with and then later... when checking for captcha, it won't post the comment even if the captcha field is filled out correctly... This is because that did it. thanks again for the umpteenth time! overtones99 May 08, 2008, at 03:06 AM #anchors not working in redirect= field...hi. i'm trying to get my FoxCommentBox to redirect to the comment section at the bottom of a page. i'm setting redirect=MyGroup/Index#comments, and the anchor seems not to be appended to the path. (:fox cbox put=bottom template=Site.FoxCommentTemplateWhite target=Cookbook.Fox-Comments
redirect=MyGroup/Index#comments cancelredirect=MyGroup/Index#comments:)
is this working on your end? i'm currently running the latest version of Fox (5/1/08) To redirect to an anchor position one needs to supply a full url using the standard url syntax, not a short url. So use great. indeed it works. thanks. only issue now is purely aesthetic - the address for the page looks like from Hans:
Please see latest fox update, which improves the redirect greatly. redirect=Group.Page#anchor - HansB fox delete page action...hi. i'm having trouble getting a 'delete page' action to work (as described on FoxPageManagement). i created a page on my main site (let's called it if (CondAuth($pagename,'admin')) {
$EnableFoxUrlInput = 'true';
$FoxPagePermissions['*.*'] = 'all';
}
and in SiteAdmin.FoxConfig, i have: GroupOne.*: add,delete (if this is even necessary??) when i click the delete link, i'm redirected to the main group page, any idea what i might be doing wrong? i have the following fox files installed: thanks, adam Add hrm - seems like that would do it, but it still doesn't delete. it now redirects correctly, however... i wonder if it works on your end? overtones99 April 27, 2008, at 01:08 AM update: having now deleted Additional fox deletion problemsand in a similar area, i'm also unable to delete multiple pages using the Fox code from the bottom of FoxPageManagement. everytime i check off a page or two to delete, i get the msg, any idea what i might be doing wrong? $FoxNameFmt[] = '*.*';
$FoxAuth = 'read';
$EnablePostDirectives = true;
$EnableFoxDeleteMsg = true;
$FoxDeleteMsg = "Are you sure you want to delete this message?";
$EnablePostCaptchaRequired = 1;
if (CondAuth($pagename,'edit')) {
$EnableFoxUrlInput = 'true';
$FoxPagePermissions['*.*'] = 'all';
}
and then all my fox files are loaded, as well as powertools.php (which i have loading after fox loads - is that a problem?)... thanks again for all your help. overtones99 April 26, 2008, at 02:23 AM This looks like a $FoxPagePermissions problem. I don't know why $FoxPagePermissions['*.*'] = 'all'; is not recognised. Try for testing without the condition. Also try a group specific variation. - HansB thanks. i think i figured it out. in addition to my Risk of Fox Inclusion in main distribution...Hi - just wondering - how much risk is there in parts of Fox someday being included in the main distro of pmwiki? and if it ever is, do you think that the syntax would then change, i.e. all the (:foxwhatever's ...:) changing back to the originals? just wondering... overtones99 April 25, 2008, at 02:22 PM I don't think this will happen. Pm created PmForm. This may still improve, but I don't think it will ever be expanded to post to multiple target pages or other special things Fox does. And Fox is far too complex to have the slightest chance of being absorbed in the PmWiki core. Even PmForm will not be added to the distribution I think. HansB Lock/hide formsHi! I've been using Fox forms to update different sections of a reporting page, with bullet points and progress indicators. Is there a way, either on a specified date or by following a command link, to stop editing abilities and (1) export the headers and text to a new page, or (2) remove all input fields and forms from the page? Mike G? April 25, 2008, at 04:55 AM There should be no need to have the form on the page itself. It could be on some template page and either be included via a Thanks. Have set up FoxEdit links for each section on the page. The date conditional doesn't help me as long as I can't set time. Could you give me another example of conditional markup that could serve this purpose? To use authgroup doesn't work as all users can read and edit.Mike G? April 25, 2008, at 10:25 AM what condition do you really need, exactly? - HansB I'm using ExportDOC to save the page in Word format upon completion. What I need is a button that can disable the edit links and then, with If foxedit links or other form elements or include markup isadded to the page by Fox via a template, then you can add foxdelete links as well, either with range markers as a foxdelete range link, or if it is a single line as a foxdelete line link. Foxdelete links need to be added via template, a later addition does not work, as Fox adds a range or line id key, which the foxdelete needs to delete just the right line or range. Template for foxdelete link which deletes the range marked by the markers, including itself: #foxbegin#
....
{[foxdeleterange ]}
.....
#foxend#
- HansB Fox PermissionsHi - i've been looking at the permissions examples on the Fox cookbook page, and am wondering - is there a way to set separate 'read','edit' and 'admin' fox permissions for pages on SiteAdmin.FoxConfig?? or is it only possible to do this in config.php (as shown in the example on the Fox cookbook page)? thanks, adam overtones99 April 24, 2008, at 09:16 PM At present you cannot set $FoxAuth values in page FoxConfig. You can only set $FoxPagePermissions page pattern / values within FoxConfig. - HansB April 25, 2008, at 02:16 AM thanks! Custom Fox Delete Msg?can one set the confirmation msg that pops up when $EnableFoxDeleteMsg is set to true? right now mine is blank, except for the URL basename... $EnableFoxDeleteMsg = true; will enable the javascript delete confirmation. The default message is: "Please confirm: Do you want to delete this post?" Try setting $FoxDeleteMessage to the message you want. - HansB April 25, 2008, at 02:16 AM i'm on a mac, and in both firefox & safari the only message that shows by default is: "The page at http://blah.com says:", and then nothing following it. adding $FoxDeleteMessage, doesn't work, but $FoxDeleteMsg DOES. thanks!! overtones99 April 25, 2008, at 02:12 PM Input Value and LabelI want to make a simple form for progress report. 'label' is not directly available as an input value. So you may try something like this example test form: (:fox frm foxaction=display:)
(:input select choice "1 Assessed" label="Assessed":)
(:input select choice "2 Tested" label="Tested":)
(:input select choice "3 Approved" label="Approved":)
(:input hidden stage "{$$(substr '{$$choice}' 0 1)}":)
(:input hidden type "{$$(substr '{$$choice}' 2)}":)
(:foxtemplate "{$$stage} {$$type}":)
(:input submit post Enter:)
(:foxend frm:)
(:foxdisplay frm:)
This uses Works! But I am using one form to generate the pages for each unit, and a second form in the template for status updates. So the second form works well in the template, but when the page is generated, the If you want to post form templates, without having the replacement variables evaluated, use $$$ instead of $$ for each Conditional markup in fox formHi! I'm new to this and may not be doing things the easiest way always, but I am testing out the wiki as a project tool, and setting up a form for input of new registrations. The heading of each entry should contain "sector" "building" "floor number" and "door number", separated by a dash. Some entries don't have the door number, and should therefore just contain the other 3 variables. What I put in the form is this:
(:if equal {$$unitdoor} "":)
(:input hidden unit "{$$sector}{$$number}/{$$unitfloor}":)
(:else:)
(:input hidden unit "{$$sector}{$$number}/{$$unitfloor}/{$$unitdoor}":)
(:ifend:)
Still, Thanks! Mike G? April 19, 2008, at 12:30 AM Such conditionals are evaluated by PmWiki when the page gets created, not when the form gets submitted. fox has no built-in method using conditionals in the markup. But it can be done with the help of MarkupExprPlus. Install this recipe and then construct a markup expression which gets evaluated when the form gets submitted. Usual markup expressions get evaluated when the page gets created, but by using the syntax So perhaps you need something like this (all on one line!!):
'{$$sector}{$$number}/{$$unitfloor}' '{$$sector}{$$number}/{$$unitfloor}/{$$unitdoor}' )}" :)
Note I have not tested this! HansB April 19, 2008, at 01:18 PM Beautiful. Works like a dream. Thanks for the quick reply! Mike G? April 19, 2008, at 01:45 PM Posting to Fox-CommentsHi - i posted a question to to Fox-Comments and it got removed a day later. I wonder, what is the desired procedure for posting on this page? (It's odd having two places [here and the list] to potentially post questions)
Thanks! overtones99 March 30, 2008, at 05:27 PM I am sorry. I thought you would have noticed, but I moved your very relevant questions to FoxNotify-Comments, and replied there, since they related specifically to FoxNotify. I try to keep questions to the relevant Fox application or sub-module if possible, and keep this page for all general Fox specific issues. I don't mind really if questions get posted on Comment pages here, or to the user list. The user list is a little more direct and may get a faster response (but I do monitor all the Fox pages). The user list also offers direct email response, which may be better for possibly more lengthy correspondence. My apologies for any confusion! HansB March 30, 2008, at 05:50 PM oh great - didn't know that page existed! : ) i will take a look - thanks! overtones99 March 30, 2008, at 06:08 PM Fox examples?Hi, is there a page somewhere with a collection of working examples (i.e. not just code) of how Fox can be used? thanks! overtones99 March 12, 2008, at 11:26 PM You can find a number of working examples on my site. See http://softflow.org/design/Fox/Fox, and also the Forum on my site is running with Fox. HansB thanks. wondering if it might be appropriate to put links on the bottom of the main fox page to examples like those on your site? it's great to read about what Fox can do, but would be evermore enticing (and might make more sense to noobs like myself) with links to a couple examples sitting there ready to be clicked. just my 2cents. thanks! overtones99 March 15, 2008, at 01:24 AM Hi, this is probably a dumb question, but I just can't get fox to work properly. If I create a page with the following content, just nothing happens if I push the GO button:
(:fox mytest foxaction=display:)
(:foxtemplate "'{$$arg1}'":)
(:input text arg1:) (:input submit post GO:)
(:foxend mytest:)
-- (:foxdisplay mytest:) --
If I add the line foxaction=display outputs to markup foxdisplay, so foxappend should not be used or needed. you need the latest fox.php for foxaction=display, please check! Otherwise your form should work. For error reporting you can add markup Thanks four your help! When adding Whenever you get a Permission Denied error there is an issue with page permissions not being configured rightly. This is done with setting $FoxPagePermissions for the appropiate page pattern and to the foxactions one wants permitted. BUT it should work to display on the same page as the form is. So I will see if I can cure this bug for the next release. Thanks for your investigation and reporting this issue! HansB PS: To fix this bug remove Add a Link Downloads pmwiki.phpHi, I am trying to use select page to add a link at the bottom of the page. The template looks fine, but when i click 'add a link' mozzilla tries to open/download pmwiki.php. On PageListTemplates
[[#selectpage]]
(:template each:)(:input select pagelink[] "[[{=$FullName}|{=$Namespaced}]]" "{=$Namespaced}":)
(:template last:)(:input submit post "Add Link":)
[[#selectpageend]]
On Main.Test
(:fox selectcategory:)
(:foxtemplate "*{$$pagelink[]}":)
(:pagelist fmt=#selectpage group=Category name=-HomePage:)
(:foxend selectcategory:)
In config.php
$FoxAuth = 'ALWAYS';
$FoxNameFmt[] = '*.*';
$FoxConfigPageFmt = '{$SiteGroup}.FoxConfig';
include_once("$FarmD/cookbook/fox/fox.php"); // fox
Can you please let me know what you think the problem is. thanks x The input submit control should be in the fox form, not the pagelist template. $FoxPagePermissions['*.*'] = 'all';
Thanks for your help. I changed it, but when I click Add Link, its still tries to open up pmwiki.php. Is there some permissions I need to set somewhere? I don't think so. But since you added your reply here above the following code I like to ask if you changed the pagelist template and the fox form using the code below, and not just the config.php? If you did, do you use a recent new version of fox.php? HansB I did change the pagelist template, fox form and confi.php file. I downloaded fox.php from http://www.pmwiki.org/wiki/Cookbook/Fox within the past week so I believe its it the most recent version. Pagelist Template [[#selectpage]]
(:template each:)(:input select pagelink[] "[[{=$FullName}|{=$Namespaced}]]" "{=$Namespaced}":)
[[#selectpageend]]
Fox Form (:fox selectcategory:)
(:foxtemplate "*{$$pagelink[]}":)
(:pagelist fmt=#selectpage group=Category name=-HomePage:)
(:input submit post "Add Link":)
(:foxend selectcategory:)
HansB February 14, 2008, at 04:57 AM Problem after update from October 2007 versionAfter an upgrade from a version from October 2007 (around the 20th), my add-a-news-entry-page form fails to add forms. What happens with the new version of fox is that an error-message about the target page not existing is being displayed. After a downgrade to my old version, everything works fine again.
(:fox newnews template=News.Template redirect=1 :)
(:input hidden author value="{$Author}" :)
'''Title:''' \\
(:input text target size=30 value={$Today}- :) (e.g. ''{$Today}-MyNewsTitle'')
...
(:foxend newnews:)
I'm trying to add a news page while being logged in as admin user, with FoxAuth set to edit. Any help would be greatly appreciated - Nyhat February 9, 2008 It should work, the target page does not need to exist, it will be created. In the form above you do not give all details though. Try this form and see if it works (your form a little simplified):
(:fox newnews redirect=1 :)
(:foxtemplate "New News Page...":)
(:input hidden author value="{$Author}" :)
'''Title:''' \\
(:input text target size=30 :)
(:input submit post 'create page':)
(:foxend newnews:)
Fox template markup \n is NOT converted into a new line.For some reason all I get is "n" instead of an actual new line when I use "\n". No big deal but very weird. Don't know how but could it be a server thing? My host is extremely restrictive. Wasim February 06, 2008, at 03:10 AM Normally you would not use \n in Fox templates. You use standard wiki markup and Fox's delete button breaks PmWiki's email notification system for mePressing Fox's delete button causes duplicate emails to be sent out from my system for pages that I've set up for email notification. (I use PmWiki's NotifyList.) If I delete the same lines using PmWiki just one email notification goes out (the correct behavior). - RandyB February 4, 2008 Notify and Fox delete work fine for me on my site, i can't see the problem. HansB February 05, 2008, at 03:53 AM Thanks so much to Hans for helping me track down the bug, and to Petko for suggesting a clean workaround. For anyone else who encounters this problem, enable Notify with this conditional in config.php: if($action!='foxpost' && $action!='foxdelete' && $action!='comment') { } - RandyB February 13, 2008 Interferrence with changed Default pagesNot a question and maybe too specific, but I thought maybe this info might be useful in case it happens to someone else: I changed the default group from Main to About and the default page from HomePage to Main ( Anke January 10, 2008, at 11:47 AM The fox.php script calls function ResolvePageName, just in case it needs this. And ResolvePageName shall only be called after the changes you made to I'm confused about the way JonHaupt December 21, 2007, at 09:53 PM Thanks for your alert, Jon! I myself was confused, and bungled the last change. I have now fixed this bug, and the delete links and buttons should work with clean urls and without and correctly point to the target page. I added a switch checking for Thanks, Hans. It works on my blog, so I've gone ahead and updated it. I also have a test site, which for some reason it doesn't work on... That site also uses clean urls, but they are in the style Thanks, Jon! I forgot to declare ScriptUrl global in the FoxDeleteMarkup function. Fixed now. HansB December 22, 2007, at 01:30 PM Excellent, thanks! By the way, I've been using Fox to make a lot of projects easier lately--it really is a great system. - JonHaupt TextSection()Hello, I just installed Fox on my wiki and this is is what turns out (trying the FoxCommentBox): Fatal error: Call to undefined function TextSection() in [...]/cookbook/fox/fox.php on line 453 Ps: Thank you for pmwiki, I just needed something like that.
- Nick You need to use PmWiki 2.2.0 beta 45 or later. Function TextSection was added only then I think. HansB December 16, 2007, at 02:56 PM More on ToDo and PicklistsHans, I have gotten pretty close to where I wanted to get to using fox for todo and pick lists lists and I am wondering if you might have any ideas on how to go about the final step:
I posted a working example on your site at Test/FoxToDoTest Pico December 08, 2007, at 02:07 PM Pico, I can't see a way right now to have one form line deleted while it posts another line. Maybe with a fox filter function, but it need s to launch the delete action after the new content is added. I need to think on this. HansB December 08, 2007, at 04:17 PM Hi, I successfully used commentboxplus and I'm using fox version 2007-11-19, pmwiki-2.2.0-beta63 and build in blocklist. Comments are written to special pages, e.g comments for "page1" are witten to "page1-Kommentare". Maybe that's a problem? Thanks, NH Please try I made a few tests and blocklist didn't work with fox. Blocklist works with fox-forum. A quick and dirty hack is to insert the line NH If you add $EditFunctions = array(... and before line starting UpdatePage(...
this: global $EnableBlocklist;
if($EnableBlocklist)
array_unshift($EditFunctions, 'CheckBlocklist');
fox.php is now updated with this. HansB November 27, 2007, at 03:08 PM Yes, this works. Thanks for patch (and scripts). NH Summary= Argument: use an input field
|