Jump to content

Bill C

Members
  • Posts

    42
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Bill C

  1. Ok , I'm just putting this up here with the hope it might save someone else a bit of time. Both the issues I ran into have been resolved. I decided to install Ryan Cramer's Blog Profile. I used PW 2.7.2, and I am on MySQL 5.7.9. I discovered the first problem I hit had already been reported here : site-blog not appearing in intallation profile dropdown Of course I decided to Google it AFTER I had figured it out for myself - DUHHH. The second problem apparently was with the file install.sql located of course in the install folder. This sql was using a zero date '0000-00-00 00:00:00' to populate a timestamp field. I think there were about 90+ instances of this in the sql file. These inserts all threw errors. I didn't put too much time into looking for a solution on this. I found this but didn't care for allowing bad dates Allow Invalid Dates - MySQL What I did as a fix, was to change '0000-00-00 00:00:00' to Now() in the install.sql file and re-ran it. That seems to have worked. When I went back into the Admin I had all greens on the update steps. Thanks to Ryan four years after the fact for providing us with this ready made Blog profile. Good stuff! I hope to learn from it AND use it as well. Have a good one...
  2. @LostKobrakai Hi , Thanks for pointing that out! Good to have for future reference.
  3. Hi Nukro, I tried working with your ProcessForm class and I ran into a few problems. I am using the code from ProcessForm.php . I would like to know if maybe the example code you listed is out of sync with the actual class's code ? One reason I ask this is that the class's code references what I believe is an associative array, that is supposed to be passed to the addInput method. For example, the method definition contains ' function addInput ( $opts = array() , $fieldset ) ... and within addInput, there is code such as if ($opts['columnWidth'] != "") { $field->columnWidth = $opts['columnWidth'] ; } . Also, the example code calls addInputfield but in the class the method name is addInput. I could probably use the class definition itself and get something working but I just wanted to run these questions past you and maybe save myself and anyone else some time. So if i am missing something, please let me know if you have a chance , and thanks for sharing this class. ----------------------------------------------------------------------------------------------------------------------------------------------------------------- Later that evening.... lol Hey again Nukro, yeah I think I just should have worked with the class file and figured it out for myself, which is what I did after my first post. I was able to create two fields and a submit button , for example, with the following code.... (see attachment below) $example = new ProcessForm($wire); // had to pass the $wire variable to the class $example->addInput( array('type'=>"InputfieldText",'label'=>"Name") ); $example->addInput( array('type'=>"InputfieldText",'label'=>"Address") ); $example->addInput( array('type'=>"InputfieldSubmit",'value'=>"Submit") ); $out .= $example->render(); echo($out); ------------------------------------------------------------------------ As mentioned in the comment I needed to make a change to give the class access to $wire. I tested this code out in a single php file. I included index.php in it to get access to $wire and then I passed $wire to the constructor for the ProcessForm class. I made $wire a private variable in the class and then I only had to change lines like $field = wire('modules')->get($type); to $field = $this->wire('modules')->get($type); So anyway, thank you again for the code Nukro. It was a good learning experience. The class offers more options than I used in my simple example, and I intend to play around with them and learn more. And thanks @Soma too for his original post... And lastly, sorry for the HUGE post guys, I tried to trim down the original post by Nukro in my post but didn't have much luck. Bill
  4. Hi benbyf , Very interesting question but I'm not positive I'm following it 100%. This is my non-expert understanding of the topic : By definition a PW module is a PHP class. If you look at 'Module Example' in http://processwire.com/api/modules/ which is also in your list of links, you'll see "class Example extends WireData implements Module {". So A Module has immediate access to any variable or method in the parent WireData class. It also has to conform to the Module interface definition it is implementing. But as Robin S pointed out 'You have the whole API available to you', nor are you restricted to the API alone. I'm not trying to be cute or sarcastic here, but if you choose to, you can use whatever code is out there in your Module, be it on Packagist, Pear, GitHub or wherever. I'm not saying you necessarily want to, but you could.
  5. Have you come across this in your travels? http://flexboxfroggy.com/ I thought it was a funny drill to get familiar the various flex settings. Also came across this write up https://css-tricks.com/snippets/css/a-guide-to-flexbox which looked like a good read and reference.
  6. Hi, I'm just posting this in the hope it might save someone else a little time one day. I went to do a database backup using SQLyog Community version. I hit an error which said 'tables used by Event Scheduler were found damaged at server start' . It took me a bit of Googling before I found a fix. I was just about to run an upgrade on MySQL in the hope of fixing the problem and one last Google came up with the solution. Love it. Anyway, the fix was to run this command from the command prompt ( In Windows) : mysql_upgrade -u root -h localhost -p --verbose --force Found the fix here : https://serverfault.com/questions/562282/mysqldump-error-1557-corrupt-event-table/562303
  7. I use Wamp at the moment. I added php 5.5.36 to my set up today. I had added php 7 in April. I now have 3 versions of php in my setup lol. I found this write up to be helpful How to Upgrade PHP in WAMP Xdebug definitely seems to be OK on 5.5 as has been said. I can only speak for Visual Studio Code and Netbeans, though. I am going to post the php.ini settings I used for 5.5. It might save someone a little time. I am using the thread safe version, 64 bit. With Windows it seems that I needed a version of php that came with the php5apache2_4.dll. The non-thread safe version did not include it in the zip. OH, and when you're updating php.ini on Wamp, remember to also save it as phpForApache.ini !! It's mentioned in the article I provided the link to. ------------------------------------------------------------------------------------------ ; XDEBUG Extension zend_extension = "c:/wamp64/bin/php/php5.5.36/zend_ext/php_xdebug-2.4.0-5.5-vc11-x86_64.dll" ; [xdebug] xdebug.remote_handler="dbgp" xdebug.remote_enable = 1 xdebug.remote_autostart = 1 xdebug.remote_host=127.0.0.1 xdebug.profiler_enable = off xdebug.profiler_enable_trigger = off xdebug.profiler_output_name = cachegrind.out.%t.%p xdebug.profiler_output_dir = "c:/wamp64/tmp" xdebug.show_local_vars=0 xdebug.remote_port=9000
  8. @kongondo Hey, sorry for the late reply. Thank you for pointing this technique out. I've already used it a few times. Very helpful. Have a good one.
  9. Hi, My answer to the original question, is 'No, not yet', but I wanted to thank you for the post. I also wanted to say that http://phpjs.org/ lead me to Lodash - https://lodash.com/ which in turn lead me to http://danieltao.com/lazy.js/ . So as you can see it was a pretty fruitful bit of surfing I'd say. Doesn't hurt to have a list of Javascript libraries to refer to, especially in my case if they lend themselves towards functional programming. The reason for that is , believe it or not, I've only recently taken an interest in the functional programming paradigm as it applies to PHP. That interest was piqued by a thread here in a PW forum - https://processwire.com/talk/topic/13494-methods-to-cycle-through-foreachcomparevalues-of-children/?p=121712 I had always put off looking into functional programming for reasons I won't get into here and now as this post is long enough already. Let's just say I regret putting it off for so long. I am finding it an interesting self-study. At some point I believe I will be doing some study of Javascript and functional programming also. Can't hurt, right? Have a good one.
  10. Hi, If you have 13 minutes to kill, you might enjoy this https://www.youtube.com/watch?v=dIjKJjzRX_E It's funny but he makes some interesting points. This guy also has a series on functional programming with javascript. I've only watched the first video so far but I thought it was pretty good. Recommended here https://processwire.com/talk/topic/13494-methods-to-cycle-through-foreachcompare-values-of-children/?p=121747
  11. Hey, I thought I would take a few minutes and append a link to this thread. A few times, I've clicked on links embedded in posts in the forums and I noticed they took me to a specific location on the page rather than positioning me at the top of the webpage. I noticed the # followed by a number appended to the url. I was curious about this and was able to find a thread explaining this 'technique'. Here it is : http://webapps.stackexchange.com/questions/24013/how-to-link-to-a-certain-part-of-a-website Here's an example that positions you a little ways down from the top of the page : http://webapps.stackexchange.com/questions/24013/how-to-link-to-a-certain-part-of-a-website#answer-24016 Anyway, I may be one of the few people left on the planet who didn't know how to do this, but just in case I'm not, I wanted to share it . Enjoy and have a good one.
  12. Bill C

    Barba.js

    Thank you Benjamin. It seems I often pick up very useful information from your posts. I wanted to say thank you also for this link you posted recently. http://adamwathan.me/refactoring-to-collections/ It's prompted me to put some time aside to do some self-study on functional programming done with PHP Here's just a few additional links I found should anyone else be interested - There seems to be a good amount of information out there on the subject. https://blog.liip.ch/archive/tag/functional-programming https://www.sitepoint.com/functional-programming-and-php/ Thanks again.
  13. I'm all for simple!! Have a good one. I think these quotes are fairly well known among coders... not sure... thought I'd share them anyway . Good stuff. Enjoy. Correct is better than fast. Simple is better than complex. Clear is better than cute. Safe is better than insecure. -- Sutter and Alexandrescu, C++ Coding Standards Programs must be written for people to read, and only incidentally for machines to execute. -- Harold Abelson and Gerald Jay Sussman The cheapest, fastest and most reliable components of a computer system are those that aren't there. -- Gordon Bell
  14. @Robin - I have to confess, my head hurt a little bit after reading over the post you credited Very interesting stuff though, Thank you for sharing that. @Manaus - Can you wrap the code/variables in your include, which you are concerned about , within a class? Maybe I'm missing something in your question, but if you're looking to be able to use variables within the include in this manner - $this->title, then I believe $title needs to be defined within a Class http://stackoverflow.com/questions/1523479/what-does-the-variable-this-mean-in-php Might help if sample code was provided with the question ? Have a good one.
  15. Bill C

    Vagrant

    Good point LostKobrakai, thank you for the warning! . I'll leave it on my 'List' for reference, but I think I'll give Vagrant another go soon when I have some time. And thanks to bernhard , gurkendoktor , MindFull and kongondo for your thoughts and recommendations.
  16. Sane is always good ... So is Sane's second cousin, Simple. I found this mini-book on CSS layout a short time ago. http://book.mixu.net/css/ . I liked it and found it helpful for myself. Plan on reviewing it every so often. Someone else might find it helpful also. Thanks again gentlemen.
  17. Hi Alan! Hey thanks for the input, I'll add Susy to the always growing list of things to check out. Appreciate your comment! Have a good one. Comments by LostKobrakai and gebeer have also been noted. Thank you also.
  18. Hi, I was looking for a CSS grid to use. I looked at Skeleton, PocketGrid and one or two others briefly. I am ok with CSS. Not an expert at all. But CSS positioning.. not my strong point .. sometimes reminded me of playing Jenga. After enough tweaks, I'd get what I wanted, but it was not usually painless. I saw Bourbon/Neat mentioned and visited their site. Next thing I know, I have Ruby, Sass, Node.js , Bourbon and Neat installed. So, yeh, you're not just installing Sass if you go the Sass route. I'm not saying it's a big deal. I was going to get Node at some point anyway And I also went with a piece of software called Koala. It does the Sass compiles after a scss file changes. It crashes sometimes, but I'm on Windows 10, so say no more. Seems like a lot of moving parts just to get a grid going , no? lol So what's your take on Flexbox? https://www.reddit.com/r/Frontend/comments/3fm2qi/flexbox_ready_for_primetime_or_not_lets_discuss/
  19. Bill C

    Vagrant

    Update on Vagrant on WIndows 10 Yeh.. umm.. not such a great experience with Vagrant and Virtualbox yesterday. I've been in sort of a slump lately when it comes to installing new software LOL . Seems to be an issue with Virtualbox on running the guest in full screen mode, if host is windows 10. Supposedly to use full screen mode, it seems you have to install something called 'Virtual Box Guest Additions'. Apparently there's a problem with installing it on windows 10 (big surprise there ). I found a suggestion to run it under Windows 8 compatibility. That didn't help. The screen is not THAT small, I decided to live with it for now. I'll pretend I'm running it on a 15" laptop : Ran into issues with Vagrant also. Seemed I had bad luck picking pre-defined boxes. I'll spare everyone the boring details. I decided to just let it sit for now. At the moment, I have Debian 8 running on Virtualbox, no Vagrant involved. It took 'longer than expected' to install. From what I saw after Googling, that seems to be the norm, so OK, I let it run. Seems to be fine for now. Will maybe try Ubuntu in the not too distant future. Where I work, it's primarily Windows, so I don't have anyone to call and ask for some recommendations on which flavor of Linux to go with. I saw Mint was recommended. I tried that, but sure enough, there was some sort of 'video rendering' issue. Some screen flickering, etc .. so I decided to pass on it for now. I will add Docker to the list of things to check out. Thank you LostKobrakai . Anyway, if you have Windows 10 your mileage may vary. Have a good one.
  20. Hi, This query will give you the columns and their data types - SELECT DISTINCT TABLE_NAME, DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME IN ('created') AND TABLE_SCHEMA='YourDatabaseName'; In my plain vanilla PW 3+ for example, I'm only seeing the following - field_images datetime field_img1 datetime field_page_comment int field_page_comment_votes timestamp modules timestamp page_path_history timestamp pages timestamp The end of the error message is giving you the row number the error occurred on ... 'for column 'created' at row ###'. Having the row number, and knowing the tables that contain a 'created' column, perhaps you can determine the table involved with the error?? Of course knowing the table is one thing. It's significant, but it's only a piece of the puzzle. As you already know, 1292 appears to be a mysql error number for an incorrect datetime value. So, as you said, the error has occurred a couple of times when you were logging in , or out. This brings up questions for myself also. I have never looked into what type of user session logging goes on in PW by default. Are you using some sort of module that is keeping track of user login/logout/session history? I just did a few searches and found this link from 4 years ago.. https://processwire.com/talk/topic/2082-module-process-login-history/ . Leads me to think there is no logging by default. Need to research. Just something else for me to add to the 'Things to look into' list, I guess.
  21. Bill C

    Vagrant

    Hey.... 2 years later.... lol I decided yesterday that I was going to try out some sort of VM on my Windows 10 workstation at home. It had been in the back of my mind for some time but wasn't too high on the list. Thought it would be a good idea to reacquaint myself with some version of Linux in terms of PHP development, with Processwire of course So anyway, for some reason I didn't stumble across Vagrant prior to searching these forums for Virtualbox to see what I could find. Once again the Processwire forums and their contributors have been a big help to me Thanks!
  22. Hi, I found this forum thread that you might find interesting. It contains a post by Mr. Cramer himself, It's a little old but still work checking out when you have a chance. https://processwire.com/talk/topic/3118-crowd-fund-new-tutorials/#entry31001 If you haven't seen this already, you might find it helpful : http://wiki.processwire.com/index.php/Small_Project_Walkthrough This one also to help with searching the forums for specific topics / tutorials https://processwire.com/talk/topic/6196-easy-search-on-pw-forums-with-google/ For example, try using this search on Google 'site:https://processwire.com learn php' . You know, the Readme.txt file that comes with the Processwire install in the templates folder? It's actually worth a read Though it has nothing to do with PHP in terms of Processwire, if you are new to programming, and you haven't done so already, I'd suggest you get familiar with debugging techniques pertaining to php. Find some tutorials on on the subject. Xdebug will come up. Look into it, There are also php debugging addons for both Firefox and Chrome. Also have a look at Tracy Debugger http://modules.processwire.com/modules/tracy-debugger/ There are also articles in the PW forums on debugging. Start creating a collection of code snippets for yourself as you go along. It doesn't have to be fancy. Just something you can go to when you need an example of how you coded something in that past. Might save you a little Googling time. Lastly, try to get in the habit of writing what is usually referred to as 'clean code'. Use comments wisely. Don't leave dead/unused code in a module. It only clutters things up and is a distraction. Take the extra time to give variables meaningful names.. etc etc. Nothing sucks worse than having to go back to something you yourself wrote, say 6 months ago, and you find yourself staring at the screen silently cursing yourself out, because you can't remember what you were trying to accomplish. Bottom line - Google on 'Writing clean PHP code' and go from there. Best wishes on your coding endeavors.
  23. @LostKobrakai, Thank you for taking the time to point this out. I have not yet done any coding involving Wire Cache, I've just started playing around with Hanna codes , but I am definitely going to be saving this link for future reference. Thanks again.
  24. Hi, I see this module : http://modules.processwire.com/modules/login-notifier/ Written by Mr. Cramer himself. I have not done any coding for user-member/access functionality in Processwire so I can't speak from experience, sorry. I would say that that module by Ryan might contain what you need or at least point you in the right direction. Can't hurt to look. Then you also have the API. - https://processwire.com/api/variables/user/ And last but not least - http://cheatsheet.processwire.com/user/user-methods/user-isloggedin/ Ok.. maybe not the last.. I found this also https://processwire.com/talk/topic/9811-frontenduser-login-logout-and-register-users-members/ . Read the features list. It has functionality to check for a user who is already logged on. Hope the above helps.
  25. Problem solved. Disregard the original post. Thank you.
×
×
  • Create New...