Jump to content

rick

Members
  • Posts

    635
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by rick

  1. I use a modified excerpt from @Robin S's module to add an image from a url like so: $field_value = $p->getUnformatted( $yourField->name ); if ( $yourField->maxFiles == 1 && count( $field_value ) ) $field_value->removeAll(); $pageimage = new Pageimage( $field_value, $url ); $field_value->add( $pageimage );
  2. FYI: I've been running two sites with that modification to the database without any errors or issues.
  3. Many ISPs throttle email delivery. I've had emails take up to a day to be delivered. There isn't anything you can do about their setup. This could be your email system or your client's email system or both causing the problem. You could possibly eliminate your provider by using a reputable provider, such as gmail, mailgun, etc. to send emails. You will still be at the mercy of the client provider though.
  4. @Cupacabra, It looks as though your form action (referenced in your ajax url) is not pointing to your b.php template so it is not being called.
  5. Sadly, the rider of this new horse is dumber than a truck-load of doorstops. So I found another way to accomplish what I was looking for. In my opinion, it's hacky, as I still don't know the answers to my op questions, but it will work for now. The $_FILES['input_file_fieldname']['tmp_name'] works as the parameter to New WireUpload(). The result is a randomly created name saved in both the PageImages and file system. Using Soma's rename procedure to provide the original uploaded file's name corrects that anomaly. The result is an uploaded image with the correct (human readable) name. Anyone want to buy a horse? Only ridden once. Includes a new stick. Cheap.
  6. Thanks @psy, I'll definitely try saddling a new horse. I'll miss the old horse. She was a beauty.
  7. Thanks for catching that! I've edited my original post.
  8. 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.
  9. 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.
  10. 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.
  11. 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?
  12. 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.
  13. If Apache is throwing an error, you have a server config issue. Follow @wbmnfktr instructions and try again.
  14. 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
  15. 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.
  16. @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.
  17. Thanks @Gideon So, that sent me in the right direction.
  18. Yeah, I had specified include=all in the selector as well with the same results. I removed it after checking the template settings.
  19. 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?
  20. This should be pinned! It's Awesome! ?
  21. Something like this maybe? // Just thinkin' out loud foreach ( $page->getInputFields() AS $fld ) { fldArray[] = $fld; } flsJson = json_encode( $fldArray );
  22. Been on linux since early 2000s and haven't looked back.
  23. Thanks @Robin S! That is a great solution. I'll close this out now.
  24. 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
  25. 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?
×
×
  • Create New...