Jump to content

ryan

Administrators
  • Posts

    17,243
  • Joined

  • Days Won

    1,704

Everything posted by ryan

  1. If you don't need to have the user maintain any specific profile data or password, etc., then you can also just create one user and use it to represent all your social service logins. Or you could create one per service (facebook, g+, etc.). This only works if the user can't change anything on their PW account. It's basically the same thing that PW is already doing with the 'guest' user and role, assigning that user to anyone not already logged in.
  2. This isn't far off from what PW is trying to do, at least relative to other systems out there. The only things we have in root are: /index.php /wire/ /site/ /.htaccess There are a few readme/txt files in there, which of course are just for initial reference and don't need to stick around with the site. It is no problem to make your /wire/ a symlink to a shared /wire/ directory located somewhere else. But probably best to keep /site/ where it is.
  3. I'm guessing it's not the CSRF protection, but that's a good thing to mention too. If that CSRF error was the one that you are getting, you can disable CSRF protection by adding this line to your /site/config.php: $config->protectCSRF = false; However, I would check the sessionName and sessionFingerprint considerations first, as a CSRF error may be a side effect of a cookie conflict too.
  4. PW doesn't care where you run it or whether you move it between subdirectories, etc. So you should be fine. The only thing you need to consider is local links you may have in a TinyMCE field. Since that is raw HTML that TinyMCE uses, it may have direct links in it (if you've inserted images or links through TinyMCE). In that case, you'd want to do an search/replace on your DB dump file replacing "/ProcessWire/" with "/", before importing to your live site. There is also a module that can manage this for you called PageLinkAbstractor (currently being re-worked under the name LinkManager). But this module is one you have to start with and stick with, so probably not as helpful here. But I usually just do the search/replace when migrating from a local subdirectory site to a live root level site. Again, only necessary if you've got image, file or URL links in your TinyMCE rich text fields and are switching from subdir to root.
  5. I agree with DaveP that it does sound like there is some sort of cookie conflict in your domain. I don't think copying and pasting between tabs should be a problem at all. Are you working with two different copies of ProcessWire on the same domain? If so you'll want to change your sessionName in /site/config.php for one of them. Does your IP address change during the session? If so, you want to disable sessionFingerprint in your /site/config.php
  6. Looking good! Thanks for posting this. I look forward to seeing this one in the modules directory. I think the reason your fx() function is getting called twice is because there are likely two hooks being attached to Pageimage (as a result of your init being called twice). I'm guessing that you have two image fields using this fieldtype? So your init() is getting called twice and two hooks are getting added. If you are keeping this as a Fieldtype, you may want to move your counter to the init() function or use self::isHooked('Pageimage::fx()'); However, I'm also wondering if this module might be better on it's own rather than extending FieldtypeImage? At least, I don't currently see a reason for it to extend FieldtypeImage, though I may be missing something or you may have more plans yet. But am thinking that your function would only get called once if it weren't extending FieldtypeImage.
  7. Nice module slkwrm! Don't forget to add to the modules directory.
  8. I like MadeMyDay's solution. A couple other possibilities are: 1. Use MarkupCache rather than template caching. That way you can cache just the parts of the output that you want to, and leave the things like your counter uncached. 2. Create an autoload module. Add a ready() function to it and have that function increment the counter of $this->page (using the same method you are already doing).
  9. I'm not sure why you'd be getting a Page by accessing that, I would think it should be null. What do you see from get_class($repeater->images)? However, I want to mention that Pagefiles/Pageimages aren't indexed by number, they are indexed by filename, so am thinking at the moment that $images[0] may not relate to anything. $repeater->images->eq(0) is probably what you were after, or $repeater->images->first().
  10. It's also just fine to use jQuery UI tabs if you prefer. WireTabs are mainly useful for tabbing PW's Inputfields, which jQuery UI tabs don't let themselves as well to.
  11. I think the same applies whether site profile or not. Where have you written all your code? I'm guessing primarily just /site/templates/* but possibly /site/modules/ too.
  12. Just wanted to clarify that it keeps the template names and meta data in memory, not the template files themselves. If you are seeing the basic-page.php file open in your debugger, and a page using that template is not being rendered, that doesn't sound right, so let me know.
  13. The simplest solution would be to just put the 'featured' page reference on your homepage, and select the featured page from there (via a PageListSelect input). But if you need to do it from a featured checkbox on the actual page being featured, then you might want to add another component to finding the featured page: $featured = $pages->get("featured=1, sort=-modified"); That would pull the page that was most recently modified and featured. It would also be relatively simple to un-feature pages via a module or in your template, etc. $allFeatured = $pages->find("featured=1, sort=modified"); $featured = $allFeatured->pop(); foreach($allFeatured as $p) { $p->of(false); $p->featured = 0; $p->save(); }
  14. PW keeps the meta data for all the templates and fields in memory. So I would expect to see basic-page somewhere in there whether it's used or not. This is basically just caching. Templates and fields aren't assumed to be infinitely scalable in quantity like pages are, so we take advantage of the performance benefits of having those things ready-to-go in one query. However, you shouldn't see any "template files" loaded that aren't being used in the request.
  15. I think you guys are right on about this. I remember years ago (1990s?) I was using a full blown IDE, debugger and profiler. But I've rarely used such things in PHP. I suppose from-scratch debugging in PHP is a lot simpler than things I've used in the past, so it just hasn't come up as a need. I did experiment with XDebug years ago, but seemed like it was costing me more time than it was saving. Now I'm curious again, thinking I might benefit from a PHPStorm + XDebug setup in some situations (like mindplay.dk has mentioned as well).
  16. Awesome module and really nicely produced! Thanks for making this. I ran into a couple really minor things, but figured I'd mention them before I forget. 1. Saw a couple PHP notices at the top of the screen, but can't remember exactly at what part. However, I'm guessing anyone with debug mode on will see the same. 2. Getting an overflow on the search keywords screen: Great job with the module and the code.
  17. You'd just want /site/templates/ right? Or perhaps /site/modules/ too if you've got any module dependencies in the templates. If you want to make it installable as a site profile, then you'd want to run the site profile exporter and include the /site/install/ directory too. But you'd want to double check that none of your module-specific passwords are getting included in the profile.
  18. The size() function is basically returning a brand new Pageimage object, so if you wanted kelvin to do the same, take a look at the size() function in /wire/core/Pageimage.php -- let me know how this works out.
  19. ryan

    Codesense

    I've been adding all of interrobang's PHPDoc comments to the core source code dev branch (great additions interrobang!) so thinking this will help a lot too.
  20. ryan

    Twig

    Great, glad that worked. I'm putting a lot on the dev branch this week but will pull it all in next week. My internet access isn't all that consistent this week, so figured I'd avoid any unnecessary master commits temporarily.
  21. I'll take a look and fix this when I get back to my office next week. I think I've already fixed this issue once already (with IE8) so it might be as simple as canceling a behavior if the IE version is 9 or above.
  22. Default values sound good as a feature, but in practice the need seems to be rare in ProcessWire. There are so many other (usually more efficient) ways to accomplish the same thing. So when/if we implement default values, it'll probably be more about appealing to people's sense of features rather than something that will actually add much value. But there are those rare instances: like a page reference field with categories where you want 3 of them selected by default... I don't think I've ever had the need, but can see it coming up for somebody.
  23. Someone correct me if I'm wrong, but IE9 doesn't support the HTML5 FileAPI, which IE10 does? To drag files into the browser and have them upload using HTML5 methods, the browser has to upport FileAPI. The only modern browsers that I know of that don't currently support that are IE9 and Safari.
  24. A default value that is displayed but not stored is really no different than having no default at all. But one might assume that they could go perform a find() or something and match pages having that default value, and you couldn't. So it introduces some confusion there. There's also the danger of the default value getting set back to the field and inadvertently saved. That's why I kind of prefer letting the developer decide when and how to implement their default value in their own code. There's no ambiguity about it. But I do still think we'll want a "populate for new fields" like Adam mentioned, for some fieldtypes. The best example is a checkbox that you want to be checked by default.
  25. Remove the "autoload" and "singular" lines from your getModuleInfo function.
×
×
  • Create New...