Jump to content

nikola

Members
  • Posts

    253
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by nikola

  1. I'll take a closer look and if I would find some improvements that could be made, I'll send you css modifications that you could apply to it.
  2. Ryan, sorry for replying so late, haven't seen your post. In the meantime, I've managed to code all the features I needed and the project is done. I've been busy last two months with projects that had to be finished before summer holidays so I haven't had chance to be more active on the forum. I have another admin theme rolling up (will finish it by the end of the holidays) Thanks for offering your help.
  3. It looks really cool, can't wait to try this. It would speed things a bit. Google Analytics integration would be superb.
  4. Got it working! I've changed $user = wire('user'); in wrong file. Thanks for you help!
  5. I've changed that line to: $user = wire('user'); and now I get: Recoverable Fatal Error Argument 1 passed to PagesType::___save() must be an instance of Page, none given (line 128 of C:\inetpub\wwwroot\processwire\wire\core\PagesType.php)
  6. @Netcarver, you were right, I forgot to add form.submit(); to submitHandler ... silly me @MadeMyDay I've corrected the path, the right one was /processwire/scripts/update.php because I have PW installed in processwire folder under www root. Now that those two are solved, I get in Firebug: Error Call to a member function save() on a non-object (line 40 of C:\inetpub\wwwroot\processwire\scripts\update.php)
  7. Hi Netcarver, submit handler is posting to right location, scripts folder is located along site and wire folders (on the same level) and server has access to it, I don't know why this ain't working...
  8. I have a form in the template: <form id="profile" name="profile" method="post" action=""> <label for="username">Username:</label> <input type="text" id="username" name="username" size="30" disable="disabled" value="<?php echo $user->name; ?>"> <label for="email">E-mail address:</label> <input type="text" id="email" name="email" size="30" value="<?php echo $user->email; ?>" class="required"> <label for="text">Password:</label> <input type="text" id="password" name="password" size="30" autocomplete="off" class="required"> <label for="passwordConfirm">Confirm Password:</label> <input type="text" id="passwordConfirm" name="passwordConfirm" size="30" autocomplete="off" class="required"> <input type="submit" name="submit" id="submit" value="Submit" /> </form> and I'm using jQuery validate to validate and submit the form: $("#profile").validate({ debug: true, rules: { email: { required: true, email: true }, password: { required: true, minlength: 6 }, passwordConfirm: { required: true, minlength: 6, equalTo: "#password" }, }, messages: { password: { required: "Enter the password", minlength: jQuery.format("Please enter at least {0} characters"), }, confirmPassword: { required: "Repeat the password", minlength: jQuery.format("Please enter at least {0} characters"), equalTo: "Passwords are not equal", }, email: { required: true, email: "Please enter a valid email address", }, }, submitHandler: function(form) { $.post('../../../scripts/update.php', $("#profile").serialize(), function(data) { $('#results').html(data); window.location='/'; }); } }); update.php is located outside PW directories in folder "scripts": <?php require_once('../../index.php'); $input = wire('input'); $sanitizer = wire('sanitizer'); $user = wire('users'); if($input->post->submit) { $error = ''; $username = $user->name; if(isset($_POST['email'])) { $email = $sanitizer->email($input->post->email); } if (!preg_match('/^[a-z0-9&\'\.\-_\+]+@[a-z0-9\-]+\.([a-z0-9\-]+\.)*+[a-z]{2}/is', $email)) { $error .= "Enter e-mail address in valid format! <br />"; } if(isset($_POST['password'])) { $password = $input->post->password; } if(strlen($password) < 6 && !preg_match("#[a-z]+#", $password)) { $error .= "Password must contain at least six letters! <br />"; } if(!preg_match("#[0-9]+#", $password)) { $error .= "Password must include at least one number! <br />"; } if(isset($_POST['passwordConfirm'])) { $passwordConfirm = $input->post->passwordConfirm; } if ($password != $passwordConfirm) { $error .= "Passwords do not match! <br />"; } $user->name = $username; $user->pass = $pass; $user->email = $email; } if (!$error) { $user->save(); echo "Your profile is succesfuly updated"; } else { echo $error; } ?> and it's not working (validation works fine but submitting doesn't). If I don't use AJAX and make a page Update with template update.php that's in templates folder and assign form action: action='<?php echo $config->urls->root?>update/' it works fine (but I lose AJAX support). Can somebody give me an advice what I'm doing wrong?
  9. Diogo, I've solved it, there was an extra strtotime in echo... It's working this way: $date = 1333425600; echo date('d.m.Y', $date);
  10. I've assigned datetime type to a field that I've added to user template. When I try to output it, it shows me 1333425600 (I'm making unix timestamp conversion through date conversion to show me the right format) and I get - 31.12.1969 date which shows me that something is wrong here. When using this kind of field in normal template everything works fine and I don't need to do any conversion. How can I display the right date?
  11. Soma, thanks for testing. I was logged in so I didn't see the form. I've tested it out and it's working fine.
  12. Thanks Ryan, but it doesn't output anything when I put above code into the template... Styling is no problem
  13. Soma, thanks for responding.
  14. Thanks Soma, I know about that... What I meant is that I would like to insert the code in my template that would call forget password screen directly on the front end (without going to Pw itself on the back end). User would have input field for entering his username on the front end with code that would reset password through PW api and sent him new password.
  15. How can I add forgot password functionality to front end (website) so that users can reset their password and so it can be sent to their mail?
  16. I need help for a project that I'm working on and that surpasses my PHP & PW knowledge. If someone is interested, contact me through PM so I can explain what it's all about (of course it's a paid job). Thanks! Nikola
  17. Alan, this seems to be a bug. I'll investigate the code and will make proper corrections.
  18. Wow, that was quick I'll try to do that and see how it'll come out... Thx
  19. I'm going to extend PW user with extra custom fields. How can I hide those custom fields from superuser(admin) and allow it to be seen only by guest account or some other custom specified accounts. I want to reduce the clutter, so superuser will only need to see default PW user assigned fields. What's the best approach with that?
  20. I've made a github repo, link added to first post, feel free to fork and improve
  21. @netcarver I have set up github account some while ago but never got the chance to explore it further. I will try to set it up completely this weekend and I'll upload the code there then...
  22. Hi guys, I've made a big update to original Futura admin theme, this one is based on Futura Remixed code (completly rewrote the code with that one). I've included some tweaks based on posts by netcarver, alan & Adamkiss. Back to top button is located in the sidebar, sidebar moves quicker then before up & down and I've fixed the main menu. Screens: Download: https://github.com/nvidoni/futura futura-admin-theme-v1.1.zip
  23. If you use search form from default PW template, you could do the following with the above script mentioned. <input type='text' name='q' id='search_query' value='<?php echo htmlentities($input->whitelist('q'), ENT_QUOTES, 'UTF-8'); ?>' /> Add HTML5 placeholder to input field like this: <input type='text' name='q' id='search_query' placeholder='Search' value='<?php echo htmlentities($input->whitelist('q'), ENT_QUOTES, 'UTF-8'); ?>' /> Include the script above to your head section and trigger it like this (also in the head): <script> $(document).ready(function() { $('input[name="q"]').placeholder(); }); </script>
  24. I ended up using this script: http://webcloud.se/code/jQuery-Placeholder and it does exactly what I needed.
  25. Thank you both, I ended up with a small bit of jQuery: $('input[name=search]').attr({value: 'Search'});
×
×
  • Create New...