Jump to content


  • Content Count

  • Joined

  • Last visited

Everything posted by simonGG

  1. Hi there, im not sure if this is realy a processwire specific problem - but the site runs on a processwire installtion - and im not sure. I have a site lets call it www.my-pw-site.com and a TLD lets call it www.external.tld which forwards to www.my-pw-site.com. What i try to do is to load a subpage of www.my-pw-site.com if the request comes from www.external.tld. So i tried to write a RewriteCond & RewriteRule in the .htaccess RewriteCond %{HTTP_HOST} ^external\.tld$ [OR] RewriteCond %{HTTP_HOST} ^www\.external\.tld$ [NC] RewriteRule ^(.*)$ http://www.my-pw-site.com/subpage/ [R=301,L] And this is working for me an also other people - but my client gets a "page not found" error. They did send me screenshots and there i can see that the url in the adressbar changed correctly. But the error message maintains. Does anybody maybe have an idea what can cause such behaviour? Thanks in advance Best Simon
  2. @Robin S Thanks a lot - exactly what i needed! Very nice 🙂 best regards Simon
  3. Hi there, i want to realize a ZIP download with pageImages but if 2 images have the same name only one is saved in the ZIP. So i tried to rename the images like this: foreach ($sweepstake_children as $sweepstake_member) { $member_image = $sweepstake_member->images->first(); $ext = $member_image->ext; $newFilename = $sweepstake_member->vorname . "-" . $sweepstake_member->nachname . "-" . $member_image->name. "." . $ext; $member_image->rename($newFilename); } But then i get an error: Call to a member function rename() on boolean ? Or ist this the wrong approch anayway? best regards Simon
  4. nbcommunication Sorry for the late reply (was totaly busy with another project) and a BIG THANKS for implementing this! best regards Simon
  5. That's what im used to and i wanted it to realize it that way (used cleaverreace). But the client dont accept that images not loaded automaticly (Outlook etc.) So i see no other option in the moment.
  6. @adrian - Thanks i checken the fork - looks good. One little question: Is there anyway to embed Images and link them with CID? I think about something like PHPMailer has: AddEmbeddedImage( $path, $cid, $name,... ) best regards Simon
  7. Hi there, i have installed the modul, opend an mailGun account and eveything works well except file attachment. My code looks like this: $m = $mail->new(); $m->to('someone@somewhere.com'); $m->from('me@myselfandi.com'); $m->subject('Test'); $m->addAttachment( $page->email_main_img->httpUrl ); $m->send(); Im wondering if i do something wrong here? regards Simon
  8. Hi there, first of all thanks for this great module! Im working on a search wich will need a lot of filtering. For example i want to get all persons with a height between 160cm & 170cm and a weight between 50kg & 60kg For the moment i came up with this approche. But im wondering if there is a more elegant "build in" functionality to solve this. The Array $searchFields could contain more or less fields as in this example . $searchFields = [ [ 'promo_koerpergroesse', 160, 170 ], [ 'promo_koerpergewicht', 50 ,60 ] ]; foreach ( $searchFields as $searchField => $searchFieldValue ) { $filterField = $searchFieldValue[0]; $filterValMin = $searchFieldValue[1]; $filterValMax = $searchFieldValue[2]; $finder->filter( function( $row ) use ( $filterField, $filterValMin, $filterValMax ) { return $row->$filterField > $filterValMin & $row->$filterField < $filterValMax; }); } Thanks / ciao Simon
  9. Okay is solved was the Cache Module. I had it deleted on local version - but not on online version. Thats all. Best regards Simon
  10. In this case at a time i had setup the cache module with an timeout of a month ... but dunno why i uninstalled it later. I use mainly chrome with dev tools and set cache to disabled. BTW it happens in all my installed browsers - xcode simulator and my android phone.
  11. Hi there, today i run in a very strange Problem. I downloaded a DB dump from a working processwire site (online) and importet it. When i use this DB with my local development version of the site the $config->urls seem to be "broke". But only as long as i am not logged in to the admin pannel! FYI the online version is just a copy of my local version with one difference - i had to change a RewriteRule in the .htaccess because the online version works with a VirtualDocumentRoot. And now here comes the next very strange thing: When using the DB dump and $config->urls isent working (points only to localhost:8888/) and i make changes in the home.php they dont show up when i refresh the local version in browser. I can even delete everything in home.php and the browser still shows the broken version of the site. I mean that's more than strange or? Anybody any idea to this mess? Would be glad because i realy stuck here. Thanks in advance. Best regards Simon
  12. @LostKobrakai ... That's it - thanks! bye Simon
  13. Hi there, i run in an strange behavior when using the PageTable field. I have a PageTable field named upload - the template for this field has following fields: file (file field) nums (table field) color (colorPicker field) Now i try to get the url's for the uploaded files (in this case 1 PDF and 1 SWF) $uploads = $page->upload; foreach ($uploads as $upload) { $file = $upload->file; echo $file->url."<br>"; echo $file->filename."<br>"; } Which returns: Upload 1 /DB-v2/site/assets/files/1060/ Upload 2 /DB-v2/site/assets/files/1061/ So you can see the URL only returns the path to the folder? And the filename isnt reachable. Anybody have a idea ? Thanks in advance and bye bye Simon
  14. @FrancisChung hidding is not realy a option for me because in my setup they musst be visible. @LostKobrakai hmm when i disallow /about/ in robots.txt - it's only hidden for crawler or? I mean i can still include the contents in my home cause home isent hidden anyway? cheers Simon
  15. Hi there, i developed a single page site where the sections of the site are pages within processwire. For example imagine this case: I have 3 sections about, work, contact. So i created 3 templates and 3 pages. Now in my home.php i include them - so far so good. Thus i get www.page/about, www.page/work, www.page/contact ... and google is indexing this urls. I don't want that to happen because they content only works within the home where the css and js is loaded. What can i do? Can i simply disallow them in a robots.txt like: Disallow: /about/ ... or will this be a SEO killer? Thanks in advance & cheers Simon
  16. @Robin S Sorry for the very very late reply ... And thanks a lot - your solution did it for me .) Cheers Simon
  17. Hi there, i am wondering about the possibility to define a fixed size for thumbnails displayed in a page table list. At the moment ist looks like image 1 - but i would like to get something like image 2! Is this possible? Thanks Cheers Simon
  18. Sorry for the late replay - and thanks for your help. I ended up with this in all template files - it's a multilingual Site (): $pages = wire('pages'); $session->redirect($pages->get(1)->url); exit(); Without get(1)->url it redirected me to ...myurl/de/pageName/1 - maybe this has to do with the fact that ist is a multilingual site? Thanks a lot + regards Simon
  19. Hi there, i developt a single page website where home.php includes the template file php's. So my template files are not considered to be viewed as they are. Only in context with the home. Because of that i want that the view button in edit mode allways links to the root page. Is this possible? Thanks in advance && regards Simon
  20. Hi Horst, removing the temporary files is a good idea .) - i diden't recognized that they flooded my asset folder - thanks! Just if someone is interested: I had to change from GET to POST because with GET i struggled into a HTTP 414 “Request URI too long” ERROR. So finnaly it works how i wanted - thanks to the team .) - and a good evening to you. <?php require_once('../index.php'); $input = wire('input'); $sanitizer = wire('sanitizer'); $pages = wire('pages'); $item_titel = $sanitizer->text($input->post("item_titel")); $item_client = $sanitizer->text($input->post("item_client")); $item_usecase = $sanitizer->text($input->post("item_usecase")); $item_text = $sanitizer->textarea($input->post("item_text")); $item_date = $input->post("item_date"); $image_fileNames = $_POST["image_fileNames"]; $item_images = $_POST["item_images"]; $image_types = $_POST["image_types"]; $parentPage = $pages->get("/items/"); $templatePage = wire('templates')->get("item"); $pageName = $sanitizer->pageName($item_titel); $upload_path = $config->paths->assets; $p = $pages->get("name={$pageName}, parent={$parentPage}, template={$templatePage}"); if(0 == $p->id) { $p = new Page(); $p->of(false); $p->template = $templatePage; $p->parent = $parentPage; $p->title = $item_titel; $p->item_titel = $item_titel; $p->item_client = $item_client; $p->item_date = $item_date; $p->item_text = $item_text; $p->save(); $i = 0; foreach($item_images as $data) { $name = $image_fileNames[$i]; $imgType = $image_types[$i]; myImageExtract($p, $data, $name, $upload_path, $imgType); $i++; } $p->save(); } function myImageExtract($p, $imgData, $imgName, $upload_path, $imgType) { $base64img = str_replace('data:'.$imgType.';base64,', '', $imgData); // fixed $data = base64_decode($base64img); $file = $upload_path . $imgName; file_put_contents($file, $data); $p->item_images->add($file); unlink($file); } Cheers Simon
  21. So finaly it works -) What do you think - is it okay this way or is there something that should be fixed? PS: the $tmpDir solution didn't work - somehow the images couldn't be found... $tmpDir = new WireTempDir('someName'); Actual code: <?php require_once('../index.php'); $input = wire('input'); $sanitizer = wire('sanitizer'); $pages = wire('pages'); $item_titel = $sanitizer->text($input->get("item_titel")); $item_client = $sanitizer->text($input->get("item_client")); $item_usecase = $sanitizer->text($input->get("item_usecase")); $item_text = $sanitizer->textarea($input->get("item_text")); $item_date = $input->get("item_date"); $image_fileNames = $_GET["image_fileNames"]; $item_images = $_GET["item_images"]; $parentPage = $pages->get("/items/"); $templatePage = wire('templates')->get("item"); $pageName = $sanitizer->pageName($item_titel); $upload_path = $config->paths->assets; $p = $pages->get("name={$pageName}, parent={$parentPage}, template={$templatePage}"); if(0 == $p->id) { $p = new Page(); $p->of(false); $p->template = $templatePage; $p->parent = $parentPage; $p->title = $item_titel; $p->item_titel = $item_titel; $p->item_client = $item_client; $p->item_date = $item_date; $p->item_text = $item_text; $p->save(); $i = 0; foreach($item_images as $data) { $name = $image_fileNames[$i]; // fortunately i can pass this from ajax $filename = myImageExtract($data, $name, $upload_path); $p->item_images->add($filename); $i++; } $p->save(); } function myImageExtract($imgData, $imgName, $assets) { $base64img = str_replace('data:image/png;base64,', '', $imgData); // TODO - must be dynamic - could be jpg, gif ... $data = base64_decode($base64img); $file = $assets . $imgName; file_put_contents($file, $data); return $file; } And thanks again - this realy a helpfull forum! Cheeers Simon
  22. Hey thank you all for your input and the effort you put in this. I am working on it and will let you know how it goes! Thanks again! Cheers Simon
  23. Hi there, im trying to add images to a page. The data is send via ajax to the php. The php gets the local image urls. They look like: data:image/png;base64,iVBORw0KGgo... Now i try to write the images to to page like this: foreach ($item_images as $image) { $p->images->add($image); } Where $item_images is a array send via js with the local image urls. This causes a Error: <b>Fatal error</b>: Call to a member function add() on null in ... So im unsure if images->add expects another data format than this local image url (see above). Or im doing somthing wrong or this is totaly wrong and i have to use WireUpload?. Full php: <?php require_once '../index.php'; $item_titel = $_GET["item_titel"]; $item_client = $_GET["item_client"]; $item_date = $_GET["item_date"]; $item_usecase = $_GET["item_usecase"]; $item_images = $_GET["item_images"]; $item_text = $_GET["item_text"]; $targetPage = "/items/"; $p = new Page(); $p->template = 'item'; $p->parent = wire('pages')->get($targetPage); $p->title = $item_titel; $p->item_titel = $item_titel; $p->item_client = $item_client; $p->item_date = $item_date; $p->of(true); foreach ($item_images as $image){ $p->images->add($image); // $image looks like: data:image/png;base64,iVBORw0KGgo... } $p->item_text = $item_text; $p->save(); $p->of(false); Any help is very much appreciated .) cheers Simon
  24. I startet this project without maken a proper plan befor. A lot of tired night work ... it total mixed atm some pages use dashes some underscore - i will unify this soon. But this pages will not be reacable in the browser via url. Ther a more a kind of container
  • Create New...