Jump to content

FrancisChung

Members
  • Posts

    472
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by FrancisChung

  1. We could always do one in Dec, Jan, Feb, Feb again if it's a leap year, Mar ....
  2. Another thing you could do is to reinstall the modules, one by one, until the problem goes away. Try and identify which module(s) is affecting this, you could have a quick search and scan for certain keywords like collation etc and see if anything comes up that might give you a clue?
  3. Processwire is more like David's car. They're both a nice piece of K.I.T.T ....
  4. If each page is going to have 20 links but cannot have the same set of links .... so some pages will have duplicate links but not all 20 duplicates or identical to another page? I haven't used nextAll so I don't know what it does exactly but I think you could use something like the following. wire(pages)->find("path=/path to you pages/")->children()[0]->findRandom(20); The children()[0] may not be necessary .. all depends on your page structure. The code snippet is from 1 of the libraries I wrote to generate some random links. Now, there is a small chance that this code might return the same 20 links in some scenarios. If this is still a strict requirement, you're going to have to store the pages in some data structure like a hash table, array etc and do a membership test after you generate these links for a page. Alternatively, you could come up with some unique hashing algorithm for the 20 links so you could store 1 hash value against the page and do a membership test instead if you do not wish to store 20 links per page.
  5. Have you tried using a different collation? I know this isn't what you wanted exactly, but this article gives you a very good background into issues you're having. https://www.blueboxcloud.com/insight/blog-article/getting-out-of-mysql-character-set-hell
  6. Ah MVC ... Whilst I didn't strictly use any of the MVC/MVP/MVVM etc methodolgy for this project (I felt the complexity > benefits), I did seperate the business logic and UI Logic/ controller sometimes if it was beneficial. It didn't make sense for me to fully apply the usual SW Engineering methodology for a simple content based website with running on Processwire. Good to know there's some Modules like Template Data Providers and Template Engine Factory out there for future iterations.
  7. Hi @owzim, What is the reason behind not recommending using class calls (and presumably classes) within your templates? Is it a performance thing? I've actually built a site using classes , and coming from a OO Background I can't see myself going back to Modules / Procedures now .... easily ...
  8. Anything for the community here! Well spotted. You know it definitely works then
  9. All UK users should start using a VPN now ... and configure / test it so that it's not leaking their IP. Not all VPN providers are the same. I recommend AirVPN which I've used for several years now.
  10. I can't between Dec 7th - 14th ... any other dates I'm open to up until 22nd ish or so ....
  11. Saw this on ghacks.net. I've never seen a conversion site so comprehensive. https://gchq.github.io/CyberChef/cyberchef.htm
  12. Right now, I use rsync for code deployement and about to install a bash script running mysqldump and mysql for DB backup and deployment. I run Procache so in the midst of writing some php modules that reconfigure the site from Dev to Prod. Hopefully I'll have a script that ties everything together soon. If this is of interest to anyone, I could post it once I'm sufficiently happy with it?
  13. I'm based in Berlin at the moment .... there's always enough Devs for a meetup
  14. Just spent an hour trying to work out why a site wouldn't load. Tried everything Ryan mentioned in this post and other posts. Was about to post a Support forum post when I saw LostKobrakai's suggestion last second. Posted the php on an online php syntax checker and lord and behold, a single comma character was the culprit ...,... Thanks Lostkobrakai for the suggestion
  15. I have tried to use the JSON Import/exporter but I got some strange results? I was testing a new survey functionality, so I recreated a live version of our site on our test site by running a DB Export of the live site and deploying the live code. Then I applied the new survey code and applied JSON Imported that contained definitions of new templates / field for the Survey functionality. When I ran this particular query, it was returning "phantom" pages that were in the test system prior to the system refresh as well as the new test data I had entered post deployment. $home = wire(pages)->get("/Survey, include=all"); The results were a bit baffling. I did check to see if the JSON definitions contained any "data" but I couldn't see any. I could only speculate that the DB Export script somehow doesn't delete any new DB objects in the target system prior to a rebuild/refresh. I am using MySQLWorkBench and just using Export function with default settings. I've been using this for a year now and never had any problems with site refresh/ rebuilds.
  16. Not sure why I wasn't notified Michael when you posted, but in any case I came up with a rudimentary event injector that lets me inject various events that will trigger Survey events as specified. I will definitely take a look at Keen, Piwik and Mautic if my solution has any shortcomings that we deem as critical. Thanks for the info!
  17. Hi, I was wondering if this was ever implemented or if there's a module out there that has this functionality?
  18. You'll probably have to create a pseudo name sort field and populate that pseudo name field with the desired sort values and sort by that field ....
  19. Not sure about someone's life but certainly a few human follicles lol. ---- Javascript : function RecordStats(id, field) { //alert("id="+id); // alert("field="+field); $.ajax({ url: '/site/<insert your PHP file path here>', type: 'POST', dataType: 'json', ///data: JSON.stringify({id: id, field: field}), data: {id: id, field: field}, cache: false, success: function(result) { //alePerSrt("Fire up Modal"); //alert(notice); //alert(result); //alert("Ajax call made"); }, error: function (xhr, ajaxOptions, thrownError) { alert(xhr.status + ' ' + thrownError); } }); Notes : 1) DataType is json, type is 'POST'. 2) Notice I have a blank function call (Explained in bold later) 3) Not sure if cache:false is needed. 4) In my URL I was pointing to recordstats.php which is listed below. PHP: recordstats : $id = $_POST["id"]; $field= $_POST["field"]; if (!IsNullOrEmptyString($id) && !IsNullOrEmptyString($field)) Stats::Record($id, $field); echo json_encode("{ok: 1}"); Notes : 1) Note I'm using $_POST to retrieve parameters 2) You HAVE TO RETURN a JSON object if I'm using JSON to receive parameters as per AJAX Specification. This is the part where I pulled a few follicles out. Stats : static function Record($id, $field) { //https://processwire.com/talk/topic/12158-how-to-make-a-simple-visitor-counter-for-your-page-in-pw/ $stats = wire(pages)->get("/stats/, include=all"); $key = $field.$id; if(!wire(session)->$key) { $stats->of(false); $stats->$field++; //$stats->save($field); $stats->save(); wire(session)->set($key,1); $stats->of(true); } } IsNullOrEmptyString :
  20. Yeah ... I don't know of JS hooks into Processwire Core APIs. I guess it would be a very nice to have. I do recall there was a forum post where someone managed to import some of these API results into Javascript and used it therefore. I'm guessing you've probably spent too much time on this to warrant searching for it and implementing it. EDIT : I think it was this article.
  21. My bad, for a moment I thought you were using full URLs like below. But I realised you've hardcoded them since. http://localhost/surfinn.rocks/js/jquery.cookie.js I blame lack of sleep and coffee Have you tried $config->paths->templates ? I think that might be what you're looking for?
  22. Yeah I normally use internal file paths for javascript paths instead of URLs. Is there a reason for using URLS over file paths? I haven't used URLs for JS file paths, but I'd imagine there's more chance of things going wrong with that. (For example, your localhost could point to different servers or sites)
  23. Hi, I'm trying to design a new User Survey functionality that allows a "User" to specify user surveys that pop up after a user clicks on an audio button after a user watched a video after visiting 5 pages on a site when users bounce etc etc So basically the potential to launch a User Survey from various places under various trigger conditions. I have already built User Survey capabilties where if the a particular User Survey field and certain trigger fields are filled in, it will trigger the user survey accordingly. I'm not really happy with the current design as it's highly coupled at the moment and I feel the design is too brittle to accommodate changes that are drastic (oh, like the one I have above for example) Has any one implemented any flexible User Survey functionality that has various triggering capabilities? I googled far and wide but I've not seen anything remotely close to what I'm looking for. All articles I've found seem to concentrate on designing the User Survey itself and not on the (smart) delivery of it.
  24. I was about to upgrade when I realise you need MacOs 10.11 ..... NoooooooOoooo. You're absolutely right about Codekit being great for beginners but I'm starting to find a bit long in the tooth in terms of speed and resources. I was contemplating setting up Grunt/GULP etc to work on PHPStorm so I can remove it eventually. Upgrading to Codekit 3 would have saved me a world of pain ...
  25. I highly recommend MySQL Compare for this exact purpose. And it's free to for Non Enterprise use according to their new licensing agreement. http://www.red-gate.com/products/mysql/mysql-compare/ Unfortunately only Windows at the moment, but for a one off task like this I would strongly consider getting a windows environment running and run this tool. I've used their SQL Server version extensively and it saved the day many a times. P/S For Data differences, you have to use this instead. Above is for Schema differences. http://www.red-gate.com/products/mysql/mysql-data-compare/
×
×
  • Create New...