Hello everyone,
I have to create a site where registered users can create ads.
I should therefore make sure that a web user can create a resource.
You know what I could do with Modx?
thanks to all
"Destiny is not a matter of chance, it's a matter of choice"
Thx TimGS.
Unfortunally i'm not able... when a web user try to create new resource: "Error - Creation of new resources not allowed.". Why?????? :-(
"Destiny is not a matter of chance, it's a matter of choice"
Thx Tim,
yes this is my call...
[!ResourceEditor? &formtpl=`pk.news.input.tpl` &tvfields=`img1,img2,img3,img4` &requiredFields=`pagetitle,introtext` &aliastitle=`1` &canpost=`` &logging=`1` &folder=`308` &editOnly=`0` &template=`annuncio` !]
but this is the output: Creation of new resources not allowed.
The problem is in ResourceEditor snippet at line 440:
// check if current webuser has rights
if(!$allowAnyPost && !$modx->isMemberOfWebGroup($postgrp)) return 'You are not allowed to publish articles';
to solve this issue i have put $allowAnyPost=true;
and now it's works.... but is not great solution :-(
"Destiny is not a matter of chance, it's a matter of choice"
Tim, another question:
i have a tv named img1, and it's a image.
in the form for create new resource how i can upload new image?
This not work :-(
<input class="field" type="file" value="[+img1+]" size="10" maxlength="255" name="img1">
Many thx
"Destiny is not a matter of chance, it's a matter of choice"
Hi,
First issue - if the output is "Creation of new resources not allowed", then the problem is nothing to do with line 440, which returns something quite different! If you are actually getting "You are not allowed to publish articles" from line 440, then try not passing a value of any sort for &canPost. I suspect there may be a small bug where passing &canPost=`` results in unintended behaviour, whereas missing it off entirely should be fine.
Regarding your file issue, saying "This not work" whilst undoubtably true is not going to help anyone help you - you need to report which error messages occur. If none occur, that is also something to report. If you post more info I may be able to help.
-- Tim.
Quote from: TimGS at Nov 20, 2012, 05:18 AM
Regarding your file issue, saying "This not work" whilst undoubtably true is not going to help anyone help you - you need to report which error messages occur. If none occur, that is also something to report. If you post more info I may be able to help.
-- Tim.
Hi Tim,
the form not send me any errors :-(
but the image is not uploaded and the tv img1 in the resource still empty.
Which information can be useful to solve the problem?
This is my form template:
<form name="NewsEditor" method="post" action="[~[*id*]~]" enctype="multipart/form-data">
<fieldset>
Titolo Annuncio:<br /><input name="pagetitle" type="text" size="40" value="[+pagetitle+]" /><br />
Descrizione breve:<br /><textarea name="introtext" cols="50" rows="5">[+introtext+]</textarea><br />
Contenuto annuncio:<br /><textarea name="content" cols="50" rows="8">[+content+]</textarea><br />
Condizioni: <br /><fieldset name="condizioni" id="condizioni">[+condizioni+]</fieldset><br />
Categoria: <br /><fieldset name="categoria" id="condizioni">[+categoria+]</fieldset><br />
Autore: <br /><fieldset name="autore-annuncio" id="condizioni" value="[+username+]">[+username+][+fullname+]</fieldset><br />
<span class="edLabel"><label for="title">Foto del prodotto </label></span>
<input class="field" type="file" value="[+img1+]" size="10" maxlength="255" name="img1">
<fieldset>
<input name="NewsEditorForm" type="hidden" value="on" />
<input name="editid" type="hidden" value="[+editid+]" />
<input name="send" type="submit" value="Submit" />
</fieldset>
</form>
[ed. note: fabryshock last edited this post 13 years, 10 months ago.]
"Destiny is not a matter of chance, it's a matter of choice"
This works!!!! enjoy
Foto del prodotto <br/>
<input class="field" type="file" value="[+img1+]" size="30" maxlength="255" name="img1" /><br/>
<input class="field" type="file" value="[+img2+]" size="30" maxlength="255" name="img2" /><br/>
<input class="field" type="file" value="[+img3+]" size="30" maxlength="255" name="img3" /><br/>
<input class="field" type="file" value="[+img4+]" size="30" maxlength="255" name="img4" /><br/>
<input class="field" type="file" value="[+img5+]" size="30" maxlength="255" name="img5" /><br/>
<input class="field" type="file" value="[+img6+]" size="30" maxlength="255" name="img6" /><br/>
</fieldset>
Many thx
"Destiny is not a matter of chance, it's a matter of choice"