-
Posts
4,054 -
Joined
-
Last visited
-
Days Won
67
Everything posted by Pete
-
Something that the forum software does is that it only limits it to seconds, minutes and hours ago, then in other places says "Today at X:XXam" and finally "Yesterday at X:XXam" so it would be nice to have those options and set a cut-off in a future version so that "if the date is before yesterday then just return the date formatted with date()" for example The thing is, once you get past today and yesterday, you have to think about your use case and whether "11 months ago" is actually that descriptive. Not a criticism, just a note that when using this module you have to think about where you're going to use this and how accurate you want to be.
-
I like this as I spend a lot of time on forums and these little things make it seem more friendly. Nice work!
-
InputfieldTinyMCE should be in /site/modules/
Pete replied to Nico Knoll's topic in Wishlist & Roadmap
Without knowing much about the code I'm going to say that it should be possible to abstract it out at some point in the future to make it easier to drop other editors in with their own links into those parts of the core but I can see why ryan would want to leave it til later. It brings up tricky questions like if it's removed from the /wire/modules/ dir, how do you get the new distribution of /site/modules/TinyMCE to people upon upgrade? Since it wouldn't be packaged with the new version it would have to be done automatically by the then-integrated ModulesManager I think, causing someone yet more fun coding headaches But yes, I'm going to go out on a limb and bring out that line I like to use: "Everything is possible in ProcessWire". -
Digging up an old topic I know, but I had a need to have a module do some AJAX to request some content from itself - the details of that are irrelevant for now, but you can have a module intercept a page request so that you can have all your PHP code from the AJAX request sitting neatly in the module itself. For example, if your module's JS file sends an AJAX request on click of a certain element and you want it to return some data, you can do this in your module's JS file: $('#myelement').load('ModuleName-ajax?do=something'); And then you can intercept that request to yoursite.com/ModuleName-ajax by putting a line like this in your module's init() if (strpos($_SERVER['REQUEST_URI'], '/ModuleName-ajax') !== FALSE && isset($this->input->get->do)) { echo "Nice!"; exit; } And of course this then echo's "Nice!" into the leement with the ID "myelement" in your HTML. The only reason I used the module name followed by -ajax was to make sure that that would never be a page on the site. It just avoids confusion if you made a site about modules I wonder if someone will tell me there's a better way now
-
Rollback (and roll forward) is a great idea, but yes that would be more work A way to do it is have a /site/archived-modules/ folder and stick the older versions in there by module name and then by version. What are you thinking in terms of the manifest?
-
I meant Nico <sings badly>Oh oh, diogo, Nico, whoah, don't go</sings badly>
-
I honestly can't remember now... I have a feeling it used to be that if you set it to 1 then it wouldn't but there was a conversation where I think maybe ryan said in 2.3 and up it would now still work with ->first()
-
Yup - it's just because it can take any number of images by default, so if you change the field settings to only allow 1 image then be sure to remove ->first() from your code.
-
So really there could be a version check and where you can install admin themes you could leave a note for 2.2 users
-
Yes, like diogo said. By default an image field can accept more than one image so unless you specifically restrict it in the settings to allow only 1 field it will be an array. As for sizes, you could do: $image = $page->portfolio_image->first()->size(160); // <-- This sets width to 160px and creates a thumbnail for you. There are more image settings and the best resource to see everything (well, almost everything) is the Cheatsheet under Image Methods.
-
I'd leave it - 2.3 is nearly final I would have thought.
-
Might require PW 2.3 from the dev branch?
-
How to stop subdomain to be redirected to main domain?
Pete replied to bytesource's topic in Dev Talk
Well first off I'd say try it in ProcessWire so we can rule out MODx as the issue. -
I was expecting a long to Icanhascheesburger after all those cat mentions but that picture is equally random.
-
Running a Daily Newspaper website with Process Wire.
Pete replied to Crssp's topic in Getting Started
Yeah, but I meant more like this because I'd forgotten about that second link : <?php // Some code to iterate through the folder structure needs to happen, but when we have a file we do something like this: $filecontents = file_get_contents('news2-sample.txt'); $filecontents = explode('<!--Head-->', $filecontents); // This splits your contents into an array containing stuff before and after the <!--Head--> delimiter $details = explode("\n", trim($contents[0])); // Now Package, Rank etc are in an array - $details[0] contains Package, Name would be $details[2] and so on // I'll ignore <!--FM--> as I have no idea what it is, so let's just imagine that wasn't in the text file $maincontent = explode('<!--Text-->', $filecontents[1]); // We're now dealing with things after the <!--Head--> tag. $maincontent[0] now stores the article title and $maincontent[1] is the body. ?> There's more you can do from there to turn the newlines in the article body into paragraphs but this gets you started with some ideas of how to parse it all. Someone will probably come up with a better way fo parsing it all using regexp though but I went with what worked inside my brain (regexp hurts my head too much). -
I keep threatening to do one too but haven't found time yet... which is silly as I think it would take me less time than I spent on theming the forums!
-
Running a Daily Newspaper website with Process Wire.
Pete replied to Crssp's topic in Getting Started
It's possible to parse either of those easily with PHP, but I can't look at it tonight so I suspect someone else may beat me to a code sample that might do it -
There are a couple of things to bear in mind with this - some of them are the reason why I've not yet released it as a module. Their API was a bit basic, so I've not gone the API route at all with the module - it actually initializes the forum software itself and calls on classes and functions where required (so it doesn't load everything, but there is obviously some overhead like if you bootstrapped ProcessWire). This isn't a downside from a functionality point of view as that's how other apps from Invision Power work to some degree so I'm not doing anything the system isn't designed to do (one of the first things in the module is that it declares IN_IPB = false; for example to tell the forum classes not to load everything unnecessarily). The potential problem for me is that if they release a version 4 of the software or even a minor version, many of the classes and functions could change, so I need to think about supporting the module. It's reasonably advanced and I'm actually doing some work on it with another site to make it easier to roll out, but just integrating things like the member bar at the very top of the forums here into a PW site has all kinds of styling and Javascript issues that I'm hoping to get around so installation is just of a case of copying and pasting some snippets of code into templates. The bottom line though is that there is going to be some work on the part of the developer working on your ProcessWire project (you in this case) in terms of implementing things in the PW templates, so I will probably release it as a paid module so I can handle support. Plus I'm being a bit selfish in that it took me a hell of a long time to build as their code didn't make it straightforward No price estimate yet, but it wouldn't be extortionate. As a quick feature list: Member bar template for inclusion in your PW templates - member bar functionality carries across seamlessly between forums and CMS "Latest topics" function can pull from a news forum or any forum you choose. Caches for X minutes so you're not overloading the server. Create Topic function can be tied to PW page creation so you can handle comments inside the forum software (alternative to PW's comments module). Delete function will be called if the page is deleted. Add/Edit/Delete reply functions as well (so you can comment on a page that has a topic linked to it) Login/Registration (planned functionality coming soon) I know it doesn't sound like a lot, but you have access to all of the member's forum information as well, so you can really tailor the experience for them without having to create a user account in PW for them - I do have some experimental code that will do that as well though
-
I liked this one a lot: http://www.koalastothemax.com/ You can see the koalas eventually - at the max in fact! Extra points if you get to the end of this: http://heyyeyaaeyaaaeyaeyaa.com/
-
Formbuilder works on 2.3 if that's what you're asking?
-
To be honest it's not like other systems where there are massive changes - everything from 2.2 will work in 2.3 so it's up to you. Upgrading is just overwriting the /wire folder too so no hassle.
-
how to use InputfieldSelectMultiple (or InputfieldSelect) ?
Pete replied to mindplay.dk's topic in General Support
Jing is okay for free. -
Running a Daily Newspaper website with Process Wire.
Pete replied to Crssp's topic in Getting Started
I don't see an attachment either and I checked the post content in the editor (yes, I can edit your posts to make you all look silly).