ivovic
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: got hackedthat *is* true, but with people running around chmodding everything to 777… that’s gotta be reaching critical mass at some point.
Anyway, that point wasn’t *just* about security, it is much nicer having a certain amount of allocated cpu and ram, especially now that wordpress is getting a little hungrier.
I agree with you though… a) it’s not the most important point I’ve ever made, and b) none of these guys want to pay that much per year, let alone per month.
Forum: Fixing WordPress
In reply to: got hackedmy all-time favourite southernism is “all y’all” 😉
as in “all y’all should get to readin’ about wordpress security”
Forum: Fixing WordPress
In reply to: More fun with sub sub pagesneatening:
$sidebar = 'Default'; while ($parentid) { echo '<li class="widget">Parentid = '.$parentid.'</li>'; if ($parentid==20) $sidebar = 'CLC'; if ($parentid==34) $sidebar = 'Community Link'; if ($parentid==11) $sidebar = 'Recycle Scotland'; if ($parentid==12) $sidebar = 'Stepping Stones'; $page = get_post($parentid); $parentid = $page->post_parent; } dynamic_sidebar($sidebar);eventually when you functionize this, this should end up in your template:
dynamic_sidebar(eval_sidebar($pageid));with eval_sidebar being your new function, which returns the name of the sidebar, given a page ID.
Forum: Fixing WordPress
In reply to: More fun with sub sub pagesI’m pretty sure that’ll call the sidebar numerous times on sub-sub pages which don’t match those IDs…
bad mojo.
I think the best way to do what you want is to set a flag.
[edited in lieu of the following]
Forum: Fixing WordPress
In reply to: got hackedThat dog won’t hunt
wow, that’s a real saying? I thought Dr Phil was just talking out of his arse, I didn’t realise all texans did it :P~~
Forum: Fixing WordPress
In reply to: got hackedgeneral unsolicited advice:
1) pay $5 more per month and use a VPS. Having your own apartment is nicer, plus you discover wonderous new possibilities.
2) keep your wordpress up-to-date. It’s not easy if you like to tinker, but do it anyway.
3) research your plugins before you upload them, see if people have had any security issues with them.
4) keep your plugins updated, and actually remove any plugins you don’t intend to use, don’t just deactivate them.
5) read this, then read it again.
6) actually DO what it says once you’ve read it.
Forum: Fixing WordPress
In reply to: got hackedlemme jump in on the dogpile too…
The real problem here is PHP itself, it makes it way too easy to build websites with hard-to-find vulnerabilities, so much so that even experienced PHP coders like those at WordPress screw up periodically.
“easy to build websites with hard to find vulnerabilities”
I’m surprised the universe didn’t implode when you said that. If it’s easy to build… then surely it’s easier to find the vulnerabilities than if it were HARD to build with it, right?
What’s your point anyway? You want something absolutely bug-free? Sorry it doesn’t exist.
The more popular something becomes, the bigger a target it is. You chose wordpress because everyone thinks it’s great. That’s the same reason the hackers are after it.
Deal, or switch to a publishing platform nobody’s ever heard of. It won’t be any more secure, but you’ll feel safer because you don’t have a big red target painted on your ass.
Trade ease of use, compatibility and extensibility for obscurity, then we’ll see you on their forum complaining that they don’t have as many nice features as wordpress.
Forum: Fixing WordPress
In reply to: More fun with sub sub pagesyeah, I thought about setting $parentid to the current page ID, but since the loop is structured not to break on its own, that’s a little inefficient because it tries to pull the parent page of the top-level page even if it finds a match.
there’s going to be a cleaner way to to this, but as you’ve noticed from my mistakes and distractions, my head’s not really in it very solidly right now.
either way, it’s probably not a bad idea to open up some curlies after those if-statements and insert a break.
if ($parentid==2) { echo 'do stuff'; break; }that’ll stop the cycle once a match is found… but I hate using breaks, ‘cos there’s usually a far nicer way to handle the trickledown.
edit: I want to note though… there’s nothing wrong with getting something in there that works for now, then refining this while taking a break from your layout/graphics work… no doubt your requirements will evolve somewhat as your design takes shape anyway.
Forum: Fixing WordPress
In reply to: got hackedif you’ve been hacked on a previous version, and then upgraded to wp2.5.1, chances are you didn’t clear out all your files from your hosting space, and whatever was planted there by your hackers is still there.
a fresh install doesn’t mean anything if have not changed your passwords to *everything* including the DB and all privileged user accounts on your blog, or if you allowed any files to remain on your hosting space when you uploaded this fresh copy of wordpress.
the other possibility of course, is that your shared hosting environment is poorly configured to allow your neighbours to write into your space. In that case, no matter what you do, if Joe next door is hacked, so are you.
Forum: Themes and Templates
In reply to: Lotsa “unique category” options — but which is best?if you think about it matt, they’re there anyway, in order to dictate which category template file should be used to display the category you’re viewing now…
… you just don’t see that because you didn’t put it there.
using conditionals like this isn’t a problem. I tend to agree with iridiax on this, given your small number of categories using conditionals actually saves on lots of duplication vs using separate category templates.
Forum: Fixing WordPress
In reply to: Pretty permalinks in IISask your host to install an ISAPI rewrite filter on their windows boxes.
if they refuse, ask them why they bother putting php and mysql on windows boxes, if they won’t do something simple like making sure the MOST REQUESTED FEATURE EVER is available as well.
Forum: Fixing WordPress
In reply to: More fun with sub sub pagesHappy to help, Alex… I’ll be glad to hear back when you’ve had a chance to make this work.
given that you’ll be reusing this, making it into a function is definitely a good idea, just be sure to pass the current page ID to the function you make, as the $post variable isn’t available to functions in functions.php by default.
The rest of the code works anywhere, you just need to give the function a starting point.
Good luck with it.
edit: Otto, I’d looked into that (when making my breadcrumbs bit)… but as you say… it no worky.
Forum: Fixing WordPress
In reply to: More fun with sub sub pages(not sure what happens if the post doesn’t have a parent?)
if it doesn’t, then the variable is empty, and the while loop is essentially skipped.
I posted that on the fly without thinking too much about it, so let me make a slight correction, which I’ll then explain in plain english.
$parentid = $post->post_parent; while ($parentid) { if ($parentid==2) echo 'this is a child of the About page'; if ($parentid==483) echo 'this is a child of a test page'; $page = get_page($parentid); $parentid = $page->post_parent; }I just swapped the order, because what I originally posted wouldn’t have caught the immediate parent… only the grandparent (oops).
Here it is in plain english:
lets see if the page we're on has a parent. if it does, and while we have parents to keep checking... Have we found an ID we like? If so, do this. If not, do nothing. ... lets pull the parent page so we can see what its parent is lets grab the ID of that grandparent now, so we can check it keep loopingThe loop stops when the last line inside the loop, sets $parentid to an empty value. No parents = no loop.
the reason you’re probably not getting any joy is because I screwed up the order of if-statements, and you didn’t have enough sub-subs to test with.
also, this needs to be in page.php, or a suitable page template, but I’m asuming you’ve got that covered already. If by chance you’re using this in your functions.php, you’ll have to modify it to pull the initial value (but you’re not, right?)
my original code also only checks parents / grandparents / great grandparent, not the page you’re on now… to do that, you’d need something like this:
if (is_page(2)) echo 'this is About'; elseif (is_page(483)) echo 'this is Test'; else { $parentid = $post->post_parent; while ($parentid) { if ($parentid==2) echo 'this is a child of the About page'; if ($parentid==483) echo 'this is a child of a test page'; $page = get_page($parentid); $parentid = $page->post_parent; } }this will continue to do absolutely nothing unless one of the IDs are matched (that is, it will just fail silently without a default result).
Please keep in mind, I haven’t tested any of this since I have my hands a little full right now, but I *think* it’ll work… barring any typos or brain farts.
Forum: Fixing WordPress
In reply to: More fun with sub sub pagesyou’re sort of doing this the wrong way around I think.
what you want to do is to keep checking the parent page until you reach the top level, and do something if you find the correct top-level ID right?
$parentid = $post->post_parent; while ($parentid) { $page = get_page($parentid); $parentid = $page->post_parent; if ($parentid=="2") echo 'this is a child of the About page'; if ($parentid=="483") echo 'this is a child of a test page'; }the while loop ends when there are no more parents. if your ID is found along the way, then the output is echoed.
Forum: Fixing WordPress
In reply to: get_posts with post_parent returns empty arrayrecord time, most people take at least an hour to solve their own problem 😉