dab

Members
  • Content count

    72
  • Joined

  • Last visited

Community Reputation

17 Good

About dab

  • Rank
    Full Member

Profile Information

  • Gender
    Not Telling

Recent Profile Visitors

1,208 profile views
  1. dab

    Many thanks @Robin S, I was using the first option, initially as just the page id (obviously the request_id wasn't getting called, & then I tried "/login?return={id}" - but clearly the syntax was wrong. Thanks, I've spent hours going through the the forums & trying various combinations of code - I'm so grateful for your help.
  2. dab

    @Robin S, thanks kindly for your suggestion. I tried this, but instead, the logged in user get redirected to "home" on login instead of the requested page. The html output is <form action='./?id=1' What I don't understand is why the "get" $request_id is not working.... // get id var from request $requested_id = (int) $input->get->id; I'll see if I can find anything else on the forums.... With thanks.
  3. dab

    ..I did some more digging & identified that the chrome issue happens when I use: $content.="<form action='./' method='post'>"; rather than @Soma's code which was originally: $out = '<form action="./?id='.$requested_id.'" method="post">'; Note: I had to change some of the quotes on @Soma 's post to: $content.="<form action='./?id=".$requested_id."' method='post'>"; as the original gave a parse error with delayed strategy templates. but the resulting html output from my edit is: <form action='./?id=0' method='post'> So something is not quite right with the code, as the requested id is not being picked up from the code... if ($user->isLoggedin()) { $content.="You are already logged in."; } else { // get id var from request $requested_id = (int) $input->get->id; if ($input->post->user && $input->post->pass) { $user = $sanitizer->username($input->post->user); $pass = $input->post->pass; if ($session->login($user, $pass)) { // login successful $t = $pages->get($requested_id)->path; $session->redirect($t); } else { $content.="Login Failed. Please try again."; } } $content.="<form action='./?id=".$requested_id."' method='post'>"; $content.="<label for='name'>Usename:</label> <input type='text' name='user' id='name'/>"; $content.="<label for='password'>Password:</label> <input type='password' name='pass' id='password'/>"; $content.="<input type='submit' name='submit' value='Login' class='button fit special' />"; $content.="</form>"; } Not sure what to try next....
  4. dab

    I'm using @Soma 's nice code for a custom login & it's working great on IE, Edge & FF (thanks!) but on Chrome I just get a blank page after the login. After refreshing the page the password protected page loads OK. I've no plugins on Chrome blocking page reload etc. The pages has a template with access denied to guest, but set to allow access via a specific role/user with access. The template for the page is set to redirect the user to the login page when a user attempts to access. Not sure if this is significant, but the password protected page url stays the same when the the login page is presented to the user... Has anyone else come across this (Chrome issue)? Thanks
  5. I've had this with several sites when trying to up from 3.0.62 to 3.0.90 - but I've still not resolved it. I suspect it is a languages issue, as the sites were setup using the multi-language template, but in the end the sites just used a single language. I also get a 404 when trying to edit some (but not all) of the pages via the admin login PW editor back end. NOW RESOLVED: If you have all the language modules installed, ready for a multi-linugual site & are not using them you will get 404 issues. I've converted fields to single language, removed all the language modules from the core tab & after upgrade no issues are seen.
  6. dab

    Found a fix for posts with multiple images... Replace // output video with: <a href="<?=$media['link']; ?>" class="instagram-item"> <picture> <source media="(min-width: 55rem)" srcset="<?=$media['images']['standard_resolution']['url']; ?>"> <source media="(min-width: 45rem)" srcset="<?=$media['images']['low_resolution']['url']; ?>"> <source srcset="<?=$media['images']['thumbnail']['url']; ?>"> <img src="<?=$media['images']['thumbnail']['url']; ?>" alt=""> </picture> </a> e.g. <div class="instagram"> <?php foreach ($feed as $media): ?> <?php if ($media['type'] === 'image'): ?> <a href="<?=$media['link']; ?>" class="instagram-item"> <picture> <source media="(min-width: 55rem)" srcset="<?=$media['images']['standard_resolution']['url']; ?>"> <source media="(min-width: 45rem)" srcset="<?=$media['images']['low_resolution']['url']; ?>"> <source srcset="<?=$media['images']['thumbnail']['url']; ?>"> <img src="<?=$media['images']['thumbnail']['url']; ?>" alt=""> </picture> </a> <?php else: ?> <a href="<?=$media['link']; ?>" class="instagram-item"> <picture> <source media="(min-width: 55rem)" srcset="<?=$media['images']['standard_resolution']['url']; ?>"> <source media="(min-width: 45rem)" srcset="<?=$media['images']['low_resolution']['url']; ?>"> <source srcset="<?=$media['images']['thumbnail']['url']; ?>"> <img src="<?=$media['images']['thumbnail']['url']; ?>" alt=""> </picture> </a> <?php endif; ?> <?php endforeach; ?> </div>
  7. dab

    Has any one noticed a problem with Instagram posts with multiple images not showing? I get the output: // output video suggesting that "multiple image" posts are not picked up as media type "image". <?php if ($media['type'] === 'image'): ?> With thanks...
  8. Make sure in your CSS you set the width to 100% & specify the height in px. I use: width: 100%; height: 600px; position: relative; overflow: hidden;
  9. dab

    Got it! So simple really $events = wire('page')->course_start_date_repeater;
  10. dab

    no problems, any ideas/input welcome
  11. dab

    @louisstephens Thanks.... It's got to be called via a hook, rather than a regular call from a page function getEvents() { $events = wire('pages')->get("/courses/hill-skills/")->course_start_date_repeater; foreach ($events as $event) { echo "'$event->course_start_date' : '<span>BOOK BELOW!</span>',"; echo "'$event->course_finish_date' : '<span>PICK THE START DATE!</span>',"; } }
  12. dab

    I'm using the "wire ('pages')->get" hook for an event calendar. The wire hook below is "hard coded" & works fine $events = wire('pages')->get("/courses/skills/")->date_repeater; But I want to get the repeater for the current page (being viewed) I've tried lots of ways of replacing the "->get" to get the repeater from the current page, but no luck. I've tried $currentpage = $page>path; & replacing the get("/courses/-skills/") with $currentpage but no joy.... Any hints would be a huge help.
  13. dab

    Have you tried this this? Might be of use? I've got it working using a repeater for the dates (but only 2 day courses start/end) if you need help.
  14. dab

    @justb3a ......thanks this is even better - perfect!
  15. dab

    For some sites the "spam message" might not be approprate So I changed line 215 in SimpleContactForm.module to $this->_("Sorry, but your message didn't pass our %s test. Please try another %s."), and change lines 155 (& the following) & 172 (& the following) in \lib\SpamProtection.php to $this->_('spam'), and $this->_('time'), So the message will read " Sorry, but your message didn't pass our spam test. Please try another time. " Thanks again @justb3a