Leaderboard
Popular Content
Showing content with the highest reputation on 08/09/2012 in all areas
-
Hi! Just finished my first module This module adds a new "Google-Analytics" Page in your Admin-Panel and displays various Statistics from a Google Analytics Account. It uses the JQuery plugin "jqplot" to display the charts. Github: https://github.com/w...GoogleAnalytics Modules directory: http://modules.proce...ogle-analytics/ Features Visits by Date (Chart) General Statistics about Visits (Total visits, Visit duration, New visitors, Returning visitors etc.) Demographics: Countries, Cities, Languages System: Browsers, Operating Systems, Screen Resolutions Mobile: Operating Systems, Screen Resolutions Pageviews by Date (Chart) Top Content Traffic Sources: Keywords, Referral Traffic by Domain and URI Choose a default date range displaying statistics: last 24 hours, 2 days, 1 week, 1 month etc. Custom date range by setting a "start date" and "end date" Requirements Google Account and Analytics Account A Project in the Google APIs Console cURL Installation 1) Create a Project in the Google APIs Console: Create a new Project in the APIs Console: code.google.com/apis/console/ Under Services, enable the Analytics API Under API Access: create an Oauth 2.0 Client-ID Give a Product Name, choose "Web-Application", Domain doesn't matter Enter a Redirect URI to the GA-Page in your Processwire Installation: http://yourdomain.com/processwire/google-analytics/ Notes: The redirect URI must exactly match with the URL from the new "Google Analytics" page in Processwire. Open the Page and copy the URL from the address-bar (localhost does work too!) The project created in the APIs Console can be reused for every Processwire installation using this module. You just have to enter more redirect URIs 2) Install the module: Place the module's files in /site/modules/ProcessGoogleAnalytics Install the Module via the Admin-Panel Enter Client-ID and Client-Secret keys from the created project in the module config Load the newly created page "Google-Analytics" and click on the button "authenticate" Grant the module access to the Analytics Data Choose a Google Analytics account (Domain) from the dropdown Done: You should see the statistics. Check out the module config options for further customization In order to let other users see the Google Analytics page, you must give their role access to the "ga-view" permission. Ps. Processwire is awesome and so is this community!6 points
-
Teppo is way too slow, always second FORUM PROTIP that I spied from Soma: quickly post something, then edit it few times. You'll win every time!4 points
-
First of all, 0x100 version is a thumbnail created by either size(), width() or height() calls in your templates or possibly by admin (if you've chosen to show thumbnails for that image field.) Secondly, I'm assuming that your image field is called "images" and it can contain multiple images? It sounds like you're asking the field itself for an URL when you should be asking that from an individual image: echo $repeater->images->eq(0)->url; Or you could loop through all the images: foreach ($repeater->images as $image) { echo $image->url . "<br />"; } Edit: Soma was faster -- again3 points
-
3 points
-
Just installed this one and it works like a charm! Really nice and very polished work. Very nice that it is already multilang friendly! Few ideas for further development: There are quite a lot stuff on screen. It might be nicer UI if you would use tabs instead of folding for main categories (audience, content, traffic sources) Showing current month is what I usually want, but it would be nice to have ability to choose date range Link to Google Analytics when you want to dive deeper into the analytics Consider using strftime instead of date - that would allow local month names etc for other languages than English. Not necessary though, since one could always define numeric only dates (like 9.8.2012) http://www.php.net/manual/en/function.strftime.ph3 points
-
2 points
-
Thank you guys! In the meanwhile, the Project is on Github and the modules overview: http://modules.processwire.com/modules/process-google-analytics/ https://github.com/wanze/ProcessGoogleAnalytics I never used Github before and had to create an account first, thanks Soma for your Tutorial! Still I'll have to explore git a bit more ;-) Please let me know what you think and if it works for you! One feature that is on the Roadmap: Compare the statistics taken from the last month (Audience) with the previous month and show +/- percentage2 points
-
One of the things I've put off learning has been LESS/SASS, seeing as I've always managed ok with CSS and there's never time enough to learn every new technology is there?! Was just interested to see who used it occasionally, the whole time, never at all, waste of time, lifesaver etc... I've certainly never struggled with just CSS but that's the way with so many new things, you don't know what you're missing until you try it1 point
-
Please read the following before looking on the big picture ) Here's an idea i got, while experimenting with PW: A lot of cool icon fonts are avaible, on the other hand the page system of pw can be used verry flexible. why not bring these together to improve customized backend usabillity, version a (more complicated to build, i guess): when creating a template you choose the icon of your choice for this kind of content. in the page tree, based on the template that you've choosen for every page, the pages uses an little icon. version b (i guess, maybe simpler): based on the choosen template, the page <a> get's a css class with the name of the template. so you need to attache an custom css in the backend that styles your page list with icons using the :before/:after css-technics, i've seen that each page list item already get's a unique class, but it doesn't look like every page list item gets an class/id based on the used template. i think version b of my idea is nicer, and would bring up more flexibilty so style the page tree, additionaly to the icon solution. however, i did a dirty mockup of version a for better illustration. what do you guys think about the draft? writing something like this myself with php would be a realy big and scary task at the moment, since i'm a young padawan, but maybe some of the jeddai masters like it? <- i did an mistake..on the mockup i mean with "<-*click* a click on the picture symbol, not the pencil >.< EDIT: another "sourcecode mockup" to illustrate what would be cool the get with version b of the draft, so page list items get automatic an template name based icon , styleable with div.basic-page:before { content: "a"; } div.sitemap-template:before { content: "k"; } link with more infos about the css part etc,1 point
-
One of my clients specializes in putting on conferences/summits around the world, primarily focused on architecture and sustainable design. I mentioned to them how some users here (starting with Netcarver) had expressed interest in a ProcessWire meetup or conference in the UK. This client does conferences in the UK every year and they are extremely enthusiastic about ProcessWire and interested in helping us to put on a conference by letting us collaborate with their conference and share the same venues and accommodations. This would help us benefit from their expertise in putting on conferences (which they've done for more than a decade), as well as help [significantly] on costs in reserving the venues, food, hotels. I have worked with this client since 1994 (18 years), so have a very high level of trust with them. The conference would be in August 2013 and be 1.5 days in London at a major ad agency, then we'd step on a train for an hour or so and do the rest of the conference in Cambridge at Kings College for another 1.5 days (total 3 days). This would be a small but relatively formal conference with presentations and workshops covering everything ProcessWire, design and web development. We'd cover topics at a higher level than you'd find anywhere else in the world. I don't yet have an idea on costs except to say that we'd find a way to make it accessible to as large of an audience as possible, and it would be completely non profit, food and accommodations (for those that wanted it) included. Yet, it'd still be higher class and more personal than any other webdev conference. This is about a year out, so I'm interested in finding out who'd be interested in this. Please 'like' or reply to this post if you would be interested in attending (or presenting) at this conference.1 point
-
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
-
Today I finally had time to add my modules to the directory. And while I did it I found a module I never published in his foru only in the webchat and on github: AutoUpgrade. (Click here to see it in the modules section) ------------------------ AutoUpdate This module will notify you if a newer version of ProcessWire is available and give's you a link which will redirect you to a "upgrade" page where you just have to press the "Upgrade" button to upgrade your system. WARNING: It's in alpha mode. So you can use it to try it but you shouldn't use it in a bigger project or similar. INSTALLATION This module's files should be placed in /site/modules/AutoUpgrade/. It's really important that it is in a separate folder! -------------------- I would love to get some feedback on this and if it's working for you or if it breaks. / Nico1 point
-
By the way, this „I don't think I need this, I don't see the benefits of it.“? Me, about a year ago. Actually, everyone now using a preprocessor said so before giving it a try. Give it a try. We promise you'll love it.1 point
-
It does actually make more sense to have it as a page reference on the homepage. But perhaps our minds like checkboxes?1 point
-
My mind also likes to put "featured" checkbox to actual items... but editors seem to be more comfortable to edit the homepage and choose the featured stuff from there. So now I usually go with the page reference on homepage.1 point
-
1 point
-
This is actually pretty interesting topic, started googling for more: http://blog.millerme...pre-processors/ Then there is this from 2009: http://nathanborror....0/sass-isnt-me/ and in comments Jeff Croft says: Forward few years and from Jeff's own blog (http://jeffcroft.com...eature-of-sass/):1 point
-
You need to do. $page->reapeatname->imagename->url; Sorry maybe you already did? Also the x100 image is most surely from the thumbnail in the admin. Edit: If it's a multiple images field you have to iterate them or using $array->first()->url; it's in a array. $repeater->images->first()->url should then give the first image.1 point
-
What Apeisa sais is also how I feel exactly. If you find yourself repeating over and over you're doing it wrong. I developed a style over the last 10-12 years where I need less and less very little CSS and thin code, it payed a lot and saved me a lot of time also from the experience of all the browsers and especially IEs. But lately it has and will shift with the whole new palette of browsers evolving, devices, displays, tv's (next?) bandwidths etc. I remember where we followed ~50kB rules for a page. And it would be still possible in that range, and we can use lots of new techniques aswell. Requirements are different now and I felt less or sass brings in what CSS maybe missing and I find it really refreshing having the possibility there if really needed. Not the big part maybe. I've been using it in some projects to try and was quite happy to be able to define some stuff and it really allows for very different workflows which is pretty cool if you think about it and play around with it. Not creating another dependency is I think the important part here. If a team really is trained to use a defined workflow and they have fun doing so it sure can help on really big and complex projects.1 point
-
For me CSS is the "fun, easy and quick" part. I don't feel like I am wasting my time there and I feel like I can make much bigger gains by improving on other aspects of my work. There are so few browser quirks today and so many well supported new stuff on CSS that I find it almost relaxing. But I don't use reset.css or ie specific stylesheets either and I have pretty much dropped using browser prefixes... I don't organize my CSS much and I enjoy "clever chaos" on that stuff. Developer tools give me exact line number for the selector and that's it. I'm kind of oldschooler here Of course if I would be doing more experiments and design on css or maintain large (= really huge) sites etc then I think it might be much more valuable for me. I am pretty sure that in some personal project I will try some css pre-processor, and if I find it huge improvement (like 5 times cleaner and faster than pure css) then I might start thinking how to make it part our workflow at Avoine. To be honest, I don't see that happening anywhere near though.1 point
-
Gazley: excuse WillyC, he's... special. Actually, it does; XDebug on + default nesting setting (100) give this error; More here, for instance: https://groups.google.com/forum/?fromgroups#!topic/cake-php/F6uRlDOwOvs%5B1-25%5D1 point
-
1 point
-
1 point
-
Although Sass and Compass make it easier to keep (vendor-prefixed) CSS3 up-to-date, it's (in my humble opinion) not its main benefit. For me, it's stuff like this: http://jsfiddle.net/yellowled/xMx5X/ This fiddle demonstrates a mixin in Sass which makes it pretty easy to create rather complex CSS constructs with one @include line. It also makes it easy to change said construct just by changing some variables. Of course, this can be done with an editor which supports snippets, but that requires a lot more work on your end, I guess.1 point
-
Have a look here: http://processwire.c...ng-image-field/ You know that you can sort the images by drag and drop? I would go with the 2 images field approach if possible.1 point
-
Funny thing: I use Sass/SCSS because (for me) it's less hassle to use over LESS or Stylus. I have yet to manage setting up a local nodejs server on my Ubuntu machine. Setting up Ruby is very easy, so my choice of using Sass was not at all related to the actual features of the preprocessor. As far as I have looked at other preprocessors, it doesn't really make a big difference anyway. Stylus has a much more concise syntax, which might be the reason I'll check it out one day. Sass has the Compass library, which I use, but not extensively. I prefer to write my own mixins and only use Compass for the complicated stuff and for CSS3 features which are still subject to change. My workflow probably wouldn't change much if I had to use LESS or Stylus from now on. Personally, I wouldn't want to go back to writing plain CSS, but that's another option, of course. I feel it has simplified my workflow massively, but like everybody else, I was sceptical at first, but now I can only recommend giving it a try. It really makes a lot of things much easier and less time-consuming.1 point
-
I do realize that you're suggesting that having the checkbox on the selectable page itself would be better UX wise, but I'd still suggest using a Page field on homepage. This way you can easily allow the user to select only one page AND all required features would already exist -- no need to reinvent the wheel Anyway, if you really want to have that checkbox on each individual page then the module you're suggesting might be the only solution. I'd probably just create a new module and add a hook before Pages save ($this->pages->addHookBefore('save', $this, 'checkFeatured') or something like that) and there (after checking if the value of this checkbox has changed for current page / if current page is a new page and has that checkbox checked etc.) make sure that no other page has the checkbox checked. Edit: Ryan beat me with his answer and pretty much posted the precise code you'd need in the hook I mentioned.. Another option would naturally be allowing multiple featured pages, with some kind of Javascript slideshow enabled to only show one at a time.1 point
-
The simplest solution would be to just put the 'featured' page reference on your homepage, and select the featured page from there (via a PageListSelect input). But if you need to do it from a featured checkbox on the actual page being featured, then you might want to add another component to finding the featured page: $featured = $pages->get("featured=1, sort=-modified"); That would pull the page that was most recently modified and featured. It would also be relatively simple to un-feature pages via a module or in your template, etc. $allFeatured = $pages->find("featured=1, sort=modified"); $featured = $allFeatured->pop(); foreach($allFeatured as $p) { $p->of(false); $p->featured = 0; $p->save(); }1 point
-
I think you guys are right on about this. I remember years ago (1990s?) I was using a full blown IDE, debugger and profiler. But I've rarely used such things in PHP. I suppose from-scratch debugging in PHP is a lot simpler than things I've used in the past, so it just hasn't come up as a need. I did experiment with XDebug years ago, but seemed like it was costing me more time than it was saving. Now I'm curious again, thinking I might benefit from a PHPStorm + XDebug setup in some situations (like mindplay.dk has mentioned as well).1 point
-
Awesome module and really nicely produced! Thanks for making this. I ran into a couple really minor things, but figured I'd mention them before I forget. 1. Saw a couple PHP notices at the top of the screen, but can't remember exactly at what part. However, I'm guessing anyone with debug mode on will see the same. 2. Getting an overflow on the search keywords screen: Great job with the module and the code.1 point
-
I'm using LESS exclusively now. I was using the JS version but recently switched to the PHP compiler. There's a lot to like about it and I'm only scratching the surface of it. The code below (gleaned from that site) looks at when the LESS file was changed and compiles it into a CSS file. <?php include ('./lessc.inc.php'); function auto_compile_less($less_fname, $css_fname) { // load the cache $cache_fname = $less_fname.".cache"; if (file_exists($cache_fname)) { $cache = unserialize(file_get_contents($cache_fname)); } else { $cache = $less_fname; } $new_cache = lessc::cexecute($cache); if (!is_array($cache) || $new_cache['updated'] > $cache['updated']) { file_put_contents($cache_fname, serialize($new_cache)); file_put_contents($css_fname, $new_cache['compiled']); } } auto_compile_less('smd.less', 'smd.css'); // Compile the mobile stylesheet too you crazy fool. auto_compile_less('smd-mobile.less', 'smd-mobile.css'); ?> Once it's compiled I can then use Minify: <?php echo "<link type='text/css' rel='stylesheet' href='/min/b=site/templates&f=reset.min.css,smd.css' />"; ?> Regards Marty1 point
-
I am so so so so so sorry... Is there a dunce's hat to wear as I will gladly put it on now and wear it for a week or two. Needless to say it was my stupid error, can anyone guess what it was? (perhaps I should make this into a poll so everyone can have a chuckle at how stupid I am!)1 point
-
Hi Nik, I've successfully used PHPStorm and XDebug for quite some time. Before that, I used NetBeans and XDebug but there were issues between the latter pairing that eventually saw me move to PHPStorm after a year or so with PhpED and its own native debugger! There is no real magic to the setup other than initially, I was coding against PW on an Ubuntu 12.04 server installation, in a VirtualBox, on my iMac. I used ExpanDrive on the Mac so PHPStorm just saw the Ubuntu server as another volume on the Mac. This worked fine until I decided to start debugging and I just couldn't get this to work at all. Basically, PHPStorm + XDebug don't really like to debug against a "remote" server when the source code isn't in a "local" installation. So, as I was talking to Ubuntu in a virtual server, albeit local to my Mac, it was still "remote". So, I installed MAMP on my Mac and setup PW in its htdocs folder. As far as PHPStorm + XDebug is concerned, it's "local". However, this still didn't work without error. I was stepping through the code and occasionally, it would just time out. This was using PHP 5.4.4 and XDebug V2.2.0, the latter known to be "buggy". In this case, maybe there was issues with PW running in PHP 5.4.4 or maybe it was XDebug. To test, I backed of PHP back to the latest 5.2 release and an appropriate XDebug version. This works like a charm. It's too much hassle trying to build XDebug from source to its latest 2.2.1 release on my Mac. This would be easy in Linux but for various reasons, on the Mac, it's a real pain. When MAMP releases another version, it will likely have the XDebug 2.2.1 or later. At that time, I'll re-install it and see whether PW + debugging works with PHP 5.4.4 or later. I was amazed that debugging seemed so alien to PW users. I really hate coding and hoping for the best so give me the ability to debug every time because when there's a problem, there's nothing easier than sticking a break-point in the code and seeing exactly what is going on. To be fair, in my day job, I use the MS stack (C#) so I use Visual Studio and that has always had great debugging/tooling. As you can imagine, I expect this to be available to me in PHP or Ruby too. I hope this explanation helps. --Gary1 point
-
Hmm, this sounds interesting. I haven't been using a debugger recently, actually ever with PHP, but I think I would find it a very useful tool for some situations even in this context. @Gazley: You might be in the minority with this kind of workflow, especially when it comes to everyday tasks, but I'm sure you're not alone. Could you maybe give a little explanation on which steps you went through to set it up? I'm guessing there were some parts you got right with trial and error, so it could be useful for someone else (like myself maybe ) trying to get there to know where there may be some pitfalls along the way.1 point
-
After login would make sense to me, and check they're a superuser too if it doesn't already would be my suggestion.1 point
-
Wanze, welcome to the forums! Great start! I tried your module on my localhost and it seems to work, though I don't have any statistics here. When I load the Google Analytics page for the first time I get several notices: Notice: Undefined index: ga:returningVisits in D:\webdev\xampp\htdocs\P21\site\modules\ProcessGoogleAnalytics\ProcessGoogleAnalytics.module on line 227 Notice: Undefined index: rows in D:\webdev\xampp\htdocs\P21\site\modules\ProcessGoogleAnalytics\ProcessGoogleAnalytics.module on line 298 Notice: Undefined index: rows in D:\webdev\xampp\htdocs\P21\site\modules\ProcessGoogleAnalytics\ProcessGoogleAnalytics.module on line 299 But they dissapear after I refresh the page, so I guess it has something to do with caching. Also after installation I get this notice untill I've filled all fields and saved: Notice: Undefined index: accountId in D:\webdev\xampp\htdocs\P21\site\modules\ProcessGoogleAnalytics\ProcessGoogleAnalytics.module on line 877 And also for some reason it breaks page encoding (cyrillic symbols don't display properly). Wanted to mention you can specify what modules are required by your module and what modules it installs in the array returned by getModuleInfo(): return array( 'title' => '', 'version' => 001, 'summary' => '', 'requires' => 'MarkupCache', 'installs' => 'MarkupCache', //not sure about this one ); Not sure though whether it should require or instead maybe install MarkupCache, I guess it shoud just require it. See more here. Thank you for your module! I've never dealt with GA before, and I guess now's the time1 point
-
I know that some of you wondered what the hell I was tring to achieve with this After a lot of messing around, full debugging via XDebug works and I am now able to put break-points anyware in ProcessWire and even step into and through the templates and their nested PHP, when the site runs. This means I can check variables, miscellaneous output as it is being written into the HTML, check program flow and step into and through the framework/CMS code. Cool!1 point
-
Available in module section right now: http://modules.processwire.com/modules/inputfield-quick-tags/1 point
-
Hey there, just a quick heads-up, I'm now displaying my Bootstrap enabled page(s) thanks to your advice! Regards --Gary1 point
-
You are correct, just make sure you supply the correct path in your template code. something like: <link rel="stylesheet" type="text/css" href="<?php echo $config->urls->templates?>bootstrap/styles.css" />1 point
-
Thanks for this thread. I also just discovered ProcessWire and am considering a permanent move away from ExpressionEngine.1 point
-
Wow, looks like we're about to go exponential on that graph there. The singularity is near!1 point