Jump to content

danielsl

Members
  • Posts

    27
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

danielsl's Achievements

Jr. Member

Jr. Member (3/6)

2

Reputation

  1. I think its better to have a tpl, so its easier to redo it manually with repeaters and a single php
  2. hi ! can anyone specify where is the template located, i feel it irritated to do $content .= str_replace("MarkupSocialShareButtons cf", "myClasses", $modules->MarkupSocialShareButtons->render()); also i need to add other elements across the output?
  3. Followed this, -> Works Thanks a lot
  4. cant set dialog working... installed the module but it doesnt show up anywhere, also no ckeditor in modules to edit...? but when i open body field i see the ckeditor toolbar(as i think) -------------- latest dev, hanna code installed->one shortcode defined
  5. Need some help i installed hanna code-> created one short code installed hanna code dialog-> but cant see any drop down dialog in page editor ---------------------------------- use latest dev processwire cant find any options for ckeditor, cant find it at all among modules, read installation guide for hanna code dialog but it does not make any sense as no idea what to configure
  6. i urge you to use smtp mail, phpmail gets to spam in general, as server name and sender mail do not match as usual, also look at the latest @giannisok form in uikit style uikit style contact form
  7. It works fine with me. Seems you have open close HTML tags issue. Try to validate it
  8. did as you recommended, its a hell lots of work, i included autoload.php require_once __DIR__ . '/autoload.php'; <?php /** * Use to autoload needed classes without Composer. * * @param string $class The fully-qualified class name. * @return void */ spl_autoload_register(function ($class) { // project-specific namespace prefix $prefix = 'ReCaptcha\\'; // base directory for the namespace prefix $base_dir = __DIR__ . '/library_php/Recaptcha/src/ReCaptcha/'; // does the class use the namespace prefix? $len = strlen($prefix); if (strncmp($prefix, $class, $len) !== 0) { // no, move to the next registered autoloader return; } // get the relative class name $relative_class = substr($class, $len); // replace the namespace prefix with the base directory, replace namespace // separators with directory separators in the relative class name, append // with .php $file = $base_dir . str_replace('\\', '/', $relative_class) . '.php'; // if the file exists, require it if (file_exists($file)) { require $file; } }); but now the form sends but have problem with wiremail and smtp server Error in hnsmtp::send : 553 5.7.1 Sender address rejected: not owned by auth user. pity to say its a buggy solution, so reverting to giannisok latest version even it need extra recapture module in processwire -------------------------- no idea how you use it. it has a lot to fix, i just found out that you wiremail call doesnt follow the api it must be wireMail($input->post->email, $contactFormRecipient, "Contact Form | " . $input->post->name, $message); instead of wireMail($contactFormRecipient,$input->post->email, "Contact Form | " . $input->post->name, $message); so it works, for those willing to skip such hardships, i pass in zip just working file set to use and study SamC version mail form, working one finally in uikit style, it adds itself in the footer of the latest Blog Profile. just add class (grid)to footer in _main.php <div id='grid' uk-grid> working contact form.7z
  9. np i installed previous version on live server Fatal error: Uncaught Error: Class 'ReCaptcha\RequestMethod\Post' not found in /home/nginx/domains/expo.0dan.ru/public/site/templates/library_php/Recaptcha/src/ReCaptcha/ReCaptcha.php:74 Stack trace: #0 /home/nginx/domains/expo.0dan.ru/public/site/templates/_contact-controller.php(53): ReCaptcha\ReCaptcha->__construct('6LeDkBkUAAAAAHi...') #1 /home/nginx/domains/expo.0dan.ru/public/site/templates/contact1.php(2): include('/home/nginx/dom...') #2 /home/nginx/domains/expo.0dan.ru/public/wire/core/TemplateFile.php(268): require('/home/nginx/dom...') #3 /home/nginx/domains/expo.0dan.ru/public/wire/core/Wire.php(377): ProcessWire\TemplateFile->___render() #4 /home/nginx/domains/expo.0dan.ru/public/wire/core/WireHooks.php(698): ProcessWire\Wire->_callMethod('___render', Array) #5 /home/nginx/domains/expo.0dan.ru/public/wire/core/Wire.php(439): ProcessWire\WireHooks->runHooks(Object(ProcessWire\TemplateFile), 'render', Array) #6 /home/nginx/domains/expo.0dan.ru/public/wire/modules/PageRender.module(514): ProcessWire\Wire->__call in /home/nginx/domains/expo.0dan.ru/public/site/templates/library_php/Recaptcha/src/ReCaptcha/ReCaptcha.php on line 74 Error: Uncaught Error: Class 'ReCaptcha\RequestMethod\Post' not found in /home/nginx/domains/expo.0dan.ru/public/site/templates/library_php/Recaptcha/src/ReCaptcha/ReCaptcha.php:74 Stack trace: #0 /home/nginx/domains/expo.0dan.ru/public/site/templates/_contact-controller.php(53): ReCaptcha\ReCaptcha->__construct('6LeDkBkUAAAAAHi...') #1 /home/nginx/domains/expo.0dan.ru/public/site/templates/contact1.php(2): include('/home/nginx/dom...') #2 /home/nginx/domains/expo.0dan.ru/public/wire/core/TemplateFile.php(268): require('/home/nginx/dom...') #3 /home/nginx/domains/expo.0dan.ru/public/wire/core/Wire.php(377): ProcessWire\TemplateFile->___render() #4 /home/nginx/domains/expo.0dan.ru/public/wire/core/WireHooks.php(698): ProcessWire\Wire->_callMethod('___render', Array) #5 /home/nginx/domains/expo.0dan.ru/public/wire/core/Wire.php(439): ProcessWire\WireHooks->runHooks(Object(ProcessWire\TemplateFile), 'render', Array) #6 /home/nginx/domains/expo.0dan.ru/public/wire/modules/PageRender.module(514): ProcessWire\Wire->__call (line 74 of /home/nginx/domains/expo.0dan.ru/public/site/templates/library_php/Recaptcha/src/ReCaptcha/ReCaptcha.php) This error message was shown because: site is in debug mode. ($config->debug = true; => /site/config.php). Error has been logged. <?php namespace ProcessWire; /** * here we include Valitron & Google recaptcha libraries * make sure the path is correct in your template */ include(dirname(__FILE__) . '/library_php/Valitron/src/Valitron/Validator.php'); include(dirname(__FILE__) . '/library_php/Recaptcha/src/ReCaptcha/ReCaptcha.php'); /** * here we add the form field values to Valitron */ $v = new \Valitron\Validator(array( 'name' => $sanitizer->text($input->post->name), 'email' => $sanitizer->email($input->post->email), 'message' => $sanitizer->text($input->post->message), ) ); /** * validation rules set for each form field * For more details on Valitron/Validator usage visit: * https://github.com/vlucas/valitron */ $v->rule('required', ['name', 'email', 'message']); $v->rule('lengthMin', 'name', 5); $v->rule('email', 'email'); /** * set Google recaptcha site-key & secret-key * create a new key from: https://www.google.com/recaptcha/admin */ $googleSiteKey = 'replaceds'; $googleSecretKey = 'replaced for forum'; /** * set the email of the contact form recipient(usually the website owner) */ $contactFormRecipient = '3011282@gmail.com'; /** * set the id of contact-page in order to redirect there when the form is sent */ $contactPageID = '1080'; //here we check whether the 'name' field exists inside post variables (which means the form is posted) if ($input->post->name) { //if fields validation passes if ($v->validate()) { $reCaptcha = new \ReCaptcha\ReCaptcha($googleSecretKey); $resp = $reCaptcha->verify($input->post->{'g-recaptcha-response'}, $_SERVER["REMOTE_ADDR"]); //if google-recaptcha validation passes if ($resp->isSuccess()) { //This is the HTML message $message = ' <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Contact Form | ' . $input->post->name . '</title> </head> <body> <p>' . $input->post->message . '</p> </body> </html>'; //here we send the form to $contactFormRecipient wireMail($contactFormRecipient, $input->post->email, "Contact Form | " . $input->post->name, $message); //here we set a flash-message to notify the user that the form was successfully sent $session->flashMessage = 'Thank you for your message! We will get in touch with you shortly.'; //save in session that the form is sent $session->sent = true; //finally redirect user to contact-page $session->redirect($pages->get($contactPageID)->url); } else { //self explain $session->flashMessage = 'Error while validating you are not a robot!'; } } } ?>
  10. well, i rewritten it many times until stopped on the last option suggested by giannisok so cant return back, but i had exactly same issues as discussed somewhere in the forum, that not all classes in recaptcha were included. anyway i try to rewrite in in uikit style and reupload it here later. also just Wiremail doesnt work probably because i have localdevelpment server, and php mail need to be setup somehow
  11. Hi thanks for replay , I tryed SamC version , but had constant failure loading Post class, tryed to include it manually, but didnt help so moved to latest suggestion by giannisok. The form visually works. validates input, and shows success message on pressing send button, but no actual mail sent, anyone how to run mail server or no idea how it works here to send mail, even no logging to check it out, MOdx was much easier in this part., what should i install extra to send Mail????? ---------------------------------- Installed WireMailSmtp->works! is it the only way???
  12. latest development version tryed adding url_link field (URL) unfortunately experience this error Session: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'expo_ch.field_url_link' doesn't exist trued recover db and add field again, every time same result any ideas how to create url link and add it to a repeater ui Session: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'expo_ch.field_url_link' doesn't exist SQLSTATE[42S02]: Base table or view not found SQLSTATE[42S02]: Base table or view not found
  13. same here development 56, ver created field, added it to repeater, same error 6 minutes ago 2017-03-20 04:04:27 pwadmin /pw/setup/field/save SQLSTATE[42S02]: Base table or view not found: 1051 Unknown table 'expo_ch.field_url_link' (in /wire/core/Fieldtype.php line 1118) 7 minutes ago 2017-03-20 04:03:23 pwadmin /pw/setup/field/save SQLSTATE[42S02]: Base table or view not found: 1146 Table 'expo_ch.field_url_link' doesn't exist (in /wire/core/Fields.php line 758) 9 minutes ago 2017-03-20 04:01:46 pwadmin /pw/page/edit/?id=1042 SQLSTATE[42S02]: Base table or view not found: 1146 Table 'expo_ch.field_url_link' doesn't exist (in /wire/core/WireDatabasePDO.php line 454)
  14. need some help, I followed the guide except one, adapted to uikit design, i have latest development pw edition , generated google keys, But my mail form doesnt respond , nor show validation errors, doesnt matter if i chose or not google captch or if i just skip the fields tracy debuger doesnt show any errors page just update leaving all filds as they were. is it a problem of local website development or i need to install a kind of mail module? is it possible to debug it somehow? <?php namespace ProcessWire; include('_contact-controller.php') ?> <div pw-append='grid' class='uk-width-1-3@m uk-flex-first@m uk-text-center uk-text-left@m'> <div class="uk-container"> <h3>Contact Form</h3> <?php if($session->flashMessage):?> <div class="alert <?=!$session->sent && (!$v->validate() || !$resp->isSuccess()) ? 'uk-form-danger' : 'uk-form-success'?>" role="alert"> <?php echo $session->flashMessage;?> </div> <?php endif;?> <form id="contact-form" method="post"> <div class="uk-margin uk-inline <?=$v->errors('name') ? 'has-error' : ''?>"> <span class="uk-form-icon" uk-icon="icon: user"></span> <input class="uk-input" placeholder="" name="name" id="name" type="text" value="<?=$sanitizer->text($input->post->name)?>"> </div> <div class="uk-margin uk-inline <?=$v->errors('email') ? 'has-error' : ''?>"> <span class="uk-form-icon" uk-icon="icon: user"></span> <input class="uk-input" placeholder="" name="email" id="email" type="text" value="<?=$sanitizer->text($input->post->email)?>"> </div> <div class="uk-margin uk-inline <?=$v->errors('message') ? 'has-error' : ''?>"> <span class="uk-form-icon" uk-icon="icon: pencil"></span> <textarea class="uk-textarea" placeholder="" name="message" id="message"><?=$sanitizer->text($input->post->message)?></textarea> </div> <div class="form-group"> <!-- Google Recaptcha code START --> <div class="g-recaptcha" data-sitekey="<?=$googleSiteKey?>"></div> <script type="text/javascript" src="https://www.google.com/recaptcha/api.js"> </script> <!-- Google Recaptcha code END --> </div> <button class="uk-button uk-button-default" type="submit">Submit</button> </form> </div> </div> <?php //here we remove the flash-message because it is already shown above the form. $session->remove('flashMessage'); //reset 'sent' variable for future submit $session->sent = false; ?>
×
×
  • Create New...