Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/13/2016 in all areas

  1. I found this website to be very interesting take on pricing websites and other development tasks. http://howmuchtomake.com/ I will be referencing this link to my clients so that they can get a realistic view of how things are priced. Depending on where you live, this may or may not be much help to web developers/designers. Good Day.
    7 points
  2. Hello, Here is some theoretical background to start with: How to actually setup parent/child(ren) relationships: Best general introductory tutorials: http://blog.mauriziobonani.com/processwire-basic-website-workflow-part-1/ https://www.smashingmagazine.com/2016/07/the-aesthetic-of-non-opinionated-content-management-a-beginners-guide-to-processwire/ If you already have a little bit of developer backgound, I recommend checking out this profile: Even if you do not want to deal with the "Wire Render Pattern" implemented for the front-end, checking out the templates/fields of the profile demonstrates a great deal about how to set things up.
    5 points
  3. I've been developing on Ubuntu and Debian for years now. It's simpler I don't do much bash scripting, but wanted to share this with you all. I know we are always trying to find the best workflow and always modifying how we do things to make our development more stream-lined. #!/bin/bash #---------------------------------------------- # I WROTE A SIMPLE SCRIPT TO: # - RSYNC A DUMP SQL FILE TO REMOTE SERVER # - THEN EXPORT A BACKUP SQL FILE # - THEN IMPORT THE DUMP SQL FILE # - THEN REMOVE THE DUMP SQL FILE #---------------------------------------------- # This work is licensed under a Creative Commons # Attribution-ShareAlike 3.0 Unported License; # see http://creativecommons.org/licenses/by-sa/3.0/ # for more information. #---------------------------------------------- ## CD INTO LOCAL WORKING DIRECTORY ## this is where I keep my local dump SQL files. ## the most recent one is always named dump.sql cd ~/www/website.dev/DB ## RSYNC LATEST DUMP.SQL FILE TO REMOTE SERVER rsync -avzP dump.sql _USER_@111.222.333.444:/home/_USER_/website.com/backups wait ## SSH INTO SERVER ssh _USER_@111.222.333.444 /bin/bash << EOF echo "**************************"; echo "** Connected to remote. **" echo "**************************"; echo ""; ## CD INTO REMOTE WORKING NON-PUBLIC DIRECTORY ## where the dump.sql file was rsynced to cd website.com/backups wait sleep 1 ## RUN MYSQLDUMP COMMAND ## save the SQL with date stamp mysqldump --host=localhost --user=root --password=_PASSWORD_ _DATABASE_ > `date +%Y-%m-%d`.sql; echo "***************************************"; echo "** `date +%Y-%m-%d`.SQL has been imported. **" echo "***************************************"; echo ""; wait sleep 1 ## IMPORT DUMP.SQL COMMAND mysql --host=localhost --user=root --password=_PASSWORD_ _DATABASE_ < dump.sql; echo "*********************************"; echo "** DUMP.SQL has been imported. **" echo "*********************************"; echo ""; wait sleep 1 ## REMOVE DUMP.SQL FILE rm dump.sql echo "********************************"; echo "** DUMP.SQL has been removed. **" echo "********************************"; exit EOF
    4 points
  4. I added interactive mode into your script, hope it helped to someone is too lazy like me #!/bin/bash #---------------------------------------------- # INTERACTIVE REMOTE DATABASE DUMP SCRIPT #---------------------------------------------- # This work is licensed under a Creative Commons # Attribution-ShareAlike 3.0 Unported License; # see http://creativecommons.org/licenses/by-sa/3.0/ # for more information. #---------------------------------------------- SCRIPT=${0##*/} IFS=$'\n' HISTFILE="$HOME/.remotedump.history" # Use colors, but only if connected to a terminal, and that terminal supports them. if which tput >/dev/null 2>&1; then ncolors=$(tput colors) fi if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then RED="$(tput setaf 1)" GREEN="$(tput setaf 2)" YELLOW="$(tput setaf 3)" BLUE="$(tput setaf 4)" BOLD="$(tput bold)" NORMAL="$(tput sgr0)" else RED="" GREEN="" YELLOW="" BLUE="" BOLD="" NORMAL="" fi # Case-insensitive for regex matching shopt -s nocasematch # Prepare history mode set -i history -c history -r # Input method text get_input() { read -e -p "${BLUE}$1${NORMAL}" "$2" history -s "${!2}" } # Input method password get_input_pw() { read -s -p "${BLUE}$1${NORMAL}" "$2" history -s "${!2}" } # Echo in bold echo_b() { if [ "$1" = "-e" ]; then echo -e "${BOLD}$2${NORMAL}" else echo "${BOLD}$1${NORMAL}" fi } # Echo in colour echo_c() { case "$1" in red | r | -red | -r | --red | --r ) echo "${RED}$2${NORMAL}" ;; green | g | -green | -g | --green | --g ) echo "${GREEN}$2${NORMAL}" ;; blue | b | -blue | -b | --blue | --b ) echo "${BLUE}$2${NORMAL}" ;; yellow | y | -yellow | -y | --yellow | --y ) echo "${YELLOW}$2${NORMAL}" ;; * ) echo "$(BOLD)$2$(RESET)" ;; esac } # Get input data and save to history save_input() { if [[ ! -n "$local_dir" ]]; then while get_input "Local DB Directory > " local_dir; do case ${local_dir%% *} in * ) if [ -n "$local_dir" ]; then break else continue fi ;; esac done fi if [[ ! -n "$remote_user" ]]; then while get_input "SSH Username > " remote_user; do case ${remote_user%% *} in * ) if [ -n "$remote_user" ]; then break else continue fi ;; esac done fi if [[ ! -n "$remote_ip" ]]; then while get_input "SSH Aliases/IP-address > " remote_ip; do case ${remote_ip%% *} in * ) if [ -n "$remote_ip" ]; then break else continue fi ;; esac done fi if [[ ! -n "$remote_dir" ]]; then while get_input "Remote Backup Directory > " local_dir; do case ${remote_dir%% *} in * ) if [ -n "$remote_dir" ]; then break else continue fi ;; esac done fi if [[ ! -n "$db_user" ]]; then while get_input "DB Username > " local_dir; do case ${db_user%% *} in * ) if [ -n "$db_user" ]; then break else continue fi ;; esac done fi if [[ ! -n "$db_password" ]]; then while get_input_pw "DB Password > " local_dir; do case ${db_password%% *} in * ) if [ -n "$db_password" ]; then break else continue fi ;; esac done fi if [[ ! -n "$db_name" ]]; then while get_input "DB Name > " local_dir; do case ${db_name%% *} in * ) if [ -n "$db_name" ]; then break else continue fi ;; esac done fi } change_pwd_rsync() { ## CD INTO LOCAL WORKING DIRECTORY ## this is where I keep my local dump SQL files. ## the most recent one is always named dump.sql cd "$local_dir" ## RSYNC LATEST DUMP.SQL FILE TO REMOTE SERVER rsync -avzP dump.sql $remote_user@$remote_ip:$remote_dir wait } remote_dump() { ## SSH INTO SERVER ssh $remote_user@$remote_ip /bin/bash << EOF echo "**************************"; echo "** Connected to remote. **" echo "**************************"; echo ""; ## CD INTO REMOTE WORKING NON-PUBLIC DIRECTORY ## where the dump.sql file was rsynced to cd "$remote_dir" wait sleep 1 ## RUN MYSQLDUMP COMMAND ## save the SQL with date stamp mysqldump --host=localhost --user=$db_user --password=$db_password $db_name > `date +%Y-%m-%d`.sql; echo "***************************************"; echo "** `date +%Y-%m-%d`.SQL has been imported. **" echo "***************************************"; echo ""; wait sleep 1 ## IMPORT DUMP.SQL COMMAND mysql --host=localhost --user=$db_user --password=$db_password $db_name < dump.sql; echo "*********************************"; echo "** DUMP.SQL has been imported. **" echo "*********************************"; echo ""; wait sleep 1 ## REMOVE DUMP.SQL FILE rm dump.sql echo "********************************"; echo "** DUMP.SQL has been removed. **" echo "********************************"; exit EOF } main() { save_input change_pwd_rsync remote_dump } main
    4 points
  5. @tpr: thanks. With your test environment this was easy to reproduce and I've just pushed a fix to GitHub To be honest I'm not entirely sure why this was broken in the first place, but it has something to do with the way isset() implementation has changed in PHP 7.0.6. Found a bunch GitHub issues related to other frameworks where this has also caused issues. Ditching isset() works in this case, since nothing that evaluates to false should be a valid value here anyway. @ryan: doing isset($this->input->get->pages_id) in a Process module resulted in "false" in PHP 7, even though $this->input->get->pages_id returns a value ('1234' or something along those lines). Unless I'm mistaken here, this might be something that the core should account for. Seems to be related to https://bugs.php.net/bug.php?id=72117.
    3 points
  6. Gee, this part sounds familiar
    3 points
  7. As a simple example, let me show you the basic setup of a blog (simplified diagram of the blog profile I recommended above): It is a "UML like" diagram, where the yellow boxes are the templates, the blue ones are sample pages (they must be created in the Page Tree) based on the templates. Generally speaking whenever you can, you should set up parent/child relationships, because this is something ProcessWire handles well, out of the box. However, it is not possible to force all the required relationships into a tree, so we can also have "simple" one-to-one and one-to-many relationships via Attributes (Fields). A Field in ProcessWire has its associated "Input field type" (found under the Input tab of the field), which sets up the UI element used by the admin for the field. Quote: "Input field type: The type of field that will be used to select a page. Select one that is consistent with the single page vs. multi-page needs you chose in the "details" tab of this field..." Hope this helps. If not, I can mock up a similar diagram about your use case too. Answers to your questions: A1. Generally yes, but I recommend implementing something like you see above: parent/child for Books/Book, Categories/Category, Chapters/Chapter, etc.. and you can connect these via Attribute (Field) / InputField relationships. This is a much more flexible setup. A2. If I understand you correctly, you can do it if you use Attribute (Field) / InputField relationship, and by setting the field to "required". A3. Yes, a field. The simplest way to implement it is using the Options type: https://processwire.com/api/modules/select-options-fieldtype/ https://processwire.com/blog/posts/new-options-fieldtype-processwire-2.5.17/ Of course, you can also setup just another Field/InputField relationship, if you need more than a simple select. A4: Sure, it can: https://processwire.com/api/variables/ BTW, one more reading on the topic: https://medium.com/@clsource/understanding-processwire-templates-fields-and-pages-201aecd0a1a4#.gd0w6u9qw
    2 points
  8. @Robin S I tried everything you suggested. As it should be working, it didn't, therefore I started from a new PW installation, and de login-form is working fine now! It is still a mystery, but I'm glad you confirmed the code was right and thx for all suggestions. hansv
    2 points
  9. This week work continued on preparing 3.x (and 2.8.x) for release. One of the features of 3.x that we'd not yet covered in much detail was the multi-instance support. So the primary focus this week was in making sure we clarified and simplified some things in that respect. This post covers all the details. In addition we've also got some $session updates that we think you'll like! https://processwire.com/blog/posts/multi-instance-pw3/
    2 points
  10. Looks okay to me. A couple of minor things that won't be related to your problem: $sanitizer->username is deprecated in favour of $sanitizer->pageName I don't see where you set the default state of $error, so you may get an undefined variable notice when an exception is not thrown. Things to try: log $username and $password before $session->login() to check that the variables are holding the correct information. can you login with this username and password at the PW admin login?
    2 points
  11. Hi guys so currently am writing a detailed tutorial about creating Modules, I have never created a module because i don't know all the classes and interfaces required, so this is like a detailed research for me, this is how i learn things by writing articles. However I might make some mistakes so i decided to make it on Google Docs to get comments and feedback, before posting on my website and Processwire tutorial site, this is going to be one heck of a detailed tutorial. Here is the link I will be updating it https://docs.google.com/document/d/1VA_WK-5qbnq3Ux_EOW3p92IcjbAcVZJ0aewIiFxmv2Q/edit# However I wanted to get a clear picture of the following Process Class and ConfigurableModule i noticed some modules require it and some don't My interpretation is that Modules with admin setting pages uses ConfigurableModule and Process are modules who require access to $this->pages and that sort Thanks all
    1 point
  12. This module adds a preview and zoom button to InputfieldTextarea for live previewing the content after being formatted by the text formatters assigned to that specific field. It's pretty alpha still but it already works. For now I was only playing with the Parsedown formatter, but it should work with every other formatter as well, even with Hanna Code, not sure though, haven't tested it. It's restricted to regular textareas, meaning TinyMCE et al are not supported yet, because they need specific change listeners. Will look into it though. The result is fetched via ajax from a process page, the default style sheet contains some Github-like styles but the style sheet is configurable, see module settings. Github: https://github.com/owzim/ProcessTextareaPreview Open for suggestions
    1 point
  13. Hi, I'd like to add an input field to the page comments that should act as a honey pot: if this field has a value, the comment will not be sent. From what I can tell from the documentation, currently the spam check is only possible with an external service or with JavaScript to apply a hidden input with a pre-defined name. To me relying on JS in order to enable a site's visitor to leave a comment seems wrong, so I'd like to go the other way: Hide the honeypot input visually so it won't get filled by (human) visitors. If a (dumb) bot fills in every input it finds with values, it'll tap also in the honey pot field -- and the spam comment will not be sent. Maybe this option could be added to the comment field's settings? Cheers, Tom
    1 point
  14. Most (all?) links made to individual replies/posts before the forum upgrade no longer work correctly in the new forum. This is frustrating because you have to hunt around for the actual reply that was referenced and reduces the usefulness of all the older posts that supply solutions to problems by linking to a specific reply. It seems like this should be possible to fix. Compare these two links to the same post, from the old forum and new forum: https://processwire.com/talk/topic/3474-admin-custom-pages-module/page-5#entry56657 https://processwire.com/talk/topic/3474-admin-custom-pages-module/?do=findComment&comment=56657 Can we get old links redirected or updated to the new syntax? Edit: what's worse is when you get this... When the new forum tries to be smart and make an iframe out of a broken link there seems to be no way to find out what thread/reply was linked to, even by inspecting the page source.
    1 point
  15. yes, it works on default theme (needs some CSS adoration on Reno)
    1 point
  16. This does also have a side-by-side view (at-least in fullscreen mode). I think it's even configurable.
    1 point
  17. The documented example for $session->login() sets the returned user to a variable and then tests the variable (and this is how I use the method in my custom login). $u = $session->login('bob', 'laj3939$a'); if($u) { echo "Welcome Bob"; } else { echo "Sorry Bob"; } The way you are doing it should be fine, but try setting a variable and then you can log/dump the variable to see what is being returned. I guess it is returning null but it pays to check. You could also test if you can log the user in successfully by using $session->login() directly as per the example above, to narrow down where the problem lies.
    1 point
  18. FYI: there is a GitHub issue open for this problem.
    1 point
  19. Thank so much, would have never have figured that out! I've disabled the DB Session handler for now, and is all working fine.
    1 point
  20. If you can, disable the session DB-handler. It is known for this behave in regard with multiple parallel images uploads. Or, if you cannot switch to session handling via files, the only other alternative is to switch PW Version up to PW 3.0.21+ (?) not sure the correct version where DB-Sessionhandler was updated / corrected. Other possiblities are not there in your case, I believe.
    1 point
  21. Assuming you're usine Apache, it's better to use Options +Indexes, without the + you may reset other apache directives that are currently in effect. Take a look about 2/3 of the way down this page: https://httpd.apache.org/docs/2.4/mod/core.html#options
    1 point
  22. I'd like to thank LostKobrakai for this excellent tutorial included in the Dec 25, 2015 blog post regarding custom page types. If you haven't read it yet, please do so. It is contributions like this by the senior members that prove selecting ProcessWire was the correct decision for this ProcessWire-Newbie. I am impressed at what I have learned within the functionality of ProcessWire, and discovering avenues I hadn't yet thought about. It is indeed a merry Christmas. I also want to thank all staff members. They deserve our gratitude for the time they dedicate to helping us learn ProcessWire, and the many avenues available with each project. For example, kongondo contribution is another great example of the team in place here. My hat is off to Ryan and his team for giving of their time and sharing their knowledge. In addition to the regular staff, there are many members, such as Kixe, Tom, (and too many others to name them all here) that also deserve recognition for their contributions and assistance. It is greatly appreciated. I am certainly looking forward to ProcessWire 2016 ;-)
    1 point
  23. ProcessWire is a content management framework, which is still a "framework", but more focused on a particular thing. Whereas the framework scope of CakePHP, Laraval, CodeIgniter, etc., is more broad and cover more territory. ProcessWire isn't meant as a replacement for one of those frameworks, but I think there are probably many instances where its focus might make it preferable. And an equal number of instances where the opposite is true as well. There's also something to be said for bringing the two together in some instances. Another big area of difference is that traditional frameworks enforce a particular approach to build on top of, whereas ProcessWire aims to be a lot more transparent, like jQuery. Frameworks set you up with a place to put your models, views and controllers, whereas ProcessWire puts in you in a plain PHP file (template file) that is given a location context ($page) and lets you take over from there. We think MVC is a good approach to take with ProcessWire template files, but don't enforce anything, as it's up to the developer. For better or worse, the possibilities are wide open in the same way they are with a PHP file on its own… though with a full CMF API at your disposal.
    1 point
  24. Hello Everyone, Thanks Soma! My reason for asking is because, except for a handful of actions, I have been able to replicate everything I was doing with CodeIgniter/Laravel here in ProcessWire. Actually, on the Laravel forums there are two related discussions about this. If you haven't seen them already, go here: http://forums.larave...id=21881#p21881 http://forums.larave...?pid=4627#p4627 There is also this: https://twitter.com/...018610362232832 I find this significant for a couple of reasons. First, because there have always been three branches of Web development for me: 1. Pure and Naked PHP 2. Fully-Baked CMS 3. PHP Framework I'm being a bit colorful, but I think you all know what I mean by "pure and naked" and "fully-baked." Of course, there are CMSs built with frameworks, but I had never found one that maintained the total freedom of the framework while also providing the crucial "engine" of a CMS without making too many assumptions. I know a few that come close. ProcessWire is the only one I have found (and I have tested a very long list of CMSs and framework-based CMSs). The "fully-baked" CMSs are not worth comparing really. If people in the Laravel community are recognizing that ProcessWire does the framework-based stuff really well, and also gives you those CMS functions every project needs, it's a big story. Thanks, Matthew
    1 point
  25. I Would like to throw a huge, hefty spanner into the works here! (Just for fun) If you split PW into two piles, in one pile you have the Site directory. Here is, or will be, your CMS. PW gives you a starter, but once you get into it, you are going to build your own content management structure in there on top of the base. In the other pile is the WIRE directory. However, this is NOT a CMS, or perhaps even a CMF .... I have a suspicion that it is really a CME - a Content Management ENGINE! Joss PS: I have this great want to rename the SITE directory to PROCESS ... just to round off the gag.
    1 point
×
×
  • Create New...