Jump to content


  • Posts

  • Joined

  • Last visited

  • Days Won


Everything posted by rick

  1. Howdy folks! This topic has already been beat to death here, here, here, here. I'm late to this party trying to find a stick in which to beat this horse. Good news is, I found a stick and have been flailing away. Bad news is, the horse is still dead. I am not able to save a selected image from a front-end form to a page image field using any of these methods. Here is an image representing the code (center) and dumps (Left and Right) at key positions. The temp path (Dump section 1) is created and appears in the file system. The WireUpload (Dump section 2 Left and expanded Right) show that the selected file was added to the wireupload. The $files variable assigned the execute results (Dump section 3, Left) shows an empty array was created. The $userProfile (Dump section 4) does not show details but does not include any new image saved to an images field. Another curiosity is: Notice the first line of code referencing the php global $_FILES. This is the only way to retrieve the selected image. $inputt->post('imagefield') returns null. I do not receive any error messages. The image itself is created from JQuery Filereader and is a base64 image and I can retrieve the raw data from a hidden field which shows a preview of the photo correctly. data:image/jpeg;base64,/9j/4... I've also tried the following: list($type, $img) = explode(';', $img); list(, $img) = explode(',', $img); list($type,) = explode('/',$type); $img = base64_decode($img); $img = $img . '.' . $type; I've passed the $img variable to the WireUpload function. No error is presented. The WireUpload shows the settings (filename, temp path, etc.) and an empty array as before. I'm runnin' 3.0.142, php 7.1, and apache 2.4.x So I have two questions: 1. Why is does WireUpload not return the file in an array? 2. Why does $input->post('imagefield') not return the selected file from the form. I hope that I have been detailed enough. If not, please let me know and I'll add the requested information. Thank you all for your help.
  2. Hi @JeevanisM, It is difficult to say what the problem is without having the code you are using. Based on what you describe, if the value of the phone number is not being saved from your form, then it may be something as simple as a misspelled field name. Please post your registration form code so that we can better assist you in resolving this issue.
  3. It's a good idea to limit your support request to only one category. Posting in multiple places makes it very difficult to track the progress.
  4. What does tracy debugger show: $u = wire('users')->get("name=saarun"); d($u); d($u->Phone); // dump content of your fields When you view the user while in admin, what does that page look like? By that I mean you should see all the fields for the user template and the field's current values. If the field (for example, Phone) is empty, then there is an issue with saving the data to the page. Most likely the data is not the correct format. Do the logs display any information?
  5. Is this still the case now that Apache doesn't throw config errors? If so, then it appears to be a possible redirect issue. Your admin url is, http://localhost/processwire/processwire/ ? You can verify this by looking at the Name column in the Pages table where ID=2.
  6. If Apache is throwing an error, you have a server config issue. Follow @wbmnfktr instructions and try again.
  7. ASCII art needs to make a come-back. I like your work! Keywords aren't used as much now as they once were thanks to their abuse. The description is still used and should reflect the current page content. That being said, keywords may play a part if they are content relevant as well. Blindly stuffing keywords on every page may result in page demerits. N N III CCC EEEEE JJJJJ OOO BBBB NN N I C C E J O O B B N N N I C E J O O B B N N N I C EEEEE J O O BBBB N N N I C E J O O B B N NN I C C E J J O O B B M N III CCC EEEEE J OOO BBBB
  8. If you allow the user to select one or more products, you can use a select field to present the options to the user. Of course it depends on the number of available products. If there are a large number of products, you may want to separate them by category. The select field's options allow for values that you require.
  9. @itsberni, I'm not sure I understand your specific use case completely. When you say "Form sends my specific value", there are only two values for a checkbox when submitted: It's either present or not. For example: if( isNull($input->post('YourCheckboxFieldNameHere')) ) { // User did not check checkbox, so set a default or whatever. } If your specific value (used in your computations) is numeric, ie, a dollar amount, or temperature, or distance measurement, etc., then you will need to use an input type that accepts numeric entries. The checkbox is not the correct input type for your data. I don't use form builder so I can't provided specific instructions. In HTML it would be the input type text. Can you be more elaborate with what you are trying to accomplish? I'm sure someone here will have the answer you seek.
  10. Thanks @Gideon So, that sent me in the right direction.
  11. Yeah, I had specified include=all in the selector as well with the same results. I removed it after checking the template settings.
  12. Can someone please point me in the right direction. I've been staring at this for a few hours and I can't see the tree. $userPage = wire('pages')->get("template=member-home,name={$user->name}"); In Tracy console, the page object is returned. In the template, however, a null page is returned. What am I overlooking?
  13. This should be pinned! It's Awesome! πŸ˜„
  14. Something like this maybe? // Just thinkin' out loud foreach ( $page->getInputFields() AS $fld ) { fldArray[] = $fld; } flsJson = json_encode( $fldArray );
  15. Been on linux since early 2000s and haven't looked back.
  16. Thanks @Robin S! That is a great solution. I'll close this out now.
  17. Okay, here is a workaround. I call it a workaround, because one, it works for what I need, and two, this will present problems when I have to process all 5K+ pages for each of the three parent pages in this current project. Here is the tracy code: $p = $pages->findMany("template=my_template"); // 34 total $s = array(); foreach( $p AS $m ) { $s[$m->id] = $m->comments->stars(true); } arsort($s); $s = array_slice($s,0,12,true); d($s); Produces this result: array (12) 1064 => 5.0 1121 => 5.0 1120 => 4.75 1056 => 4.5 1065 => 4.43 1054 => 4.41 1068 => 4.33 1086 => 4.3 1122 => 4.29 1062 => 4.25 1127 => 4.25 1058 => 4.22
  18. Well, sorting by stars seems to not work. When I expand the test data the sort fails. Here is the tracy test code... $p = wire('pages')->findMany('template=my_template,sort=-comments.stars,include=all,limit=12');//34 total pages foreach( $p as $m ) { $stars = $m->comments->renderStars(true, array('schema'=>'microdata','partials'=>true)); echo $m->id.': '.$stars.'<br />'; } which gives the following results... 1027: β˜…β˜…β˜…β˜…β˜…4/5 (7 ratings) 1068: β˜…β˜…β˜…β˜…β˜…β˜…4.3/5 (6 ratings) 1148: β˜…β˜…β˜…β˜…β˜…β˜…3.8/5 (17 ratings) 1086: β˜…β˜…β˜…β˜…β˜…β˜…4.3/5 (10 ratings) 1056: β˜…β˜…β˜…β˜…β˜…β˜…4.5/5 (2 ratings) 1114: β˜…β˜…β˜…β˜…β˜…4/5 (9 ratings) 1057: β˜…β˜…β˜…β˜…β˜…4/5 (7 ratings) 1120: β˜…β˜…β˜…β˜…β˜…β˜…4.8/5 (8 ratings) 1121: β˜…β˜…β˜…β˜…β˜…5/5 (3 ratings) 1063: β˜…β˜…β˜…β˜…β˜…β˜…3.8/5 (12 ratings) 1064: β˜…β˜…β˜…β˜…β˜…5/5 (1 rating) 1065: β˜…β˜…β˜…β˜…β˜…β˜…4.4/5 (14 ratings) Also notice that some ratings display 6 stars. The default config is set to 5. I am not concerned with sorting by the number of ratings, only the average ratings. Anyone have an idea what I am doing wrong?
  19. @wbmnfktr Yes it does. Even the fractional star rating, eg, 5, 4.75, 4.5 ... to 0 works.
  20. For other's and my reference: Sorting pages by stars requires the comment field name prefix, eg: // From previous post... $pc = $p->children('sort=-comments.stars, limit=12'); // Returns pages with 5 stars, then 4.5 stars, etc. I must have mistyped the comment field name before. My apologies. Thanks for your help @dragan.
  21. $this->halt(); As shown at the bottom of this thread. Is this what you are referring to?
  22. Yes Sir, I've tried a few combinations with the same results. I haven't seen anything in the source regarding an average other than the public function stars itself.
  23. @dragan, I'm using the core comments with star rating field type. Yes, the test code doesn't return any errors... // Tracy console $p = wire('pages')->get('template=my_template,include=all'); if($p->hasChildren) { $pc = $p->children('sort=stars, limit=12'); // One of many combinations I've tried d($pc); } But the results (12) are not sorted by stars, rather the results are returned in the order the pages were created (Id)... total => 34 start => 0 limit => 12 pager => "1 to 12 of 34" (13) items => array (12) Page:0 => array (5) ... Page:11 => array (5) selectors => "parent_id=1026, sort=stars, limit=12, status<1024" (49) [edit] Also, each template has the comments (fieldtypecomment) and stars are enabled.
  24. Howdy all, Is there a means to return pages sorted by star ratings? I apologize if I have missed a topic, but I haven't found anything related with my searches. Thanks for your help!
  25. I believe what you are looking for might be answered here.... If not, please elaborate and someone will jump in and help.
  • Create New...