Harmen

Members
  • Content count

    102
  • Joined

  • Last visited

Community Reputation

58 Excellent

About Harmen

  • Rank
    Sr. Member

Profile Information

  • Gender
    Male
  • Location
    The Netherlands

Recent Profile Visitors

554 profile views
  1. Just discovered this topic, and it's great! Bit late, but hey better later than never Below some of the music I listen to while coding besides Epic music: https://www.youtube.com/watch?v=z4nKOzk8qbw&index=64&list=WL https://www.youtube.com/watch?v=1GkYZH7AoS4&index=53&list=WL If the music has a decent beat, the singer a nice voice then I'm in!
  2. Glad it works now! Good luck with the further development of your website!
  3. Sure! See the snippet below if ($input->post->submit) { // === When submit button is clicked if ($v->validate()) { // === Validate the data if ($captcha->verifyResponse() === true) { // === Verify Captcha $subject = 'Contact Form'; // === Subject $messageHTML = include_once('partials/contact/_email.php'); // === Get the message, is in HTML $mail = wireMail() // === Set up the mail data ->to($contactFormRecipient) ->header('Reply-To', $email) ->subject($subject) ->bodyHTML($messageHTML); if ($mail->send()) { // === If mail is sent, while sending e-mail $session->flashMessage = __('Thank you for your message! We will get back to you.'); $session->sent = true; $session->redirect($page->url); } else { // === If mail isn't sent $session->flashMessage = __('Mail not sent. Error occured.'); } } else { // === Captcha error $session->flashMessage = __('Recaptcha Validation Error'); } } else { // === Validation errors $session->flashMessage = __('Please correct the errors and try again.'); } }
  4. Hi, I think if you replace this: $m->to($contactFormRecipient) ->from($email) ->subject('Contact form submission') ->bodyHTML($message) ->send(); with the following: $m->to($contactFormRecipient) ->from($email) ->subject('Contact form submission') ->bodyHTML($message); that it will work and the email will be send one time, that's how my contact form works , I hope this helps you ~ Harmen
  5. One thing to make your foreach loop a bit smaller and faster is to move these lines of code (below). Just set them before the foreach loop. As far as I can see you are checking the date for each ad, but it's always the same so it's faster to define it once. $todaysdate = date("F j, Y H:i"); $today = strtotime($todaysdate); So that results in this: $ads = $pages->find("parent.template=client, sort=expiration_date"); // === Get $ads $alert_count = 0; // === Set alert count $todaysdate = date("F j, Y H:i"); // === Get the date $today = strtotime($todaysdate); // === Make a string from the date foreach ($ads as $ad) { // === Start foreach $expireson = $ad->expiration_date; $expires = strtotime($expireson); // === I think you can also shorten this to $expires = strtotime($ad->expiration_date); Maybe you can even try $fiveaway = strtotime($ad->expiration_date) - 432000; $fiveaway = $expires - 432000; if ($today > $expires) { $alert_count += 1; } } // === End Foreach echo $alert_count; // === Echo the counter result Hope this helps...
  6. @fbg13, you're a real hero! EDIT: Uh, I meant also @flydev, your code did the trick. Now it looks like it should look! Thanks! I think the space between the ' ' did the trick, I am not sure but I will spend this evening to figure out what I did wrong. I am building this module to make the process for handling RMA's in my company easier. So I am creating a module and $this->GeneralfieldsSelector grabs all the fields that are selected in the module settings to show them on the frontend. I didn't want to build the form itself because maybe I will also release this module here on PW and than is this a bit better than a custom made HTML-form XD
  7. Yep, these are modules like Batch Child Editor, Tracy Debugger, ReCaptcha and some custom made modules. But I don't think any of these modules conflict with the module I am working on now.
  8. @fbg13: // === The render method that links to the render form method public function ___render(){ return $this->renderForm(); } // === The renderForm() method protected function renderForm() { $form = $this->BuildForm(); $form->setMarkup(self::$markup); // === Pressed submit? if ($this->input->post->submit){ $form->processInput($this->input->post); if (!$form->getErrors()){ if ($this->sendEmail == true){ $text = 'Configure Email options' //to do } } } return isset($text) ? $text : $form->render(); } // === Build Form Method protected function BuildForm(){ $form = $this->modules->get('InputfieldForm'); $form->method = 'post'; $form->attr('id+name', 'rma-form'); // === Add the fields to the form if (is_array($this->GeneralfieldsSelector)) { foreach($this->GeneralfieldsSelector as $fieldName){ if ($field = $this->fields->get($fieldName)){ $input = $field->getInputfield($this->page); $input->attr('class', 'form-control'); $input->skipLabel = true; $form->append($input); } } } // === Submit button $submit = $this->modules->get('InputfieldSubmit'); $submit->name = 'submit'; $submit->attr('class', 'btn btn_default'); $submit->attr('value', 'Send RMA request'); $form->append($submit); return $form; } I don't think the problem is in this piece of code, but maybe I've done something wrong...... // ====== @OLSA: I've tried that mate, but it doesn't work... Thanks for your comment though!
  9. No problem! Unfortunately, this works neither
  10. Yep, the text is gone now, and the icon too....
  11. Glad you fixed it. Good luck with the development of your website
  12. Hi, If you go to a page that doesn't show up, and you go to the settings of that page, is the checkbox checked to activate the english URL? See image below, the checkbox should be checked
  13. That's an option, but I think it's better to fix this issue in the markup itself.
  14. Hi all, I am trying to build a form in a module. So when the render() method is called, I build the form and I want to apply a custom markup, which is defined in an array. Unfortunately I can't remove some text in my label. Instead of a label I want an icon, but there is always some text next to my icon as you can see below: I don't know how, but my icon is placed in the label, and that's not what I want. My markup looks like this: static protected $markup = array( 'list' => "{out}\n", 'item' => "\n\t<div class='form-group input-group'>\n{out}\n\t</div>", 'item_label' => "<label class=input-group-addon>{out}</label>", 'item_icon' => "<span><i class='fa fa-fw fa-{name}' aria-hidden='true'></i></span>", 'item_content' => "{out}", 'item_error' => "\n<p class='field--error--message'>{out}</p>", 'item_description' => "\n<p class='field__description'>{out}</p>", //.... etc ); and results in this: <div class="form-group input-group"> <label class="input-group-addon"> <span> <i class="fa fa-fw fa-envelope" aria-hidden="true"></i> </span> E-Mail </label> <input id="Inputfield_contact_email" name="contact_email" class="form-control InputfieldMaxWidth" type="email" maxlength="512"> </div> and what I want is: <div class="form-group input-group "> <span id="contact_form" class="input-group-addon"><i class="fa fa-user" aria-hidden="true"></i></span> <input required="" class="form-control" name="name" id="contact_form" type="text" value="" placeholder="Name"> </div> The only problem is that the code above is hard-coded and I don't know how to remove that piece of text next to my icon.... Thanks in advance, ~Harmen
  15. @Robin S, thanks for the links. I fixed or cheated it in a bit different way. In the success function of the AJAX Post, I check for the reply if it is success or not. If it is equal to success I redirect to the same page with a query behind the normal URL. In the file I check if the query is in the URL and if so I push the file as a download. The only thing insecure to this method is that if you know the query you can still get the file without a serialnumber. Anyway, it works for the time being, hopefully this helps someone else