Jump to content

ryan

Administrators
  • Posts

    16,772
  • Joined

  • Last visited

  • Days Won

    1,530

Everything posted by ryan

  1. 2.3 (dev branch) also supports omitting the width/height attributes from inserted images. You can get to it via Modules > Process > Page Edit Image, and see the checkbox in that module's settings.
  2. Could this line be the problem? Notice you are checking statusHidden twice rather than statusUnpublished: if ($galleries_page->is(Page::statusHidden) || $galleries_page->is(Page::statusHidden)) {
  3. For your beginning/ending matches, you might also try using the %^= and %$= operators. They are the same as ^= and $= except that they bypass the fulltext index and the limitations (and benefits) that go along with that.
  4. I'm stepping into this kind of late as I've been out of town, but just want to mention that if you've got a lot of plugins in WordPress that already accomplish what you need, there's no reason to try and duplicate that somewhere else. WordPress is a very good platform for many needs, and if you've got a couple dozen plugins accomplishing things you need, why look further? There should be no shame in using WordPress. Plenty of us will still use it when the needs match up. Ultimately the whole point of tools is to save you time and make your job easier. Use the tool that accomplishes the goal in the most direct manner possible.
  5. The error message is intentionally vague because you don't want to reveal anything about the system or what's happening to non administrative users. Detailed error messages are a hackers best friend. If you are a logged-in admin user, then you should get a more detailed error message. Likewise, you can review your /site/assets/logs/errors.txt for more detailed messages. Lastly, you can enter an email address in your /site/config.php ($config->adminEmail) and get error messages emailed to you as they occur. The one that Soma mentioned sounds unintentionally ambiguous when it shouldn't be, so let me know if you find a way to reproduce it. However, the one BrendonKoz mentioned is very much intentionally vague for security reasons.
  6. I take the same approach as Soma, which is to use browser tabs when I need to keep tabs on more than one thing at a time (like the Page List while editing another page). Basically I'll be in the page tree, and CMD-click the 'edit' link, when I want to keep my current Page List handy. I think there are a lot of good and welcome ideas here, and I'd like to do anything I can to support implementation of them in other admin themes. For the default admin theme, I feel like I've got to keep it immediately understandable and infinitely scalable. It's got to be something that will accommodate any situation. I have no doubt that other implementations are possible that would have more appeal to some (especially power users), but it would be a compromise in some other respect. What I'm trying to avoid is a sidebar tree because that gets awkward when things grow. I've been turned off by the way that Silverstripe and MODx handle this. Likewise, I'm reluctant to introduce any kind of frames in the default admin theme (other than modals) or accept the overhead of executing PageList on every request. I do like what Diogo demonstrated about a sidebar that pops out only when you hover (or click) it, but only if it were a top (or bottom) bar instead that can span full width. But there's lots of baggage to consider. Example: if taking the frame route, adding a new page wouldn't be reflected in the PageList. If not taking the frame route, then PageList is getting executed on every request. There may be simple solutions to these that I'm not aware of, or there may be other issues to consider as well. If anyone is interested in working on an admin theme (or variation of one) that accomplishes any of what's been mentioned in this thread, then I'd be very interested and glad to help in any way I can. If there's anything that needs to be added to the core in order to support, I'll add it too.
  7. Nik, thanks for your research and testing on this. Admittedly I found a lot of ambiguity about the the salt rules. It's been awhile now, but if I recall correctly I was not getting the expected results when taking the PHP docs literally on this one. I found several other sources that indicated it should be 21 characters plus a trailing $, so that's what I went with. My first inclination here is to avoid the issue you brought up by making supportsBlowfish() return false when the PHP version is older than 5.3.7. After all, 5.3.19 and 5.4.9 are the current, so treating 5.3.6 and lower like 5.2 probably makes sense here. Based on your understanding of this, would this solve the issue you were running into? Or do you think revisiting the salt length is a necessity?
  8. If you are using any template or markup caching features, you might also want to clear those caches after moving a site to/from a subdir. To do this, go in the admin to: Modules > Markup > Markup Cache > clear cache Modules > Page > Page Render > clear cache
  9. Those status values are just meant to indicate the comment's moderation status whether spam, pending or approved. They aren't bitmask flags like a Page status, so I don't think it's a good candidate for what you are trying to do unless your statuses would supersede the built-in ones. You might instead want to designate a certain email address or IP address to indicate a system comment. These fields are already built-in and can potentially be repurposed. You can modify any of the values before a comment is saved by hooking before one of the functions in FieldtypeComments.module. I would recommend either sleepValue or savePageField, both of which are called before a comment is saved. Another alternative is to copy and rename the FieldtypeComments.module or all of the comment module files to make your own customized comments module. If you go that route, you'll need to rename the classes. I know that Nico has done this, so you may want to look at what he's done with it as well.
  10. Just to confirm, this is the line that doesn't work? foreach($products->find("applications=$a, uses=$u")) as $p) { I can't say for certain why not because I don't have the code in front of me to execute, but make sure you were using $products and not $pages. If you want to test an alternate, it could also be written as this: foreach($products as $p) { if(!$p->applications->has($a)) continue; if(!$p->sectors->has($s)) continue; echo "<li><a href='$p->url'>$p->title</a></li>"; }
  11. Cropping direction has been added to the latest commit on the dev branch. Example of usage: $image = $page->image->size(300, 200, array('cropping' => 'north')); // or you can use this shorter syntax $image = $page->image->size(300, 200, 'north'); That would make it crop towards the top of the image. Possible values for crop direction include: northwest, north, northeast, west, center, east, southwest, south, southeast or a blank string to disable. If you prefer, you can use short versions like 'nw' for northwest or 's' for south, etc. Crop direction can also be used with the width/height functions: $image = $page->image->width(300, 'north'); PW now supports this shorter syntax for crop direction, and also with quality and upscaling. If you specify a string for the last argument, it assumes you are specifying a crop direction. If you specify an integer, it assumes you mean a 'quality' setting. If you specify a boolean, it assumes you mean an 'upscaling' toggle on/off. If you need to combine multiple options then of course you should specify an array, as before. This behavior applies to the size(), width() and height() functions. If interested, more details are in the function comments. Thanks to interrobang for providing the implementation of crop directions.
  12. The profile exporter does exist, but I don't think it has seen a lot of action yet. I hope to change that and put out a couple more profiles myself here soon.
  13. Arjen thanks for creating and sharing this module. Can you post to the modules directory?
  14. This thread was started for a different trip, but figured I'd re-use it since it was already here. I'm back in town finally after a great vacation. Thanks to everyone for keeping things running smoothly here. It looks like it's been an exciting week here with all that's going on with the Wiki and some cool releases. I look forward to getting caught up! Today I'm just unpacking and such, but will be back in the forum and email tomorrow. It may take me a few days to get fully caught up. To people that have posted messages directed at me or emailed me, thanks for your patience. I will be sure to get caught up on every thread and email.
  15. Thanks Soma this is really nice of you. Thank you also for all the great work that you are doing here! Now I have to logoff for a few days, so this is a great last post to read before I head out. Hope that you all have a great weekend and week! Also please no more Ektron licenses on my credit card.
  16. I think you are better off not exiting, just because any hooks that go after render theoretically wouldn't get executed. It's possible some other housekeeping might get missed. Doing a "return;" might be better.
  17. ProcessWire has a class called WireUpload that's worth checking out.
  18. Definitely possible, and there are some past posts that cover similar territory (though can be admittedly hard to find). My office is just about to close up, so have to reply quickly, but here's a few places to start: Have a look at the API cheatsheet and the $pages var. If you want something ready-to-go, Form Builder can do this without you having to code anything. You might also look at the FormTemplateProcessor module at modules.processwire.com.
  19. Could certainly do that. Not sure I'd want to make such long filenames full of MD5 hashes though. I suppose I'd prefer to have a human-readable filename that isn't quite so long. Though the scalable benefits of the hash are hard to argue with. Definitely something to think about.
  20. Isn't Solr Java-based and have something to do with Lucene? I don't know if I've actually come across a server with this, though could be wrong. It seems perhaps a bit specialized for our case, but willing to look into it.
  21. You'd want to hook after $pages->save(); If you want your function to execute on every page save, any time, then you'd want to create an autoload module. http://wiki.processwire.com/index.php/Module_Creation If you want to capture newly added pages separately, then you'd also want to hook $pages->added(), which is called after a new page has been added. This example shows both: /site/modules/HelloWorld.module class HelloWorld extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'Hello World', 'summary' => 'Just an example module class.', 'version' => 1 'autoload' => true, ); } public function init() { $this->pages->addHookAfter('save', $this, 'hookSave'); $this->pages->addHookAfter('added', $this, 'hookAdded'); } public function hookSave(HookEvent $event) { // this function called any time a page is saved (whether new or not) $page = $event->object; // now you can access anything from the $page } public function hookAdded(HookEvent $event) { // this function only called after a new page added $page = $event->object; } }
  22. Haven't tested, but adding this, or something like it, to your .htaccess (after RewriteEngine On) might work: # skip over URLs with a period (possible filename) or your admin URL RewriteCond %{REQUEST_URI} !(\.|processwire) # skip over requests to files that physically exist RewriteCond %{REQUEST_FILENAME} !-f # redirect to the same URL with a trailing slash RewriteRule ^(.*)([^/])$ http://%{HTTP_HOST}/$1$2/ [L,R=301]
  23. The best way to debug cookies is to watch them in your browser inspector. In Chrome thats View > Developer Tools > Resources > Cookies. In Firefox, FireBug makes it easily to track them as well. Locate the cookie and then keep your eye on the window and watch what changes it goes through as you navigate between pages. Another thing to double check is that you don't have any output occurring before your setcookie(). That could very well prevent the cookie from being set. Even a little PHP notice that you didn't know was there could screw it up. So view the source on your page and see if you've got any error messages appearing above your <doctype>.
  24. That setMaxFileSize is only in the dev branch.
  25. ryan

    ProcessWire on the web

    I'd welcome the opportunity to do anything that helps move the ProcessWire project forward. I'm cool with interviews so long as I've got at least a rough list of questions ahead of time. I tend to think a lot before I speak so wouldn't want to waste people's time with "Hmm, let me think about that" or "Hmm, let me look up what FLOSS and FOSS means again." Since I don't work in an office with other developers, it's rare that I talk to anyone about webdev topics. But think I can do a good job when prepared.
×
×
  • Create New...