Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/07/2012 in all areas

  1. Hello there! Appreciation First of all I would like to say Thank You for making such a fantastic back-end. In my ten years of web development it's the first one to actually make sense to me. When I used to develop in Flash I was searching every where for a back-end that would just let me output my data as xml without the hassle of learning a new "language" or syntax, or messing with settings directly in the back-end itself. For my current portfolio and some other sites I ended up using Drupal with some plugins for managing the data and then just dug in to the database directly, pulling out whatever i needed. It wasn't easy, but it was easier than learning how to make an actual plugin that did the same. With process wire I realize now I could have saved weeks of development, had I known of it's existence. It was so easy to get into that I basically just sad down a few hours one day to get familiar with the UI and I have only had use for the cheat sheet ever since. This stuff is build in a very logical way and without unneeded complexity. I can see a lot of thought / experience has gone into this, and I really appreciate you letting us use it! Question I have some ideas for new modules that I would like to build. They would add some extra functionality to the core functions of Processwire. One is to implement getID3() (http://getid3.sourceforge.net/) to get the extra data in mp3s like $fileMp3->composer for example. The other one is to add extra image functionality on both the front- and back-end using imagemagick. I'm updating my portfolio to an html5 version and it's going to have a worn down/outdoor look, and therefore I'd like to add some Instagram type of effects to certain images (http://net.tutsplus....lters-with-php/). On the back-end I would like to add options for adding image effects when the image has been uploaded. I would like to keep the original while the modified Image is used by the front-end. Ideally it would be a drop down with some predefined effects while having the option to add more than one effect. Next would be to extend the Image with more options, just in the same way resize works. For example $fileImage->resize(150,150)->kelvin(75, "#4499ff") I'll post what I came up with so far. It's inspired mainly by the tutsplus article and it contains obvious errors, but it's more to give you an idea of what I want to achieve. I looked for an Image class to add a hook to - in the same way that resize works, but I couldn't really find out how it was put together. I also don't quite understand why this module shows up under an "Image" section as I didn't define it anywhere (see attached image). I'm not asking for finished code here, but looking for guidance as http://processwire.com/api/modules/ and the hello_world.module don't tell me what I want to know. Or maybe I'm looking in the wrong place? Anyway, here's the code so far. Any tips would be greatly appreciated! ( And sorry for the wall of text ) <?php class ImageInstagram extends WireData implements Module { public $_image = NULL; public $_output = NULL; public $_prefix = 'IMG'; private $_width = NULL; private $_height = NULL; private $_tmp = NULL; public static function getModuleInfo() { return array( // The module'ss title, typically a little more descriptive than the class name 'title' => 'Image Instagram Effects', // version: major, minor, revision, i.e. 100 = 1.0.0 'version' => 003, // summary is brief description of what this module is 'summary' => 'Add InstaGram effects to images', // Optional URL to more information about the module 'href' => 'http://www.processwire.com', // singular=true: indicates that only one instance of the module is allowed. // This is usually what you want for modules that attach hooks. 'singular' => true, // autoload=true: indicates the module should be started with ProcessWire. // This is necessary for any modules that attach runtime hooks, otherwise those // hooks won't get attached unless some other code calls the module on it's own. // Note that autoload modules are almost always also 'singular' (seen above). 'autoload' => true, ); } public function init() { $this->addHook('Images::kelvin', $this, 'kelvin'); } public function kelvin($event) { $this->tempfile(); $this->execute("convert( $this->_tmp -auto-gamma -modulate 120,50,100 ) ( -size {$this->_width}x{$this->_height} -fill 'rgba(255,153,0,0.5)' -draw 'rectangle 0,0 {$this->_width},{$this->_height}' ) -compose multiply $this->_tmp"); $this->frame($this->_tmp, __FUNCTION__); $this->output(); } public function tempfile() { # copy original file and assign temporary name $this->_tmp = $this->_prefix . rand(); copy($this->_image, $this->_tmp); } public function frame($input, $frame) { $this->execute("convert $input ( '$frame' -resize {$this->_width}x{$this->_height}! -unsharp 1.5×1.0+1.5+0.02 ) -flatten $input"); } public function execute($command) { # remove newlines and convert single quotes to double to prevent errors $command = str_replace(array("\n", "'"), array('', '"'), $command); $command = escapeshellcmd($command); # execute convert program exec($command); } public function output() { # rename working temporary file to output filename rename($this->_tmp, $this->_output); } }
    1 point
  2. It is definitely something that you think you do need (of course you need default values), but in real life I haven't got the need even once (only default date).
    1 point
  3. Confirmed here too. Glad that it isn't anything worse: it is possible to drag after instert to correct position.
    1 point
  4. I think that much of it would be simpler to implement than with TinyMCE, as the API looks super-simple and straightforward. At the same time, I don't think this editor is anywhere near as broad in scope as TinyMCE, but it probably crosses over with much of what we like TinyMCE for. I don't think we'd want to put a lot of time into building full integration around this editor, given the ambiguous license that says it's GNU compatible but obviously isn't. But I do think it's worth some trial and experiments. Rather than have anyone buy a developer license, we'd probably just include in the instructions where to download Redactor and where to put it's files. Then if people are really liking it, we can go for the developer license to make installation a 1-shot deal. But I think we'll have to keep this 3rd party (non-core) to avoid license interference.
    1 point
  5. http://www.bs-eutin.de Unfortunately, the site's in German only, so most of you guys won't understand its content. It's a site for a very specific type of school. I'm not sure if this type of school is common outside of Germany – the dictionary mentions the term "trade school". In Germany, apprentices still have to go to school one or two days a week. Also, this school offers some educational programs for people who are not satisfied with their regular school education and want to earn a better degree etc. Anyway, it's HTML5, it's responsive (using Adaptive Images), it uses some jQuery plugins (most notably Responsive slides and Colorbox). The logo was already done before I got the project, it also "dictated" the webfont. Unfortunately, quite a lot of pages are still missing a photo – the school is producing all the photos themselves (which I always prefer over stock photos), so it will take some time to fill the holes here (because the school term just started). This is the first larger project I did with ProcessWire, and it's been a breeze. Like I always say, it's not really a question if something can be done with PW. The question is how it can be done with PW.
    1 point
  6. Hi and welcome to the forums! That comes from the classname. Camelcases are preferred there and modules directory will use first word as a category. I would myself try to build the API methods first and after that is working start to build the admin usage. You also might find some help from my thumbnails modules: https://github.com/apeisa/Thumbnails Interesting module and I hope to help you more soon (pretty busy today). That is not the simplest one for first module, but the need is a good motivator I'm sure you find good help from here. Ryan is on holidays this week, but there are many who can help you out. Also, if you can point out more exact questions it will help us to help you.
    1 point
  7. No problem. I've been busy with other projects so didn't get the chance to do much unfortunately. Hopefully I can get some more work done on it. This is what I thought. My main issue is determining what to do if the user has files in the views directory. Should I remove it anyway (I don't think this is the best bet); give user a message stating that it should be removed if they no longer use it; or give some way (checkbox) for them to select to delete it on uninstall? Personally I like the last option, so is this something that is relatively easy to do in an uninstall routine? Is there another module that has user interaction in the uninstall method that I can look at for reference? Yes. At first I thought this behaviour would cause more potential issues than it solves, but it would definately make templates cleaner (there are many cases where it is unclear whether you can use, say, page.image or you have to use page.get('image'). This makes things a little messy and difficult to debug due to the fact that variables might be called from inherited templates. There is an 'if defined' type function in Twig, but this method itself can trip ProcessWire's exception. If you don't think it is feasible to do it in the module itself then I guess if you are happy to add the configuration option it would help a lot. By the way, I know I said this before but I am continually impressed by your friendly and open involvement with the community here. This is what Open Source is all about. Thanks again.
    1 point
  8. I'm also interested if cost would be acceptable. It's only 2 hours flight time
    1 point
×
×
  • Create New...