Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by janlonden

  1. Thanks adrian and slkwrm. $today = strtotime('today midnight'); This made my code a bit cleaner
  2. Here's a couple of problems I need help with. I have a schedule page with a repeater field which has besides other fields a date field. Right now it displays all items. What I would like it to do is to only show future items and todays item. The code I'm using: <?php foreach($page->schedule as $schedule_item) { ?> <p><?=$schedule_item->schedule_date?></p> <p><?=$schedule_item->location->title?></p> <?php if($schedule_item->location->location_url) { ?> <p><a href="<?=$schedule_item->location->location_url?>">Karta</a></p> <?php } ?> <p><?=$schedule_item->starts?></p> <p><?=$schedule_item->ends?></p> <?php } ?> I would also like a "next schedule item" thingy on the homepage, which would only show the next item on the schedule or todays schedule. Any help appreciated! Edit: I found help on a couple of threads here Here's how I got it working. Show only future items and todays item: <?php $today = strtotime(date("Y-m-d") . " 00:00:00"); foreach($schedule_items = $page->schedule->find("schedule_date>=$today") as $schedule_item) { ?> To show only one item on the homepage I just added limit=1: <?php $today = strtotime(date("Y-m-d") . " 00:00:00"); foreach($schedule_items = $pages->get(1007)->schedule->find("limit=1, schedule_date>=$today") as $schedule_item) { ?>
  3. I still think it's not clear enough. I remember the first time when I looked at the breadcrumb and thought "I wonder what that home icon does". I was surprised to end up in the site. Edit: It seems that adrian agrees with me, hehe
  4. The home icon in the breadcumb functions as the "View site" button right now. But I agree with you that it should be elsewhere, and have it's own icon.
  5. Manfred, those were some nice skins. Thank you. I decided to use the bootstrap one. I would love to use version 4, but I think I'll have to wait for Ryan to update to it. Or have you managed to update to version 4?
  6. Thanks Ryan. This means I'll have to stay with tinymce. The only reason I wanted ckeditor was the look, but the default grey skin in tinymce is good enough.
  7. Is there a way to control tag useage like in tinymce with the valid elements option? The extra allowed content option seems to be as the name suggests, just a second layer of control. I would like to restrict the tags to just the basics. I would also like to force some values to my headings, which I accomplished in tinymce like this: h2[role:heading|aria-level:2] I searched the documentation, which wasn't to much help at all.
  8. Tried it. No improvement here. I tried both jpg and png. It's strange because just a while ago I uploaded two screenshots.
  9. Sorry, same problem. Tried with jpg and png. I'll email them.
  10. The border radius is now gone from the sub menus in the new version The new font looks a little "jagged" here on firefox, as if it's not being displayed at it's recommended size. Also I found a strange visual behavior on select elements when hovered on. I tried to post screenshots but it wouldn't let me? I get a message that says: "You are not allowed to use that image extension on this community." Anyway, I'm really happy with the new theme.
  11. We really appreciate this Ryan. I like the bigger font size and added padding. The futura color theme matched the company's website I'm working on right now almost perfectly One thing that still bothers me a little is the rounded corners on submenu items when hovered over with the mouse. Not a big thing, but still wanted to give a little constructive criticism. Thank you for your work!
  12. Yes! I also think that the admin should be as neutral design wise as you said as possible. A good example of this is Nico Knolls Dark Business, appy, clean and neutral design.
  13. I had the same problem. I just thought I had missed something I fixed it by renaming main-classic.css to main.css and replacing that one with the original.
  14. Got it. Thanks! Ahhh. Much better with 1.6em Even though some margins and paddings are proportionally too small.
  15. Wow! Thank you Ryan. A big improvement from the old theme. I get this message when I press the "Add new" button: "Not yet configured: See template family settings." What am I supposed to do in the "Family" tab? One more thing, I would like the base font size to be larger. Right now I have to squint to see some texts. Maybe it's just me but I like large font sizes. Is there a way to easily increase the base font size?
  16. That bookmarking app is amazing! Exactly what I was thinking about, except maybe not that advanced
  17. I've been looking at PHP frameworks and considering learning one to make apps. I've been reading some Laravel tutorials and it seems like even I could propably make some simple apps in it But then I thought it might be possible and easier with ProcessWire. Here's my question. Is it possible to have a login form as your homepage which redirects you to a custom page where I can have complete control of the output? Lets say I wanted to create a simple todo app. There would only be a list of items and a create new/delete buttton. This would make all the database, field, users management so much more convenient compared to other frameworks. If this is possible please point me to some tutorials or code examples if you've done something similar yourself. Thanks.
  18. Put this in your config.php: setlocale(LC_ALL, 'Polish_Poland'); You could try changing this: "<div class='date'>{$e->date}</div>". to: "<div class='date'>" . strftime("%e %B %Y", $e->getUnformatted("date")) . "</div>". I'm not a programmer so this could be totally wrong.
  19. First run this on your server: <?php echo '<hr>test WINDOWS server for locales'; /* try different possible locale names for english GB as of PHP 4.3.0 */ echo '<p>'; $loc_en = setlocale(LC_ALL, 'english_gbr', 'english_britain', 'english_england', 'english_great britain', 'english_uk', 'english_united kingdom', 'english_united-kingdom'); echo "Preferred locale for english GB on this system is '$loc_en'"; echo '<br/>' . strftime("%A %d %B %Y", mktime(0, 0, 0, 12, 22, 1978)); /* try different possible locale names for english USA as of PHP 4.3.0 */ echo '<p>'; $loc_enusa = setlocale(LC_ALL, 'english_usa', 'english_america', 'english_united states', 'english_united-states', 'english_us'); echo "Preferred locale for english USA on this system is '$loc_enusa'"; echo '<br/>' . strftime("%A %d %B %Y", mktime(0, 0, 0, 12, 22, 1978)); /* try different possible locale names for german as of PHP 4.3.0 */ echo '<p>'; $loc_de = setlocale(LC_ALL, 'de_DE@euro', 'de_DE', 'deu_deu'); echo "Preferred locale for german on this system is '$loc_de'"; echo '<br/>' . strftime("%A %d %B %Y", mktime(0, 0, 0, 12, 22, 1978)); /* try different possible locale names for spanish as of PHP 4.3.0 */ echo '<p>'; $loc_es = setlocale(LC_ALL, 'esp_esp', 'esp_spain', 'spanish_esp', 'spanish_spain'); echo "Preferred locale for spanish on this system is '$loc_es'"; echo '<br/>' . strftime("%A %d %B %Y", mktime(0, 0, 0, 12, 22, 1978)); /* try different possible locale names for dutch as of PHP 4.3.0 */ echo '<p>'; $loc_nl = setlocale(LC_ALL, 'nld_nld'); echo "Preferred locale for dutch on this system is '$loc_nl'"; echo '<br/>' . strftime("%A %d %B %Y", mktime(0, 0, 0, 12, 22, 1978)); ?> It will show you what setlocale setting your server accepts. I had to use "swedish_sweden" on my local xampp server and "sv_SE" on the live server. In your config.php put this: $config->timezone = 'Europe/Stockholm'; setlocale(LC_ALL, 'sv_SE'); Modify to your needs of course. And finally use this to output the date: <?php echo strftime("%e %B %Y", $page->getUnformatted("date"));?> Hope this helps!
  20. You're awesome! This worked: if(!$error) { $subject = "Kontakt formulär"; $message = ''; $headers = 'From:'.$form[epost]."\r\n".'Content-Type: text/plain; charset=utf-8'."\r\n"; foreach($form as $key => $value) $message .= "$key: $value\n"; mail($emailTo, '=?UTF-8?B?'.base64_encode($subject).'?=', $message, $headers); $sent = true; } Thank you!
  21. Partial success sakkoulas! The subject field is now showing åäö correctly but the problem remains in the message textarea. I've tried to move your code around, putting $message here and there without success hehe How would i use this code for $message? Thanks!
  22. I tried changing utf-8 from this: $form[$key] = htmlentities($value, ENT_QUOTES, "UTF-8"); to iso-8859-1. But it didn't help.
  23. I've encountered a problem with my contact form. Characters such as å, ä and ö in mails sent from the form are displayed as Ã¥, À, and ö. I'm sure it has something to do with character encoding(utf-8, iso-8859-1). I've googled around for a solution but couldn't find an answer Any ideas how to fix this? Here's my contact form code: // set this to the email address you want to send to (or pull from a PW field) $emailTo = ''; // or if not set, we'll just email the default superuser if(empty($emailTo)) $emailTo = $users->get($config->superUserPageID)->email; // set and sanitize our form field values $form = array( 'namn' => $sanitizer->text($input->post->namn), 'epost' => $sanitizer->email($input->post->epost), 'meddelande' => $sanitizer->textarea($input->post->meddelande), ); // initialize runtime vars $sent = false; $error = ''; // check if the form was submitted if($input->post->submit) { // determine if any fields were ommitted or didn't validate foreach($form as $key => $value) { if(empty($value)) $error = "<p class=\"error\">Kontrollera att du har fyllt i alla fält.</p>"; } // if no errors, email the form results if(!$error) { $subject = "Kontakt formulär"; $message = ''; foreach($form as $key => $value) $message .= "$key: $value\n"; mail($emailTo, $subject, $message, "From: $form[epost]"); $sent = true; } } if($sent) { echo "<p class=\"success\">Tack! Ditt meddelande har skickats.</p>"; // or pull from a PW field } else { // encode values for placement in markup foreach($form as $key => $value) { $form[$key] = htmlentities($value, ENT_QUOTES, "UTF-8"); } echo $error; ?> <article role="complementary"> <form action="./" method="post"> <p> <label for="namn">Namn</label> <input type="name" id="namn" name="namn" aria-required="true" value="<?php echo $form[namn] ?>" required> </p> <p> <label for="epost">E-post</label> <input type="email" id="epost" name="epost" placeholder="du@domän.se" aria-required="true" value="<?php echo $form[epost] ?>" required> </p> <p> <label for="meddelande">Meddelande</label> <textarea id="meddelande" name="meddelande" aria-required="true" required><?php echo $form[meddelande] ?></textarea> </p> <input type="submit" id="submit" name="submit" value="submit"> </form> </article> <?php } ?>
  24. Like Nico Knolls Dark Business theme, this one looks amazing! I'm really glad to see more awesome admin themes popping up I really like the idea to be able to change color theme, to match the frontend design of your clients website. I'm looking forward to use this theme.
  25. I've been going through all the admin themes but in every case I end up deleting the templates-admin folder after a while. But this one just clicked with me instantly! incredibly clean and professional looking! Too bad there are some bugs, which make it unuseable for me. This happens when I open the menu: And this overflow/width problem: I would like to help fix these bugs, but I'm in a middle of a project right now, which should've been done already.
  • Create New...