Jump to content

Manaus

Members
  • Posts

    209
  • Joined

  • Last visited

Everything posted by Manaus

  1. 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!!
  2. 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!!
  3. 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!
  4. 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...!
  5. 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)..
  6. 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!..
  7. 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... !
  8. 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.
  9. 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
  10. Reading 'Learn CF in a Week' by Simon Free, Emily Christiansen, Tim Cunningham... via @marvinreader http://t.co/ebzOEUkZgZ

  11. RT @SaraSoueidan: Retweet if you wish @twitter had markdown support (including simple code highlighting with ``)

  12. 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
  13. 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!
  14. really I can't make friends with mac unix system: usr/lib, usr/local bin sbin opt (?!) what's the rationale?

  15. bariol, a new rounded font designed by atipo. download it for free: http://t.co/D4Jsi24Ykl

  16. RT @shanestillwell: Groupon moved from RoR to @Nodejs and is serving 50K req per min. Cool! https://t.co/TK9N793unw

  17. Hello, is there a way to select 10 pages and delete them in a single click, in the admin panel? Thank you very much
  18. RT @gittower: We're giving away 3 licenses for the popular text editor @chocolatapp ! Retweet for a chance to win: http://t.co/Egrnj9TbF6 (…

  19. I just bought Dash, a OS X Documentation Browser for 80+ APIs http://t.co/nS9KUeuqMe

  20. 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
  21. Hello, is there some way to extend the users template with First name, Second name and so on? Thank you very much
  22. 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
  23. That was easier than imagined: $progetti = $pages->find("parent=$parent, user=$user->id");
  24. 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.
×
×
  • Create New...