Patrick Johanneson
Forum Replies Created
-
Forum: Hacks
In reply to: Lock down media filesI hoped I’d be able to affect it somehow since the .htaccess file points requests to ‘/files/.*’ to the ms-files.php file (I think; right now I don’t have access to the actual .htaccess file since it’s behind a firewall). But I didn’t see any action or filter hooks in the ms-files.php file; I’d hoped I’d just missed one.
I will certainly try setting the files directories to 600 and see if that works.
Thanks!
Glad you got it working. I was planning to ask you to have a look at your theme files after work, but it seems like you’ve got it going.
As to your “MINOR issue”: It looks to me like there’s an
overflow: hidden;
declaration somewhere in the stylesheet (by default, a theme’s stylesheet is called “style.css”, but it could be elsewhere). It also looks like the element is styled that way so as to make it fit in a box of a certain height; you might want to be mindful of that when you’re editing your stylesheet. You might fix your current problem but introduce another one, if your element is suddenly larger than intended by the theme’s originator.Good luck!
Forum: Hacks
In reply to: Edit Post Programaticly in post.phpIf I’m reading the wp_update_post() page right, you need to make sure that there’s a post ID being delivered. Maybe double-check that
$post['ID']
is set correctly right before you do yourwp_update_post()
.Also, if I’m reading the Codex page right,
save_post()
is fired bywp_update_post()
, so you may be duplicating effort there. (I’m not 100% sure of that, though.)You should be able to print the excerpt using the_excerpt() in the loop that generates your three headlines on the right side. (Or, if you want to return the excerpt’s content for further processing, you can use get_the_excerpt()).
Forum: Hacks
In reply to: Email admin on page viewIn either case, you should be able to write a function to send the email, and hook it to an action hook.
For instance:
function xx_email() { if is_home() { // only emails from the home page // email code goes here } } add_action( 'shutdown', 'xx_email' );
See the add_action and Action Reference pages for more details.
Forum: Hacks
In reply to: Email admin on page viewWould it send you an email every time a logged-in user views the home page, or do you want an email every time anyone views the homepage? The latter sounds like you’d get a lot of emails…
Forum: Hacks
In reply to: extending wbdp class to use another user authentication systemWow, that sounds daunting. Good luck!
Forum: Hacks
In reply to: extending wbdp class to use another user authentication systemFor one example that I use at work — if you need examples, of course — check out the Simple LDAP Authentication plugin.
Forum: Hacks
In reply to: allow multisite to match bare URLAh yes, I suppose there can only be one site with a
$blog_id
of 1. (I’ve got a multisite install going, but only one domain, so I should probably be cautious of assuming that site #1 = ‘/’ .)Forum: Hacks
In reply to: Creating on-page options for Custom Post TypeSo far I’ve only used it in plugins, so I’d say it’s good to go.
Forum: Hacks
In reply to: extending wbdp class to use another user authentication systemwp_authenticate is a pluggable function, meaning that you can add a function to a plugin to override its functionality. (I think — I haven’t dug around much in pluggable functions myself.)
Forum: Hacks
In reply to: Creating on-page options for Custom Post TypeIf you want to add custom meta fields to your custom post type’s editing screen, have a look at the Custom Meta Box and Fields library. I’ve used it a few times and it’s incredibly handy.
Forum: Hacks
In reply to: Overriding the css of a theme from a pluginNo problem.
Forum: Hacks
In reply to: allow multisite to match bare URLCould you not do something like this:
global $blog_id; if( 1 == $blog_id ) { // this is the '/' blog }else{ // this is one of the sub-sites }
…instead of modifying core code?
Forum: Hacks
In reply to: Overriding the css of a theme from a pluginI just used Firefox’s “View Source” option, and clicked through in the source view to the flying-menu.css file. Then I double-checked with the file in your Git repository, and I didn’t see it there either.