-
Posts
212 -
Joined
-
Last visited
Posts posted by Manaus
-
-
Hello,
I can't see a role "halfsuperuser" I just created within the page access permissions ("Who can access this page?")... I can only see guest and super-user.
How can I see the new one?
Thanks! -
Thanks Adrian.
I can't find last in the documentation, just last() (which is behaving differently, as it seems)
Any hint where I can look?
Thanks!
-
Hello,
I'm trying to ckech whether a user is allowed to see a specific page. The page has a Page field, holding the assigned users. I tried $page->allowedusers = $user, $page->has($user) and so on, but it's not working...
Thanks for any help.
-
Great, thanks!!!
-
Hello,
I'm trying to create a new user from the API, this is my code:
$u = $users->add($csvnome); $u->save(); $u->of(false); // $u->save(); $u->azienda = $csvazienda; $u->pass = $csvpass; $u->email = $csvemail; $u->nome = $csvnome; $u->save(); $u->addRole("utente"); $u->save(); $u->of(true);
I get this error: Error: Exception: Can't save page 0: : Pages of type NullPage are not
saveable (in /Users/utente/Sites/gammapw/wire/core/Pages.php line 514)I suppose this is not the right way to create a new user?
Thanks!!
-
Thanks so much Matthew for publishing the code
Thanks Dragan
Well I have a Project $page which is, say "Project Bluemoon". I need to add users to this project, and since they might be dozens, the client asked me to make a form. Upon uploading the csv rows, this is the logic:
if (user exists) {
add user to Project
} else {
add user to $users;
add user to Project;
}
Each Csv row contains username, email, password, project_code
That's it... !
Thanks!!
-
Hello,
is there any way to use ImportCsv functions from the front end? I need to make a page where the user uploads a csv file and then values are added to some page
Thanks!
-
Hello,
I added a crop image field in the user template, and set the field to accepting 1 file only. I upload the image via the front end using these values:
$a->setMaxFiles(1);
$a->setOverwrite(true);
Now, if I upload an image via the back end or the front end, the image field keeps many images.
This resolves in a code trouble: if I try to print $page->createdUser->image->getThumb('micro') I get a string: the first image, but I need the last one. Btw printing $user->image I get an array, but it’s not what I need. Tried of course $page->createdUser->image->last()->getThumb('micro'), but returns an error "Pageimage::last does not exist or is not callable in this context"
Thanks for any suggestion...! -
For example I have
Project 1
Links
Link 1
Link 2
Link 3
Posts
Post 1
Post 2
Post 3
I need to unpublish all of these, I was wandering if there is something like $pages->delete($page, true), that is $pages->unpublish($page, true)..
-
Thanks Dragan,
I don't think I got it, I need to hide programmatically a branch of pages, and with Page::statusUnpublished I see I can hide only the root page.
Is there any way to make it the easy way?...
Thanks!..
-
Hello,
what is the behaviour of unpublished pages children?
In the admin I see them as published, but if I query them via the Api, I see an Internal Server Error ("Call to a member function children() on a non-object").
Should I unpublish children and grandchildren recursively?
Thanks... !
-
Hello,
I need to delete children and subchildren of a page, this is the code I'm using:
$ch = $tobedeleted->children(); foreach ($ch as $c) { echo $c->title; // works if ($c->id) $c->delete(); }
Still I get an alert telling that the page cannot deleted because it has children.
Thanks for any suggestion.
-
Hello,
I need to import a list of users, it can be like this:
User1, Project1
User2, Project1
And so on.
In the future the client might give me a list like this:
User1, Project1
User2, Project2
User3, Project2
I need to make sure the second import doesn't change User2 values (i.e., remove Project1), but just add a new Project to his relations.
Can this be done with the ImportCsv plugin?
Thank you very much
-
Hello,
I need to upload an image to the user page, can anybody point me out the basic code for this?
This is my code
if ($input->post->avatar) { $user->images = $input->post->avatar; $user->save(); }
Thank you very much
-
Hello,
I'm making a field-reset page for the user password, which $sanitizer could I use? -- btw, is there a module for this?
Thanks!
-
Hello,
is there a way to select 10 pages and delete them in a single click, in the admin panel?
Thank you very much
-
Hello,
my user (41) logs in, I need to know if he has permission to see that page. To enforce granularity, each page has a 'user' field, for example (41|1010).
How do I check whether the user can see that page? I'm evaluating the strpos php function, but I fear it might lead to error. Note it's not about roles, each user can see one or more pages.
Thank you very much
-
Hello,
is there some way to extend the users template with First name, Second name and so on?
Thank you very much
-
Hello,
I need to access a page provinding a specific url parameter, such as ?project=14
Before accessing, the user should authenticate. Is this doable? If so, can you provide some hint?
Thank you very much
-
That was easier than imagined:
$progetti = $pages->find("parent=$parent, user=$user->id");
-
1
-
-
Hello,
I have a template where there's a Page field "utente" containing a user. I want to query the pages like this:
$progetti = $pages->find("parent=$parent, utente=$user->email");
But I'm getting a Internal Server Error.
Thanks for any suggestion.
-
Oh I see now I'm starting to get a grip on this
Thanks and sorry for the dumbness
-
Thanks Ryan!
I'm wondering how to query the pages so to find all pages with user = loggeduser... I'm trying this one:
$annunci = $pages->find("parent=/bacheca/, sort=-date, title!=new, limit=20, createdUser=$user->id");
But it doesn't seem to work.
Thanks!!
-
Hello,
I'd like to add the user who wrote the post to the page data (either guest, or the logged in user), this is the code I'm currently using
$form = $modules->get('FormTemplateProcessor'); $form->template = $templates->get('annuncio'); // required $form->requiredFields = array('title', 'body'); $form->parent = $page->parent; // optional, saves form as page echo $form->render(); // draw form or process submitted form
Btw, using this code I get all the fields I put in the template, so rendering the user field generates a dropdown selectable list of users...
Thanks for any advice!
Markdown & Textile
in Dev Talk
Posted
I vastly prefer Textile over Markdown: the *thing* appears as _this_ and **this** is different from *this*...
What's more, on Italian keyboards you don't have the ` sign. I'm wondering what about French, Spanish etc.
Pros in textile are bold, italic, links notation, and so many other things.
Cons is titles, I agree, and popularity.