Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


maxf5 last won the day on November 4 2017

maxf5 had the most liked content!

Community Reputation

133 Excellent

About maxf5

  • Rank
    Sr. Member
  • Birthday January 30

Profile Information

  • Location
  • Interests
    schalke04, whisky, rock 'n roll

Recent Profile Visitors

1,740 profile views
  1. Isn't there this onboard method? https://processwire.com/api/ref/wire-array/slices/
  2. try: wire('pages')->find("template=basic-page, content_blocks.downloads.tags!='', check_access=0"); https://processwire.com/docs/selectors/#access_control
  3. You have to make the ajax call with the url .. not the template file. Make sure you have created a page with that template. $.post('ajax.inc', function(e) {}); $.post('/path-to-ajax-page', function(e) {}); Example Ajax Template from different db: $mydb = new Database('host', 'username', 'password', 'db'); $result = $mydb->query("SELECT * FROM example"); from pw db: $query = $database->prepare("SELECT id, name FROM pages LIMIT 10"); $result = $database->execute($query); Your js $.ajax({ type: "GET", url: "/path-to-ajax-template", success : function(data){ var markup = $(data).find('#result'); $('#result').html(markup); } });
  4. Hi Sir, thanks for the module - great addition! I always get the 404 errors from the script and those pages dont hit into the counter. Whats the deal with this "phcv1"?
  5. Thanks @Noel Boss ! Am I the only one with this mystical box shadow?
  6. @Noel Boss thank you for the improvements, looking good so far! Can you update the version info here, too? https://github.com/noelboss/AdminThemeBoss/blob/master/AdminThemeBoss.info.json When you have ProcessWireUpgrades installed it always alerts you that a new version is available 🙂
  7. Pass it to an associative array (not tested): <?php namespace ProcessWire; function processNewPerson(WireArray $data) { $u = new Page(); $u->template = "person"; $u->parent = $pages->get("/people/"); $u->of(false); $u->first_name = $data["first_name"]; $u->last_name = $data["last_name"]; $u->full_name = $data["first_name"] . " " . $data["last_name"]; $u->city = $data["city"]; $u->name = $sanitizer->pageName($u->full_name, true); $u->save(); } if($input->post["submit"]) { $data = WireArray::new([ "first_name" => $sanitizer->text($input->post['first_name']), "last_name" => $sanitizer->text($input->post['last_name']), "city" => $sanitizer->text($input->post['city']) ]); $people = $pages->find("template=person, first_name=$data['first_name'], last_name=$data['last_name']"); if($people->count === 0) processNewPerson($data); }
  8. Here is a little fix: In your templates/admin.php add a custom css file: $config->styles->add($config->urls->templates . "styles/admin.css"); require($config->paths->adminTemplates . 'controller.php'); in templates/styles/admin.css .PageList .PageListItem:hover .PageListActions { display: inline-block !important; }
  9. no problem, thanks for clearing up. I thought i would be the same as $page->created, $page->modified
  10. Dates are stored as timestamps and you have to search the whole day :) $start = strtotime(date('Y-m-d') . " 00:00:00"); $end = strtotime(date('Y-m-d') . " 23:59:59"); $result = $users->find("birth_date>=$start, birth_date<=$end");
  11. You can make it this way, so you don't need two loops and the high res will be first in the array. $available_flavors = $pages->get(1017)->children("sort=-is_high_res_image"); <div class="row"> {% for flavor in available_flavors %} <div class="col-sm d-flex flex-column"> <div class="shishaFlavor align-self-center" style="background-image: url('{{ flavor.shisha_flavor_image.url }}')"> </div> <h3>{{ flavor.title }}</h3> </div> {% endfor %} </div>
  12. echo $results->renderPager(array( 'linkMarkup' => "<a href='{url}#YOURANCHOR'><span>{out}</span></a>" ));
  13. Will all those nice functions ever appear in the Api Reference or just when the dev reaches master? I am more or less afraid of forgetting all the nice features mentioned in the blog.
  14. You can create roles in ProcessWire. For example GuestsA, GuestsB, GuestsC and easily get 'em via Api. // Get them $usersA = $users->find("roles=GuestA"); // Check them if($user->hasRole('GuestA')) Also you can create custom fields inside the user-"pages". So you could create a selectfield which you can set with a hook after registration. $users->find("yourcustomfield=groupA");
  15. try this one: $page->social_activity->sort("-created")->slice(0,10);
  • Create New...