Jump to content

Doc

Members
  • Posts

    108
  • Joined

  • Last visited

Everything posted by Doc

  1. Hi Tom, I think so that most of the URL are set in javascript. Some are not, and I could easily modified them. I left this strategy when I understood that the application was dynamically building some URL in js. I could hack some Php in there but it would be very long. I'm comfortable with the PW documentation but did not find the way to tell to PW I just want to use relative link for that directory...
  2. Hi guys, I'm trying to integrate into PW that external module I have on the website I'm building : https://www.docpaddock.com/paddockhero_freemium/ It's using a lot of dynamically built javascript url inside, for everything : buttons, actions, etc, etc (I didn't code that module myself) I tried to integrate it into the main website but it was a nightmare to find how those dynamically url are built to replace them with code like that : <script src="<?php echo $path_template?>/myAppDirectory/js/createjs-2015.11.26.min.js"></script> <div id="header"><img src="<?php echo $path_template?>/myAppDirectory/img/header.png"></div> Is there a way with PW to tell something like : "I want to load everything for this page from that relative directory './myDirectoryApp' ?" I'm ready to add something like that at the top of every page if needed. Actually my website is built like that : /templates/library /templates/js /templates/css /templates/myAppDirectory Any idea on that ? Thanks !
  3. thanks for the blazing fast answer adrian. I had refresh the page, but my test was running again and again, so didn't see that. Merci !
  4. Hi, I'm trying to update some registered members fields such as email, password. I've made some tests and apparently it works without using $user->save, but I've read that in the forum also (question was how to survive without admin pwd) : $u = $users->get('admin'); // or whatever your username is $u->of(false); $u->pass = 'your-new-password'; $u->save(); So do I need to $u->save(); after a $u->email = NEW_EMAIL for example ? Thanks
  5. Thanks Robin S ! It seems it's exactly what I was looking for The module looks quite old but i'll try it on my 3.x version.
  6. Hello, I'm loosing the session when I quit my browser (it's not lost when I close/reopen the tab). Is there a way I can keep my PW session after a browser restart ? I use the session->login usual stuff to start one. Thanks
  7. Thanks to both of you. The support is awesome here I'll use LostKobrakai's proposal to filter the right user. I shouldn't have added the same email, but, I like the idea to filter them correctly as they don't have the same privileges.
  8. Hi, I've just hit a problem I didn't think of. I've registered a fake player on my website (still in dev) with the email I've used for the administrator. So, when I connect, password doesn't match and I can't sign me up. I'm using : (sum up) $connect_user = $users->get("email=$email"); if($connect_user && $connect_user->id) { $username = $connect_user->name; } else { echo "unknown email"; } // if everything is ok : if ($session->login($username, $password) !== null) { // Go on It only retrieves the admin (guest, superuser) roles but not the player I'm looking for, who has another kind of role. Is there a way to add the role filter in the $users->get ? I've used too : $connect_user = $users->find("email=$email"); but it brings back different stuff than $users->get. Thanks
  9. hey @szabesz, thanks for all those links ! I'm going to read all that and will post here the one I choose.
  10. Hi, I'm looking for a nice forum I could use with PW. I'd like to use the same credentials for the PW website and for the forum. Any advice on that ? Thanks
  11. Hello, When do you choose to use $input->whitelist($key, $value) rather than $session->myvar (with myvar = 3 for example) ? The documentation uses the example of the MarkupPagerNav module : "An example is the MarkupPagerNav plugin module, which provides an easy way for you to have pagination. Lets say that you used it to paginate search engine results. [...]" (from https://processwire.com/api/variables/input/) But If I don't have pagination, but some variables to store for each member of my website, do I have any interest to store them with whitelist rather than within sessions ? Thanks
  12. Good to know, thank you ! My tests were made inside /site/... .
  13. Hello, I'd like to put some backend files for example in /backend. I'd like to access them directly with www.mywebsite.com/backend/myfile.php (behind a htaccess for example). How can I do that without declaring that file as a template/page ? Right now all I have is a "this localhost page can't be found". Thanks
  14. Yes, I understand that. But then, how can I translate the parameters too ? Do I have to do this separately ?
  15. Thanks @Martijn Geerts It kinda works but I don't get the opportunity to translate the parameters actually. I write in my translation file '/path/to/myfile.php ' I write : __('Hello %1$s how do you %2$s?', '/path/to/'), 'Doc', 'do') but through the admin, the only sentence I see waiting for translation is : 'Hello %1$s how do you %2$s?'
  16. Hi guys, I've just discovered (thanks to you) textdomain, which works fine. Now I'd like to use that functionality with sprintf rather than echo __("my string to translate", "my path") Is it possible ? Thanks
  17. Hi, When I'm registering a user : $u = new User(); $u->name = $username; $u->pass = $password; $u->addRole("guest"); $u->save(); ... is there a way to tell that the user was correctly saved ? Can I merely check with : if ($user->id) // OK else // KO I'm asking that because when I'm registering a new user, I'm also saving that $user->id in another table. So I'm wondering is there any clean way to check that, otherwise I'll use a basic check on the existence of $user->id. Thanks
  18. Thanks @Sérgio, I should have read more attentively that part, I didn't know those textdomain where the thing I was looking for. The doc wasn't crystal clear for me, but this post made me understand the way to do it :
  19. Hi guys, I've just had this wonderful idea : I know that multi-language field (example : $page->myfield) are useful whatever the page. I mean you can define a multi-language field in your homepage and make use of that same field in another page and benefit of the different translations there too. Is it the same for translatable string (such as echo __("blablabla")) ? Am I able to translate some strings in one template and benefit of those translated strings in another template ? Thanks
  20. Hi guys, I'm using translatable strings such as : echo __("Hello"); It works on my dev configuration but when I upload the website on the production environment, it only displays the default language. Do I have to upload some special files where could be located the translations ? Thanks
  21. Thanks @BitPoet, I'll add your instanceof line in comment in my code and see if I progress on the "object path" But for now I feel more comfortable using kongondo's syntax.
×
×
  • Create New...