Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/02/2016 in all areas

  1. Just a short update: if MySQL (or the OS it's running on) and PHP are configured with different time zones, results will be wrong. You'll likely not notice anything off on local dev environments where everything is configured with the same time zone, but to prevent issues on deployment, MySQL needs to be made timezone-aware and PW's database connections need to tell MySQL which timezone to use for conversions, which should IMHO be done through a not-yet-existing $config property. That's why I've filed feature request #19. I'm now holding my fingers crossed and waiting to hear if it gets considered. This will mean that, assuming it does, the module will require at least the PW version that gets the new $config property.
    5 points
  2. @Macrura @horst I've added this feature request to the new repo - please emoti-vote for it if you still want this as a core feature. As a side note, here are some screenshots of a module that I ended up developing in the absence of this feature. Take a standard ASM Select... ...add some extended data attributes to the options... ...and a little javascript to use the data-group attribute of the selected options to disable other, currently unselected options with a matching data-group value (all while keeping things in the right sort order.) You then get a list that prevents your gymnasts from being booked in to the Trampoline group at the same time they are already booked in the Gymnastics group...
    3 points
  3. No, the true culprit is here: protected function ___renderList() { $out = "\n<ol id='{$this->id}_items' data-id='{$this->id}' data-name='{$this->name}'>" . $this->renderListItem("Label", "1", "itemTemplate"); The pageSelected function in InputfieldPageAutocomplete.js then checks if the select page's id equals the value in the item template, and with "1" matching the id of "home", it returns without appending the page. I can't definitely say if this is intentionally excluding home, but my guess is that it was only meant to exclude items already present in the list in whatever scenario those might occur. In that case, excluding the template item in the selector for the duplicate checks would be sufficient: pageSelected: function($ol, page) { var dup = false; $ol.children('li:not(.itemTemplate)').each(function() { var v = parseInt($(this).children('.itemValue').text()); if(v == page.page_id) dup = $(this); });
    3 points
  4. Just spent an hour or so learning how to set-up custom scheme handlers in Arch linux to try this feature out and it's now working fine for me after a few false leads. This will really come in handy - thanks Adrian and the Tracy devs!
    3 points
  5. Did you upgrade the upgrades module first? It's working here!
    3 points
  6. As promised, here's the script with delete powers. Only tested on a small subset of an installation I'm switching over to CroppableImage3 so do your own testing please!
    3 points
  7. This is the first time that I'm going to post anything under the showcase forum, although I have a few ProcessWire powered websites under my belt. This one is special because I think the use case is somewhat unique. Caltex Loyalty Club - initial the situation Caltex Loyalty Club is a customer loyalty and rewards program of Caltex Palawan aimed to provide exciting promos and incentives their customers' continuous patronage. Caltex Palawan originally bought their system from a large software company that also provides card-based solutions. The previous system consist of the following: two high-end Dell servers that are located in two separate Caltex' offices traditional EFTPOS devices for reading loyalty cards MIfare RFID cards as loyalty cards Running within one of the Dell servers was a crude and barely usable loyalty/rewards manager application that runs the whole thing. Here's what I mean: You're free to imagine what the rest of the application looks like. The other dell server acts as a VPN server through which all the EFTPOS devices and the application server connect to. To cut the long story short, this setup was running smoothly for a total of 3 weeks before problems started popping up, mostly because VPN server did not have a static IP address and the EFTPOS devices could not connect. The developers refused to provide service to the system because Caltex Palawan does not want to shoulder the travel and boarding expenses of the developers (since it was just working 3 weeks). We were called in at this point (we being a local tech solutions provider in Puerto Princesa), and we made the VPN server work, but other problems soon surfaced. The whole system was barely working for about 3 years when they finally decided they were fed up with the customer complaints they keep getting everyday. Our Solution We studied the existing system for quite some time to examine where the problems we're coming from. The most obvious one we found was that because the servers were located inside Caltex Palawan's offices, the servers were prone to downtimes caused by power outages and internet connectivity problems. It was obvious that the better way would be a web-based solution that would always be online. We also wanted to replace the bulky and outdated EFTPOS devices with android based NFC device that are more portable, and easier to work with. We retained the cards that originally came with the system since there are thousands left unused, but eventually replaced them with NTAG stickers, and newer cards. To sum it up: A web-based application to manage the loyalty / rewards system Android based NFC device to read the loyalty cards NTAG stickers to act as loyalty cards ProcessWire to the Rescue Having used ProcessWire before, it was our best choice, after considering using Laravel, and other frameworks, because of ProcessWire's key strengths: all custom fields - no unnecessary bloat powerful api scalability Although this straight up looks like it's been lifted from processwire.com's front page, but this really is the case, and these are all we need from a web-application framework to do almost anything! All custom fields Since we are working with a unique dataset, it's impossible for us to find anything out there that would have anything even remotely close to what we need. In the beginning we were planning to use custom database tables that we would deploy alongside ProcessWire. I even posted one time in the forum, asking if there's any way to integrate an ORM library with ProcessWire, and the answer I got was that it would be redundant, and almost surely unnecessary. And this turned out exactly the case! When we designed our database (using ERDs), we we're delighted at how closely we were able to replicate our relational design using templates, fields, and pages. This is mainly due to FieldtypePage. We were able to create meaningful relationships within our templates. We ended up with ~60 templates and ~70 fields. Powerful API About 70% of our code are API calls. The rest are just control structures and simple computations. That's how powerful the ProcessWire API is. So powerful that we did not even need to write a single sql query to complete the whole project. We needed to handle user login, API has it. Session handling, API has it. Selecting and manipulating huge amount of interrelated data, the API has it! Scalability At the onset of the project, the existing CLC program already has some 20 thousand members with hundreds of thousands of transactions. Right now, our current system has around 500,000 pages and counting and were not experiencing any slowdown. How we used ProcessWire The first thing that we decided that our client would not be able to see the processwire admin page. We wanted to present them with a simplified UI that does not present them with anything they don't need. We created a whole frontend UI for the client to use. We had custom forms for all the pages that they can create, and all the actions that they can do. We, on the otherhand, use the admin backend thoroughly in continuously developing, and supporting the system. What the clients see vs what we see: Our setup ProcessWire 2.8 running on a LEMP stack DigitalOcean droplet AjentiV VPS manager Modules we used We used a very minimal amount of modules for the project: ImportPagesCSV - to import the data migrated from the old system FieldtypeDecimal - for all our decimal values Modified RestHelper - from clsource for all the communication between ProcessWire and our android POS app Modified PagesSum from esrch ProcessSelectorTest - for quickly checking some selections Things we had to do on our own Frontend user login Frontend password recovery Fine-grained permission handling for users Cron jobs for scheduled tasks. The rest are API calls, and business logic. The Result Our Caltex Loyalty Club web application is now running on its sixth month without so much as a hiccup! Compared to the previous system that was averaging 200 transactions per day, we are now getting 800 and it's growing. We are running 10 campaigns and promos simultaneously across 18 Caltex Stations all over Palawan, with 30 android NFC terminals communicating to a single ProcessWire installation. We are very happy with ProcessWire in terms of performance, ease of use, and most importantly it's simple and yet very powerful functionality as a web-application framework even though it doesn't primarily market itself as one. PS. Also one of the best things we experienced while doing this project is the awesome, unparalleled community support. Throughout the project, although we had a lot of moments when we just couldn't figure out what to do, never once did we have to ask a question in the forum. A quick search here and there, and someone already helped someone else that faced the same problem we were having. It's almost as if people are being paid to diligently answer all the questions! We most of the time just had to like an answer that was already there! Screenshots and photos Android POS terminals and CSR training
    2 points
  8. A new band website for the German electronic avant-garde band DEINE LAKAIEN. The idea was to make this an introduction website for media and new listeners. For in-depth information, the website is accompanied by another new ProcessWire website (with an integrated xenforo forum) for the fanclub: colour-ize.com. and the label website chrom.de. All three websites use the same UI and re-occurring elements (while preserving a unique look), so people find their way around easily. Design/programming details: It was tried to make the dark look (which is the band CI) feeling modern and artistic (avoiding a Nineties look which so many dark themed websites have). The website is built in my spare time in 5 weeks thanks to the ease of ProcessWire 3 and is fully responsive (using uikit and Hype). ProcessWire's new language features were more than welcome to make language management a breeze (People coming from WordPress know what I mean). The backend is build in a way that non-techies (band, volunteer translators, fanclub, booking) can handle the CMS without needing much support and knowledge of SEO. Everything is explained or almost self-explanatory. And the complex internal link-building is done either fully automatic or half automatic.
    2 points
  9. http://www.oreilly.com/programming/free/ A good selection of Python, Design Patterns and Java books peppered with some interesting titles like 2016 European SW Dev Salary Survey and 2016 SW Dev Salary Survey
    2 points
  10. It should work that way. At least it used to work. I have disabled the compiler completely in all my sites so cannot test it quickly, but I was the first one to raise this issue an Adrian had solved it. If the issue is back, it was not intentional, I think.
    2 points
  11. You'll probably need to log out - that module only checks for new PW versions when logging in: https://github.com/ryancramerdesign/ProcessWireUpgrade/issues/10
    2 points
  12. Or without all those parenthesis: $page->set('siteviews', $page->siteviews ? $page->siteviews + 1 : 1); Edit: Scratch that. null + 1 does work without error notice: $page->set('siteviews', $page->siteviews + 1);
    2 points
  13. @adrian I am just about to checking this for you to report it later. (I am not sure it is the module, it might be MAMP4 on localhost, for example, so I was checking here for possible similarities).
    1 point
  14. i am indeed somewhat a follower of the 'fourth way'... there are a lot of recordings of those piano arrangements, i have Alain Kremski and Keith Jarret which are all good.. I used to listen to Discreet Music a lot, on vinyl
    1 point
  15. I don't see the Gurdjieff/De Hartmann music name-checked too often, I'm familiar with Cecil Lytle's recordings. Are you into Gurdjieff's teachings? Such an interesting person with some amazing ideas! When I'm working and things are crazy, ambient music helps get me in a productive frame of mind - my favorites include: Brian Eno's "Discreet Music" "Music for Airports" and "Another Green World" (I've listened to this maybe 1,000 times and still hear new things!) Daniel Lanois' "Belladonna" and "Apollo" (one of many Eno collabs) Bill Laswell "Radioaxiom: Bass the Final Frontier" and his remix of Gigi's "Illuminated Audio"
    1 point
  16. Not sure if it's too late but just couple of things I thought of 1) certain fields like timestamps are usually different across languages and certainly have different meaning between programming languages and databases. 2) Probably best to stick to UTF-8 or some sort of encoding ALL of the technology stack agrees with (i.e. PHP, .NET, MySQL, SQL Server) 3) To call SQL Server from PHP http://php.net/manual/en/function.sqlsrv-connect.php To call .NET code from PHP http://php.net/manual/en/book.com.php 4) A quick way of testing this is to install one of the basic example sites and then migrate the MySQL DB into SQL Server and change DB Connections in PW to point to the MySQL instance? You could probably find the UnitTests they have (on github?) for PW and run that against this example site? You could also see how the DB is created and if it's a SQL script, perhaps run that on a SQL Server and see what happens?
    1 point
  17. I took a really quick peek inside /wire/modules/Inputfield/InputfieldPage/InputfieldPage.module, and am wondering if this block, starting at line 175 within the isValidPage method, is where the problem lies? if($field->parent_id && $field->parent_id != $page->parent_id) { if(version_compare(PHP_VERSION, '5.3.8') >= 0) { if(is_subclass_of($field->inputfield, 'InputfieldPageListSelection')) { // parent_id represents a root parent $rootParent = wire('pages')->get($field->parent_id); if(!$page->parents()->has($rootParent)) $valid = false; } else { // parent_id represents a direct parent $valid = false; } if(!$valid && $editPage) $editPage->set('_isValidPage', "Page $page does not have required parent $field->parent_id"); } else { // PHP version prior to 5.3.8 $reflector = new ReflectionClass($field->inputfield); $valid = $reflector->implementsInterface('InputfieldPageListSelection'); } } Specifically, this line (180): if(!$page->parents()->has($rootParent)) $valid = false; Would that prevent the home page from validating, since it doesn't have a root parent (parent_id is 0)? Seems like we need an exception for the home page here, yes?
    1 point
  18. Yes, that would work. Even without Soma's module there is a checkbox for clearing the cache in the config of the PageRender module. Or use a simple function/module/snippet to clear just the pages that use the particular templates you worked on, e.g. function clearCache($tpls) { $p = new \ProcessWire\Page(); $pgs = wire('pages')->find("template=$tpls"); wire('modules')->PageRender->clearCacheFilePages($pgs, $p); } clearCache('basic_page|home');
    1 point
  19. I have enabled the compiler just to test it and it works as expected for me.
    1 point
  20. Hi @adrian, Apologies if this has already been asked and answered before. When using the "Editor Protocol Handler" feature, the linked error is often to a file in the file compiler cache, e.g. "...\assets\cache\FileCompiler\site\templates\home.php". But to correct the error you actually want to open "\site\templates\home.php" for editing. Would it be possible to rewrite links to compiled files so they point at the original uncompiled file instead?
    1 point
  21. Hi @horst - this module is great and I use it regularly. Only problem is that it causes a deprecated constructor notice in PHP7 (class "filo" has a method "filo" rather than "__construct"). Would you mind updating it? And maybe submit it to the modules directory too? I could update it for my own use but it would be cool to have an "official" version.
    1 point
  22. It's not so much that I'm intentionally using caching in a development environment. It's that I have many small (and small-budgeted) sites where it isn't economic, or really necessary, to maintain and sync independent dev/staging/production environments. So it's not unusual for me to make small template changes directly on the live site, where the issue is that changed CSS and JS files may be loaded before the corresponding HTML changes flush through the cache. Having said the above, I do take the point that it's probably not a situation that justifies any changes to Template Cache or ProCache. It might be possible to avoid a recursive modified time check by detecting changes with an inotify script (thanks to @netcarver for the reminder), and I'm going to explore that out of curiosity, but the simplest and best solution is just to remember to manually clear the cache after making template changes. This by itself does not clear the template cache - you would still need to clear the cache for any pages using templates you have modified. Otherwise when you set... $config->disableTemplateCache = false; ...after making template changes PW will serve the old cached pages that exist from before template cache was disabled.
    1 point
  23. I think that's a reasonable position to take - it addresses the concern expressed by @szabesz here, and can still be used to provide folks like @Sephiroth access as described here.
    1 point
  24. Sometimes most obvious things aren't obvious, so remember to check if it's working as a quest. if($session->get('visit_counter_flag') === 0 && !$user->isSuperuser())... If you are a superuser it does nothing.
    1 point
  25. Yes, every file in PW has a db table to match its name prepended with "field". If there are no rows, then that explains why echo $page->siteviews isn't showing anything. Ton convince yourself that your echo is working, I would manually add a number to the siteviews field for a page (via the page edit interface in the admin). Then you need to debug why @LostKobrakai's: $page->set('siteviews', $page->siteviews + 1); is not working. Are you actually using that, or his pre-edit version?
    1 point
  26. No need to manually include site/ready.php What you want is: $page->siteviews because you are trying to get the value of that field for the current page. $pages->siteviews won't work at all because $pages needs a ->find or ->get to get the page of interest if you're searching for a page other than the current one ($page). Did you notice that @pmarki's code uses "visitCounter" rather than "siteviews" ?
    1 point
  27. // This might work... $page->set('visitCounter', ((int) $page->visitCounter) + 1); // If not, try this... $page->set('visitCounter', (($page->visitCounter) ? ($page->visitCounter) :0) +1); // Personally, I don't like this style of code - I see too many smileys in there.
    1 point
  28. The ?? is new to php 7 http://lornajane.net/posts/2015/new-in-php-7-null-coalesce-operator
    1 point
  29. Yes, it works with pw3. Just updated module info and added textarea field.
    1 point
  30. True happiness!! And today Vue 2.0 was released too, Destiny are you trying to tell me something?! Thanks everyone for the amazing work, I keep enjoying developing with PW like in no other system.
    1 point
  31. I have it in a site/ready.php (if you don't have this file just create one) function bot_detected() { if (isset($_SERVER['HTTP_USER_AGENT']) && preg_match('/bot|crawl|slurp|spider/i', $_SERVER['HTTP_USER_AGENT'])) { return TRUE; } else { return FALSE; } } if($session->get('visit_counter_flag') === 0 && !$user->isSuperuser()) { if (bot_detected()) return; /* if the user is NOT logged in and not counted */ /* turn of output formating so PW do not give an error when we change the value */ $page->of(false); /* save the visitor_counter field */ $page->set('visitCounter', ($page->visitCounter ?? 0) + 1); $page->save('visitCounter', array('quiet' => true, 'uncacheAll' => false, 'resetTrackChanges' => false)); /* turn on output formating so PW work as it should */ $page->of(true); /* set a visit counter flag to 1 so next load do not count */ $session->set('visit_counter_flag', 1); } As a extra bonus this script exludes bots from statistics.
    1 point
  32. wireshell 1.0.0 Compatibility: ProcessWire 3.x Prepares wireshell for ProcessWire 3.x, adds namespace support, only supports ProcessWire 3.x Updates Github Repository: github.com/processwire/processwire Improves module:upgrade command, if no argument is provided it just checks for upgrades Extends new command, adds option --src=path/to/source to be able to use a pre-downloaded tgz/zip/folder Extends status command, only shows database password if --pass option is provided, shows if an upgrade is available Updates upgrade command, removes options dev and devns
    1 point
  33. I'm new to processwire, but have some decent experience in Scala, python and others. I was the typical guy making fun of php. Processwire changed that, the api design is very elegant and convinced me. I can host the event in Berlin, so we have big monitors for everyone, projectors, etc. Ping me if you are interested. We can make it a mini conference, with speakers etc.
    1 point
  34. Just uploaded v068 which adds template edit link tooltips to the main pagelist items plus has some CSS improvements to a few CKE plugins (some seem to be written at least 10 yrs ago :)). And also see the ProcessPageList.js attached that was modified to enable opening collapsed pagelist items when hovering over them during drag-and-drop. It's still not perfect but it's still much better than the original imo - please feel free to modify the code (see line 1035, "change" property of "sortOptions"). The file's location is "/wire/modules/Process/ProcessPageList/". The main problem is that I check the next item after the placeholder (.PageListSortPlaceholder) so expand-collapse occurs only when moving the placholder above on item and not directly on it. I think this could be improved somehow. The reason I uploaded this here is because AOS v068 contains a few lines of CSS that modifies the appearance of dragging. Of course it works without AOS too. Here is what it looks now: ProcessPageList.js
    1 point
  35. I don't believe it has been explored for maybe the following reasons: (1) I would look first at the stated requirements for ProcessWire https://processwire.com/about/requirements/ It should be noted that it says that MySQL is required (or any MySQL compatible database i.e. MariaDB) (2) Furthermore, I don't believe anyone has explicitly said that it technically can't be done, however you first need a good understanding of the differences between MySQL and SQL Server (MSSQL). Then you would need to account for these differences in your code. http://www.databasejournal.com/features/mysql/mapping-data-types-between-mysql-and-sql-server.html http://www.databasejournal.com/features/mysql/comparing-sql-server-and-mysql-functions.html (3) Additional vital information regarding Microsoft Infrastructure (Database technology), in case you want to pursue getting this to work https://www.microsoft.com/en-us/download/details.aspx?id=20098 http://www.iis.net/learn/application-frameworks/install-and-configure-php-on-iis/install-the-sql-server-driver-for-php (4) Additional information regarding Microsoft Infrastructure (Web Server technology) which will always be applicable when working with Windows solutions http://www.iis.net/ There is much information (provided before) about using Microsoft technologies (specifically IIS working with MySQL) to enable working with ProcessWire. They work without changing coding standards and I believe many people are using these solutions successfully. BTW, .Net is a Microsoft technology and framework
    1 point
  36. http://venturebeat.com/2016/08/03/microsoft-launches-excel-api-out-of-preview/
    1 point
  37. There is one thing that needs a bit attention when importing data. We need to check if a record was also imported by a previous run of the script, otherwise you may end up with numerous duplicates. while($row = $result->fetch_assoc()) { $title = wire("sanitizer")->text($row['title'], array("maxLength"=>128)); // fetch and sanitize the title $p = wire('pages')->get("title={$title}"); // check if it already exists if(0 < $p->id) continue; // move on to the next record if it exists $p = new Page(); $p->template = "dam"; $p->parent = "something"; $p->title = $title; // use the sanitized title $p->save(); }
    1 point
  38. Hi Tony! Welcome to the forum I think one of the fundamental things to consider with projects like these, is to actually look and analyse the existing data - the structure, the format, the quality, and any relationships there may be. It's almost going through the normalisation process but perhaps not as strict. It would be a good idea to take every column in the existing database to decide how that will be represented in the ProcessWire site. Probably, some of these will be simple translations - Varchars will become Text fields, and Ints will still be Integer fields. But what will be more important is the data in these fields - does it vary with just about every single dam? Is it a value representing Yes/No? Are there only a few values for that column that all dams can potentially use? If so, do the values all use the same spelling of words, or are some mixed case or have weird formatting or spacing issues? When you have a set list of values to choose from, this is where you can decide how to store the data in ProcessWire - Page fields, PageTables, Options field, etc. If your source data quality is good, your job will be easier. If it's not, there will be some work involved in preparing it so that it is clean to work with. You may already have a good idea of how your data looks or is structured, but I usually like to do some form of planning on paper or using a spreadsheet to map out the source data to the ProcessWire templates and fields. Doing the important work now will save you hassle later on down the line and will really help you to make the search feature more functional. As an example: In ProcessWire, I imagine there would be a template created called 'dam'. You might add the following fields to this template (just for starters): title description location (FieldtypeMapMarker) height (integer/float) length (integer/float) capacity/volume (integer/float) country (Page field/Options field?) built (date) opened (date) For each dam, a Page would exist somewhere in the page tree, using the 'dam' template. As you've already seen the Skyscraper profile, you can probably look at that for more ideas on how to structure things though
    1 point
  39. Coding with Cassius right now. Even the constants are dancing
    1 point
  40. Music that goes psychedelic and gets a hold on you - enjoy
    1 point
  41. Sorry to hear about the job loss, but you'll appreciate it later on as you move on to bigger and better things. I think it's good that you've invested time in learning ProcessWire. You know how to use a tool that most people don't, and a tool that lets you easily turn any idea into reality. It will be a money printing machine if you want it to be. Unless you have a lot of bills to pay, don't jump back into something where you are dependent upon another employer for your livelihood. You can make a lot more money working for yourself than someone else, though it does take time to get there. Be useful. But find a way to be useful to millions of people rather than just your boss. One idea is to find a fairly specific subject you are passionate about and think about how you might build an online empire around it over time. But that's just scratching the surface. If necessity dictates going back into another job, then at least save your best energy (early in the morning or late at night) building something for your own future, rather than just your employer. The internet really is the land of opportunity where anything is possible. We have more opportunities than anyone has in history. The more you can make investments in and for yourself and the future, the better.
    1 point
  42. A guy at Kodingen is working on this. It's not music, but it's sound and good for programming http://rainycafe.com/ love it!
    1 point
  43. my 5 cents to keep on going relaxed behind my laptop
    1 point
  44. The main reason it's not there is just because $input is another layer on top of $_POST (or $_GET or $_COOKIE) and I wanted to limit the overhead of it as much as possible, at least until we needed it. Didn't want to enable the possibility of someone posting endless multidimensional arrays from a security standpoint. But ultimately if the need was there, I would add it. And now that its come up, we might as well add it. Probably what I will do is just limit the recursion to 2 or 3 levels to keep it safe. I don't see any potential issues with adding it. If you've had the need for it, then I'm sure others will to. If you want to submit a pull request, I'll bring it into the core. Otherwise, I'll plan to add and commit an update to the core soon. Thanks, Ryan
    1 point
×
×
  • Create New...