Jump to content

netcarver

PW-Moderators
  • Posts

    2,241
  • Joined

  • Last visited

  • Days Won

    47

Everything posted by netcarver

  1. Thank you for the feedback Horst. According to another article, the CSS used should work in IE10+ (along with FF5+, Opera 12+, Safari 4+ & Chrome) but the quality may vary. Even on a new-ish chrome browser on a fast Android tablet the animation quality can vary a little between loads of the page - sometimes there is a little stall here and there. With regard to per-slide transformation settings: yes, it is possible. The example code I posted sets a simple scale-up for the image and a translation for the overlay text for all slides but you can specify a slide field for the image and/or overlay transformations making them configurable for each slide. Having said that, I've not tried to duplicate the effects used in that site so I can't say a positive "Yes, it can do that" even though you can customise things on a per-slide basis. Edited to reflect the removal of the image scale-up from the opening post - FF on android was stalling with the image scaling.
  2. Markup Cross-Fade On Github. In the Module Repository. Thanks to the good people at Lightning.pw for hosting the demo for free! Demo no longer available. A full-screen cross-fading background animation module with optional, per-slide, overlay text. It's based on an article by Mary Lou over on codrops. Here's the home.php template code for the entire site... <?php $cf = wire('modules')->get('MarkupCrossfade'); $settings = array( 'pages' => wire('pages')->get("template=slides")->children(), 'title_xforms' => "scale(1.0) translateY(300px)\nscale(1.0)\nscale(1.0)\ntranslateY(300px)", ); ?><html lang="en"> <head> <meta charset="utf-8"> <title>MarkupCrossfade Demo</title> <style> @font-face { font-family: 'BebasNeueRegular'; src: url('<?php echo wire('config')->urls->assets; ?>fonts/BebasNeue-webfont.eot'); src: url('<?php echo wire('config')->urls->assets; ?>fonts/BebasNeue-webfont.ttf') format('truetype'); font-weight: normal; font-style: normal; } body { background-color: #333; overflow-x: hidden; padding: 0; border: 0; margin: 0; } <?php echo $cf->renderCss($settings); ?> .markup-crossfade li div h3 { font-family: 'BebasNeueRegular', 'Arial Narrow', Arial, sans-serif; font-size: 80px; letter-spacing: 2px; } </style> </head> <body> <?php echo $cf->renderHtml($settings); ?> </body> </html> The only other work involved was adding a 'slides' and a 'slide' template ('slides' having children of template 'slide') and adding an image field called 'image' (NB. not "images"), a text/textarea called 'body' and a required integer field called 'duration' to the slide template. Add a parent to the page tree called 'slides' using template 'slides' and add as many manually sorted children as you need, setting the image, body text and duration for each. After that, the only thing left to do was to upload BebasNeue from fontsquirrel to 'assets/fonts'. That's it. There are a number of parameters you can configure and pass in to the render methods. Here's the list of settings and their defaults taken straight from the source code... array( 'pages' => $pages, // WireArray of pages defining the slides of the slideshow. 'duration_field' => 'duration', // Field of the slide page that provides the duration (in seconds) 'overlay_field' => 'body', // Field of the slide page that provides the overlay text 'image_field' => 'image', // Field of the slide page that provides the image (url) 'title_xform_field' => '', // Textarea field of the slide page that provides the title transformations 'image_xform_field' => '', // Textarea field of the slide page that provides the image transformations 'title_xforms' => '', // Default title transformations - one per line (\n separator please) - leave blank for none. 'image_xforms' => '', // Default image transformations - one per line (\n separator please) - leave blank for none. 'html_class' => 'markup-crossfade', // What class to apply to the owning list 'z_index' => '-10', // z-index of slideshow container and its spans 'li_id' => 'slide_', // What id to use for each slide. The slide # will be appended to this 'browsers' => array( // Array of browsers extensions to render CSS for '', '-webkit-', '-moz-', '-o-', '-ms-' ), 'skip_css' => false, // only generate the keyframes, don't output a modified copy of the module's static css file. 'mask_image' => '', // location of mask image relative to the site root. Leave blank if none. ); In order to use per-slide image and/or title transformations you need to add either one or two textarea fields to your slide templates. Each textarea should have a maximum of five lines of text. Each line of text is used to define the transformation(s) applied at each of the 5 stages of the animation that gets generated. The following (used for the global title animation on the demo site)... scale(1.0) translateY(300px) scale(1.0) scale(1.0) translateY(300px) ...defines the start keyframe with the title scaled at 1.0 and translated along the Y axis by 300px. The next keyframe is not translated so the browser animates it up into the visible area. It stays there in the next frame and is animated back out in the fourth frame. The skip_css setting lets the renderCss() method know if it should include its default css scaffolding file (included with the module) in the output. If set to true, only the CSS for the actual animations is output and you'll have to supply your own scaffolding CSS in your page templates. Whilst this works great in Chrome on linux, could you let me know what the experience is like for you on your OS/Browser combination. Thank you!
  3. Hello @Philipp First of all, thank you for this great service! Trying it out today as a demo platform for a new module I'm getting close to releasing. I'm having some trouble logging in using ftp. I'm pretty sure the credentials I'm using are correct but I keep getting '530 Login Incorrect' errors when I try connecting using gFTP. Are there some limitations on the daemon's ability to accept non-ascii characters in passwords? Login with the same password to the admin interface is just fine. Thanks in advance!
  4. Hi tinacious, Does wrapping your call to strftime() in utf8_encode() fix this for you? Like this... $formatted_date = utf8_encode(strftime($strings['date_format'], $page->date));
  5. Thank you ceberlin. I've been in two minds about allowing optimisation of InnoDB tables for a while and this has pushed me off the fence. I'll remove the optimisation for that engine with the next release. Regarding a configurable level for issuing optimisation "warnings" that should be entirely possible.
  6. @ceberlin Thanks for posting. I'm not able to repeat the problem with a newly updated pw2.5.8 dev installation. Can you tell me what steps you take that make this repeatable please?
  7. It's about time this was pulled together as a configurable module. So here it is on github and in the module DB. You can configure a set of roles and a target redirect page under the module config. I've done very limited testing here - hence it being marked as alpha in the module DB - so please let me know if it works for you. A word of thanks to both Wanze and kongondo are in order as they pulled most of the material together that I used for this!
  8. Perfect, Raymond, thank you!
  9. @Raymond I'm trying this out now and seem to have hit a problem. I can see that the assigned column is getting stored correctly in the DB but when I access the assigned time as per your example in the opening post I always get "1970-01-01 01:33:34" - which is obviously incorrect. Edited to add: I think your example code should be... if (count($page->myfriends)) { foreach($page->myfriends as $friend) { echo "id: ".$friend->id."<br>"; echo "name: ".$friend->name."<br>"; echo "assigned on: ".$friend->assigned."<br><br>"; } } ...as the assigned field is already formatted. Double-formatting it causes the problem (at least it does in my case.)
  10. @Raymond Thanks for sharing this module. I'm thinking of using it in a project but need to know if the assigned value is API settable too - I'm presuming it is but want to be sure. Thanks in advance!
  11. Some nice feedback there - thank you. Am I right in thinking that ProCache is the only part of the official PW system that needs write access to .htaccess? If so, does it need that access on install or all the time? If it is only at install I'll change the wording on that warning to indicate that it's a general steady-state recommendation and that some components might need write-access when installing them.
  12. I think the size is likely to be correct. Can you verify with a tool like phpMyAdmin? Once I'm less busy I can take a look at why this isn't optimizing.
  13. @cmscritic Thanks for being open to feedback, even criticism, Mike. I like that! And thank you for your backing of PW too! <reminiscence> This topic reminds me of the time I shared a house with a bunch of Spanish post-grad students here in the UK. All 13 of us had communal meals and shared the dining table and house duties. Being a reserved Brit, however, I'd been brought up with one conversation at a time at the dining table - and you could join in or not as you wished. In the student house there were always, what seemed to me to be, six concurrent arguments going on; usually about football. As I got used to this, I realised that they weren't arguments - just good-natured, frank, conversations: with the volume cranked way up. I've seldom met a group of guys who were so community minded, cheerful, helpful and well organised yet their neighbours lived in fear of them through incorrect perception which seemed to equate their being foriegn and loud with aggression/unfriendliness. </reminiscence>
  14. @gebeer Thank you for the feedback - glad this is working for you. For this Inputfield I deliberately wanted to have a way of quickly entering things from the keyboard but I do appreciate that some folks might want a way of adding a JS picker to this. When I'm less busy with my current project I'll look at re-visiting this to add one. If anyone else has additional suggestions for a candidate time-picker, please drop a note below.
  15. Tom, You can use WireHttp's get() and getHttpCode() methods for this.
  16. Good to hear! Not really. The if, as a whole, applies to whatever is in the brackets following it. Yes, $page->sidebar is in the mix, but not as a true/false evaluation any more. So, you've got this bit; if (some-boolean-expression) { // If the expression evaluates as true do this stuff... echo "True!"; } Now you have to peel the if "onion", from the outside in, to find what's happening... if (strlen(X) > 0) : // Checks if the string length of X is greater than 0. This is the true/false decision. // Now let's peel another level and look at what X is... trim(Y) // X is the trimmed version of Y // And Y is? $page->sidebar Putting it together again, from the inside out, the if statement says... 1) Read the contents of the $page->sidebar field. (Even when this string field is empty in PW's admin page it's coming to us with length 1 after the textformatter - probably the TF adding whitespace) 2) Trim it - The trim function trims leading and trailing whitespace (amongst other things) - so now we have an empty string. 3) Measure how long the trimmed version is (Now it's 0) 4) If that length is > 0 then do this stuff (This stops us showing the empty string as the length is no longer greater than zero. You might find this, simpler, if statement works for you too... <?php if (trim($page->sidebar) != '') : ?> ...and I think that's what Soma was suggesting earlier in the thread. Hope that helps.
  17. So doesn't this solve your problem... <?php if (strlen(trim($page->sidebar)) > 0): ?> <div class="sidebarItem"><?php echo "$page->sidebar"; ?></div> <?php endif; ?> ...?
  18. And what about... echo "<pre>Len: ", strlen(trim($page->sidebar)), "</pre>"; If it's still len: 1 then there are some chars in there that the trim function isn't removing. It that's the case I'd do this... $ord = ord($page->sidebar); echo "Ord: $ord";
  19. What do you get if you do this... echo "<pre>Len: ", strlen($page->sidebar), "</pre>"; ...?
  20. @alan Yeah, it's a mess. I found a link to the episode of Security Now that I listened to about this. It's here (hashing in SSL certs part of the show starts about 48 mins in) and there is a transcript for the show over here. Edited to add: If it's any consolation, I currently don't plan to switch to a better cert till the deadline is almost upon us.
  21. Alan, this probably won't affect you or anyone else here who's running https sites but I'll post it anyway... Please makes sure that there aren't any issues with your visitors' browser support for SSL certs that use SHA-2. If you have a whole bunch of visitors using older versions of IE then you may be cutting them off if you do go down this route. (I know that another take on this would be "Encouraging them to switch".) I believe that Mozilla had to rapidly switch back to SHA-1 after switching to SHA-2 recently as many people who install Windows then visit Mozilla's site to get the latest version of Firefox and download it. Of course, when Mozilla switched to SHA-2 some proportion of their visitors (I think it was a fair few percent but can't remember the figure) were finding that they couldn't download Firefox without certificate warnings & ironically this put up a barrier to their switching to a better browser - so Mozilla rapidly reverted the change. What I like about the story are that folks were using IE just once, as a bootstrap, to load a better browser & that Mozilla thought that it was more important to allow them to do that easily than to improve their own site's SSL hash algorithm.
  22. Hehe, if you can get the address of Ryan's public calendar for releases, I'll add it as a default feed.
  23. Just posted a new module to github that simply displays a google calendar in a new calendar page in the Admin interface. It's meant to go hand-in-hand with Ryan's MarkupLoadGcal module. There's really not much else to say about it other than it uses the new module config class so you'll need to be running an up-to-date dev version to be able to use this. Here's a shot of the config page... ...and here's what the calendar page is like... Please note, this module only embeds the calendar; the event you see listed under the calendar in the screenshot above is added by hooking this module's execute() method and extending the output. The hook method uses Ryan's MarkupLoadGcal module to pull events out of the calendar's feed and then appends them under the calendar. ProcessGcalEmbed in the module repository. ProcessGcalEmbed on Github.
  24. Has anyone else tried this yet? If you have, could you let me know if, using the new scheme, you managed to get checkboxes as configuration fields working please? Thanks in advance.
  25. netcarver

    Muesli Café

    @diogo Perhaps onjegolders is onto something (offering an illustration or illustrations) for potential donors who are not in Porto and can't benefit from your rewards with local delivery.
×
×
  • Create New...