-
Posts
4,043 -
Joined
-
Last visited
-
Days Won
67
Everything posted by Pete
-
Love all of this - I've uploaded my modules I think there are only a very few things I'd suggest adding (that may also cause you a headache! ): The ability to upload images for illustration/instruction purposes The ability to link to a YouTube or Vimeo video A download counter Other than that it's all very good. My only other thought is that it asks you to enter your forum name as it appears in the forums, but your name appears lowercase after you submit the module. Am I right in assuming it's creating a ProcessWire user account? In that case wouldn't it make sense to have another field in the user template called "forum display name" or something like that?
-
ryan - The module for IP Board would need to read files from the forum directory (it initialises and uses various classes) so I'm not sure how we could work around that. I can send you what I've got shortly and you can have a look though.
-
I'll send you over something that does just that later on as that's relatively easy. There are a few internal IPB functions along the lines of getMember that I think take an ID or name and return the user's details which is what I use to build those URLs myself. I can then leave out the other functions that I'm not quite happy with until I've properly checked them.
-
If you like Ryan I'll finally tidy up my forum integration module and you could have comments tied into the forums as well as be able to auto-link it to the current forum user? I use it to auto-create users in PW as well but I just need time to finish that bit off properly. Or it could wait for a version 2.
-
Nice addition - could be very useful for user comment fields. You can still type bbcode into these forums too by the way, just the editor makes it a little pointless really.
-
I've updated this to include yellowled's suggestion of making the code appear in a form field - easier to copy and paste plus it looks neater. Also turned off autoload at ryan's suggestion. Thanks guys! I would love to see this, though I think it would only happen for something like the blog profile ryan is working on, since the basic layout is pretty much standardised (so the user has no need to move the layout around if they don't want to). In that case and in the case of other standardised site profiles, I'd be happy to modify the module to automatically insert code. I guess in that instance, what you would want it to do is scan the installed theme for any links and scripts and try to replace them automatically with a couple of minified strings, something that would have me tearing my hair out trying to work out the regexp for I think I'll cross that bridge when ryan builds it
-
Thanks! I'll look into the form field. Not sure about the clean URL as that may require altering the config file for min, and I'm trying to keep it as simple as possible to upgrade. That said, it's not like the Minify library gets updated that often so I may look into that. I still think that non-expert users will have to modify the default template anyway if only to change the theme, so I'm not too worried about that. If they can't at least copy and paste then managing a CMS is going to be a shock
-
The isue with the double links was because there was an old copy of the forum theme still in the database - removed that now. That indentation issue is very odd though. It might have been fixed in the latest version though so I'll check it locally when I get time.
-
Cheers I was getting a headache last night trying to get the variables escaped well enough since they're inside a PHP variable inside a JS variable in the module code so didn't bother in my first version since they kept on messing each other up. This is now fixed in version 0.0.2 (download from the original post above) where you can even view the horrible code that solved it It would be a lot of extra code to implement your first idea though and, unless you actually have a pre-configured head.inc file that you drop into each project, this doesn't actually save you any time. Even then it only saves about 10 seconds per project (or however quickly you can copy and paste) which probably doesn't add up to how long it takes a kettle to boil over the course of a year I think I prefer the idea of people pasting the code for the following reason. If you upload a lightbox like Shadowbox, or other scripts where they have their own folder structure that you need to preserve you might find that you need to manually tweak the URLs. Here's an example from one of my sites (before I built the module): <link href="/site/libs/min/b=site/templates&f=styles/reset.css,styles/general.css,dark/css/dark.css,light/css/light.css,scripts/fancybox/jquery.fancybox.css,styles/forums.ipb.css" rel="stylesheet" type="text/css" /> Lots of scripts in different folders means that the way this module works - scanning two of PWs default directories for files - simply wouldn't work. I'd wager that if someone did something similar without understanding how it worked that they would either: use Minify for the scripts in /site/templates/scripts/ and a normal <script> tag for the rest (which sort of defeats the purpose of it), or: abandon using the module entirely when they perceive that it can't do what they need it to do. My thinking is that by looking at the code they can do what I did and simply tweak the paths to suit. I think overall there are too many possible configurations to take all of the work away from the user.
-
Possibly a recent upgrade issue - I'll look into it today.
-
A modules section is planned for the new website, so that should help
-
Here you go:
-
ProcessWire2.+ Minify 1.0.3 This module helps you combine Javascript and CSS files into one, minified file to save on unnecessary HTTP requests and to compress files anywhere up to 80% (including already minified .js files). To use it, extract the attached zip file into your /site/modules/ directory and check for new modules in the ProcessWire Admin area, then install the module. Once installed, go to configure the module and, instead of this configuring anything for you, you can use the drop-down lists to build stylesheet and script code to place in your templates, grabbing a list of any stylesheets and scripts it finds in the /site/template/styles/ and /site/templates/scripts/ directories respectively. It's more of a helper than anything else, but it should take the guesswork out of configuring Minify for your site. Notes: This module contains a third-party library - Minify - which is subject to its own license (a copy is included in the attached zip file). I've left the module in-tact including its unit test files so there are more files than are necessary, but this will make it easier for me to upgrade the module if/when they release updates to that code. This module doesn't insert any code into your templates automatically - I think copying and pasting the code it currently outputs to the screen is more useful/configurable for more situations. It's worth using even if you only have one CSS or JS file as it will compress CSS files by about 80% and JS files by quite a lot too, plus since it handles caching on the server-side and does its own checks of the files it is serving (plus it's a dynamic URL), you can always be sure that it will serve the latest version of a CSS file (no more CTRL+F5 to show the new styles if your browser decides to cache it. You can change the /site/modules/Minify/min/config.php as you could if you were using Minify as a standalone script - tweak cache paths (default is your server's cache path) and other advanced settings here. Updates: v0.0.2 - now produces code that includes paths derived by ProcessWire at run-time so paths will be fine on localhost and live servers, removing potential issues when pushing a site live. v1.0.0 - bumped this up to a major version number since there appear to be no issues with the initial versions to speak of. Also implemented yellowled's input field suggestion (looks much better and easier to select for copy and paste purposes) and turned off autoload at ryan's suggestion. v1.0.1 - now recusrively searches for files inside subfolders under the scripts and styles directories using PHP 5's built-in iterator classes v1.0.2 - pull request from teppo - https://github.com/Notanotherdotcom/Minify/pull/1 v1.0.3 - updated Minify code to v2.1.7 which fixes a significant security flaw: https://groups.google.com/forum/#!msg/minify/cpN-ncKPFZE/kwYVpLMkfDwJ You can download the module here.
- 35 replies
-
- 17
-
-
I think that would be massively complicated in that if you delete the original page it's attached to then that file also gets deleted (each file/image is stored in a folder named with that page's database ID).
-
What I meant was different files for different templates, so on one site I load extra JS and CSS on a page containing a Google Map and in that case I simply set that page to use a different template and in the head.inc file check the current page's template and - if it matches 'map' for example - output the relevant extra JS and CSS. Module should be ready tomorrow or Sunday at the latest.
-
Module: Video embed for YouTube/Vimeo (TextformatterVideoEmbed)
Pete replied to ryan's topic in Modules/Plugins
The good thing about oembed is that you don't rely on third party scripts/services and many services already support it - see Ryan's module code and you'll see YouTube and Vimeo's oembed URLs As such, this module can easily be expanded upon to provide more services. -
I'm halfway through a module for this already, but it will still just build a URL from a selection of files to paste into the template. The whole ethos of ProcessWire is not making assumptions about what people are going to do with it or how they're going to work, so reducing the Minify process to a simple copy and paste is about as far as I feel comfortable taking it. There are occasions where you won't want every JS or CSS file being called for every page so I don't want it to make assumptions or rewrite anyone's HTML markup if I can help it. It'll be a simple solution though - I promise You will always have code in your templates by the way so that's not a problem. Take a look through the default template files in the site/templates directory to see what I mean.
-
Module: Video embed for YouTube/Vimeo (TextformatterVideoEmbed)
Pete replied to ryan's topic in Modules/Plugins
No probs, but not sure it was me that mentioned oembed ryan - think I said I'd build this module and then never did (there's a theme there ). -
I would still choose Minify since it already handles CSS as well and doesn't require the .htaccess: http://code.google.com/p/minify/ I've got it working on one site already, but I don't know that it's really worth a module to be honest since its already easy to set up (there's a helper script included that pretty much builds the URL for you). I just put mine in somewhere like /site/lib/min/ and put the relevant URL in head.inc for the JS and CSS. A module could save a little time, but in the case of Minify it would be about ten seconds EDIT: I did just think of a way a module could save a lot more time actually so I might build this module soon. EDIT 2: my first thought was to make it inject the relevant code before the head tag but that's nt always ideal plus you don't always want all scripts/stylesheets in every template. I think I might just make it give the relevant code to copy and paste into the template instead.
-
I was a long-time MODx user before PW and it does take time to un-learn your previous system. Moving forward though PW is pretty easy to pick up with the right examples - the people using it have a wide range of programming knowledge and ability. It's always interesting to see what people come up with and gratifying to see them get going with it after asking a few questions here, so if you have any other queries or suggestions please keep them coming.
-
Oddly in Windows it's Alt+F4 to quit an application, so Alt+Q probably starts your car by that logic Not saying Macs make any more sense mind, requiring a key with a fruit on when they ran out of letters and numbers that by all rights should produce an apple when pressed.
-
Yup, what they said
-
Just after your foreach I would do $thumb = $feature->images->first()->size(325,325); and then you can output $thumb->url and description as normal.
-
No probs - no such thing as a bad question. You'll want $feature->images->first()->url and if you want the description too then same as this but description instea of url
-
I'm with you on that Soma. Even on my largest site with 400 pages there are only a few images (maybe 5-10) that actually needed to be re-used elsewhere. The more I think about file managers the more my head hurts nowadays, but it did seem odd at first coming from MODx's file manager (something hooked up to TinyMCE) but after you get used to it it's far easier this way for most purposes I've found.