Jump to content

danielsl

Members
  • Content Count

    27
  • Joined

  • Last visited

Everything posted by danielsl

  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; ?>
  15. you saved my day, work perfectly, now i have language choice dropdown in main menu, closed function ukNavbarNav(PageArray $items, $options = array()) { if(!$items->count) return ''; $defaults = array( 'dropdown' => null, // array of page paths, page IDs, or template names where dropdown is allowed (null=allow all) ); $options = _ukMergeOptions($defaults, $options); $page = $items->wire('page'); $activeItems = $page->parents("id>1")->and($page); $out = "<ul class='uk-navbar-nav'>"; $liActive = "<li class='uk-active'>"; $li = "<li>"; foreach($items as $item) { $out .= $activeItems->has($item) ? $liActive : $li; $out .= "<a href='$item->url'>$item->title</a>"; // determine whether dropdown should be used for this $item $useDropdown = false; if($options['dropdown'] === null) { $useDropdown = $item->hasChildren && $item->id > 1; } else if($item->hasChildren && is_array($options['dropdown'])) { foreach($options['dropdown'] as $s) { if($item->template->name === $s || $page->path === $s || $page->id === $s) { $useDropdown = true; break; } } } if($useDropdown) { $out .= "<div class='uk-navbar-dropdown'>"; $out .= "<ul class='uk-nav uk-navbar-dropdown-nav'>"; foreach($item->children as $child) { $out .= $activeItems->has($child) ? $liActive : $li; $out .= "<a href='$child->url'>$child->title</a></li>"; } $out .= "</ul></div>"; } $out .= "</li>"; } # $out.= '<li> <a hreflang="en" href="/" class="" aria-expanded="false">Language</a> <div class="mod-languages uk-navbar-dropdown "> <!-- dropdown gruprv --> <ul class="languages uk-nav uk-navbar-dropdown-nav" aria-hidden="true" >'; foreach(wire('languages') as $language) { if(!$page->viewable($language)) continue; // is page viewable in this language? if($language->id == wire('user')->language->id) { $out.= "<li class='$hreflang'>"; } else { $out.="<li>"; } $url = $page->localUrl($language); $hreflang = $page->getLanguageValue($language, 'name'); $out.= "<a hreflang='$hreflang' href='$url'>$language->title</a></li>"; } $out.='</ul> </div></li>'; # $out .= "</ul>"; return $out; }
  16. Look . All you describe here has nothing to do with my question. I added multilingual support to blog scheme and it works perfectly showing multilingual menu. But as I asked I need to integrate it into main menu using build in functionality. And I believe there is a really easy way for that. Secondly why should I use menu builder if I can simply fix a template with pure php. All I need is to pass $languages to function uknavbarnav somehow or decide a function in parts. No idea yet. Buy surely there must be a simple answer
  17. 1 trying to add extra pages to default _uikit.php function ukNavBarNav-> fails ...it requires 1 array 2 trying to add dropdown multilingual menu there-> fails it requires pages array and problem n1 3 adding standard php multilingual code (for menu generation) to UkNavBarNav ->fails as variable $languages is empty there SO What is the best way to navigate(menu) in Blog profile and how to add language switcher in a drop down manner?
  18. i decided to extend _uikit.php functionality with extra functions in separate file in case in future updates, in _init.php i included my _uikit_override.php call in _uikit_override.php i have include_once('./_uikit.php'); function ukEventPost(Page $page, $options = array()) { .... its still copy of ukBlogPosts ... but after that i have strange error TypeError Argument 1 passed to ProcessWire\ukEventPost() must be an instance of ProcessWire\Page, instance of ProcessWire\PageArray given, called in C:\WTServer\WWW\pw32\site\templates\home.php on line 34 search► Source file File: ...\WWW\pw32\site\templates\_uikit_override.php:84 74: * - `divider` (bool): Specify true to show a divider between root level items (default=auto). 75: * - `attr` (string): A string of additional tag attributes to add to the `<ul>` (default=''). 76: * - `fields` (array): Any additional fields you want to display for each item. 77: * @return string 78: * 79: */ 80: 81: #include(_uikit.php); 82: include_once('./_uikit.php'); 83: 84: function ukEventPost(Page $page, $options = array()) { 85: 86: $defaults = array( 87: 'summarize' => null, // Display blog post summary rather than full post? (null=auto-detect) 88: 'metaIcon' => 'info', any ideas how to properly include php files and call functions??
  19. Installed latest blog profile with _uikit.php had to setup a second blog on the same installation, faced few problems 1 i needed it without comments so this field was deleted-> crash->non destructive workaround in function ukBlogPost(Page $page, $options = array()) { if($page->comments){//prepend $n = $page->comments->count(); //col 662 }else{$n=0;};//append 2 category page changed, (each blog like setup requires its own category page) can be anything by default 'categories' added option to ukblogpost-> echo ukBlogPosts($posts,['category'=>'expo_tags']); non destractive change $defaults = array( 'summarize' => null, // Display blog post summary rather than full post? (null=auto-detect) 'metaIcon' => 'info', 'moreIcon' => 'arrow-right', 'moreText' => __('Read more'), 'categoryIcon' => 'hashtag', 'bylineText' => __('Posted by %1$s on %2$s'), 'category' => 'categories', <-- new line ); ----------------- $metaIcon = ukIcon($options['metaIcon']); $moreIcon = ukIcon($options['moreIcon']); $categoryIcon = ukIcon($options['categoryIcon']); $cat=$options['category']; <-- new line --------------------- $categories = $page->$cat->each($categoryIcon . <--categories replaced for $cat "<a class='uk-button uk-button-text' href='{url}'>{title}</a> " ); 3 Problem, Is it possible to extend ukblogPosts to display calendar , events, date event table, really need simple solution for php newbie 4 ready.php hooks??? do i need to add new ? for new blog type pages? cant understand how it affects blogpost , so what is the function of default hook in log profile?? 5 _main.php (html menu) needed to add/extend extra page -> manual dirty solution $p=$home->and($home->children); $p=$p->and($pages->get('/service/Expo-list')); #print_r($p); #and($pages->get('/Service/'))) ?> <?=ukNavbarNav($p, [ 'dropdown' => [ 'basic-page', 'categories' ] ])?> doesnt like this solution/ is there a simpler way to combine 3 arrays or just page ids for ukNavBar ->call -------- i realy like new templates functionality, great work
  20. Checked it . Works fine. Thanks . Tracy debugger doesn't show up in my install. Latest development 3ver. Or I don't know how to init it
  21. great, thanks a lot , i'll try it tomorrow, i broke my head dumping $page array
×
×
  • Create New...