-
Posts
140 -
Joined
-
Last visited
Everything posted by Mackski
-
I was unable to hook to this page, so ended up creating a custom admin page to support a button to export users via CSV. Seems overkill, and I'm sure there are other senarios which may warrant additional buttons such as: Selecting all users for another operation (copy to clipboard) or email all users etc. It would be nice to find out the appropriate method to hook to
-
There is no form on this page to hook to: /processwire/access/users/ Hence the problem.
-
Thanks Lost, but I'm still Lost! Still no idea how to hook prior to output to add the new button, this is what I have: $this->addHookBefore('ProcessUser::render', $this, 'usersAddButtons');
-
Hey gebeer, I'm trying to extend your function for admin only, by adding a button to the users screen: /processwire/access/users/ Do you know where exactly I would create my hook point? I'm a little stumped, while adding hooks to ProcessPageEdit are relativley easy, I'm yet to see an example for the users section of processwire.
-
It appears this code as part of smtp.php, generates a false positive in my case (no authentication required) While the test fails, the module still sends mail correctly. if($success && strlen($mechanism)==0) { $this->error="it is not supported any of the authentication mechanisms required by the server"; $success=0; } Commenting out $success will make the test pass, but probably not a good idea. Nothing special about the hosting enviroment, as I said all email scripts, the normal wireMail() works, along with PHPMailer. The issue is the SMTP server does not require authentication, which seems to be a requirement of the smtp.php as above, which in turn causes the test of the module to fail.
-
First time using this module and I get this error: "it is not supported any of the authentication mechanisms required by the server" The SMTP server is an open relay restricted by sender IP, no authentication required. I have tested using PHPMailer succesfully. Any ideas?
-
Thanks Valan, This also worked for me when adding a concatenate field to the user template. I presume the field is actually hidden on the page? Unless this is another bug within the user template only?
-
I'm forever writting code like this: $currency_id = $pages->get($page->currency); $packages = $pages->get('template=packages, currency='.$currency_id); Where $page->currency is a page select referencing another page. It would be great to shortcut this method to something like this: $packages = $pages->get('template=packages, currency='.$page->currency->getPage()->id'); Or if I wanted to get the title of the currency referenced by the page field: echo $page->currency->getPage()->title; So in essence I'm chainging calls to get a page field, the get the corresponding page and retrieve the value of a selected field.
-
I need to hook to a locked textarea field to modify it's layout at run time, however the field doesn't seem available to hook to? My code is as follows: $this->addHookBefore('InputfieldTextarea::render', $this, 'render'); public function render(HookEvent $event) { $field = $event->object; if($field->name == "currency_data") { echo "<pre>".$field->value."</pre>"; } } If I modify the field to any other value than "locked" the field becomes available. Not exactly sure why it's not available when locked.
-
I'm always a bit paranoid, so I check like this: // download the secure file if($input->get->dl == 1) { if($file->name && $file->isDownloadable()) { $file->download(); exit; } else { // erorr } }
-
I also change line 63 in the module to: $storageLocation = $this->wire('config')->paths->root.rtrim($field->get('storageLocation'), '/') . '/'; So my secure file path is relative to my web root: eg: ../secure_files/ Which is just one level down from my web root, and is easily configured on most shared hosts. Just saves a bit of time working out absolute paths on shared accounts. Might be an option within the module to select "Relative path to Processwire root" or "Absolute Path"
-
I get an error when saving, although it seems to still work. Missing required value (inputfieldClass)
-
I'm have a problem re-populating some data based on this code which doesn't seem to work. $form_field = $templates->get('template_name')->fields; $page = $pages->get('template=template_name,id=123'); foreach($form_fields as $field) { $_POST[$field->name] = $page->fields->get($field->name); } The page has mixed elements, so I just need to retrieve the actual values of each page field. Instead the obove returns objects. What am I missing?
-
Now I feel silly, it was a selector issue, this works: template=user,role*=coach
-
Maybe I should clarify things. The obove selector does work in the backend when displaying the list of usernames in the select box, the problem occurs when trying to add users from the API or updating the selectbox in the backend. So how would I allow adding users? I have tried the option "Allow new pages to be created from this field" with no luck. It does work however if I only set "Selectable template" to users.
-
I get this error when creating a page with related field selector: Error saving field "coach_user" - Page 1152 is not valid for coach_user (Page 1152 does not match findPagesSelector: template=user,roles=coach,include=all) Code: $user->addRole('coach'); $user->save(); // then $p = new Page(); $p->template = 'coach'; $p->coach_user = $user->id; $p->save(); The selector for the page field "coach_user" is: template=user,roles=coach Is this a bug or am I missing something simple?
-
What's the difference between deleteAll and removeAll. Does an image need to exist for either function to work?
-
Perfect thanks Lost, I must have missed that update. Checking change log now....
-
Generally I would take this approach with fields that are only changed by a user on the front end and admin or editors have no need to view the data in a human readable format. In this instance the fields may be changed under review within Processwire.
-
For an up-coming site, I have requirements for many user account fields: - 2 types of user accounts, each account has a number of share fields, eg: facebook url, skype id etc - Each account type also has many specific fields. (around 50 each) In this instance, what would be considered "best practice"? 1. Keep user accounts minimal, then create the user types as pages with child pages for each user containing the set of specific and shared fields. Then link these pages to the user account: - User type 1 - User 1 - User 2 - User type 2 - User 3 - User 4 OR 2. List all fields required for all users on the user template, separated by field sets. The user accounts will also be used / linked in a number of other pages. Although the actual user data will not change often. eg: - Products - User 1 - User 4 Interested in how anyone else would approach this issue. Is there any performance issues having a large number of fiends within the user account template? Cheers.
-
Released: PadLoper (commercial eCommerce platform for ProcessWire)
Mackski replied to apeisa's topic in Modules/Plugins
Hi Apesia, I've just joined up via the mailing list. Look forward to testing it out! -
Nice little wrapper library for adaptive design requirements, although I did change references from array to object, so it's more inline with PW config conventions. eg; public function mobileDetection(HookEvent $event) { $this->detect = new Mobile_Detect; $config = $this->wire('config'); $mobileDetect = (object) array( 'deviceType' => $this->getDeviceType() ); foreach($this->detect->getRules() as $name => $regex) { if ($this->detect->{'is'.$name}() === true) { if (in_array($regex, $this->detect->getBrowsers())) { $mobileDetect->browser = strtolower($name); } elseif (in_array($regex, $this->detect->getOperatingSystems())) { $mobileDetect->operatingsystem = strtolower($name); } elseif (in_array($regex, $this->detect->getPhoneDevices()) || in_array($regex, $this->detect->getTabletDevices())) { $mobileDetect->device = strtolower($name); } } } $config->mobileDetect = $mobileDetect; } So calling is simply: $config->mobileDetect->deviceType etc.
-
Looks great, but I get when I try to visit: http://pma.lightning.pw
-
Hey Larry, Finally got around to checking this out. Question: // Index will be executed by all pages using the Home template.// Except if a page-specific method is defined (see below)// This function MUST be defined in your template controller. How does PW call a page-specific method? ie: foo_bar Thanks!
-
Github issues logged.