Jump to content

netcarver

PW-Moderators
  • Posts

    2,173
  • Joined

  • Last visited

  • Days Won

    44

Everything posted by netcarver

  1. Hehe Antti - I seem to recognise the showIf() and requiredIf() calls from somewhere
  2. Like it. Like it. Like it! Thanks to Ryan and Antti. @Ryan - would be great to get an audio explanation on your demo videos if possible
  3. Hi JoshoB and welcome to the PW forum - hope you like it! Hmm, interrobang, can you force the browser to switch the language it uses in the tooltips by sending the correct accept-lang header with the page?
  4. Hi FuturShoc, I'd guess that it's hashing the passwords for each user you are adding that's causing the delay here as the hash function has to be deliberately slow to make brute-forcing a leaked hash harder. hort's suggestion of calling set_time_limit(30); in the loop is definitely where I'd start addressing this.
  5. I don't deal well with vocals when working so I tend to go for stuff like some of Jean Michelle Jarre's earlier works (Oxygène, Équinoxe or Magnetic Fields) which all work well for me.
  6. I was being nice - the man behind the counter even said he thought I was very nice as he dialed the police.
  7. I once tried to do it at the registry office but the man behind the counter looked at me blankly. Apparently they only handle births, marriages and deaths, not renames using the PW API.
  8. Perhaps you could take an additive approach instead and have one module per use-case. Installing the module would create all the templates and fields it needs and removing the module could delete them?
  9. Fantastic! Congratulations.
  10. Hey Alan, No probs re the docs. Something you might want to consider: Reducing the number of characters in the output character set (by using the distinct charset) does reduce the strength of the generated token somewhat so you may want to consider increasing the length of your generated tokens to compensate for this -- maybe by using 4 runs of 4 chars.
  11. Hi Alan, Try something like this... $key = CryptoPPP::genKeys(); $key = CryptoPPP::keyToTokenBlocks($key, 4, 3, '-', CryptoPPP::DISTINCT_CHARSET); That's off the top of my head and untested. You should get three blocks of four chars from the "Distinct charset" (which should be safe as a GET variable) with a dash between the blocks. You can check the parameters of keyToTokenBlocks here, and here are the characters from the "distinct charset".
  12. Sounds like a bug in is_string() in PHP 5.2.17 or perhaps the string with the leading dollar in it is being interpolated by PHP somehow leading to a string that is shorter than 13 characters. What do you get for this... $hash = '$2'; // Make sure you use single quotes here please. if (!is_string($hash)) { echo "Buggy"; } else { echo "Interpolation maybe?"; } ...? Edited to add: Ignore the above, I posted at about 5am after an all-night bug hunt. Possibly unrelated: there are reports of Crypt() differences coming in between different PHP versions. Sorry I don't have time to look at this more but very busy at the moment.
  13. Glad you finally got some movement on this GOTK. We are with BT at work but over the past 3 years we have had several problems with the BT-supplied ADSL router kit though what you've posted about the line makes me wonder if part of the following might be down to our BT line too. With regard to the BT kit: Our first ADSL router developed a fault which only occurred when connecting to FTP servers (everything else was fine) and once we found this we had to spend several hours getting through to their engineers and demonstrating the problem. Once convinced, they quickly sent a replacement unit (credit to them) and that worked well for over a year before giving up the electronic ghost. So we temporarily switched to a budget end Netgear 4-port ADSL router we pulled out of a skip (en_us: dumpster) and this got us back online. In the meantime we bought and tested a £200+ Draytek unit which was very nice and had some features we needed. The Draytek ran rock solid for over a week on a non-BT test line so we switched it for the budget Netgear unit on the BT line. The Draytek died within 8 hours and we had to re-flash the unit to bring it back to life. Back in went the cheapo Netgear rescue unit whilst we tested the Draytek on the non-BT line. It ran fine for a number of weeks so we decided it was "fixed" and put it back on the BT line. Dead again within 8 hours and sent back for a full refund (great service from our supplier). Since then we've upgraded (again from the waste stream) the free budget netgear to a not-so-low-end Linksys box with a few more features. Both the Netgear and the Linksys units have done well for us on this line when compared to BTs own kit and the expensive DrayTek. Anyway, I'm now beginning to wonder if the Draytek unit's failures were a unit + line combo as it worked brilliantly on another supplier's wire.
  14. @JeffS, thanks, bookmarked that for a look later.
  15. Hey folks, just found etherpad lite and I'm quite liking what I'm seeing. It's a live document collaboration tool and Mozilla has a server up and running where you can start public or 'team' documents you want to work on with others. I've just started one here to play with and invite you to join in and try it out. I wonder if this might be a way that we, as a community, might be able to work on documents for the wiki or something? Anyway, give it a try and see what you think.
  16. When you type in the URL of your site into your browser, what do you see? Do you see the homepage of your website or something else? If something else, please describe what it is you see.
  17. That's a good example of fixed-point storage and is certainly one way to address this. Also, though I'm not 100% sure about this, I seem to remember having heard from accounting circles that you should be storing 2 decimal points beyond the smallest unit of currency, not one. Meaning $3.25 would be represented as 32500 and $3.256 as 32560. If that's right, that would apply no matter if you were using strings or integers behind the scenes.
  18. Hi Roelof, welcome to the ProcessWire forum, you'll find quite a few Textpattern users in here! At least, I seem to remember a roelof from the TxP forum with a domain similar to that one but my memory is not what it used to be. Anyway, if that is you and your site is running on Textpattern then you should be OK with ProcessWire. I haven't yet come across anything that I did in Textpattern that I can't do with ProcessWire (and usually much more easily too.) Edited to add: But, it does take knowing some PHP as you'll need to use PHP in your template files.
  19. Take a look at fNumber and fMoney from the Flourish library if you need something to ease working with these kinds of data. And here's a how-to for autoloading Flourish from your template files should you choose to go down that route.
  20. Ah, ok. If you need any more help with that I should be around in #processwire later this evening.
  21. What are folks wanting to store in these float fields? If you want to store what would be monetary values then I'd suggest avoiding floats or doubles like the plague. Go with fixed-point values which are usually strings which you manipulate with PHP's bc maths functions. MySQL also supports fixed point numbers using the DECIMAL() type. Contrary to popular belief, floating point numbers (including doubles) are *extremely* inaccurate number representations. Where floats and doubles shine is where you have to store values from a huge *range*; but they do it at the expense of accuracy. They are almost always inaccurate approximations of the value you want to store.
  22. Hey Joss, Not a total solution, more of an idea to get you started; when you hear phrases like "ad-infinitum" in the context of computation you probably need to be thinking of using recursion rather than iteration. In most programming languages this is handled by having a function that calls itself as many times as needed to get the job done. Something like this perhaps... function renderChildrenOf($parent) { $output = ''; $children = $parent->children; foreach ($children as $child) { // Render this child. NB use of .= which is a PHP shortcut to // concatenate stuff at the end of existing $output. // Adjust this to suit your needs $output .= '<li>' . $child->title . '</li>'; // If this child is itself a parent, then render it's children in their own menu too... if (count($child->children)) { $output .= '<ul class="dropdown-menu">' . renderChildrenOf($child) . '</ul>'; } } return $output; } $homepage = $pages->get("/"); // Setup the start of the top-level menu... $menu = '<ul class="nav">'; // Append something for the homepage (as menus usually squish the root node in with its children anyway)... $menu .= '<li><a href="/">' . $homepage->title . '</a></li>'; // Set the ball rolling... $menu .= renderChildrenOf($homepage); // Close the top-level menu... $menu .= '</ul>'; // Show the result to the world... echo $menu; Ok, that's off the top of my head and is meant to give you a starting point to address your ad-infinitum issue. You'll need to experiment some and adjust the markup as needed for bootstrap. Hope that helps.
  23. @thissnafu: welcome to the forum. Glad you worked out your problem!
×
×
  • Create New...