Jump to content

Frank Schneider

Members
  • Posts

    32
  • Joined

  • Last visited

Everything posted by Frank Schneider

  1. Danke das hat funktioniert, der Zähler der Authlogs ändert sich nicht ist das Normal?
  2. Meine Seite ist Authlogs (127000 Einträge) mit dem template authlogs. Darin werden Daten gespeichert Authlog mit dem template authlog. Mein Problem ist, dass meine Rest API langsam reagiert, und ich vermute dass die Datensätze zu groß sind. Jetzt will ich alte Datensätze löschen, bei Processwire kann ich das aber nicht so einfach. Ich müsste jeden anklicken, das dauert mir zu lange. Also muss es ein weg geben diese Blockweise oder per Befehl oder tool z löschen. Gruß Frank
  3. I have a table (Authlogs) where the check ins are stored. There are now 130,000 data records there. Wiw can I delete the old ones by date older than 2020? without manually clicking on each record!
  4. from one day to the next (overnight) changes to the PHP file are no longer accepted in the browser. No matter what I change, I update with F5, the view remains the same. None of my changes work. Not until I delete the FileCompiler folder in the catch. But then again the same. Anyone have any advice?
  5. i update my PHP from 7.4 to 8.0 and now i get an error while printing pdf with mPdf -> mPDF error: No font or default font set! i try set define('_MPDF_TTFONTPATH', __DIR__ . '/ttfonts'); in config_fonts.php but nothing change. Did anyone know how to fix this error?
  6. i add this and no changes, $_FILES is empty
  7. I have a Processwire application. In it I have two areas company and their employees. I insert an image in Employees and upload it, it works fine so far, now I do the same in the company and want to use it as a logo, it doesn't work there. When I click save, the $_files field is empty, but not for the employee. So exactly the same as with the employee does not work, same fields, same code. The field is defined in fields as Image and assigned to the template I've searched the whole internet but can't find the reason. my code: $form_fields = array( ..... 'foto' => array('type' => 'file', 'required' => true), ); // --- WireUpload settings --- $upload_path = $config->paths->assets . "files/.tmp_uploads/"; // tmp upload folder $file_extensions = array('jpg', 'jpeg', 'gif', 'png'); $max_files = 1; $max_upload_size = 1*1024*1024; // make sure PHP's upload and post max size is also set to a reasonable size $overwrite = false; $update_page = ($page->url == $pages->get("/firmenverwaltung/edit/")->url) ? $pages->get("id=".(int)$input->urlSegment0) : null; $file_field = "foto"; //HTML <div class="col-lg-6"> <div class="form-group"> <label class="form-control-label">Logo: <?php if ($form_fields['foto']['required']) { ?><span class="tx-danger">*</span><?php } ?></label> <div class="<?php if ($errors["foto"]) { echo "parsley-error"; } ?> custom-file"> <input id="foto" type="file" name="foto[]"> </div> <?php showError($errors, "foto"); ?> </div> <?php if ($firma) { $foto = null; foreach ($firma->foto as $image) { $foto = $image->width(250); break; } if ($foto != null) { echo "<img src='".$foto->url."' />"; } } ?> </div> //Save if($input->post->action == 'send') { // first validate the CSRF token to check if it is a valid request if(!$session->CSRF->hasValidToken()){$errors['csrf'] = "Form submit was not valid, please try again."; } //Look for required fields and make sure they have a value foreach($required_fields as $req) { //print_r($_FILES); //die; // required file upload field if($form_fields[$req]['type'] == 'file'){if(empty($_FILES[$req]['name'][0])){$errors[$req] = "Wählen Sie Dateien zum Hochladen aus.."; } } else if($form_fields[$req]['type'] == 'checkbox'){if($form_fields[$req]['value'] == 0){$errors[$req] = "field necessary.";} // erforderliche Textfelder } else if($form_fields[$req]['type'] == 'text' || $form_fields[$req]['type'] == 'textarea' || $form_fields[$req]['type'] == 'email') { if(!strlen($form_fields[$req]['value'])){$errors[$req] = "Feld notwendig."; } // reqired email fields if($form_fields[$req]['type'] == 'email') { if($form_fields[$req]['value'] != $input->post->$req){$errors[$req] = "Bitte eine gültige E-Mail Adresse angeben.";} } } }
  8. Thanks in advance for the help. But I'm looking for an editor where you don't have to edit the HTML code. I'm looking for an editor like a CMS.
  9. Is there a front end editor or something similar for pw. This html syntax is not my thing. So it's easier to edit.
  10. I've also tried the parameters I, D and F the same. It must be an attitude, but where. WirePDF I installed it via Modules-> Site-> New-> Add Module Manualy
  11. i create a pdf file with WirePdf on PW andand want it download to browser downloads folder. $header = ''; $footer = $pages->get("/einstellungen/")->company_name; $filename = 'Ausgabe.pdf'; error_reporting(0); // E_ALL=Melde alle PHP-Fehler 0=deaktiviert ob_start(); ob_clean(); $pdf = $modules->get('WirePDF'); $pdf->pageFormat = 'A4'; $pdf->leftMargin = 20; $pdf->rightMargin = 20; $pdf->topMargin = 20; $pdf->bottomMargin = 20; $mpdf = $pdf->mpdf; $mpdf->SetHTMLHeader($header); $mpdf->SetHTMLFooter($footer); $mpdf->WriteHTML($content); ob_end_clean(); $mpdf->Output($filename, 'F'); $mpdf->Output($filename, 'F'); works and create in template folder. $mpdf->Output(); not working and the browser shows, annot load file. Know anyone the reason. Ist it a parameter in PW?
  12. i have a string as follows $content='<h2>asdfgjklöä</h2>Familienname xName'; and i want replace xName but i cannot find any function. Is there a way like c# replace?
  13. I try to use RockPdf when i dump $pdf->dump(); the pdf show perfect When i $pdf->download('pdf-filename.pdf'); it not work It show it is no valid pdf $pdf = $modules->get('RockPdf'); $pdf->set('SetHeader', 'This is my header text'); $pdf->write('Hello World ' . date('H:i:s')); $pdf->write('<!-- my custom comment -->'); $pdf->html(); // output html in tracy console $pdf->save(); // generate pdf //$pdf->dump(); // dump pdf to iframe in tracy console $pdf->download('pdf-filename.pdf'); What is the reason
  14. Here is the call. <h1><?php echo get_zehner($pages->get("/mitglieder")) ?></h1> Field typ of mitglied_kategorie is text
  15. /* Kategorie */ $siteconfig["kategorie"] = array(); $siteconfig["kategorie"][] = "Mitglied"; $siteconfig["kategorie"][] = "Probetraining"; $siteconfig["kategorie"][] = "Zehnerkarte"; $siteconfig["kategorie"][] = "Ehemaliges Mitglied"; $siteconfig["kategorie"][] = "Personal"; $siteconfig["kategorie"][] = "Abo"; $siteconfig["kategorie"][] = "Neuanmeldung"; sort($siteconfig["kategorie"]); <!-- Kategorie --> <div class="col-lg-2"> <div class="form-group"> <label class="form-control-label">Kategorie: </label> <select class="form-control " name="Kategorie" data-placeholder="Kategorie wählen" > <?php foreach ($siteconfig["kategorie"] as $kategorie) { if ($mitglied->mitglied_kategorie == $form_fields['kategorie']['value']) { echo "<option value='".$kategorie."' selected='selected'>".$kategorie."</option>\n"; } else {echo "<option value='".$kategorie."'>".$kategorie."</option>\n";} } ?> </select> </div> </div> //Save $mitglied->mitglied_kategorie = $_POST['Kategorie']; //Filter return count the kategorie <?php //========================================================================================= // //========================================================================================= function get_zehner($page) { $selector = "template=mitglied,mitglied_kategorie=Zehnerkarte"; $ret=$page->count($selector); return($ret); } //========================================================================================= // //========================================================================================= function get_member($page) { $selector = "template=mitglied,mitglied_kategorie=Mitglied"; $ret=$page->count($selector); return($ret); }
  16. I have a page member, and i want count a field wich have same entry. /* Kategorie */ $siteconfig["kategorie"] = array(); $siteconfig["kategorie"][] = "Mitglied"; $siteconfig["kategorie"][] = "Probetraining"; $siteconfig["kategorie"][] = "Zehnerkarte"; $siteconfig["kategorie"][] = "Ehemaliges Mitglied"; $siteconfig["kategorie"][] = "Personal"; $siteconfig["kategorie"][] = "Abo"; $siteconfig["kategorie"][] = "Neuanmeldung"; sort($siteconfig["kategorie"]); I want count member who has Zehnerkarte, i do as folow but get all member //========================================================================================= // //========================================================================================= function get_zehner($page) { $selector = "template=mitglied,mitglied_kategorie==Zehnerkarte"; $ret=$page->count($selector); return($ret); } How i can filter to "Zehnerkarte"
  17. i try but it not save here my code. $mitglied = $pages->get("id=".(int)$input->urlSegment0); $ts_entry = $mitglied; $ts_entry->setOutputFormatting(false); $ts_entry->title =$mitglied->mitglied_name." ".$mitglied->mitglied_vorname; $ts_entry->parent = $pages->get("/mitglieder/"); $ts_entry->mitglied_name =$mitglied->mitglied_name; $ts_entry->mitglied_vorname =$mitglied->mitglied_vorname; $ts_entry->mitglied_strasse =$mitglied->mitglied_strasse; $ts_entry->mitglied_plz =$mitglied->mitglied_plz; $ts_entry->mitglied_ort =$mitglied->mitglied_ort; ....... $ts_entry->mitglied_beitrag =$mitglied->mitglied_beitrag; $ts_entry->mitglied_zahlart =$mitglied->mitglied_zahlart; $ts_entry->mitglied_vertragsbeginn =$mitglied->mitglied_vertragsbeginn; $ts_entry->save();
  18. I have a page with data and picture. Now i want edit this page. How i can edit the data? I get the page with $mitglied = $pages->get("id=".(int)$input->urlSegment0); With if($mitglied->id) {} I will edit. i try $ts_entry = $mitglied; $ts_entry->setOutputFormatting(false); $ts_entry->title =$mitglied->mitglied_name." ".$mitglied->mitglied_vorname; $ts_entry->parent = $pages->get("/mitglieder/"); $ts_entry->mitglied_name =$mitglied->mitglied_name; $ts_entry->mitglied_vorname =$mitglied->mitglied_vorname; $ts_entry->edit();
×
×
  • Create New...