Jump to content

adrian

PW-Moderators
  • Posts

    10,803
  • Joined

  • Last visited

  • Days Won

    346

Everything posted by adrian

  1. I haven't actually read this yet, but I am intrigued, so using this as a bookmark for later http://alistapart.com/article/can-email-be-responsive
  2. Hey Martijn, It's not you - there is something wrong with either Github or Ryan's module creation code. I guess Github changed something in their API recently? I have mentioned it to him already. In the meantime you can simply edit your module's entry in the directory and manually add in the "master" before zip.
  3. Sorry I didn't actually look at mindplay's code. It might be easiest to just: echo '<li><a href="/">Home</a></li>'; before the spot where you return the output of the function. Perhaps if you are still confused so us your complete code so far.
  4. Did you make sure that basic-pages was selected as an available template in the module config settings? Take a look at the screenshot here: http://modules.processwire.com/modules/service-pages/
  5. Something like this should work: $menu_items->prepend($home); Of course this all depends on the array of pages that you are iterating through to generate your menu. And of course you need to define $home, like: $home = $pages->get("/"); Lots of options really.
  6. madalin, PW 2.4 manages themes a little differently. Unfortunately most (all?) of the third party themes have not been updated yet. Here are some instructions on how to get it to work: https://processwire.com/talk/topic/4650-new-processwire-admin-theme-on-dev-branch/?p=53671 However honestly I think you are better off sticking with the default theme at the moment - there is a lot of new functionality in there that the old themes don't support. I also know that there is a second 2.4 specific theme just around the corner, and I am sure more will follow.
  7. This is my version of Ryan's starter: $requested_pid = (int) $input->get->pid; $t = $pages->get($requested_pid)->path; if($user->isLoggedin()){ if($requested_pid == ''){ $session->redirect('/'); } else{ $session->redirect($t); } } if($input->post->username && $input->post->pass) { $username = $sanitizer->username($input->post->username); $pass = $input->post->pass; $u = $users->get($username); if($u->id && $u->tmp_pass && $u->tmp_pass === $pass) { // user logging in with tmp_pass, so change it to be their real pass $u->of(false); $u->pass = $u->tmp_pass; $u->save(); $u->of(true); } $u = $session->login($username, $pass); if($u) { // user is logged in, get rid of tmp_pass $u->of(false); $tmp_pass = $u->tmp_pass; $u->tmp_pass = ''; $u->save(); // now redirect to the profile edit page if($tmp_pass == $pass){ $session->redirect('/profile/'); } else{ $session->redirect($t); } } } // present the login form $headline = $input->post->username ? "Login failed" : "Please login"; $content = " <h2>$headline</h2> <form action='./?pid=".$requested_pid."' method='post'> <p> <label>Username <input type='text' name='username'></label> <label>Password <input type='password' name='pass'></label> </p> <input class='bluebutton' type='submit' name='login' value='Login'> </form><hr /><br /> <p><a href='/reset-pass/'>Forgot Password?</a></p> "; Then wherever you have a link to login: <a href="/logout/?pid='.$page->id.'">Login</a> Of course you can do the same with logout too. Hope that helps
  8. http://modules.processwire.com/modules/all-in-one-minify/ http://modules.processwire.com/modules/minify/ http://modules.processwire.com/modules/minify-html/
  9. +1 for the RCDefaultApp - I should have mentioned that one in my list. I find that really important too! I was tempted to use the windows maximizer, but decided I would try the Mac way - not really panning out for me There is a great article somewhere about this but I can't find it at the moment. Basically talks about people who like to have typical overlapping windows on a Mac, vs fully maximized windows on Windows and something about being better multi-taskers, or something like that. Sounds like rubbish to me
  10. This forum needs a way to spread the love to the person who really deserves it - in this case, Nico! Maybe this would help a little: https://processwire.com/talk/topic/6373-mention-system-for-the-forums/
  11. Well I don't have the recording mode done yet, but thanks to Nico we now have the ability to migrate content from a Wordpress site into PW. Firstly, this module has been renamed - now it is simply: "Migrator" https://github.com/adrianbj/ProcessMigrator so please uninstall your old one and install this new version. The module now supports 3rd party plugin modules for migrating content from other sources. The first one is: MigratorWordpress: https://github.com/NicoKnoll/MigratorWordpress Here's what it looks like in action. Not much action in that screenshot I know, but you can see how MigratorWordpress adds in a new data source option (a WordPress xml export file). There are instructions on exporting in the MigratorWordpress readme. For those of you who still have access to a WordPress site, simply run WP's built in exporter, then import the resulting xml file into Migrator. At the moment the Wordpress site needs to still be live because any embedded images are installed to PW from their full existing URL. Also if you have ideas for other plugins, please feel free to start coding If there is interest I'll write a guide defining what is required for the module to be recognized by Migrator and also about the JSON schema that is required. So please test out and let us know how things go.
  12. Perhaps this will be more affordable: http://www.adobe.com/products/creativecloud/buying-guide.html Single app - $20 / month Illustrator really is phenomenal, but if you are in need of a vector app for free, Inkscape is functional, and in a pinch try out SVGEdit.
  13. One comment on your function - there is no need to have $selects as an argument in your function. You can leave it blank between the (). You need to: echo selector(); EDIT: You need to do something with the results of selector(). You could put a foreach inside the function if the output will always be formatted the same way, or do as Ozwim suggests below if you want to treat them differently each time.
  14. Depending on just how corrupted things are, this should remove the field from all templates and then delete the field: $field_name = "myfieldname"; foreach($templates as $template){ foreach($template->fieldgroup as $field){ if($field->name == $field_name){ $template->fieldgroup->remove($field); $template->fieldgroup->save(); break 2; } } } $fields->delete($field); The first chunk of code is stolen from Soma. I just added the bit at the end to delete the actual field as well.
  15. Actually I missed the bit about the text and layout being in Illustrator - I assumed Word. I am guessing that is why the bullets and other simple formatting are not importing correctly. You could probably export to svg and if you don't need to support legacy browsers, you could display the svg labels on the site. Apparently Google indexes text in SVGs. I don't honestly think this is a good idea - copying/pasting and reformatting will be better, but just thought I'd thrown it out there
  16. I'd be curious to see some examples of the different label layouts. I would think if I was selling products I would have a standard label layout format for all products. It sounds like it might even be better to have a few different fields for each product, like: Name Ingredients Usage Expiry date Just guessing what might be relevant of course, but the key thing with have the separate fields is that you can ensure a professional looking site by making sure the layout is identical for each product and quickly adjust them all at once through html/css. The way they want things now, it would be a nightmare to make any batch changes to the look of the labels. Of course I might not be fully understanding the requirements, in which case I am sorry - nothing to see here
  17. Things like bullets, bold, italics etc should copy across just fine. A standard paste in TinyMCE preserves these. There is also the Paste from Word option installed by default with CKEditor. In my opinion you don't want line spacing to copy across - you want it to match your sites css line-height. As for columns, that is another case where I don't think it is appropriate to copy across - this should be controlled by your site's markup. I think this is another case where the client needs to be educated that duplicating an exact layout from a Word document is actually not a good thing in most cases - their site would start looking like a jumbled mess and varying layouts very quickly.
  18. I don't actually see how your revised find would work, but this will: $id = $this->pages->get("include=all, sort=-id")->id + 1;
  19. Haven't needed this myself, but from the PHP date page: "To format dates in other languages, you should use the setlocale() and strftime() functions instead of date()." EDIT: Given the way this module uses dateFormat, it might not be possible easily without hacking the core of the module. Perhaps it would be better to implement a new way of defining the date format in the module by using strftime instead of date here: https://github.com/ryancramerdesign/MarkupLoadGCal/blob/master/MarkupLoadGCal.module#L351 If you have the time and skills this should be pretty easy and might be a nice pull request for enhancing the module. Perhaps someone more language savvy will chime in too.
  20. @darrenc The way you submit enhancements/fixes to a project on github is to first fork the project, then make the changes to your forked version, then submit a pull request to the original project. Ryan will receive notification of your PR and he can then review and accept the changes as is, or modify them as needed. Obviously it's hard to know whether your changes will be coded the way Ryan would prefer or not. Depending on the change it might be just as productive to simply submit an issue asking for the enhancement. You could look through some of the previous PR and issues and see if you think your enhancement suggestion and your coding quality would make it better suited to one approach or the other. Sorry, not a definitive answer, but hopefully helpful.
  21. The instructions for this module say to use the path relative to your templates directory, eg: styles/mystyles.css or scripts/myscript.js There is a setting in the module config: "Allow Directory Traversal: Enable the directory traversal option to make it possible to add files from outside of the template folders. (../)" which you can use if you need to access css and js files above the templates directory, but otherwise they should all be in subfolders of "templates" and linked to with a path relative to templates. Make sense? EDIT: not relevant to this module, but path vs url - depends on what is being done with the file being linked to. If it's a css or js file, typically you are going to want the url option. The path option is the full server path to the file which is useful for php operations on files, but no good for front-end display/calling of files.
  22. Wow @cstevensjr - I am feeling the love from you tonight
  23. Nico - this reminds me (not that I had really forgotten, but have been REALLY busy), that I need to do a little work associated with this for you. I really will try to get to it shortly!
  24. Ok, so I have added support for automatic populating the video title into the image description field for both Youtube and Vimeo. Not sure how much longer this method will work with Youtube, but I think it's simpler to keep using v2 of their API for the moment. I implemented both cURL and file_get_contents methods for Youtube and simplexml_load_file for Vimeo. Let me know how it works for everyone and I'll tweak methods if needed.
×
×
  • Create New...