-
Posts
4,054 -
Joined
-
Last visited
-
Days Won
67
Everything posted by Pete
-
Also an ex-MODx'er myself. It's been fun converting some very different sites over the past few years as things that required a lot of custom code and queries in snippets in MODx to something that's much more manageable using the API in ProcessWire templates. Kidderminster-Husum-Twinning Before: https://web.archive.org/web/20130726180253/http://www.kidderminster-husum-twinning.co.uk/ After: http://www.kidderminster-husum-twinning.co.uk/ StrategyCore Before: https://web.archive.org/web/20120118171718/http://strategycore.co.uk/ After: http://www.strategycore.co.uk/ Etc etc
-
Someone I work with was busily deleting files fro the Windows folder one day to free up space because "they didn't seem to be anything he recognised as being relevant". Same chap also had his laptop on a boat on a sailing holiday and it got soaked when a big wave came over the side. I constantly threaten him with his next laptop being one of these:
-
Site Profiles from Modules Directory as install option
Pete replied to Roope's topic in General Support
I'm not sure about it to be honest (which probably goes against what I've said on the subject when it's been mentioned before ). I mean, the user will have just done some manual work to get the files onto their server to begin installation anyway (even if they use the single file installation method) so it shouldn't be too daunting for them to put a different profile in the right place. What might not be a bad idea as a first step towards this is maybe mention on the first step of the installer that other profiles are available with a link to them? -
I'm going to highlight this again horst as it's the important bit So whether yours or Teppo's module is installed or neither, emails can still be sent using the default Wiremail class. Therefore if I'm writing a module that requires email sending functionality, it needs to be able to use the same functions whether it's ryan's base module, the SwiftMailer class or your own module or module authors won't know what to expect. I think these WireMail modules need to be coordinated somewhat so that whatever the base class supports, the other classes also support so there are no surprises.
-
The problem with just implementing it in Swiftmailer (or in your class) is this from ryan's first post: So I can't count on the user not just using the default WireMail class and certain functionality not being available. I think that the WireMail base class needs to have these functions set up before subclasses (is that the correct term?) implement features or we'll have issues with things working consistently or we'll have to do some checks to see which Mail module is installed. My usage in this case is writing modules that use the WireMail class, so I need the functionality in the base class to be sure that the emails will definitely send
-
Can we have options for CC and BCC please ryan (and then Teppo in SwiftMailer )? It's not mega urgent, but these do come in handy in a few situations.
-
I'm now on page 70-odd of stories on the Clients from Hell website... it's a bit addictive, and quite amusing
-
Cheers - I forgot I had similar in place for page edit as well! My next message as about not having template edit access, but I figured I could save a lot of headaches by just allowing the right permissions on the template (though I did see your note on the subject here: https://processwire.com/talk/topic/371-page-specific-permissions/page-2 ).
-
So my edit function works great, but my add function fails to override the correct permissions (I'm happy overriding permissions because the users can't see the page tree to cause mayhem and I will have other checks in the code too). I was trying to do something like this: public function executeAdd() { $this->fuel->breadcrumbs = new Breadcrumbs(); // start with a fresh breadcrumbs list $this->fuel->breadcrumbs->add(new Breadcrumb($this->config->urls->admin . 'mymodule/', "My Module")); $this->fuel->page = $this->page; $this->fuel->page->addable = true; $addForm = $this->modules->ProcessPageAdd; $addForm->parent_id = $this->page->id; return $addForm->execute(); } However $this->fuel->page->addable doesn't seem to want to work. I'm probably missing something obvious, but any suggestions?
-
Did you have fun explaining it to him in that last example? Please paint a picture of the look on his face (using words, not MS Paint ).
-
Can you not just do this when they submit the text field containing the URL? $pic->add($input->post->your-text-field); Not sure it works with URLs but that's the way to test it
-
Exactly what Soma said. What you are trying to do above when you say $page->title works sounds like you're trying to find all pages with the template "child-template" that have the current page in the "provincie" field, so you don't need to do anything more complicated than this (because $page is the current page): $selects = $pages->find("template=child-template, provincie=$page->id"); Or if you don't specify a field on the end of $page then it returns the page ID anyway: $selects = $pages->find("template=child-template, provincie=$page"); It sounds like you're trying to find other pages that relate to the page currently being viewed, so you should always try matching the current page's ID, assuming "provincie" is a Page fieldtype? For that fieldtype pages are stored using their IDs. UrlSegments is just over-complicating things at this stage
-
Would you like to export it as a site profile for ease of installation? All you have to do is install the Profile Exporter module to create a profile from your setup and then people can install ProcessWire using this profile.
- 5 replies
-
- 2
-
-
- HTML5
- Boilerplate
-
(and 1 more)
Tagged with:
-
EDIT: I edited my posts because millions of rows will slow down a search, but you have to ask yourself when you expect to encounter millions of rows in your database? Comments on a news site maybe, but then when are you ever going to want to search the contents of a comments field across all articles? It's all relative to what your scenario is.
-
I know IPB (this forum software) has an archive feature, but it's only worth it for forums when you reach many thousands of posts and want to archive some stuff that you don't want to search. I just did a whildcard search on the forum database for these forums over the 59,000 posts and it took 0.2973 seconds! Add on maybe a second or two when we get to 590,000 posts and it's still not that big an issue (though I would consider Sphinx or something by that point). For large numbers of invoices/bookings/whatever if you simply use sensible selectors in your templates then there isn't really an upper limit aside from disk space. For example, only returning small result sets (25 or 50) and paginating, or offering filters to specify date ranges etc. You will very rarely want to return thousands of results in one massive list, and even if you did you certainly wouldn't want tens of thousands, let alone millions, so you're very unlikely to ever try and pull in every row of a database into memory - you're more likely to want to filter your results to find something. If your tables are properly indexed (I think in PW the equivalent is that your fields would be autojoin ) then hundreds of thousands of rows are just taking up space, not slowing down queries significantly. Now, when you get to queries where you want to search the body field which contains unknown content length for a specific word and you have millions of rows, then yes - that will probably take a lot of time. If you want to do things like that then something like Apache Lucence or Sphinx will be the option to go for. I wouldn't worry about it too much though to begin with. I used to get into a habit of thinking "what if my site reaches this size" and you generally find that you don't have to worry about it for several years or more, by which time there will be other technology or improved technology available to help you out (the next Lucence or Sphinx for example). So if you implement a solution on day one of your site/application but don't need to worry about such volume in your database until year 2+ you'll probably only have to update your code anyway to make use of newer technology
-
The sky is the limit really, I hooked up Processwire to this forum software at www.StrategyCore.Co.uk but it really depends on what you want to do.
-
I've heard the "unoptimised script" excuse with different software on different hosts over the years and it always ticks me off when you're using software you know is properly configured and can handle the load. If nothing else I feel your pain
-
Why wouldn't you be able to store it in the database though? A database still exists on a disk so your only limitation is disk space and server power (assuming lots of pages means lots of visitors). It would be more worthwhile looking into caching options instead I think. Something like the ProCache module (see the Store link at the top of the forums) caches your pages as static HTML so the database doesn't get queried for users who aren't logged in and is a relatively simple but really massive speed boost whilst taking a lot of load off the server (neither PHP or mySQL get touched for ProCached pages). If you have some really complicated page templates, ie. lots of fields in an invoices template that will have hundreds of thousands to millions of rows etc, then it can be worthwhile building a fieldtype specificaly for it so that it acts like a normal table and all the fields are in the one table in the database (less queries to join all the data). I would definitely investigate other options first, but always remember that a database exists on a disk so is theoretically only limited by hardware if your queries are built well. What size site do you have that is causing you to ask about this anyway, if you don't mind me asking?
-
I've gone back to marking one of Soma's answers as the "solved" answer purely because his way doesn't require the extra pages, though both ways work. For those who are curious, you can use Soma's code in the executeEdit function and this in the executeAdd function to avoid the requirement of extra pages: public function executeAdd() { $addForm = $this->modules->ProcessPageAdd; $addForm->parent_id = your_parent_page_id; return $addForm->execute(); }
-
Ha, oh yeah - forgot it was under wraps I feel so silly - that's kind of obvious now you mention it I'd love to see the code behind that page - it's a bit further developed than mine is but in the same direction I'm heading.
-
Okay, marking Tom's way as the answer. In conjunction with this code in my autoload module I can even have the breadcrumbs displaying correctly: // In init: $this->addHook('ProcessPageEdit::execute', $this, 'articleBreadcrumbs'); public function articleBreadcrumbs($event) { $page = $event->object->getPage(); if ($page->parent == $this->kbHome) { $this->fuel->breadcrumbs = new Breadcrumbs(); // start with a fresh breadcrumbs list $this->fuel->breadcrumbs->add(new Breadcrumb($this->config->urls->admin . 'knowledgebase/', "Knowledgebase")); return $this->fuel->breadcrumbs; } } Since two correct answers were given in this topic I feel a bit bad changing it, but I'm sure Soma won't mind (look at the amount of likes he's had!!).
-
You know, I hadn't thought of doing it that way Tom - kind of obvious now I understand what you mean
-
Soma's solution works perfectly. I did have a look at the source and see if the page ID was in a field or something since it wasn't pulling it from the URL, but I guess it's something else. Doesn't matter too much as it works now. Thanks guys! Ha, but now my custom admin page isn't correctly highlighted in reno's new admin theme. Guess I can't have everything though hey?
-
I'm not setting the custom admin page as ProcessPageEdit though if that's what you mean?
-
Hmm... it is something to do with kb_category=page.kb_category so that narrows it down. When I remove that it's fine.