Jump to content

Spica

Members
  • Posts

    122
  • Joined

  • Last visited

Everything posted by Spica

  1. I have a pagearray, each page has a location. I calculate the distance to a given location for each page's location. How would I best organize a sort of the pagearray on the distance. The distance is not a field of the pages but calculated. Hope I am clear enough.
  2. @kongondo: haha. yes. but what if I want to prevent others to click it? @LostKobrakai: wasnt there an automatic modules update with an core upgrade?
  3. How do prevent a module from upgrade?
  4. I now solved it like this //search the first viewable child and redirect public function ___execute() { $moduleChildren = $this->page->children; foreach ($moduleChildren as $modulechild) { if ($modulechild->viewable()) { $this->session->redirect($modulechild->url); return; } } }
  5. Hmm. This morning my code is running without errors. Maybe I was to tired. Thanks for the help anyway. To be save I now use if ($p->viewable()) { $session->redirect($p->url, false); } else { $session->redirect("./", false); }
  6. well, I shortened it. It has a parent, name, title and creaded user. here the full code $p = new Page(); $p->template = 'mytp'; $p->name = $myname; $p->parent_id = $myparentid; $p->name = $myName; $p->title = $mytitle; $p->created_users_id = $user->id; $p->save(); $session->redirect($p->url, false); Creation of pages is working. I used to stay at the page where new pages get created: $session->redirect("./", false); but now want to redirect to the newly created page
  7. $p = new Page(); $p->template = 'mytp'; $p->name = $myname; $p->save(); $session->redirect($p->url, false); The redirection fails. How to do it?
  8. I have some process Modules with own permission per module and assigned them to admin pages. Is it possible, to check by api if a user has access to one or all of these pages/processmodules? I only find how to check if a user has a certain permission. But what if I want to check generally if he has access, without knowledge of its permissions, e.g. to redirect to another page?
  9. I'd like to show (without editing) some parentpages textfields on a pages edit form. I tried too hook into buildFormContent or buildForm but do not succeed. Is that the right place and what do I need?
  10. Oh, I ve forgotten the cell output which needs the leading 0 stripped for an autom. call. Can do it in the template or do you see an adaption into your module? will check the new version immediately.
  11. Havent used the Repeater Matrix pro yet. PageTable seem too make the gui more complex as needed. Checkbox would be nice to toggle the extension on/off. But ist not a must have.
  12. Thanks, adrian, version works now for me very well. I already noticed the output format override, which already would be a good solution. But I thought of more convenience for users not to even get a extention input field when they want to add a cell number. Dont know if this anyhow makes sense.
  13. Your right, my mistake in transcription. Should be {([phoneAreaCode,0,1]) } But it seems, that the single 0 is interpreted as a non value. It is for German city codes, that start always with a 0. So there is a notation convention to note the 0 in brackets, if the country code is also notated. A call within Germany needs the leading 0. A call with the country code dialed first makes it obsolete, so I need to supress it for the unformatted output. I could put the 0 into the pattern, but this may confuse users with the input as they my try to note the 0. The extention code is also dialed directly and leads from the main connection to certain phones/offices and is divided by a divice, but dialed in once with the whole number. The divice is only a visual hint. As it is not standarized how many numbers a mainline and a extension has, I cant divide it by a pattern but need the fields. So my main problem right now is how to get the leading 0 and I would be able to note my numbers. It only has to do with the local notation convention. For mobile numbers you can already disable the extension in the field settings, or just leave it out. But I thought maby us the field as a repeatable field, so it would be nice to chose the format for each entry while input it?
  14. Next Problem. Have this output Format {+[phoneCountry] }{([phoneAreaCode,0,0]) }{[phoneAreaCode,1,5] }{[phoneNumber]}{–[phoneExtension]} it should give e.g. +49 (0) 30 1111-22 but actually gives +49 30 1111-22 The Mobile (unformatted) output should give +4930111122 and not +49030111122 How to handle that best way?
  15. Yes, was confused about that too and first tested for an installation problem. But now its working. Thanks. Btw. I changed the input type to type='text' pattern='[0-9]*' as the type number does not allow a leading zero (which is necessary for me) and has this up and down ticks, that do not make sense to me for telefonenumbers. This makes updating harder in future. Mayby the input type is selectable in a next version?
  16. I have a problem setting the field as mandatory. I get allways a warning that its not set.
  17. That sounds good. That's right. Would you please provide some information on calculation basics. E.g. does the unsharpen mask just need an own instance, is it calculabe at all, is it only the unsharpen mask that increases the memory need. So one can finde a balance between using the effect, the thumbs size and the memory limit.
  18. Sorry, I was unclear. I did not mean to optimize for 64M. It is just a limit, as 512M also is. And 512 can be easily reached and lead to break the page when we use large images and lots of instances for effects. I can not come up with a solution as I am not realy into the code. I have no clue how often the instances are needed or how to deal best with it. My consideration is: What environment is needed to not get broken pages? Is it predictable? If I now set the limit to 256 or even 512, does it guarantee to not cause any error? If these errors can not be avoided by the script, how to calculate the max. needed limit (therefore we should know how many instances are needed for what effect)?
  19. I tested like this my target picture (thumb) is 2500x1870 I tested two memory limits, 128 and 64 with array('sharpening' => 'none') both tests rendered the image with sharpening on 64M Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 10000 bytes) in /Applications/MAMP/htdocs/ProcessWire-dev/wire/core/ImageSizer.php on line 1632 128M Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 18700001 bytes) in /Applications/MAMP/htdocs/ProcessWire-dev/wire/core/ImageSizer.php on line 1655 then with your imageSizer.php modification and sharpening on 128M image gets rendered 64M Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 10000 bytes) in /Applications/MAMP/htdocs/ProcessWire-dev/wire/core/ImageSizer.php on line 1678 So it seems to me, that there are several more instances created for different image effects which take the memory uncontrolled. Even if 64M may seem to be a very low memory to someone, but as devices resolution may rise in future high resolution images even higher memory limits may get broken.
  20. Thanks Horst, for the explanation. if I put your snippet into my template I do get bool(true) bool(true) as output, so the memory limit should be read. But when I set my output dimension of the image up I still get: Error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 18700001 bytes) (line 1655 of /usr/www/users/user/ProcessWire/wire/core/ImageSizer.php) Dont know why line 1655 causes the error, as I am only resizing with image->width and image->height
  21. yes, lostkobrakai. Size can be calculated like here But am I done with a simple size calculation of the file and checking it against the memory limit? Or are there other processes when I start a resizing that take additional memory.
  22. I cant increase memory limit. Anyway, there would be still a limit, that could be reached and shouldnt lead to break the page. I think the needed memory size can be calculated from the origin image, but also depends on how many instances get done at once, generally speaking how the script handles the memory resources. But as I am not realy deep into that I better ask.
  23. I have a lot of image heavy pages. So I have several memory_limit errors with resizing. I wonder, if pw's image resizing functionality has any routine to avoid breaking the whole page. If not, would it be enough reading the memory size and compare it to the calculated target image size before starting the resizing?
×
×
  • Create New...