Jump to content

MindFull

Members
  • Posts

    106
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MindFull

  1. @adrian - Thanks for that. That's usually what we do for the primary DB instance when we aren't using GCP. For us, setting the DB instance flags in Google Cloud SQL accomplishes the same thing via their admin console. In case anyone needs it: this is Google's reference for Cloud SQL's flags. Do note, there's a known issue that there's no automatic daylight saving adjustment. I prefer to leave the UTC with no offset. I'll likely look at the module's source a little closer and modify the input/output timestamps from PW to match the client user's timezone.
  2. Happy to report this module has been fairly robust in some of our clients PW instances. Thanks for all your work! One thing I noticed is that the revision timestamp is being generated by the database and not via PHP. So when the two services are on separate machines, with different timezone configurations, the timestamps don't match up with the activity on the web server. Just discovered this as one of our client's databases went down and a failover database in another zone took its place. Revisions were showing that the users had traveled to the future... 5 hours from now. 😄
  3. Are you referring to fields that have the Datetime type? If so, have you tried enabling the "Date Picker Year Range" field by selecting any radio under the "Date Picker" field other than the "No date/time picker" option? It allows you to specify the year range before and after the current year.
  4. I went down this road for a couple months - tried it out but I wasn't making much headway with the learning curve (steep). Reluctantly, I decided to come back to PW... 😏
  5. ################################################################################################# # START PROCESSWIRE HTACCESS DIRECTIVES # @version 2.3 ################################################################################################# ... # ----------------------------------------------------------------------------------------------- # Access Restrictions: Keep web users out of dirs that begin with a period # ----------------------------------------------------------------------------------------------- RewriteRule "(^|/)\." - [F] Eeek! - My PW 2.3 is showing lol! I have go to remove that from my Notepad++ cache
  6. Absolutely loving this! The tables look great - way to to put PW to work!
  7. I've seen the .well-known directory with hosting providers that offer cPanel accounts with the AutoSSL feature turned on. Both LetsEncrypt and Comodo cert renewals use the folder to install and replace soon-to-expire SSLs. Depending on your hosting provider's configurations, even self-signed SSLs may get updated. BTW: For those that chose to use AutoSSL, Processwire's .htaccess config prevents reading of .txt files and access to directories beginning with periods so those would need to be turned off temporarily to allow the cert to be installed. Otherwise, PW will issue a 403 each time AutoSSL attempts to access the directory/file. Then, the SSL will expire and piss everyone off until it's fixed. But that's no fault of Processwire - It's better to keep those things in check then to let hosting plugins silently do whatever they want.
  8. Then don't save it No, really though, if you want you can just delete/clear the field before save.
  9. That's great to hear! It makes me want to give it a go just to see how it compares with my vagrant/vb box config. More speed = more better lol.
  10. Just an idea: use PageTable. Maybe use a template for artist that has Artist_firstname and Artist_lastname, etc. Then, a pageTable called Artist_pageTable that uses the artist template. Also, create a template called Artist_works with the associated work fields, including the Artist_works_inventory_no. Then create a pageTable called Artist_works_pageTable that uses the Artist_works template. Since everything's a page, you could do this: $pages->get("template=artist,Artist_firstname=$firstname,Artist_lastname=$lastname")->children("Artist_works_inventory_no=1")->count();
  11. The repeaters are nested so you'll need to approach this differently. In your page tree, you'll see that the repeaters are not true pages of your Artist page. If you look at settings of the repeater fields you created, you'll see they have templates and parents that belong in then Admin/Repeaters area. If you must use repeaters like this (which I don't think you do) you'll need to target the repeater templates/parents. Since your attempt shows that Artist_works_inventory_no is not unique, you could try: // get ID of repeater with artist that matches the first/last name provided $artistRepeaterID = $pages->get("template=repeater_Artist,Artist_firstname={$firstname}, Artist_lastname={$lastname}")->id; // repeaters have names like for-page-someID, check your page tree to see what I mean $artistWorkParent = "for-page-".$artistRepeaterID; // Find the matching children that have the inventory id and count echo $pages->get("name={$artistWorkParent}")->children("Artist_works_inventory_no=1")->count(); Personally, I think this approach with nested repeaters could be reevaluated. Many you can explain what you're trying to accomplish?
  12. I think so too. If the inventory number is unique for all art work, you could use: echo $pages->count("template=repeater_Artist_works,Artist_works_inventory_no=1"); The repeater before Artist_works comes from PW adding before storing the repeater field in Admin/Repeaters
  13. Maybe you can show us what you've tried? I just copied/pasted Soma's example and the core of it stills offers a starting point for using PW core inputfields in custom forms. Here's how the result looks: This is with the code Soma gives for the form and the head.inc which he gives in the mentioned thread. You'll have to make it functional for your needs but it gives you a starting point.
  14. Congratulations! It gets easier on each iteration (no pun intended)
  15. Just curious, is there a particular reason to why you use opening and closing php tags for each line of code?
  16. Not to nitpick, but remember that $pages->find will give you a pageArray so it is possible that the $store->title might not work how you'd expect. If another child of Deals exists, then you might run into some errors. It would be better to use either $pages->findOne or $pages->get. If you anticipate that Deals might have more child pages, I would suggest expanding the selector as well.
  17. Wow, that's strange that they would do something like that. In ProcessPageEditLink.js, I see this // avoid adding scheme if we already added it before and user removed it if ($this.attr('data-ignore') == domain) { // do nothing } else { $this.val('http://' + val); $this.closest('.InputfieldContent').find('.notes').text('http://' + val); $this.attr('data-ignore', domain); } So it looks like if you delete the http:// once or twice, it should stop auto-filling.
  18. That's weird but it looks like you're working out of two different directories for the install. You have a _tmp and a tmp. Maybe double check the install directory and make sure that the htaccess file, and wire & site directories exist alongside index.php. Which version of PW are you using?
  19. Just curious, if it is an external link, why would you want to remove the http:// ?
  20. The $session->login($user, $pass) is going to return a user object if the user exists and password is correct. Otherwise, the session call will fail. That's why creating the user before the login check works when registering the user. It's okay to build users on-the-fly as long as you sanitize and do your role/permission assignments, etc. If you have a separate login form from the registration form, use one to create and login the user while the other simply logins in. I don't think you'll need to use any extra hashing, PW will compare the hashed value of the supplied password to that stored in the database.
  21. I vaguely remember this coming up a while ago when Google was changing the way it crawled AJAX enabled pages. I would check to see if Google is actually caching the page with the # as a separate page. If so, grabbing the url and determining if the # is present might help with creating a dynamically created meta tag to tell the crawler not to index the page.
  22. Interesting ideas. I think I would probably allow the subaccounts be properties/fields of the master account that are required to be unique. Maybe create a template for subaccounts and have a select option for specific privileges. Then, based on the page being visited, the appropriate sub-account can be retrieved and the privileges set accordingly. That allows a way to determine which sub-account is being used and if a post is created, can use the appropriate account name associated with the master account. In conjunction with clsource's suggestion for a decent REST api, I don't think it would be too difficult.
  23. Seems to be a CSS issue with the width attribute of the figure element. It's set to 1px while the img element has max-width set to 100%. When you go to add a centered image caption, CKE adds the <figure> tags and things get wonky. You could copy/paste the version of the content.css from the core into the site/modules/InputfieldCKEditor directory and use that path for the field's Custom Editor CSS option (under the Input tab). From there you could tweak the CSS but it would only affect the admin view. To mirror the changes in the front end you'll need to add some CSS there too. Or maybe you could just modify the source to maybe use the img and p tags with the align-center class.
  24. I've had to use DT for some rather large page results before (1000+) because it was the requirement of the customer. kongondo did a great job showing how easy it is to use PW alongside DT. Sometimes, the pages might need to be fetched with real time results and without reloading the current page when doing searches. I thought I’d mention the good old legacy format that DataTables still supports because I prefer it over the new API’s requirement to issue column information when using PW. Here's how a simple SSP file might look like using the legacy format: // iDisplayStart helps in pagination as it keeps track of what record to start on when displaying results. $iDisplayStart = intval($_GET['iDisplayStart']); // iDisplayLength is how many records are displayed on the screen at once based on the // selection of the Records select box $iDisplayLength = intval($_GET['iDisplayLength']); // Start with an empty response array $response = array(); // Get some pages. Limit results to whatever $rows = $pages->find("template={$someTemplate},limit=1000"); // Create the response array that DataTables needs foreach ($rows as $row) { // Get fields as needed $name = $row->name; $comments = $row->comments; // sSearch is the string typed into the search box by a user // Assuming searches are case-insensitive, make the search string and searchable field lowercase $sSearch = strtolower($_GET['sSearch']); // User has typed something so the results need to be filtered by hits if($sSearch != '') { // The search has found a hit in this record if(strpos(strtolower($comments), $sSearch)){ // Add the hit to the response $response[] = array( $name, $comment; } } // User has not typed anything in the search bar so return all results elseif($sSearch == ''){ $response[] = array( $name, $comment ); } } // Now that we might have results, send it back to the requesting page if(!empty($response)) { $results = array( // sEcho refers to the page of pagination that is being viewed "sEcho" => intval($_GET['sEcho']), // Number of pages returned in total "iTotalRecords" => count($rows), // Number of filtered pages found based on search "iTotalDisplayRecords" => count($response), // Use array_slice for partition the result for pagination // aaData is the array that DataTables uses for data that needs to be displayed "aaData" => array_slice($response, $iDisplayStart, $iDisplayLength) ); // Finally send the results echo json_encode($results); } Obviously the _GET variables would need sanitizing and such. In addition, the old bDeferRender option for DT is good to use when loading large sets of data into the table since it will only the needed visible rows will be drawn at any given time.
  25. MindFull

    Vagrant

    I'm with bernhard on using Scotchbox. I started using it a while back and it was a great entry point to learning the not so mysterious methods of Vagrant. Plus, I've always been a fan of Ubuntu but being mobile is a must so I've learned to enjoy its presence as a VM on all my Windows devices. I use Scotchbox across Win 7 to Win 10 on multiple devices including Surface Pros and it has always worked out of the box. Once projects are done I just destroy the box because I push everything to GitHub anyway. I used to configure each VM myself in VirtualBox and got those same problems with Guest Additions. It is usually caused by mismatched versions between it and the VirtualBox installation.
×
×
  • Create New...