Jump to content

Bill C

Members
  • Posts

    42
  • Joined

  • Last visited

  • Days Won

    1

Bill C last won the day on April 26 2016

Bill C had the most liked content!

Profile Information

  • Gender
    Male
  • Location
    Somewhere in the Garden State :)

Recent Profile Visitors

1,462 profile views

Bill C's Achievements

Jr. Member

Jr. Member (3/6)

77

Reputation

2

Community Answers

  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.
×
×
  • Create New...