Jump to content

DrQuincy

Members
  • Posts

    248
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by DrQuincy

  1. That's really good, thanks for the suggestions! I'm going to keep that as a potential way. I like it, thinking outside the box. 🙂 My somewhat liazier solution is simply to add a field to the user template: Legacy, Legacy converted, and New. If A Legacy user attempts a login it simply sends them to the password reset page. And when they do they become Legacy converted. Your way is far slicker so I'll present the client with both options.
  2. I have an old custom site I built myself where the passwords are hashed using BCrypt. I'm assuming the answer is no due to the one-way nautre of hashing but is there any way to take my bcrypt-hashed passwords and import them into PW? Where as my passwords stored the BCrypt strength, hash and salt together, PW seems to store the hashed password in two parts. I think it's further complicated by the $config->userAuthSalt value (this looks more like a pepper to me). It can't be done, can it? In which case, will just have to copy the emails, etc across into PW and send them each an email asking they set a new password or display a message on the website if a legcay email is used to attempt a login.
  3. Oh wow, you are amazing, LOL! That worked great. The only downside I can see if that I can't see a way of having a dynamic number of rows in the Google Doc. So I have to paste more than I need for the update to work. E.g. If I paste 10 rows in the Doc that limits it to 10. That should be okay but am I missing something that would allow me to have any numbers of rows pull through?
  4. Hi all, This is nothing to do with PW… I have some data in Google Sheets. Do you know if it's possible, ideally without having to use their API, to create Google Docs that automatically feed in data from certain sheets/cells. E.g. A Google Sheet has a list of addresses that have address in one column and a “type” flag attached to them (e.g. rural, suburban, urban). Let's say there are 3 x types as mentioned. Is it possible to have 3 x Google Docs that feed in addresses filtered by type? And, ideally, if the data is updated in the Sheet it automatically progates into the Docs. Can this be done? I have had a look but can't find anything. It looks like they have a decent enough API but it looks like it would take more work than I have time to spend on it. Thanks.
  5. Thanks! So I guess since that github comment is ~3 months old you have to be on a fairly recent version for the performance increase.
  6. When you access an image from the API you can get the width and height with $imade->width() and $image->height(). When you run these internally does ProcessWire get the sizes from the database or does it actually use GD to get them? I'm assuming if you aren't creating variations on the fly it just reads them from the database (the schema has width and height columns). Just checking that there won't be any significant overhead if doing this on lots of images.
  7. I have a site that has a parallax fixed banner at the top and then the rest of the content goes underneath with a higher z-index. It works great but when — on a Mac at least — you scroll quickly down to the bottom of the page it scrolls beyond the height of the document body and then snaps back and for a breif moment you can see the fixed banner underneath. Is there a CSS property to prevent this?
  8. Thanks! Looks like there are a few LG Ultra Fine options. There's a secondhand 22" one at 4096 x 2304 on eBay at a decent price. Perfect!
  9. I want to get an external display for my new 24" iMac. I don't want something huge but I want it to be retain display. It seems like most monitors out there are either about the size I want (20"–24") but they are “full HD” (only 1080). Or 4k, which is a better resolution, but the screen sizes are huge! Without getting an Apple Studio Display or LG Ulttrafine, does anyone know if a 20"–24" display that is also retina?
  10. I've got this code: $field = wire('fields')->get('mySelectOptionsField'); $options = $field->type->getOptions($field); echo $options->first()->title; The echoed statement is not HTML-encoded. However, when you get select titles from $page rather than from $fields the title is HTML-encoded. I get that this is intended behaviour. I just wanted to check: When in the front-end and using the API is the general rule anything you get via $pages or $page has of set to true by default but anything else — such as my example above — there is no output formatting since that only applies in the context of pages Is there an in-built way to HTML-encoded from $options as above — or should I just used $sanitizer->entites()? Thanks.
  11. Interesting, you learn something new every day! I'll bear that in mind for next time. I think I was put off by this: Since I was reading and writing quite complex models I was more comfortable using JSON and sharing data that way.
  12. I believe bootstrapping for when your other script is not already a PW instance, including command line (I have used that on a project before, by the way, and it's very useful and easy). With the multi-instance option, due to the PHP namespace, you can only write to the main instance. You can read from as many others as you want but you can never save anything as when you run new \ProcessWire\Page you are always creating a page in main instance's namespace. In my case, I needed to read from the main instance and write to the secondary one so it wouldn't work for me. At least that's how I understood it! I couldn't see anything in the doc that allows you to create new pages in secondary instances.
  13. Thanks for confirming. Yes, I am currently using a Textarea rows="1" and removing line returns on save so it effectively does the same thing.
  14. I have a Table field that I am using for some spam filtering. I have one field in the table set as a Text field. If I enter <a href=" and save it becomes blank regardless of any text formatters applied. It's weird because if I do the same with a Text field that is not part of a Table field it works fine. And within the Table field if I change it from Text to Textarea, it works. Any ideas why? Thanks.
  15. The client basically has two sites. One is in the UK and the other in the EU but serves customers internationally. There is a lot of shared information on both sites but at the same time they are different enough to warrant individual sites. But the client didn't want to, for example, add (and keep up-to-date) the same product twice. What I have set up is a root site that doesn't have a front-end but stores all the shared data. Then there is a folder for each site within that, each a separate PW instance. /root/ /root/uk/ /root/eu/ My question above was really to see if I could copy info between the sites within the same script. While Robin S's link was useful, it would appear to be for read-only so I didn't end up using it. Instead, the root site has hooks that saves all data into JSON files and associated assets and the EK and EU then take the and convert it to PW pages. If you're wondering why the EU and UK sites are within the root site folder as opposed to being siblings, it's because they share the same templates, models, JS, SCSS, etc.
  16. Great, thanks! I notice is says “Development version, not yet recommended for production use” so I'll have a play with it first. 🙂
  17. Oh wow, thanks. That looks (as everything tends to be with PW) so simple!
  18. If I had sites A and B is there a way in site A to create an instance of ProcessWire\wire() that is connected to a completely different site? The reason I ask is to sync some data between two different sites on the same server on the fly. E.g. on site A: $page1 = wire('pages')->get(/foo-bar/); $page1->of(false); $page2 = new \ProecssWire2\Page; $page2->template = $page1->title; $page2->title = $page1->title; // and so on $page2->save(); // Saves to site B
  19. Just that really…I searched the module directory and couldn't find anything. Is there a way to export a single page into a zip (with something like a JSON or SQL file along with all file assets) which can then be imported.
  20. I want to manually render a string as markdown (TextformatterMarkdownExtra). How can I do this? E.g. This is _a_ string becomes <p>This is <em>a</em> string</p> Thanks.
  21. Thanks, I'm inclined to agree. I have being playing with cookieconsent this morning and it's really good.
  22. What's the general consensus for users with JavaScript disabled? Solutions are naturally JS-based and indeed most cookies would be set via JS and require JS to run. However, many scripts, such as Google Analytics, also give you an noscript image or iframe to install. How do you handle this? I presume they are still take people's IP and using it for tracking and therefore it's personal info under GDPR.
×
×
  • Create New...