Jump to content

ryan

Administrators
  • Posts

    16,714
  • Joined

  • Last visited

  • Days Won

    1,515

Everything posted by ryan

  1. I haven't tried it, but you might be able to get this module to output in different languages by combining it with the LanguageSupportPageNames module.
  2. Nice, thanks Pete. I just submitted it as an issue in the InputfieldCKEditor module, so hopefully the author will add it in soon.
  3. FormBuilder is also a good way to go for contact forms, especially if you want to set one up without doing any development and have a lot of pre-bundled options as to where the submitted data goes.
  4. If there was a way for us to make PW automatically reassign the $user variable after login, we'd do it. It's not technically possible for PW to do that (it's a matter of variable scope). That's why you'd have to do what Adrian suggested and assign the $user variable yourself from the result of login(). However, what Soma was getting at before he gave up was even better because it wouldn't trash the $user variable if the login failed. So something like this might be ideal: $u = $session->login($username, $pass); if($u) { $user = $u; echo "logged in"; }
  5. What Wanze mentioned is the way to fix it. It sounds like the page just lost connection the Process, which can be easily fixed by editing the page and selecting the right Process for it. This can happen of you use the site profile exporter and don't include the 3rd party module files in your profile (that's the only way I've seen it happen), though maybe there are other ways it can occur too. It also sounds to me like you may need to increase the memory available to PHP. If a limit of 100 modules in ModulesManager works, but 350 doesn't, then it sounds like you are running out of memory. I usually give my PHP installs 128m or 258m for memory (depending on how big of images it needs to deal with).
  6. Looking nice Harmster–thanks for sharing this with us and keep up the good work.
  7. You will probably have to make edits to several files in there to adjust the paths it references to be consistent with the paths in your site. For instance, if you see a $config->urls->root . "archives/"; then you'd change that to $config->urls->root . "blog/archives/"; and if you see a $pages->get('/posts/'); you'd change that to a $pages->get('/blog/posts/'); And so on. I'm guessing most of these updates can be to the files in /site/templates/markup/ and /site/templates/blog.inc, but you may need to look at all the template files used by the blog profile.
  8. I don't know on the multi-site module side (haven't yet used it). But in your case I'm not sure you necessarily need or want the LanguageSupportPageNames module. All you need to do is detect the language from the hostname in your head.inc or $config->prependTemplateFile. The fact that the hostnames select the language makes everything simpler. if($config->httpHost == 'www.website.nl') { $user->language = $languages->get('nl'); } if($config->httpHost == 'www.website.de') { $user->language = $languages->get('de'); } else { $user->language = $languages->get('en'); }
  9. Beyond what Dragan mentioned, it'd also be good to look at what 3rd party modules you have installed, just in case any of them are interfering. For instance, 2.2.9 is now an older version of PW, so you may have a module that was meant for 2.3+.
  10. Page numbers are runtime directives like URL segments, not part of the actual page's path. Consider what you see in the tree in the admin–those are the pages. As a result, you shouldn't try to retrieve a page with a page number in it–leave that part off. Next thing is that I'm not positive about the ~= operator in this context. You might need to use %= or *=.
  11. Thomas, I'm finding this block of code really difficult to follow. There may be issues here that we can't be certain of without stepping through it live. I think there might be benefit in refactoring it. Beyond that, I suggest doing a wire('sanitizer')->entities('text'); on the output you are sending through $this->message(), as that seems to be vulnerable to XSS injection (though maybe you are just using that for debugging). I also have some concerns about this method of presenting different language content on a site because it uses the http_accept_language header rather than a defined URL. That could create some potential SEO issues. Though if search indexing is not a concern here, then it should be ok. But the other disadvantage is that it's relying on session variables to determine output, preventing it from being cachable (whether with the built in template cache or ProCache). Regardless of which direction you go, you may want to use the dev branch just because it has better multi language support.
  12. Glad to see Foundation5 out. I've spent some time there and like what I see. Though I tried to install the SCSS version and can't seem to get my computer to meet all the dependencies (I'm running an old OS X), so looks like I'll have to use the regular non-sass version. But other than that Foundation5 really looks great. I'll plan to upgrade the Foundation profile in January when my schedule starts to clear up a bit here. I want to get PW 2.4 released stable before that. As for how to use the interchange plugin (whether in or out of PW), I think that Foundation's docs will probably be the better place for that. But if I see any good opportunities to use it in the profile update I will.
  13. That's a good observation. That must have started when I added the version checking code to GitHub. It now updates each module page with the date of the last time it checked the version. The problem here is that it's also updating the 'modified' timestamp of those pages, which is in turn appearing in the feed that ModulesManager uses. The good news is that an option was recently added to the core (on dev) that can prevent this: $pages->save($page, array('quiet' => true)); That 'quiet' option tells it not to update the modified date or user, which will be perfect for this particular situation. I'll plan to get the modules directory updated with this option soon.
  14. ryan

    processwire webfont

    I think WillyC is correct on that one. The term "font" means an entire character set. As for the resulting logo: Whether in an SVG, font-set, PNG, GIF, JPG, EPS, etc. the logo is a flat image (whether vector or bitmap). The file format means little. I don't see any difference between a font-set with the PW logo in it and a PNG or EPS file of the logo.
  15. If a page is unpublished, PW won't let you publish it until you can save it error free (meeting required fields, etc.). If the page is already published, then ProcessWire is not going to prevent you from saving it, but will warn you that the field is required.
  16. I am thinking that Google News provides some other options here. We had to setup a custom XML news feed that adhered to Google's sitemap-news format. In addition, the feed could only show news articles posted within the last 48 hours. There were no requirements about 3 digit numbers.
  17. What Soma said. ProcessWire promises the Fieldtype interface that it will have an actual Page to work with (one that has an ID and a place to store files, etc.). It could be reduced to 1 step by automatically creating that page whenever you click "new", but you'd likely have plenty of accidental pages as a result. Also, as a best practice, GET requests should not make changes to database or disk, so it's always preferable to submit a form before creating a new asset.
  18. That's because the "page10" portion is not part of the page's path in the system. It's just an extra instruction to the page, like a URL segment, telling it to use the 10th pagination. In this case, you'd want to trim off that "page[n]" portion. There's any number of ways to do that, but I'd probably just use a regex: $title = 'http://host/gallery/page3'; $title = preg_replace('{page[\d+]/?$}', '', $title); echo $title; // should output "http://host/gallery/"
  19. Your best bet is to do something like this: if(!is_writable(wire('config')->paths->templates)) { $this->error("Please make your /site/templates/ dir writable to use this module."); }
  20. I'm not aware of anything related between that setting and users or passwords. Is it possible that a PHP version downgrade (into a version 5.3.8 or before) happened at a similar time (whether by migration or on the same server)? That could potentially account for the behavior you described.
  21. If the issue is showing up in Chrome and not Safari, is it possibly just a browser cache issue? Have you tried clearing the cache, quitting the browser, etc.? I had Chrome pull a similar trick on me recently.
  22. Sounds like a bug, but could very well be one that's already been fixed in dev. What version of ProcessWire are you running?
  23. I think that this change should be okay, I can't think of any potential side effects here. I make the same change here–thanks!
  24. If you are getting a redeclare error, then you'd just use require_once() rather than require(). That tells PHP to include the file only if it hasn't already been included. That should accommodate either situation.
  25. That's interesting about the language rules there and I probably should have realized a space was not universal. If there simply is no word separator, then I suppose there's no need for that 2nd mb_substr() that truncates to the last space ... I'm guessing you can remove that entirely. Depending on the length you need to truncate to, trying to locate the last "。" and truncate to that might sometimes result in a non-match, but otherwise seems like a safe bet (for reasonably long truncations).
×
×
  • Create New...