Jump to content

landitus

Members
  • Posts

    181
  • Joined

  • Last visited

Profile Information

  • Gender
    Male
  • Location
    Buenos Aires, Argentina

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

landitus's Achievements

Sr. Member

Sr. Member (5/6)

42

Reputation

  1. @kongondo WOW!!!! I'm very happy to see this module! I can't wait to try it in my projects. Way to go!!
  2. I'm doing a custom login/register in the front end, and flash messages are really useful to inform the user about the process of user registration. I was used to using Codeigniter with their flash message system. I've seen very few messages in the forum where $session->message is used but I haven't seen a full implementation. I've tried my own with some degree of success, but the flash messages persist in a different way that I've expected. It's like there is a "delay". Maybe I'm doing something wrong. The header.inc has a standard notices loop: <?php if($notices) :?> <?php foreach($notices as $notice) :?> <?php $class = $notice->className(); ?> <div class="notification <?= $class; ?>"> <p><?= $notice->text ;?></p> </div> <?php endforeach ;?> <?php endif ;?> This is my register.php: When submitting the form with errors, the first time no error message are displayed. The second time I submit it with errors, then the error message appears. This is what I describe as the "delay". <?php include("./helpers/form_helpers.php"); /** * Register template * */ $out = ""; $errors = ""; // create a new form field (also field wrapper) $form = $modules->get("InputfieldForm"); $form->action = "./"; $form->method = "post"; $form->attr("id+name",'register-form'); // Name // $field = $modules->get("InputfieldText"); // $field->label = "Name"; // $field->attr('id+name','name'); // $field->required = 1; // $form->append($field); // append the field to the form // Email $field = $modules->get("InputfieldEmail"); $field->label = "E-Mail"; $field->attr('id+name','email'); $field->required = 1; $form->append($field); // append the field // Password $field = $modules->get("InputfieldPassword"); $field->label = __("Contraseña"); $field->attr("id+name","password"); $field->required = 1; $form->append($field); // Submit $submit = $modules->get("InputfieldSubmit"); $submit->attr("value",__('Crear cuenta')); $submit->attr("id+name","submit"); $submit->attr("class","btn btn--primary"); $form->append($submit); // Form submitted: process form if($input->post->submit) { // user submitted the form, process it and check for errors $form->processInput($input->post); // here is a good point for extra/custom validation and manipulate fields if($sanitizer->email($form->get("email")->value) != '') { // Email should be unique if(!isUniqueUserEmail($form->get("email")->value)){ $form->email->error(__("El e-mail ingresado ya se encuentra registrado")); } } if($form->getErrors()) { // the form is processed and populated but contains errors // Render Form $session->error(__('There are errors in the form')); $out .= $form->render(); } else { // Sanitize inputs //$full_name = $sanitizer->text($input->post->name); $email = $sanitizer->email($input->post->email); $password = $input->post->password; // Generate username from email $username = $sanitizer->email($input->post->email); // Create New User $u = new User(); $u->of(false); $u->name = $username; $u->pass = $password; $u->email = $email; $u->addRole("guest"); $u->addRole("member"); $u->save(); $u->of(true); // Create hash // Email the user with confirmation e-mail // Redirect to login page and display success Message $session->message(__('User registration sucessfull')); $session->redirect('/login'); } } else { // Form not submitted: render out form without processing $out .= $form->render(); } include("./partials/header.inc"); ?> <div class="container container--narrow"> <div class="page"> <h1>Nuevo usuario</h1> <?= $out ;?> </div><!-- .page --> </div><!-- .container --> <?php include("./partials/footer.inc"); ?> On a successful submission, the next page displays the correct message, but also the error message "There are errors in the form". It's like the error message get's carried over. I appreciate any help to sort this out.
  3. I think this could be a bug. I'm using an Options field to create an array of radio fields. This field is required. Each option activates a conditional field and this works perfectly. I added a required if condition to this conditional fields, on a template level, and this is displayed correctly with the red *. But the fields are not validated and the page saves nonetheless. I figured since the red asterisk is on, I've configured the fields conditions correctly, right?
  4. I've been experiencing some weird issues with PW on my local machine (using MAMP). Since upgrading to version 5.2.3, I get logged out of the admin or on the front end unexpectedly and randomly. It happens while editing pages and when visiting password protected areas. I would like to provide more information if it helps to figure this out. Seems pretty broad and can't figure out what to do. It's pretty annoying since it happens pretty often.
  5. I've noticed the same thing: when logged in, all repeaters are included in the search results. I don't know if this is ok, or if there's a reason. It looks weird to me
  6. The Pro fields are looking great! Thanks Ryan. I was wondering what would be the best way to store a running event scorecard. This is a table with 2000+ rows and 15 columns of data, where each runner has its race time and more. This data would then be displayed in an html or a js enhanced data table. The site is a running magazine and there will be a lot of score tables. I guess I would just store and xls or json file in PW and then get into the datatables plugin. But maybe there's a more efficient way with the Pro fields?
  7. This is great news Adrian! Can't wait to try it!
  8. More on this subject. I saw this article for Wordpress and it's pretty much what I'm referring. http://wordpress.stackexchange.com/questions/128931/tinymce-adding-css-to-format-dropdown Could some of this be achieved in PW?
  9. I'm having (for the first time) a similar problem. The thing is I have 2 Page fields in one template which no matter what I select, their values won't get saved. The page is saved and there's a notification, but nothing is saved on those 2 fields. The rest of the page (text fields) are working ok. The crazy thing is that those same 2 fields are present on another template and they work fine! This ocurrs only on the production website. Everything works ok locally. I'm using PW 2.3.1 What could this be? I'm using the Date Archiver module, but both templates use it! I'm lost!!
  10. I'm am trying to accomplish a Save and notify button which Ryan's mention that has to have a second save hook. I'm starting with the code for the button (the same Mackski) but I have no idea how to attach this button to save action. How would you implement such hook?
  11. I will be displaying all events in the future and there will be 150/200 for the current year. It only has events for the current year. Do you think this will be a problem?
  12. With more time, I may try the other more elaborated solutions and keep an eye on performance.
  13. Well, what can say... What an awesome amount of responses!! I was able to do it Diogo's way but all 3 are excellent answers. You all saved my day, so thank you!
  14. Is it possible to add pagination limit after merging to PageArrays? I'm querying pages for an event calendar where there are two conditions: Events that are starting in the future Events that started in the past but are ending in the future (aka are current) I've coded the following but I want to limit the results to trigger the pagination, but my code is not working. What can I do? $events = $pages->find("template=event, date>=today, sort=date"); $events = $events->append($pages->find("template=event, date<=today, date_end>=today,sort=date")); $events = $events->find("limit=15");
×
×
  • Create New...