Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/09/2018 in all areas

  1. I've made a website for a client, called Ekzaga which serves multiple purposes. It is a forex broker and cryptocurrency exchange directory, as well as a trading tutor marketplace. The trading tutor marketplace section is hidden as my client is trying to get various tutors to join the website willing to teach students, but it does exist in the code, you just can't access it online. Launch Ekzaga
    8 points
  2. This profile can be used as a simple business card or blog. The profile does not use any framework css structure, only styles based on CSS GRID and FLEX. To minimize page loading, I added lazy load for images ( Tupola Lazy Load ). With include functions like: MarkupRegions FunctionsAPI CAN DOWNLOAD FROM THIS LINK: https://github.com/rafaoski/site-grayscale-pw https://github.com/rafaoski/site-min-grayscale-pw Screenshot:
    8 points
  3. This week we take a look at something really cool we added a few months ago but haven’t told you about yet: owner selectors. We also take a brief look at what’s new in ProcessWire 3.0.95 and and the status of our next master version, which is just about ready! https://processwire.com/blog/posts/processwire-3.0.95-core-updates/
    7 points
  4. Its not straightforward and sometimes frowned upon . Have a look at this thread. And this one: And this one for changing published date: OK, if you've decided to carry on, first, some quick by the way technical tips. If unsure whether something is a runtime or DB property, I check the API: http://processwire.com/api/ref/page/ For $page->created, it says: That gives me an idea that when setting, I should probably set in the same format (Unix timestamp). If unsure, I can check the code or try to pass it a normal formatted date. You never know, ProcessWire can convert it behind the scenes. I sometimes check the database table of the field. This case, the table is pages. This helps me to check out the schema and if the property is runtime or saved to DB. There they are. They are columns in the pages table. If need to, I also check the table structure, but don't need to in this case. OK, to the code. // CURRENT DATES // timestamps echo 'Created Date: ' . $page->created . '<br>'; echo 'Published Date: ' . $page->published . '<br>'; echo 'Modified Date: ' . $page->modified . '<br><hr>'; // formatted date echo 'Created Date: ' . date('D d M Y H:m', $page->created) . '<br>'; echo 'Published Date: ' . date('D d M Y H:m', $page->published) . '<br>'; echo 'Modified Date: ' . date('D d M Y H:m', $page->modified) . '<br>'; // MODIFY CREATED DATE $page->created = 1425898824;// Monday, 9 March 2015 11:00:24 $page->published = 1426762824;// Thursday, 19 March 2015 11:00:24// will not work; @see links to threads above $page->of(false); #$page->save();// @NOTE: WILL NOT WORK; you need below $page->save(array('quiet' => true));// @NOTE: ONLY WORKS FOR CREATED // MODIFIED CREATED DATE echo '<hr>'; // timestamps echo 'Created Date: ' . $page->created . '<br>'; echo 'Published Date: ' . $page->published . '<br>'; echo 'Modified Date: ' . $page->modified . '<br><hr>'; // formatted dates echo 'Created Date: ' . date('D d M Y H:m', $page->created) . '<br>'; echo 'Published Date: ' . date('D d M Y H:m', $page->published) . '<br>'; echo 'Modified Date: ' . date('D d M Y H:m', $page->modified) . '<br>';
    5 points
  5. Sure - I added 2 files with adminonsteroids: site/template/admin/admin.css site/template/admin/admin.js With these codes I hide following features: Image Cropping Image Variations Image Title change Image Actions Image Change on Drag & Drop /* added ot admin panel sites */ .InputfieldFileActionSelect, .InputfieldImageEdit__info, .InputfieldImageEdit__buttons button { display: none !important; } .InputfieldImageEdit__buttons button.InputfieldImageButtonFocus { display: inline-block !important; } .InputfieldImageEdit__name span { cursor: default; } .InputfieldImageEdit__imagewrapper .detail-upload { visibility: hidden !important; } // added ot admin panel sites $(document).ready(function() { $('.InputfieldImageEdit__name span').removeAttr('contenteditable'); });
    2 points
  6. @adrian Thanks for the feedback - I like the idea. It needs a take account of the chosen time format (that's just one of the ones on offer), but this should be possible. Will see what I can do.
    2 points
  7. Excellent! Glad we got there in the end .
    2 points
  8. There is an option in the ImportPagesCSV module for that: ImportPagesCSV can't do that for you, but after the data is imported you could loop over the pages and do the group assignment via the API. Or you could write your own API script for importing the CSV data and do the group assignment as you import. Below is a link to an action for @adrian's AdminActions module that will take a CSV file from a file field and loop over the rows.
    2 points
  9. Cleave looks nice, thanks. I managed to set up a working PoC, the only issue came up was submitting the value - the formatted value got saved so I had to remove fomatting on submit to save the raw value. You can see the raw value (no delimiters) for a second before submit and Tracy Console also shows the right value. The configuration looks like this:
    2 points
  10. Thank you Mats and dragan. Your forum is great. I have never experienced one so responsive and useful; and I belong to many forums.
    2 points
  11. Install this module and run Batch Create Users https://modules.processwire.com/modules/process-admin-actions/
    2 points
  12. Here's some code for importing pages/users from csv-file:
    2 points
  13. Every CKEditor field has a configuration field Custom Editor CSS File (regular mode), by default it is: /site/modules/InputfieldCKEditor/contents.css If you set this option in all your CKEditor fields, with the same path, they will share that css file. https://github.com/processwire/processwire/blob/master/wire/modules/Inputfield/InputfieldCKEditor/README.md#custom-editor-css-file
    1 point
  14. Hello, Perhaps it's better to ask at
    1 point
  15. Do you mean in the page editor? I'll look if there are modules for this because I'm not sure. But you can also do this via the api: $home = $pages->get('/'); echo date("d M Y", $home->published) . PHP_EOL; // 21 Feb 2017 echo date("d M Y", $home->created) . PHP_EOL; // 21 Feb 2017 $home->published = strtotime("February 21, 2016"); $home->created = strtotime("February 21, 2016"); $home->save(); echo date("d M Y", $home->published) . PHP_EOL; // 21 Feb 2016 echo date("d M Y", $home->created) . PHP_EOL; // 21 Feb 2016 Edit: My bad. The changes doesn't seem to persist. Turns out, published, created, and modified are not "fields" per se, but rather are properties built-in to the page. This might be a good candidate for a quick module for those who need to edit the values.
    1 point
  16. I'm pretty sure ProFields: PageTable allows creation of new pages from from within the page being edited.
    1 point
  17. It is a page selector. See this example of selecting all pages with a certain parent. Note that you can click on "show" to see the matches to confirm they are what you expect. It uses the WireMail class which the Mailgun module extends so it should send through that.
    1 point
  18. I solved it with AdminOnSteroids and Custom CSS/JS
    1 point
  19. The key thing about the AdminActions module is that you can easily write your own actions to do exactly what you need. Take one of the existing actions as a starting point, rename and save it to /site/template/AdminActions/ - easy to build and easy to access.
    1 point
  20. Hi MrKing, if the above tips doesn't suite your needs, I can provide you example scripts of individual imports.
    1 point
  21. OK. However, index.php will work even without .htaccess. This is what I am confused about. If the .htaccess file is working, you should have seen a server 500 error when you added random gibberish text at the very top of the htaccess file. If you didn't, it means the htaccess is not getting read. Maybe repeat the test to confirm? Could these posts be of help to you?
    1 point
  22. Welcome to PW MrKing! Here is one example how to create users with the API:
    1 point
  23. You have a backup of your website and database, right ? So, delete everything in the root and database of your Host and then do a fresh new processwire installation. That will tell you if your Host has any restrictions yes or no. As soon as you can do a fresh new processwire installation on your host, you can compare both the .htaccess and the config.php files with the ones you have in your website backup.
    1 point
  24. Or Stripe Checkout: https://stripe.com/checkout https://stripe.com/docs/checkout (Integrating Checkout, etc.) https://stripe.com/docs/checkout/php Edit: http://modules.processwire.com/modules/payment-stripe/
    1 point
  25. I've dealt in the past with a web host who enabled some ModSecurity or Custom settings that were geared towards protecting WordPress installations. This affected some of my clients PW sites on shared hosting. Once I sent a message to the web host, letting them know these weren't WP sites and that their changes were impacting the PW sites, they relented and removed the WP-specific host settings.
    1 point
  26. More updates! Here is what was added since my last post: FieldtypeDatetime now supports format argument. Which allows you to pass PHP date format string and retrieve your datetime values formatted the way you want. Besides FieldtypeDatetime fields, the built-in fields created and modified are also support new format argument. FieldtypeOptions is now supported. first and last fields on PageArray types are now supported. As per @eelkenet's request. See above post for details on those. Finally, now there is a way to add support for any fieldtype you want via third-party module. What you need to do is create a module with the name exactly as the fieldtype you want to add support for with "GraphQL" prefix. So for FieldtypeMapMarker it would be GraphQLFieldtypeMapMarker. Then you need to add three required methods and install it. This will automatically add GraphQL support for your desired fieldtype and it will be available in your GraphQL api. Checkout the documentation and an example module for reference.
    1 point
  27. Hey everyone! It's been a while since I last had a time to work on this module. But now I finally managed to focus on this module. So here are the latest updates. The codebase of the module grew very big and the more features I added the more time I had to spend to make sure the changes I made does not break anything. Because I had to manually verify if everything works as expected. After long night hours of trial and error I managed to setup tests for this module. Tests will help us quickly add/remove features as needed, because now there is no need for manually verifying all edge cases. Also I setup the Travis-CI so people can contribute more confidently and I can merge pull requests without worrying! There are already bunch of tests, but there is still some I'll be adding. 🎉 🎉 I will add some documentation on how to run tests locally in github wiki pages soon and let you know here. Another thing to note is that the master branch of our module no longer tracks the vendor code. This means that if you download the master branch and put it into your /site/modules directory it will not work. Instead you should use release builds that are a cleaned version of the module. It includes required vendor codes and does not have extra files that are not relevant to ProcessWire. Like presentation gif images, test files and so on. This makes the module size smaller!
    1 point
  28. Here it is in a hook. Use it with $pages->get(1234)->setPublished($timestamp), where you can get timestamp using strtotime or edit hook to build a date formatted as Y-m-d h:i:s wire()->addHookMethod('Page::setPublished', function (HookEvent $e) { $page = $e->object; $timestamp = $e->arguments(0); if (!$page->id) return false; if (!$timestamp) return false; $date = date('Y-m-d h:i:s', $timestamp); $query = $e->database->prepare("UPDATE pages SET published=:pub_date WHERE id=:page_id"); $e->return = $query->execute([ ':pub_date' => $date, ':page_id' => $page->id ]); });
    1 point
  29. I find it very easy to install PHP, URL Rewrite 2.0 and PHP manager with the help of Microsoft Web Platform Installer (WPI). Download and install WPI at http://www.microsoft.com/web/downloads/platform.aspx and then from the list of Products/Frameworks add PHP, from the list of Products/Tools add PHP Manager for IIS and from the list of Products/Server add URL Rewrite 2.0. Click "Install". Next download and install MySQL at https://dev.mysql.com/downloads/windows/installer/. You will need web.config, see attached zip. Run install.php and follow the instructions. webconfig.zip
    1 point
  30. Just add another option to the selector, where you check for cases, where the start is before the searched date and the end is after the searched date. $selector = ""; // Start date inside $selector .= ", range=("; $selector .= "datefrom>=".$input->whitelist("datefrom"); $selector .= ", datefrom<=".$input->whitelist("dateto"); $selector .= ")"; // End date inside $selector .= ", range=("; $selector .= "dateto>=".$input->whitelist("datefrom"); $selector .= ", dateto<=".$input->whitelist("dateto"); $selector .= ")"; // range overspans searchrange $selector .= ", range=("; $selector .= "dateto>=".$input->whitelist("dateto"); $selector .= ", datefrom<=".$input->whitelist("datefrom"); $selector .= ")";
    1 point
  31. I'm not sure I understand the example. What is NubUsers and NubPages? Also something like $fields->find("page=$r->id"); is completely unfamiliar to me. It seems like there are some parts ProcessWire and some parts something else? Here's a simple example that does exactly that: foreach($page->fields as $field) { echo "<p>"; echo "Field: {$field->name}<br />"; echo "Type: {$field->type}<br />"; echo "Value: " . $page->get($field->name); echo "</p>"; }
    1 point
×
×
  • Create New...