Jump to content

netcarver

PW-Moderators
  • Posts

    2,241
  • Joined

  • Last visited

  • Days Won

    47

Everything posted by netcarver

  1. Yep -- just tried it -- even more useful than my snippet above. I'll be adopting this, thanks!
  2. Ryan, IIRC, they are almost so -- but I thought that in HTML5 you needed to omit the delimiters that PCRE expects. I might be wrong (probably so) and I don't have time to dig through the documentation right now.
  3. A few keystrokes if you do it a lot. My main driver is that I like the fluency of it. @Adam Not seen it done like that before. Will try that out too.
  4. Perhaps slightly off-topic (or on-topic but from a programmer's twisted pov.) When dealing with object oriented PHP code, I like to keep things terse and also like to be able to chain things straight from when they are constructed (kind of like the fluent style) -- but PHP doesn't let you do it. So, when I want to to do this in various parts of my code... echo new somethingOrOther()->set('size', 'big')->render(); ...PHP only lets me do this... $thing = new somethingOrOther(); echo $thing->set('size', big')->render(); Yikes! However, if I define a function (once) called newSomethingOrOther() then I can get what I want easily... function newSomethingOrOther() { return new somethingOrOther(); } // The following now works as I want, however many times I need it in my code... echo newSomethingOrOther()->set('size', 'big')->render(); Ok, end of diversion, as you were.
  5. Anyone here installed Piwik 1.9.2 recently? If so, check your installation for a possible backdoor that it may have contained. The download server was compromised and a backdoor injected into the downloadable. Background, including basic cleanup instructions, via the-H (includes links for more info).
  6. Hello USSliberty. Welcome to the PW forums and thank-you for your contribution.
  7. Methinks this... 'url' => "./$event[id]", // event ID is the url segment ); return json_encode($json); // <<<< wrong data? } ...should be this... 'url' => "./$event[id]", // event ID is the url segment ); return json_encode($items); // <<<< right data? }
  8. Hi Harm, try to develop the habit of always putting the constant first in statements like this... if('inactive' == $u->user_status) ... Then if you miss out an '=' sign PHP will shout at you about it.
  9. I don't know if this is possible or not, but I wonder if MySQL has any events/triggers you can set on ALTER commands. If there are then perhaps you can install something in the DB itself that can log schema changes via ALTER or CREATE commands to a 'structure_change_log' table (or whatever).
  10. @rob, I echo bcartier's thanks for your work on this module. Looking forward to seeing it added to the PW arsenal. @bcartier, welcome to the PW forum!
  11. @diogo, thank you, overall that seems better to me but may not be to everyone's taste and I do now see mindplay's point about the navigation not being so obvious.
  12. The Link Shortener module hides the title field for children of a known parent template. Maybe some code in there that can help you.
  13. I don't know 100% for sure as I haven't dug that deeply into the code. However, I'd guess it goes like this: 'as global' fields are needed in every PW page, PW can collect it before you choose the template. If a field isn't global, the collection will have to get pushed back till after you choose the template.
  14. Hello Deane, welcome to the PW forum. This question (well, one very similar) came up recently in the forum. Basically it's because the title field is setup as a global field and is therefore needed in every template. To cure it, please try... setup > fields > title > advanced tab > turn off the global flag > save. setup > templates > basic-page (or whichever template doesn't need a title) > delete the title field > save And enjoy ProcessWire!
  15. I've tried this and like it. The idea in your second post sounds like a good addition too. However, I do have one thought: would it be even nicer if the hover target was narrower? Currently the list items are pretty wide so the menu pops up even if the cursor is over the other side of the screen which seems a little over-animated to me. BTW, I'm using the default theme - I guess other themes may have a more restricted width on the list items.
  16. These are just quick ideas off the top of my head about running at the same time every day. If you can add cron jobs to the server box, that's probably the best way to go. Try... Making the script executable by whatever user the webserver uses. From the server's command prompt setup the cronjob via "crontab -e". You will need to add a line to this file and you can use this cronjob calculator to help you set it up. However, if you have no access to cron on the server, install the lazycron module instead and then set up a cronjob on another internet connected box that is always on at 2am that uses wget to visit your site and hence trigger your script.
  17. Hmm, could this be due to some kind of QOS/throttle settings at the host combined with your ISP pipe limit? With (s)ftp/rsync you are pushing to the server from your box through a relatively thin pipe (+ QOS filter?), when using SSH + git clone you are telling the webhost server to go pull files from github directly and both the webhost + github are both on fat pipes.
  18. We've touched on common use of Vim before unless; you are forgetting or... I'm delusional. Of these, option 2 is probably more likely Seriously though, XDebug + VDebug is a great combination. I've modded VDebug a little to compress the local variable context view which was a little sparse for my liking.
  19. Ryan, I'm happy to take over maintenance of those two modules once the next version of textile is released. Lets stick with the status quo until then.
  20. @Gazley yeah, it's like having a microscope and being able to see inside the code again -- I had forgotten how useful it can be and it's certainly easier than having to instrument routines with all kinds of debug output. It's given me a much better insight into one of the other PHP codebases I look after so I'm really glad your thread prompted me to look for a Vim solution.
  21. Hi arjen, if you are using the TextformatterTextile module then you could try this... Go to site/modules/TextformatterTextile* and rename classTextile.php to classTextile.orig.php Click this link and save the file as classTextile.php in site/modules/TextformatterTextile* *Adjust exact path as needed You should now be able edit any page using the new version of textile and see if it produces changes (for better or worse.) Edited to add: diogo got there first!
  22. Thanks diogo. I didn't touch the table code but please take a look at any links you have in textile just to make sure they are still working as expected.
  23. Folks, I've been working on an experimental re-write of the link & image handling code in textile as I've become increasingly annoyed with the existing code. If you don't know what textile is then pass this over but if you do know what I'm talking about could you try out the code from the link-detection-rewrite branch and see if it improves or breaks anything for you? Thanks in advance!
  24. Hi Matthew & welcome to the forum. Looks like apeisa got there with a suggestion first so I'll just add: here is some additional reading on the matter.
×
×
  • Create New...