Jump to content

FrancisChung

Members
  • Posts

    472
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by FrancisChung

  1. I ended up using Ajax, Javascript and the above PHP Code so it's not so simple any more Ajax + passing parameters to PHP was a real pain in the proverbial ... trying to figure out all the idiosyncracies. If anyone is interested, I can post it up for your scrutiny
  2. +1 for Sourcetree too. Great tool if slightly confusing at the beginning. I probably need to look at this tutorial myself as some of the GIT Terminology confuses me. I'm always under the impression Push / Pull / Get Requests etc seem to have slightly different meaning to what I know them to be from using much older SCCs. 1 important gotcha of the Sourcetree tool is that you can't do merges of 2 branches with it (At least I haven't figured it out). So it appears me to that certain "admin" tasks can only been done online using the web client.
  3. I was drinking an ale and was feeling a bit fa... when I .... ... hmm maybe I better just stick to being "kind" I went through a similar climbing experience of various walls when I first started out (still starting out). From what I can gather (correctly or otherwise), 1) Most Processwire API calls and HTML expect you to use a path that starts out "/site/templates/... " etc e.g. JS Script paths <script src="/site/templates/js/min/google-platform.min.js" async defer></script> Calls to (some) APIs $pdf->save('/site/templates/test-file.pdf'); 2) However, in some scenarios you will need to provide a FULL Path to the function or API call. I think any PHP core functions or API calls, it's better to start off with a full path before reverting to a path that starts with "/site/templates/...." e.g. PHP Include or Require statements require_once(__DIR__."/../lib/Lib.php"); ___DIR__ is the current full path of where the module or file you're looking at resides, so if the file that has require_once statement lives in /var/usr/tmp/file.php for example , then __DIR__ will return /var/usr/tmp
  4. I saw that this morning when I reviewed it and looks like you beat me to the punch I really need to familiarise myself with PHPStorm's colour schematics, as it doesn't highlight it as an error (red).
  5. So wouldn't retrieving a page from a $page->get() call, manipulating a value of a field on the page, and then saving the page down by calling the Save() work? If this isn't the work flow, what would it be?
  6. I found this post So I tried using $stats->save($field); and it works. Does anyone know why the above would work? The Stats page only has 1 field at the moment anyways.
  7. Hi, I'm having the same issues here but I can't get it to work on any of the browsers I've tried (Chrome, Safari, Firefox) Perhaps it's an issue with my code but if i step through the code and look in the error logs, there's no error being generated. public function Record() { //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"); $field = 'stats_click_PDF'; $key = $field.$this->page->id; //Temporary disable Session check whilst debugging save issue //if(!wire(session)->$key) { $stats->of(false); $stats->$field++; $stats->save; wire(session)->set($key,1); $stats->of(true); //} }
  8. If that's the case then it's a shame the API documentation do not have notes indicating that is the case. AFAIK I think the API documentation is auto generated it would be great at least if there are links to certain forum articles or gotchas, aka PHP Documentation and their comments. Better would be in the API documentation itself outlining certain nuances and example codes. It's very frustrating to spend a lot of time navigating through these issues and I think for myself it's definitely a minus when using the API sometimes on Processwire. Update : Unpublishing the page and adding the ', include=all' clause seems to have worked. Thanks for the help @Robin S . Much appreciated, mate.
  9. @Robin S, Yes the same code works if i publish the page. It's kinda weird. The template the page is based on only has 1 integer field representing a particular click stat. I'm running PW 2.7.x (2?)
  10. It looks like the pages have to be published in order for Get function to work. The page option "Hidden : Excluded from Lists and Searches" is a little misleading as I had that option unchecked and I assumed it would be searched. Perhaps "Unpublished : Not visible on site" should be more elaborate and include "Excluded from searches (and lists????)"
  11. Hi there, I'm trying to implement a hidden stats page to store various counters and I'm using this article as a basis for my PHP Code I've created a stats page based on a stats template, and the page is set to unpublished with no other attributes. What have I overlooked if the following code returns a Nullpage ? $stats = wire(pages)->get("/stats"); I can "get" a homepage without any issue for reference.
  12. Interesting stuff, Max. Am looking for some sort of e-commerce solution down the road. Will take a look when I have to cross that bridge.
  13. I highly recommend Michael Marshall Smith or Michael Marshall he is now known if you're looking for a great fiction writer with a sci-fi twist. https://www.amazon.co.uk/Michael-Marshall-Smith/e/B000APTPVA/
  14. Hi there, I was looking for some Processwire + Amazon integration advice. I've never built an e-commerce platform before and surprisingly there's hardly any articles or forum posts when you type in variation searches of "Amazon + Processwire" Are there any 3rd party tools and services you recommend? Any gotchas I should be aware of ? Thanks in advance!
  15. Usillos, just trying to get my head around a few questions If you're not comfortable discussing it publicly, we can take it offline? 1) If a Dev chooses a Course presumably sponsored by a Company or Companies, is there a catch or an obligation on the Dev side? Perhaps they have an obligation to interview for a particular vacancy? 2) Do the companies for example get to choose or approve a Dev that selects the course? 3) So a Dev finishes a course for example. What next? Job Interview? Or is it before? 4) Normally a job requires many skills. Most developers will have most but not all. It's probably not realistic for the Company to offer training on all the skills required. Will they decide based on skill shortage and importance? I can't see a company sponsoring more than a few max? UPDATE : I should scroll down on the website which answers some questions.
  16. Shameless self plug warning : I'm currently in the process of migrating my electronic / dance music mixes to Orfium from Soundcloud. I like to think my mixes are more accessible to people than most, even if you're not into the genre. Like all my free offer posts, this is also free to try Update : Changed link to Mixcloud from Orphium. https://www.mixcloud.com/AlQabron/
  17. 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?
  18. So I've managed to get XDebug working partially with PHP7. It seems that XDebug throws the __debugInfo must return an array error on any breakpoints where the php code is not a class definition. If I put breakpoints in any classes, debugging works fine. Also, I don't know whether it's a different issue but I had to set break on first line in PHPStorm to get the debugger start up properly. Perhaps there's some bootstrapping going on with this option that isn't happening elsewhere. I've used the same config for PHP 5.5 and everything works as previously. So until they fix this issue (which was allegedly fixed in Xdebug 2.4.1), best to put breakpoints only in classes. P/S If anyone needs setup instructions, here's some helpful guides. http://www.codechewing.com/library/debug-php-with-phpstorm-xdebug-mamp/ http://manovotny.com/setup-phpstorm-xdebug-mamp-debugging/ P/P/S More info on __debugInfo
  19. 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
  20. Perhaps they handle this manually by a customer rep so you may need to wait until Monday / Tuesday. Mine was a guy by the name of Jordan Miller and gmail treated it like a promo e-mail so it was nowhere to be seen initially.
  21. I think they send you an e-mail with a registration Key. I too was waiting for the e-mail but I think a customer rep sends it sans Redgate labelling which is why you might not see notice it in your inbox.
  22. Have you had a look at this @szabesz? https://forum.parallels.com/threads/accessing-mysql-mac-from-windows.105647/ If I recall correctly, I think I had a similar situation with SQL Server where the version (32/64) of the client driver had to match the Server.
  23. I think I know what I did here. I think 1 of the first modules I wrote was a standalone module that needed access to the API. Also happened to be the first module I wrote that accessed the API. So because it worked, I just assumed it was the correct way of calling the API without actually realising what I was doing. Should pay attention more to the documentation, but I guess it's sometimes hard when you're on super tight deadlines, reading/skimming so much material and working with new technologies you haven't got a clue about or lean on mentors for advice and validation.
  24. There are some modules that have dependencies on Const.php. It's loaded via require_once in all of them require_once(__DIR__."/../const/Const.php");
×
×
  • Create New...